fixed not working/existing custom fields and widget-types for dates, accounts and cats

This commit is contained in:
Ralf Becker 2007-08-20 07:51:49 +00:00
parent f17e9b4032
commit fde08a961d

View File

@ -84,6 +84,10 @@ class contact_widget
$GLOBALS['egw']->translation->add_app('addressbook'); $GLOBALS['egw']->translation->add_app('addressbook');
$this->contacts->contacts(); $this->contacts->contacts();
$cell['sel_options'] = $this->contacts->contact_fields; $cell['sel_options'] = $this->contacts->contact_fields;
foreach($this->contacts->customfields as $name => $data)
{
$cell['sel_options']['#'.$name] = $data['label'];
}
$cell['type'] = 'select'; $cell['type'] = 'select';
$cell['no_lang'] = 1; $cell['no_lang'] = 1;
break; break;
@ -102,15 +106,36 @@ class contact_widget
$value = ''; $value = '';
break; break;
} }
$value = $this->contact[$cell['size']]; $type = $cell['size'];
$value = $this->contact[$type];
$cell['size'] = ''; $cell['size'] = '';
$cell['no_lang'] = 1; $cell['no_lang'] = 1;
$cell['readonly'] = true; $cell['readonly'] = true;
switch($cell['size']) switch($type)
{ {
// ToDo: pseudo types like address-label // ToDo: pseudo types like address-label
case 'bday':
$cell['type'] = 'date';
$cell['size'] = 'Y-m-d';
break;
case 'owner':
case 'modifier':
case 'creator':
$cell['type'] = 'select-account';
break;
case 'modified':
case 'created':
$cell['type'] = 'date-time';
break;
case 'cat_id':
$cell['type'] = 'select-cat';
break;
default: default:
$cell['type'] = 'label'; $cell['type'] = 'label';
break; break;