| | |
| | | 'name' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('name'), 'category' => 'main'), |
| | | 'firstname' => array('type' => 'text', 'size' => 19, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('firstname'), 'category' => 'main'), |
| | | 'surname' => array('type' => 'text', 'size' => 19, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('surname'), 'category' => 'main'), |
| | | 'email' => array('type' => 'text', 'size' => 40, 'maxlength' => 50, 'label' => rcube_label('email'), 'subtypes' => array('home','work','other'), 'category' => 'main'), |
| | | 'email' => array('type' => 'text', 'size' => 40, 'maxlength' => 254, 'label' => rcube_label('email'), 'subtypes' => array('home','work','other'), 'category' => 'main'), |
| | | 'middlename' => array('type' => 'text', 'size' => 19, 'maxlength' => 50, 'limit' => 1, 'label' => rcube_label('middlename'), 'category' => 'main'), |
| | | 'prefix' => array('type' => 'text', 'size' => 8, 'maxlength' => 20, 'limit' => 1, 'label' => rcube_label('nameprefix'), 'category' => 'main'), |
| | | 'suffix' => array('type' => 'text', 'size' => 8, 'maxlength' => 20, 'limit' => 1, 'label' => rcube_label('namesuffix'), 'category' => 'main'), |
| | |
| | | $jsdata = array(); |
| | | |
| | | $line_templ = html::tag('li', array( |
| | | 'id' => 'rcmli%s', 'class' => '%s'), |
| | | 'id' => 'rcmli%s', 'class' => '%s', 'noclose' => true), |
| | | html::a(array('href' => '%s', |
| | | 'rel' => '%s', |
| | | 'onclick' => "return ".JS_OBJECT_NAME.".command('list','%s',this)"), '%s')); |
| | |
| | | |
| | | $name = !empty($source['name']) ? $source['name'] : $id; |
| | | $out .= sprintf($line_templ, |
| | | html_identifier($id), |
| | | rcube_utils::html_identifier($id, true), |
| | | $class_name, |
| | | Q(rcmail_url(null, array('_source' => $id))), |
| | | $source['id'], |
| | |
| | | $groupdata = rcmail_contact_groups($groupdata); |
| | | $jsdata = $groupdata['jsdata']; |
| | | $out = $groupdata['out']; |
| | | $out .= '</li>'; |
| | | } |
| | | |
| | | $line_templ = html::tag('li', array( |
| | | 'id' => 'rcmliS%s', 'class' => '%s'), |
| | | 'id' => 'rcmli%s', 'class' => '%s'), |
| | | html::a(array('href' => '#', 'rel' => 'S%s', |
| | | 'onclick' => "return ".JS_OBJECT_NAME.".command('listsearch', '%s', this)"), '%s')); |
| | | |
| | |
| | | $class_name .= ' ' . $source['class_name']; |
| | | |
| | | $out .= sprintf($line_templ, |
| | | html_identifier($id), |
| | | rcube_utils::html_identifier('S'.$id, true), |
| | | $class_name, |
| | | $id, |
| | | $js_id, (!empty($source['name']) ? Q($source['name']) : Q($id))); |
| | | } |
| | | |
| | | $OUTPUT->set_env('contactgroups', $jsdata); |
| | | $OUTPUT->set_env('collapsed_abooks', (string)$RCMAIL->config->get('collapsed_abooks','')); |
| | | $OUTPUT->add_gui_object('folderlist', $attrib['id']); |
| | | $OUTPUT->include_script('treelist.js'); |
| | | |
| | | // add some labels to client |
| | | $OUTPUT->add_label('deletegroupconfirm', 'groupdeleting', 'addingmember', 'removingmember'); |
| | | |
| | |
| | | { |
| | | global $RCMAIL; |
| | | |
| | | $groups_html = ''; |
| | | $groups = $RCMAIL->get_address_book($args['source'])->list_groups(); |
| | | $js_id = $RCMAIL->JQ($args['source']); |
| | | |
| | | if (!empty($groups)) { |
| | | $line_templ = html::tag('li', array( |
| | | 'id' => 'rcmliG%s', 'class' => 'contactgroup'), |
| | | 'id' => 'rcmli%s', 'class' => 'contactgroup'), |
| | | html::a(array('href' => '#', |
| | | 'rel' => '%s:%s', |
| | | 'onclick' => "return ".JS_OBJECT_NAME.".command('listgroup',{'source':'%s','id':'%s'},this)"), '%s')); |
| | | |
| | | // append collapse/expand toggle and open a new <ul> |
| | | $is_collapsed = strpos($RCMAIL->config->get('collapsed_abooks',''), '&'.rawurlencode($args['source']).'&') !== false; |
| | | $args['out'] .= html::div('treetoggle ' . ($is_collapsed ? 'collapsed' : 'expanded'), ' '); |
| | | |
| | | $jsdata = array(); |
| | | foreach ($groups as $group) { |
| | | $args['out'] .= sprintf($line_templ, |
| | | html_identifier($args['source'] . $group['ID']), |
| | | $groups_html .= sprintf($line_templ, |
| | | rcube_utils::html_identifier('G' . $args['source'] . $group['ID'], true), |
| | | $args['source'], $group['ID'], |
| | | $args['source'], $group['ID'], Q($group['name']) |
| | | ); |
| | |
| | | 'name' => $group['name'], 'type' => 'group'); |
| | | } |
| | | } |
| | | |
| | | $args['out'] .= html::tag('ul', |
| | | array('class' => 'groups', 'style' => ($is_collapsed ? "display:none;" : null)), |
| | | $groups_html); |
| | | |
| | | return $args; |
| | | } |
| | |
| | | return array(); |
| | | } |
| | | |
| | | $cid = explode(',', $cid); |
| | | $result = array(); |
| | | $cid = explode(',', $cid); |
| | | $got_source = strlen($source); |
| | | $result = array(); |
| | | |
| | | // create per-source contact IDs array |
| | | foreach ($cid as $id) { |
| | | // get source from decoded ID |
| | | if ($sep = strrpos($id, '-')) { |
| | | $contact_id = substr($id, 0, $sep); |
| | | $source_id = substr($id, $sep+1); |
| | | if (strlen($source_id)) { |
| | | $result[(string)$source_id][] = $contact_id; |
| | | // extract source ID from contact ID (it's there in search mode) |
| | | // see #1488959 and #1488862 for reference |
| | | if (!$got_source) { |
| | | if ($sep = strrpos($id, '-')) { |
| | | $contact_id = substr($id, 0, $sep); |
| | | $source_id = (string) substr($id, $sep+1); |
| | | if (strlen($source_id)) { |
| | | $result[$source_id][] = $contact_id; |
| | | } |
| | | } |
| | | } |
| | | else { |
| | | if (substr($id, -($got_source+1)) == "-$source") { |
| | | $id = substr($id, 0, -($got_source+1)); |
| | | } |
| | | $result[$source][] = $id; |
| | | } |
| | | } |