| | |
| | | | Author: Thomas Bruederli <roundcube@gmail.com> | |
| | | | Author: Aleksander Machniak <machniak@kolabsys.com> | |
| | | +-----------------------------------------------------------------------+ |
| | | |
| | | $Id: search.inc 456 2007-01-10 12:34:33Z thomasb $ |
| | | |
| | | */ |
| | | |
| | | if ($RCMAIL->action == 'search-create') { |
| | |
| | | $search_set = array(); |
| | | $records = array(); |
| | | $sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name'); |
| | | $afields = $RCMAIL->config->get('contactlist_fields'); |
| | | |
| | | foreach ($sources as $s) { |
| | | $source = $RCMAIL->get_address_book($s['id']); |
| | |
| | | } |
| | | |
| | | // get records |
| | | $result = $source->list_records(array('name', 'firstname', 'surname', 'email')); |
| | | $result = $source->list_records($afields); |
| | | |
| | | while ($row = $result->next()) { |
| | | $row['sourceid'] = $s['id']; |
| | |
| | | $OUTPUT->command('set_env', 'source', ''); |
| | | $OUTPUT->command('set_env', 'group', ''); |
| | | |
| | | // unselect currently selected directory/group |
| | | if (!$sid) |
| | | if (!$sid) { |
| | | // unselect currently selected directory/group |
| | | $OUTPUT->command('unselect_directory'); |
| | | // enable "Save search" command |
| | | $OUTPUT->command('enable_command', 'search-create', true); |
| | | } |
| | | $OUTPUT->command('update_group_commands'); |
| | | |
| | | // send response |
| | |
| | | $label = isset($colprop['label']) ? $colprop['label'] : rcube_label($col); |
| | | $category = $colprop['category'] ? $colprop['category'] : 'other'; |
| | | |
| | | if ($ftype == 'text') |
| | | // load jquery UI datepicker for date fields |
| | | if ($colprop['type'] == 'date') |
| | | $colprop['class'] .= ($colprop['class'] ? ' ' : '') . 'datepicker'; |
| | | else if ($ftype == 'text') |
| | | $colprop['size'] = $i_size; |
| | | |
| | | |
| | | $content = html::div('row', html::div('contactfieldlabel label', Q($label)) |
| | | . html::div('contactfieldcontent', rcmail_get_edit_field('search_'.$col, '', $colprop, $ftype))); |
| | | |