| | |
| | | $OUTPUT->include_script('list.js'); |
| | | |
| | | // add some labels to client |
| | | $OUTPUT->add_label('deletecontactconfirm', 'copyingcontact'); |
| | | $OUTPUT->add_label('deletecontactconfirm', 'copyingcontact', 'contactdeleting'); |
| | | |
| | | return $out; |
| | | } |
| | |
| | | function rcmail_contact_form($form, $record, $attrib = null) |
| | | { |
| | | global $RCMAIL, $CONFIG; |
| | | static $jqueryui_loaded = 0; |
| | | |
| | | // Allow plugins to modify contact form content |
| | | $plugin = $RCMAIL->plugins->exec_hook('contact_form', array( |
| | |
| | | if ($colprop['subtypes'] || $colprop['limit'] != 1) |
| | | $colprop['array'] = true; |
| | | |
| | | // load jquery UI datepickert for date fields |
| | | if ($colprop['type'] == 'date') { |
| | | if (!$jqueryui_loaded++) { |
| | | $RCMAIL->plugins->load_plugin('jqueryui'); |
| | | $RCMAIL->output->set_env('date_format', strtr($RCMAIL->config->get('date_format', 'Y-m-d'), array('y'=>'y', 'Y'=>'yy', 'm'=>'mm', 'n'=>'m', 'd'=>'dd', 'j'=>'d'))); |
| | | foreach (array('jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec') as $month) |
| | | $month_names[] = rcube_label($month); |
| | | $RCMAIL->output->set_env('month_names', $month_names); |
| | | } |
| | | $colprop['class'] .= ($colprop['class'] ? ' ' : '') . 'datepicker'; |
| | | $val = format_date($val, $RCMAIL->config->get('date_format', 'Y-m-d')); |
| | | } |
| | | |
| | | $val = rcmail_get_edit_field($col, $val, $colprop, $colprop['type']); |
| | | $coltypes[$field]['count']++; |
| | | } |
| | |
| | | } |
| | | |
| | | // wrap rows in fieldgroup container |
| | | $content .= html::tag('fieldset', array('class' => 'contactfieldgroup ' . ($colprop['subtypes'] ? 'contactfieldgroupmulti ' : '') . 'contactcontroller' . $col, 'style' => ($rows ? null : 'display:none')), |
| | | ($colprop['subtypes'] ? html::tag('legend', null, Q($colprop['label'])) : ' ') . |
| | | $rows); |
| | | if ($rows) { |
| | | $content .= html::tag('fieldset', array('class' => 'contactfieldgroup ' . ($colprop['subtypes'] ? 'contactfieldgroupmulti ' : '') . 'contactcontroller' . $col, 'style' => ($rows ? null : 'display:none')), |
| | | ($colprop['subtypes'] ? html::tag('legend', null, Q($colprop['label'])) : ' ') . |
| | | $rows); |
| | | } |
| | | } |
| | | |
| | | if (!$content) |
| | | continue; |
| | | |
| | | // also render add-field selector |
| | | if ($edit_mode) |
| | |
| | | $content = $fieldset['content']; |
| | | } |
| | | |
| | | $out .= html::tag('fieldset', null, html::tag('legend', null, Q($fieldset['name'])) . $content) ."\n"; |
| | | if ($content) |
| | | $out .= html::tag('fieldset', null, html::tag('legend', null, Q($fieldset['name'])) . $content) ."\n"; |
| | | } |
| | | |
| | | if ($edit_mode) { |