| | |
| | | // TODO: define fields for vcards like GEO, KEY |
| | | ); |
| | | |
| | | $PAGE_SIZE = $RCMAIL->config->get('addressbook_pagesize'); |
| | | if (!$PAGE_SIZE) { |
| | | $PAGE_SIZE = $RCMAIL->config->get('pagesize', 50); |
| | | } |
| | | |
| | | // Addressbook UI |
| | | if (!$RCMAIL->action && !$OUTPUT->ajax_call) { |
| | |
| | | // instantiate a contacts object according to the given source |
| | | function rcmail_contact_source($source=null, $init_env=false, $writable=false) |
| | | { |
| | | global $RCMAIL, $OUTPUT, $CONFIG, $CONTACT_COLTYPES; |
| | | global $RCMAIL, $OUTPUT, $CONTACT_COLTYPES, $PAGE_SIZE; |
| | | |
| | | if (!strlen($source)) { |
| | | $source = get_input_value('_source', RCUBE_INPUT_GPC); |
| | |
| | | |
| | | // Get object |
| | | $CONTACTS = $RCMAIL->get_address_book($source, $writable); |
| | | $CONTACTS->set_pagesize($CONFIG['pagesize']); |
| | | $CONTACTS->set_pagesize($PAGE_SIZE); |
| | | |
| | | // set list properties and session vars |
| | | if (!empty($_GET['_page'])) |
| | |
| | | |
| | | function rcmail_get_rowcount_text($result=null) |
| | | { |
| | | global $CONTACTS, $CONFIG; |
| | | global $CONTACTS, $PAGE_SIZE; |
| | | |
| | | // read nr of contacts |
| | | if (!$result) { |
| | |
| | | 'name' => $_SESSION['contactcountdisplay'] ? $_SESSION['contactcountdisplay'] : 'contactsfromto', |
| | | 'vars' => array( |
| | | 'from' => $result->first + 1, |
| | | 'to' => min($result->count, $result->first + $CONFIG['pagesize']), |
| | | 'to' => min($result->count, $result->first + $PAGE_SIZE), |
| | | 'count' => $result->count) |
| | | )); |
| | | |
| | |
| | | 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( |
| | |
| | | |
| | | // 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'), false); |
| | | $val = rcmail_format_date_col($val); |
| | | } |
| | | |
| | | $val = rcmail_get_edit_field($col, $val, $colprop, $colprop['type']); |