[turba] Multiple selection for keywords or categories

Radim Machů radim at machu.cz
Thu Jan 31 17:15:12 UTC 2008


>> 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?
Sorry, I wrote the final sentence without summarizing the questions:

1. is form type "keyval_multienum" a proper form type to manage a field with multiple selection information?

2. before I ask our HORDE admin to test this, I would like to know a piece of sample code for attributes.php and sources.php

3. finally, what is database field type for a such data: ENUM or SET?


Regards,

Radim
	
-- 
_________________________________________________________
Radim Machů
Hostětín 31
687 71
mailto: radim at machu.cz



More information about the turba mailing list