[turba] Multiple selection for keywords or categories

Jan Schneider jan at horde.org
Thu Jan 31 16:53:29 UTC 2008


Zitat von Radim Machů <radim at machu.cz>:

> Hi,
>
> we use Horde Webmail Edition v1.0.3.
>
> I was inspired by http://wiki.horde.org/TurbaOutlook2003 which refers
> how to configure and address book fields.
>
> I am not willing to have a mess of Outlook addressbook fields :-)) but I
> would like to include a couple of  new fields. One of them should be a
> multiple selection keyword/category list. I have found out that
> following Horde Form Types could be used
> (http://wiki.horde.org/Doc/Dev/FormTypes):
> mlenum          n/a      Multi-level drop down lists           Values to
> select from, Prompt text
> multienum     enum     Multiple selection         Values, Size
> keyval_multienum     multienum     Multiple selection         Values, Size
>
> Could you please help how to set such a multiple selection field:
> * in attributes.php,
> * in sources.php,
> * and in the database?
>
> My suggestions or questions follows:
>
> **attributes.php ******************************
>
> |require_once 'Horde/Prefs/CategoryManager.php';
> $cManager = &new Prefs_CategoryManager();
> $categories = array_merge(array(_("Unfiled")), $cManager->get());
> $attributes['category_multi'] = array(
>     'label' => _("Multiple Categories"),
>     'type' => '|keyval_multienum|',
>     'params' => array($categories),
>     'required' => false
> );
>
> |**in sources.php*******************************
> |
> ...
> ,'category_multi' => 'object_category_multi',
> ...|
>
> **in the database******************************
> ...,
> |object_category ||ENUM('/|value1|/','/|value2|/',...),
> !!BUT !!
> ENUM is ||a| string object that can have only one value, chosen from  
> the list of values |'/|value1|/'|,|'/|value2|/'|,
> while SET is a string object that can have zero or more values, each  
> of which must be chosen from the list of values |'/|value1|/'|,  
> |'/|value2|/'|!!!
> ***********************************************

These are the suggestions, but where are your questions?

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the turba mailing list