Re: [imp] Hooks for search_sources/search_fields

2011-06-09 Thread Marco
Jan Schneider  horde.org> writes:

> The search_fields preference expects a json-encoded array. Just pass  
> $out through json_encode().
> 
> Jan.

I already encoded it, my hook is:

 public function prefs_init($pref, $value, $username, $scope_ob)
{
switch ($pref) {
case 'add_source':
// Dynamically set the add_source preference.
return is_null($username)
? $value
: $GLOBALS['registry']->call('contacts/getDefaultShare');

case 'search_fields':
case 'search_sources':
// Dynamically set the search_fields/search_sources preferences.
if (!is_null($username)) {
$sources = $GLOBALS['registry']->call('contacts/sources');

if ($pref == 'search_fields') {
$out = array();
foreach (array_keys($sources) as $source) {
foreach ($GLOBALS['registry']->call('contacts/fields',
array($source)) as $field)
   if ($field['search']) $out[$source][] = 
$field['name'];
}
} else {
$out = array_keys($sources);
}

return json_encode($out);
}

return $value;
}
}

It seems that with this:
{"939e0d883993d2a7a36e0b4bc68d3bbe":["name","email"],"localldap":
["name","email"]}

autocomplete doesn't work: no search has done.

Into web IMP addressbook preferences I see my addressbooks on right panel with
only "name" and "email" selected, as desired.

Autocomplete during "compose" mail works only if I leave default hook with this
result:

{"939e0d883993d2a7a36e0b4bc68d3bbe":
["firstname","lastname","middlenames","namePrefix","nameSuffix","name","alias",
"birthday","photo","phototype","homeStreet","homePOBox","homeCity",
"homeProvince","homePostalCode","homeCountry","homeAddress","workStreet",
"workPOBox","workCity","workProvince","workPostalCode","workCountry",
"workAddress","timezone","email","homePhone","workPhone","cellPhone","fax",
"pager","title","role","company","logo","logotype","category","notes","website"
,"freebusyUrl","pgpPublicKey","smimePublicKey"],"localldap":
["name","email","firstname","lastname","freebusyUrl"]}

(but in web preferences address book have still have only "name" and "email"
selected, ...I'm confused)

Many thanks
Marco


-- 
IMP mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: imp-unsubscr...@lists.horde.org


Re: [imp] Hooks for search_sources/search_fields

2011-06-09 Thread Marco
Marco  csi.it> writes:

> (but in web preferences address book have still have only "name" and "email"
> selected, ...I'm confused)

...this is beacuse in backend I have:

table: horde_prefs
pref_scope: horde
pref_name: search_fields
pref_value:
7724a026e66eb49c8bc20f75bc5dcf56
d05a78fe4ca3203163067167a7ef1f6cnameemail
localldap   nameemail

So preferences honor DB backend. But it seems that this is not used... Maybe
does something has fault during DB upgrade? I make upgrade from Administration
web interface of horde.

I also notice that addressbook name 'd05a78fe4ca3203163067167a7ef1f6c' differs
from what hooks make: '939e0d883993d2a7a36e0b4bc68d3bbe'.

Regards
marco


-- 
IMP mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: imp-unsubscr...@lists.horde.org


Re: [imp] Hooks for search_sources/search_fields

2011-06-09 Thread Marco
Jan Schneider  horde.org> writes:

> > Upgrading from horde 3 I also see that there are other preferences  
> > not read from
> > db: 'fullname' and all about multiple identities.
> 
> fullname is an identity pref, it's not used or read from the backend  
> individually.
> I'm not sure what mean with identities. Are they not converted to the  
> new format after logging in for the first time, or are they not read  
> from the backend at all?

It seems they are not read from backend. I make this example to be more clear.

A user have multiple identities as defined in the backend:

pref_scope: horde
pref_name identities
pref_value:
a:3:{i:0;a:11:{s:2:"id";s:19:"Identità di Default";s:8:"fullname";
s:12:"Marco Rossi";s:9:"from_addr";s:12:"falon@it";s:16:"default_identity";
s:1:"0";s:12:"replyto_addr";s:21:"raffaele.tenco@it";s:10:"tieto_addr";a:1:
{i:0;s:21:"raffaele.tenco@it";}s:9:"signature";s:0:"";s:10:"sig_dashes";
i:1;s:9:"sig_first";i:0;s:14:"save_sent_mail";i:1;s:16:"sent_mail_folder";
s:13:"Posta inviata";}i:1;a:10:{s:16:"default_identity";s:1:"0";s:2:"id";
s:16:"Sistemisti-posta";s:8:"fullname";
s:16:"Sistemisti-Posta";s:12:"replyto_addr";
s:23:"sistemisti-posta@it";s:10:"tieto_addr";
a:1:{i:0;s:23:"sistemisti-posta@it";}s:9:"signature";s:0:"";s:10:"sig_dashes";
i:1;s:9:"sig_first";i:0;s:14:"save_sent_mail";
i:1;s:16:"sent_mail_folder";
s:50:"Shared Folders/User/sistemisti-posta/Posta inviata";}i:2;a:10:
{s:16:"default_identity";s:1:"0";s:2:"id";s:13:"Identità fake";
s:8:"fullname";s:21:"Marco Rossi Desantis";s:12:"replyto_addr";
s:26:"marco.desantis-coll@it";s:10:"tieto_addr";
a:0:{}s:9:"signature";s:4:"ciao";s:10:"sig_dashes";
i:1;s:9:"sig_first";i:0;s:14:"save_sent_mail";
i:1;s:16:"sent_mail_folder";s:13:"Posta inviata";}}

I don't see these values on "Personal Information" of "Preferences for Mail"
(web). In web portal I only see a "Identità di Default" without any values.

Regards
Marco

-- 
IMP mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: imp-unsubscr...@lists.horde.org


Re: [imp] Hooks for search_sources/search_fields

2011-06-09 Thread Ralf Lang
> It seems they are not read from backend. I make this example to be more
> clear.
> 
> A user have multiple identities as defined in the backend:
> 

I have a hook writing three identities and imp reads them and uses them. The 
identity details don't show up in imp's separate configuration fields though.

-- 
Ralf Lang
Linux Consultant / Developer

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
-- 
IMP mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: imp-unsubscr...@lists.horde.org


Re: [imp] Hooks for search_sources/search_fields

2011-06-09 Thread Marco
Ralf Lang  b1-systems.de> writes:


> I have a hook writing three identities and imp reads them and uses them. The 
> identity details don't show up in imp's separate configuration fields though.

In my prefs I only locked  'from_addr'. All identities work on
horde-webmail-1.2.9: IMP uses them and users can configure not locked prefs.

Upgrading to horde 4.0.5 (Horde Groupware Webmail Edition 4.0-RC2) all
identities values disappear, unless default identy and from_addr of default
identity.

I can create/modify identity on horde 4. It works. I think it's only an upgrade
problem from horde 3.

Thanks a lot
Regards
Marco



-- 
IMP mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: imp-unsubscr...@lists.horde.org