Hi Aleksander,
do a
$contact = $addressbook->read(‘account:’.$account_id);
or to do it with the search, you had to do a
list($contact) = $addressbook->search(array(‘account_id’ =>
$account_id),‘tel_cell,tell_cell_home’)
Gives you the cell phone number, with preference to the business one
$cell = $contacts[‘tel_cell’] ? $contacts[‘tel_cell’] :
$contacts[‘tel_cell_home’];
Ralf
Aleksander Adamowski schrieb:
Hi!
I’m working on the SMS notification plugin and I have the following problem.
Given a notification recipient, I successfully obtained the ID number
of the recipient in $this->recipient->account_id.
Now I need to perform a lookup in the accounts repository of the
addressbook in order to obtain the tel_cell number (if available) of
that recipient.
In the infolog code I’ve found an example of addressbook lookup and
tried this snippet to perform it:
$addressbook =& CreateObject(‘addressbook.bocontacts’);
$result = (array)$addressbook->search(array( ‘owner’ => 0,
‘contact_id’ => $this->recipient->account_id),
False,’’,’’,’’,false,‘AND’,false,null,’’,false);
However, for the given recipient, I receive no useful data. Data in
$result looks like this after the search():
array ( 0 => false, )
My configuration is:
=== Domain setup: ===
Authentication / Accounts
Select which type of authentication you are using: LDAP
Select where you want to store/retrieve user accounts: LDAP
=== Addressbook application site configuration: ===
Select where you want to store / retrieve contacts: SQL
Account repository: LDAP
This configuration works properly, when I go into AddressBook, I can
see all the accounts from LDAP with mobile phone numbers available
(even jpegPhoto’s are shown!).
So how to properly obtain a user’s mobile number given the user’s numerid ID?
–
Ralf Becker
eGroupWare Training & Support ==> http://www.egroupware-support.de
Outdoor Unlimited Training GmbH [www.outdoor-training.de]
Handelsregister HRB Kaiserslautern 3587
Geschäftsführer Birgit und Ralf Becker
Leibnizstr. 17, 67663 Kaiserslautern, Germany
Telefon +49 (0)631 31657-0
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It’s the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers