[turba] Custom fields?

Chris Shaffer cat-turba at gesserit.net
Mon Jul 21 20:38:33 PDT 2003


Quoting Chuck Hagenbuch <chuck at horde.org>:  
   
 > Quoting Chris Shaffer <cat-turba at gesserit.net>:  
 >   
 > > I may be missing something, but I can't seem to find any way to get  
 > Turba  
 > > to allow me to use custom fields.  I'm running Turba 1.2 with a 
MySQL  
 > > backend.  I'd like to split 'name' into 'firstname' + 'lastname',  
 > split the  
 > > address fields into similar components, add a few fields, etc.  I've  
 > tried  
 > > editing attributes.php, sources.php and the MySQL table, but I end 
up  
 > with  
 > > MySQL errors about missing indexes and such.  
 >   
 > Then you're not doing something right, but without seeing the actual  
 > error  
 > messages, we have no way to help you.  
 >   
 > -chuck  
 >   
 > --  
 > Charles Hagenbuch, <chuck at horde.org>  
 > They're just looking at a wall of meat.  
   
 OK.  I made one change to demonstrate, replacing only name with  
 firstname.  I'd eventually like to break the addresses into street, 
city,  
 state, zip and so forth.  In attributes.php I have:  
   
 $attributes['firstname'] = array(  
     'type' => 'text',  
     'desc' => _("First Name")  
 );  
 $attributes['alias'] = array(  
     'type' => 'text',  
     'desc' => _("Alias")  
 );  
 $attributes['email'] = array(  
     'type' => 'email',  
     'desc' => _("Email")  
 );  
 $attributes['title'] = array(  
     'type' => 'text',  
     'desc' => _("Title")  
 );  
 $attributes['company'] = array(  
     'type' => 'text',  
     'desc' => _("Company")  
 );  
 $attributes['homeAddress'] = array(  
     'type' => 'multiline',  
     'desc' => _("Home Address")  
 );  
 $attributes['workAddress'] = array(  
     'type' => 'multiline',  
     'desc' => _("Work Address")  
 );  
 $attributes['homePhone'] = array(  
     'type' => 'phone',  
     'desc' => _("Home Phone")  
 );  
 $attributes['workPhone'] = array(  
     'type' => 'phone',  
     'desc' => _("Work Phone")  
 );  
 $attributes['cellPhone'] = array(  
     'type' => 'phone',  
     'desc' => _("Mobile Phone")  
 );  
 $attributes['fax'] = array(  
     'type' => 'phone',  
     'desc' => _("Fax")  
 );  
 $attributes['notes'] = array(  
     'type' => 'multiline',  
     'desc' => _("Notes")  
 );  
   
   
 and in sources.php I have:  
   
 $cfgSources['localsql'] = array(  
     'title' => 'My Addressbook',  
     'type' => 'sql',  
     'params' => array(  
         'phptype' => 'mysql',  
         'hostspec' => 'localhost',  
         'username' => '************',  
         'password' => '************',  
         'database' => 'horde',  
         'table' => 'turba_objects'  
     ),  
     'map' => array(  
         '__key' => 'object_id',  
         '__owner' => 'owner_id',  
         '__type' => 'object_type',  
         '__members' => 'object_members',  
         'firstname' => 'object_firstname',  
         'email' => 'object_email',  
         'homeAddress' => 'object_homeaddress',  
         'workAddress' => 'object_workaddress',  
         'homePhone' => 'object_homephone',  
         'workPhone' => 'object_workphone',  
         'cellPhone' => 'object_cellphone',  
         'fax' => 'object_fax',  
         'title' => 'object_title',  
         'company' => 'object_company',  
         'notes' => 'object_notes'  
     ),  
     'search' => array(  
         'firstname',  
         'email'  
     ),  
     'strict' => array(  
         'object_id'  
     ),  
     'public' => true,  
     'readonly' => false,  
     'admin' => array(),  
     'export' => true  
 );  
   
   
 and when I search or browse my address book, I get this response:  
   
 Notice: Undefined index: name in  
 /var/www/html/horde/turba/templates/browse/column_headers.inc on line 10  
  
--  
Chris 
cat-turba @ gesserit.net 
 
 
 



More information about the turba mailing list