diff --git a/addressbook/inc/class.addressbook_display.inc.php b/addressbook/inc/class.addressbook_display.inc.php new file mode 100755 index 0000000000..92f48640d0 --- /dev/null +++ b/addressbook/inc/class.addressbook_display.inc.php @@ -0,0 +1,96 @@ + + * @package addressbook + * @copyright (c) 2008 by Stefan Becker + * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License + * @version $Id: class.addressbook_display.inc.php 24099 2008-02-18 16:29:06Z stefanbecker $ + */ + +require_once(EGW_INCLUDE_ROOT.'/etemplate/inc/class.uietemplate.inc.php'); +require_once(EGW_INCLUDE_ROOT.'/addressbook/inc/class.uicontacts.inc.php'); + +/** + * SiteMgr Display form for the addressbook + * + */ +class addressbook_display extends uicontacts +{ + /** + * Shows the Addressbook Entry and stores the submitted data + * + * @param array $content=null submitted eTemplate content + * @param int $addressbook=null int owner-id of addressbook to save contacts too + * @param array $fields=null field-names to show + * @param string $msg=null message to show after submitting the form + * @param string $email=null comma-separated email addresses + * @param string $tpl_name=null custom etemplate to use + * @param string $subject=null subject for email + * @return string html content + */ + // +function get_rows(&$query,&$rows,&$readonlys,$id_only=false) + { + $query['sitemgr_display'] = ($readonlys['sitemgr_display'] ?$readonlys['sitemgr_display']:'addressbook.display'); + $total = parent::get_rows($query,$rows,$readonlys); + $query['template'] = $query['sitemgr_display'].'.rows'; + + foreach($query['fields'] as $name) + { + $rows['show'][$name]=true; + } + + return $total; + + } + + function display($content=null,$addressbook=null,$fields=null,$msg=null,$email=null,$tpl_name=null,$subject=null) + { + $tpl_name=($tpl_name ? $tpl_name : 'addressbook.display'); + $tpl = new etemplate($tpl_name); + + $content = array( + 'msg' => $msg ? $msg : $_GET['msg'], + ); + $content['nm1'] = $GLOBALS['egw']->session->appsession(($tpl_name ? $tpl_name : 'index'),'addressbook'); + $readonlys['sitemgr_display']=$tpl_name; + if (!is_array($content['nm1'])) + { + $content['nm1'] = array( + 'get_rows' => 'addressbook.addressbook_display.get_rows', // I method/callback to request the data for the rows eg. 'notes.bo.get_rows' + 'bottom_too' => false, // I show the nextmatch-line (arrows, filters, search, ...) again after the rows + 'never_hide' => True, // I never hide the nextmatch-line if less then maxmatch entrie + 'start' => 0, // IO position in list + 'cat_id' => '', // IO category, if not 'no_cat' => True + 'no_cat' => 'True', + // 'options-cat_id' => array(lang('none')), + 'search' => '', // IO search pattern + 'order' => 'n_family', // IO name of the column to sort after (optional for the sortheaders) + 'sort' => 'ASC', // IO direction of the sort: 'ASC' or 'DESC' + // 'col_filter' => array(), // IO array of column-name value pairs (optional for the filterheaders) + // 'filter_label' => lang('Addressbook'), // I label for filter (optional) + 'filter' => $addressbook, // =All // IO filter, if not 'no_filter' => True + // 'filter_no_lang' => True, // I set no_lang for filter (=dont translate the options) + 'no_filter' => True, // I disable the 1. filter (params are the same as for filter) + 'no_filter2' => True, // I disable the 2. filter (params are the same as for filter) + // 'filter2_label' => lang('Distribution lists'), // IO filter2, if not 'no_filter2' => True + // 'filter2' => '', // IO filter2, if not 'no_filter2' => True + // 'filter2_no_lang'=> True, // I set no_lang for filter2 (=dont translate the options) + // 'filter2_onchange' => "if(this.value=='add') { add_new_list(document.getElementById(form::name('filter')).value); this.value='';} else this.form.submit();", + 'lettersearch' => true, + 'do_email' => $do_email, + 'default_cols' => '!cat_id,contact_created_contact_modified', + 'manual' => $do_email ? ' ' : false, // space for the manual icon + 'no_columnselection' => True, + 'csv_fields' => false, + ); + + $content['nm1']['fields'] = $fields; + } + + return $tpl->exec('addressbook.addressbook_display.display',$content,$sel_options,$readonlys,$preserv); + } +} diff --git a/addressbook/inc/class.uicontacts.inc.php b/addressbook/inc/class.uicontacts.inc.php index 383fdb8d90..185c69bd38 100644 --- a/addressbook/inc/class.uicontacts.inc.php +++ b/addressbook/inc/class.uicontacts.inc.php @@ -265,7 +265,15 @@ class uicontacts extends bocontacts { $sel_options['action']['infolog'] = lang('View linked InfoLog entries'); } - $sel_options['action'][lang('Move to addressbook:')] = $this->get_addressbooks(EGW_ACL_ADD); + if (($move2addressbooks=$this->get_addressbooks(EGW_ACL_ADD))) // do we have addressbooks, we should + { + foreach ($move2addressbooks as $m2a_id => $m2alabel) + { + $m2a['move_to_'.$m2a_id] = $m2alabel; + } + $sel_options['action'][lang('Move to addressbook:')] = $m2a; + } + if (($add_lists = $this->get_lists(EGW_ACL_EDIT))) // do we have distribution lists? { @@ -450,7 +458,6 @@ class uicontacts extends bocontacts { //echo "

uicontacts::action('$action',".print_r($checked,true).','.(int)$use_all.",...)

\n"; $success = $failed = 0; - if ($use_all || in_array($action,array('remove_from_list','delete_list'))) { // get the whole selection @@ -485,6 +492,10 @@ class uicontacts extends bocontacts if ($org_contacts) $checked = array_unique($checked ? array_merge($checked,$org_contacts) : $org_contacts); //_debug_array($checked); exit; + if (substr($action,0,8) == 'move_to_') + { + $action = (int)substr($action,8); + } if (substr($action,0,7) == 'to_list') { $to_list = (int)substr($action,8); @@ -654,7 +665,6 @@ class uicontacts extends bocontacts $Ok = $this->add2list($id,$to_list) !== false; } break; - default: // move to an other addressbook if (!(int)$action || !($this->grants[(string) (int) $action] & EGW_ACL_EDIT)) // might be ADD in the future { @@ -701,7 +711,14 @@ class uicontacts extends bocontacts function get_rows(&$query,&$rows,&$readonlys,$id_only=false) { $do_email = $query['do_email']; - $old_state = $GLOBALS['egw']->session->appsession($do_email ? 'email' : 'index','addressbook'); + // is this wanted??? + if ($query['sitemgr_display']) + { + $old_state = $GLOBALS['egw']->session->appsession($query['sitemgr_display'],'addressbook'); + } else { + $old_state = $GLOBALS['egw']->session->appsession($do_email ? 'email' : 'index','addressbook'); + } + if (isset($this->org_views[(string) $query['org_view']])) // we have an org view, reset the advanced search { if (is_array($query['search'])) unset($query['search']); @@ -734,7 +751,12 @@ class uicontacts extends bocontacts { $query['searchletter'] = ''; // reset lettersearch if viewing the contacts of one organisation } - $GLOBALS['egw']->session->appsession($do_email ? 'email' : 'index','addressbook',$query); + if ($query['sitemgr_display']) + { + $old_state = $GLOBALS['egw']->session->appsession($query['sitemgr_display'],'addressbook',$query); + } else { + $GLOBALS['egw']->session->appsession(($do_email ? 'email' : 'index'),'addressbook',$query); + } // save the state of the index in the user prefs $state = serialize(array( 'filter' => $query['filter'], @@ -744,6 +766,12 @@ class uicontacts extends bocontacts 'col_filter' => array('tid' => $query['col_filter']['tid']), 'org_view' => $query['org_view'], )); + if ($state != $this->prefs[($query['sitemgr_display'] ? $query['sitemgr_display'].'_state' : 'index_state')]) + { + $GLOBALS['egw']->preferences->add('addressbook',($query['sitemgr_display'] ? $query['sitemgr_display'].'_state' : 'index_state'),$state); + // save prefs, but do NOT invalid the cache (unnecessary) + $GLOBALS['egw']->preferences->save_repository(false,'user',false); + } if ($state != $this->prefs[$do_email ? 'email_state' : 'index_state']) { $GLOBALS['egw']->preferences->add('addressbook',$do_email ? 'email_state' : 'index_state',$state); @@ -803,8 +831,12 @@ class uicontacts extends bocontacts } else // contacts view { - $query['template'] = $do_email ? 'addressbook.email.rows' : 'addressbook.index.rows'; - + if ($query['sitemgr_display']) + { + $query['template'] = $query['sitemgr_display'].'.rows'; + } else { + $query['template'] = $do_email ? 'addressbook.email.rows' : 'addressbook.index.rows'; + } if ($query['org_view']) // view the contacts of one organisation only { foreach(explode('|||',$query['org_view']) as $part) diff --git a/addressbook/setup/etemplates.inc.php b/addressbook/setup/etemplates.inc.php index 114f76ef3f..8d7e1b8a55 100755 --- a/addressbook/setup/etemplates.inc.php +++ b/addressbook/setup/etemplates.inc.php @@ -20,6 +20,10 @@ $templ_data[] = array('name' => 'addressbook.contactform','template' => '','lang $templ_data[] = array('name' => 'addressbook.contactform.test','template' => '','lang' => '','group' => '0','version' => '1.5.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:24:{i:0;a:26:{s:3:"h14";s:39:",!@show[adr_one_locality]=postcode_city";s:3:"h15";s:45:",!@show[adr_one_locality]=city_state_postcode";s:2:"c3";s:4:",top";s:3:"c14";s:4:",top";s:3:"c15";s:4:",top";s:2:"h2";s:17:",!@show[org_unit]";s:2:"h1";s:17:",!@show[org_name]";s:2:"h3";s:13:",!@show[n_fn]";s:2:"h5";s:14:",!@show[email]";s:2:"h6";s:17:",!@show[tel_work]";s:2:"h7";s:17:",!@show[tel_cell]";s:2:"h8";s:16:",!@show[tel_fax]";s:2:"h9";s:17:",!@show[tel_home]";s:3:"h10";s:12:",!@show[url]";s:3:"h12";s:23:",!@show[adr_one_street]";s:3:"h13";s:24:",!@show[adr_one_street2]";s:3:"h17";s:16:",!@show[custom1]";s:3:"h21";s:13:",!@show[sep5]";s:3:"h19";s:13:",!@show[sep4]";s:3:"h20";s:13:",!@show[note]";s:3:"h16";s:13:",!@show[sep3]";s:3:"h11";s:13:",!@show[sep2]";s:2:"h4";s:13:",!@show[sep1]";s:3:"h22";s:16:",!@show[captcha]";s:3:"c20";s:4:",top";s:3:"h18";s:16:",!@show[custom2]";}i:1;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"image";s:4:"name";s:4:"home";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Company";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"64,64";s:4:"name";s:8:"org_name";s:4:"span";s:1:"4";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}}i:2;a:7:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:10:"Department";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"64,64";s:4:"span";s:1:"4";s:4:"name";s:8:"org_unit";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}}i:3;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"image";s:4:"name";s:8:"accounts";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Contact";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"10,64";s:4:"name";s:8:"n_prefix";s:4:"blur";s:6:"Prefix";}s:1:"D";a:4:{s:4:"type";s:4:"text";s:4:"name";s:7:"n_given";s:4:"size";s:5:"20,64";s:5:"align";s:6:"center";}s:1:"E";a:6:{s:4:"type";s:4:"text";s:4:"name";s:8:"n_family";s:5:"align";s:5:"right";s:4:"size";s:5:"22,64";s:4:"span";s:1:"2";s:6:"needed";s:1:"1";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:3:{s:4:"type";s:5:"label";s:4:"span";s:10:",redItalic";s:5:"label";s:1:"*";}}i:4;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"hrule";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}}i:5;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"image";s:4:"name";s:9:"email.png";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Email";}s:1:"C";a:5:{s:4:"type";s:4:"text";s:4:"size";s:49:"64,64,/^[a-z0-9._-]+@[a-z0-9-]+(\\.[a-z0-9-]+)+$/i";s:4:"span";s:1:"4";s:4:"name";s:5:"email";s:6:"needed";s:1:"1";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:3:{s:4:"type";s:5:"label";s:4:"span";s:10:",redItalic";s:5:"label";s:1:"*";}}i:6;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"image";s:4:"name";s:5:"phone";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:14:"Business phone";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"64,64";s:4:"span";s:1:"4";s:4:"name";s:8:"tel_work";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}}i:7;a:7:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:12:"Mobile phone";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"64,64";s:4:"span";s:1:"4";s:4:"name";s:8:"tel_cell";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}}i:8;a:7:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:3:"Fax";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"64,64";s:4:"span";s:1:"4";s:4:"name";s:7:"tel_fax";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}}i:9;a:7:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:10:"Home phone";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"64,64";s:4:"span";s:1:"4";s:4:"name";s:8:"tel_home";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}}i:10;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"image";s:4:"name";s:8:"internet";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Internet";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"64,64";s:4:"span";s:1:"4";s:4:"name";s:3:"url";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}}i:11;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"hrule";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}}i:12;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"image";s:4:"name";s:4:"home";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Street";}s:1:"C";a:5:{s:4:"type";s:4:"text";s:4:"size";s:5:"64,64";s:4:"span";s:1:"4";s:4:"name";s:14:"adr_one_street";s:6:"needed";s:1:"1";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:3:{s:4:"type";s:5:"label";s:4:"span";s:10:",redItalic";s:5:"label";s:1:"*";}}i:13;a:7:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"64,64";s:4:"span";s:1:"4";s:4:"name";s:15:"adr_one_street2";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}}i:14;a:7:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"City";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"10,64";s:4:"name";s:18:"adr_one_postalcode";s:6:"needed";s:1:"1";}s:1:"D";a:6:{s:4:"type";s:4:"text";s:4:"size";s:5:"48,64";s:4:"span";s:1:"3";s:4:"name";s:16:"adr_one_locality";s:5:"align";s:5:"right";s:6:"needed";s:1:"1";}s:1:"E";a:2:{s:4:"type";s:4:"text";s:4:"name";s:14:"adr_one_region";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:3:{s:4:"type";s:5:"label";s:4:"span";s:10:",redItalic";s:5:"label";s:1:"*";}}i:15;a:7:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Stadt";}s:1:"C";a:5:{s:4:"type";s:4:"text";s:4:"size";s:5:"36,64";s:4:"span";s:1:"2";s:4:"name";s:16:"adr_one_locality";s:6:"needed";s:1:"1";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:4:{s:4:"type";s:4:"text";s:4:"size";s:4:"8,64";s:4:"name";s:14:"adr_one_region";s:5:"align";s:6:"center";}s:1:"F";a:5:{s:4:"type";s:4:"text";s:4:"size";s:4:"8,64";s:4:"name";s:18:"adr_one_postalcode";s:5:"align";s:5:"right";s:6:"needed";s:1:"1";}s:1:"G";a:3:{s:4:"type";s:5:"label";s:4:"span";s:10:",redItalic";s:5:"label";s:1:"*";}}i:16;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"hrule";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}}i:17;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"image";s:4:"name";s:4:"gear";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:15:"@customlabel[1]";}s:1:"C";a:5:{s:4:"type";s:4:"text";s:4:"name";s:15:"@customfield[1]";s:4:"span";s:1:"4";s:6:"needed";s:1:"1";s:4:"size";s:2:"64";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:3:{s:4:"type";s:5:"label";s:4:"span";s:10:",redItalic";s:5:"label";s:1:"*";}}i:18;a:7:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:15:"@customlabel[2]";}s:1:"C";a:4:{s:4:"type";s:21:"customfields-no-label";s:4:"name";s:6:"#woher";s:4:"span";s:1:"4";s:4:"size";s:13:"Please select";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}}i:19;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"hrule";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}}i:20;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"image";s:4:"name";s:8:"edit.png";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Message";}s:1:"C";a:5:{s:4:"type";s:8:"textarea";s:4:"size";s:4:"5,45";s:4:"span";s:10:"4,width100";s:6:"needed";s:1:"1";s:4:"name";s:4:"note";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:3:{s:4:"type";s:5:"label";s:4:"span";s:10:",redItalic";s:5:"label";s:1:"*";}}i:21;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"hrule";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}}i:22;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"image";s:4:"name";s:11:"private.png";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:12:"Verification";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:5:"label";s:13:"@captcha_task";}s:1:"D";a:6:{s:4:"type";s:4:"text";s:5:"label";s:30:"%s please calculate the result";s:6:"needed";s:1:"1";s:4:"span";s:1:"3";s:4:"name";s:7:"captcha";s:4:"size";s:1:"3";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:3:{s:4:"type";s:5:"label";s:4:"span";s:10:",redItalic";s:5:"label";s:1:"*";}}i:23;a:7:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Submit";s:4:"name";s:8:"submitit";}s:1:"D";a:4:{s:4:"type";s:5:"label";s:4:"span";s:13:"all,redItalic";s:5:"label";s:17:"required fields *";s:5:"align";s:5:"right";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}s:1:"G";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:23;s:4:"cols";i:7;s:4:"size";s:3:",,0";s:7:"options";a:1:{i:2;s:1:"0";}}}','size' => ',,0','style' => '.width100 textarea { width: 99%; }','modified' => '1197011086',); +$templ_data[] = array('name' => 'addressbook.display','template' => '','lang' => '','group' => '0','version' => '1.5.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:2:{s:2:"h1";s:6:",!@msg";s:2:"h2";s:2:",1";}i:1;a:2:{s:1:"A";a:5:{s:4:"type";s:5:"label";s:4:"span";s:13:"all,redItalic";s:5:"align";s:6:"center";s:4:"name";s:3:"msg";s:7:"no_lang";s:1:"1";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:3;a:2:{s:1:"A";a:4:{s:4:"type";s:9:"nextmatch";s:4:"size";s:24:"addressbook.display.rows";s:4:"name";s:3:"nm1";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:3;s:4:"cols";i:2;s:4:"size";s:4:"100%";s:7:"options";a:1:{i:0;s:4:"100%";}}}','size' => '100%','style' => '','modified' => '1194343373',); + +$templ_data[] = array('name' => 'addressbook.display.rows','template' => '','lang' => '','group' => '0','version' => '1.5.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:17:{s:2:"c1";s:2:"th";s:2:"c2";s:7:"row,top";s:1:"B";s:17:",!@show[org_name]";s:1:"C";s:17:",!@show[org_unit]";s:1:"D";s:13:",!@show[n_fn]";s:1:"E";s:14:",!@show[email]";s:1:"F";s:17:",!@show[tel_work]";s:1:"G";s:17:",!@show[tel_cell]";s:1:"H";s:16:",!@show[tel_fax]";s:1:"I";s:17:",!@show[org_home]";s:1:"J";s:12:",!@show[url]";s:1:"K";s:23:",!@show[adr_one_street]";s:1:"L";s:27:",!@show[adr_one_postalcode]";s:1:"M";s:25:",!@show[adr_one_locality]";s:1:"N";s:23:",!@show[adr_one_region]";s:1:"O";s:16:",!@show[custom1]";s:1:"P";s:16:",!@show[custom2]";}i:1;a:17:{s:1:"A";a:2:{s:4:"type";s:16:"nextmatch-header";s:4:"name";s:4:"type";}s:1:"B";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:7:"Company";s:4:"name";s:8:"org_name";}s:1:"C";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:10:"Department";s:4:"name";s:8:"org_unit";}s:1:"D";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:7:"Contact";s:4:"name";s:4:"n_fn";}s:1:"E";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:5:"Email";s:4:"name";s:5:"email";}s:1:"F";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:14:"Business phone";s:4:"name";s:8:"tel_work";}s:1:"G";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:12:"Mobile phone";s:4:"name";s:8:"tel_cell";}s:1:"H";a:3:{s:4:"type";s:16:"nextmatch-header";s:4:"name";s:7:"tel_fax";s:5:"label";s:3:"Fax";}s:1:"I";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:10:"Home phone";s:4:"name";s:8:"tel_home";}s:1:"J";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:8:"Internet";s:4:"name";s:3:"url";}s:1:"K";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:6:"Street";s:4:"name";s:14:"adr_one_street";}s:1:"L";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"ZIP Code";s:4:"name";s:18:"adr_one_postalcode";}s:1:"M";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:4:"City";s:4:"name";s:16:"adr_one_locality";}s:1:"N";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:6:"Region";s:4:"name";s:14:"adr_one_region";}s:1:"O";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:15:"@customlabel[1]";s:4:"name";s:7:"custom1";}s:1:"P";a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:15:"@customlabel[2]";s:4:"name";s:7:"custom2";}s:1:"Q";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:6:"2,,0,0";i:1;a:3:{s:4:"type";s:16:"nextmatch-header";s:5:"label";s:14:"select country";s:4:"name";s:7:"country";}i:2;a:4:{s:4:"type";s:22:"nextmatch-customfilter";s:4:"name";s:19:"adr_one_countryname";s:4:"size";s:24:"select-country,Country,1";s:4:"span";s:14:",countrySelect";}}}i:2;a:17:{s:1:"A";a:5:{s:4:"type";s:5:"image";s:4:"size";s:1:"1";s:4:"name";s:12:"${row}[type]";s:8:"readonly";s:1:"1";s:5:"label";s:21:"$row_cont[type_label]";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:4:"name";s:16:"${row}[org_name]";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:4:"name";s:16:"${row}[org_unit]";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:4:"name";s:13:"${row}[line1]";}s:1:"E";a:2:{s:4:"type";s:5:"label";s:4:"name";s:13:"${row}[email]";}s:1:"F";a:2:{s:4:"type";s:5:"label";s:4:"name";s:16:"${row}[tel_work]";}s:1:"G";a:2:{s:4:"type";s:5:"label";s:4:"name";s:16:"${row}[tel_cell]";}s:1:"H";a:2:{s:4:"type";s:5:"label";s:4:"name";s:15:"${row}[tel_fax]";}s:1:"I";a:2:{s:4:"type";s:5:"label";s:4:"name";s:16:"${row}[tel_home]";}s:1:"J";a:2:{s:4:"type";s:5:"label";s:4:"name";s:11:"${row}[url]";}s:1:"K";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:2:{s:4:"type";s:5:"label";s:4:"name";s:22:"${row}[adr_one_street]";}i:2;a:2:{s:4:"type";s:5:"label";s:4:"name";s:23:"${row}[adr_one_street2]";}}s:1:"L";a:2:{s:4:"type";s:5:"label";s:4:"name";s:26:"${row}[adr_one_postalcode]";}s:1:"M";a:2:{s:4:"type";s:5:"label";s:4:"name";s:24:"${row}[adr_one_locality]";}s:1:"N";a:2:{s:4:"type";s:5:"label";s:4:"name";s:22:"${row}[adr_one_region]";}s:1:"O";a:2:{s:4:"type";s:5:"label";s:4:"name";s:15:"${row}[custom1]";}s:1:"P";a:2:{s:4:"type";s:5:"label";s:4:"name";s:15:"${row}[custom2]";}s:1:"Q";a:2:{s:4:"type";s:5:"label";s:4:"name";s:27:"${row}[adr_one_countryname]";}}}s:4:"rows";i:2;s:4:"cols";i:17;s:4:"size";s:14:"100%,,,,,,auto";s:7:"options";a:2:{i:0;s:4:"100%";i:6;s:4:"auto";}}}','size' => '100%,,,,,,auto','style' => '','modified' => '1195309977',); + $templ_data[] = array('name' => 'addressbook.edit','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:7:{i:0;a:5:{s:1:"A";s:3:"750";s:2:"c3";s:4:",top";s:2:"h3";s:3:"350";s:2:"h4";s:5:",!@id";s:2:"h5";s:13:",@hidebuttons";}i:1;a:1:{s:1:"A";a:4:{s:4:"type";s:5:"label";s:4:"span";s:13:"all,redItalic";s:4:"name";s:3:"msg";s:7:"no_lang";s:1:"1";}}i:2;a:1:{s:1:"A";a:4:{s:4:"type";s:4:"text";s:4:"name";s:2:"fn";s:8:"readonly";s:1:"1";s:4:"span";s:3:"all";}}i:3;a:1:{s:1:"A";a:4:{s:4:"type";s:3:"tab";s:5:"label";s:41:"personal|organisation|home|details|custom";s:4:"name";s:41:"personal|organisation|home|details|custom";s:4:"span";s:3:"all";}}i:4;a:1:{s:1:"A";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"owner";}i:2;a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:5:"owner";s:8:"readonly";s:1:"1";}}i:2;a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";s:5:"align";s:5:"right";i:1;a:2:{s:4:"type";s:5:"label";s:5:"label";s:13:"last modified";}i:2;a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:8:"last_mod";s:8:"readonly";s:1:"1";}}}}i:5;a:1:{s:1:"A";a:4:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"2";i:1;a:7:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"5";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Edit";s:4:"name";s:12:"button[edit]";s:8:"tabindex";i:15;}i:2;a:3:{s:4:"type";s:6:"button";s:5:"label";s:4:"Copy";s:4:"name";s:12:"button[copy]";}i:3;a:5:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:12:"button[save]";s:8:"tabindex";i:16;s:9:"accesskey";s:1:"s";}i:4;a:4:{s:4:"type";s:6:"button";s:5:"label";s:5:"Apply";s:4:"name";s:13:"button[apply]";s:8:"tabindex";i:17;}i:5;a:5:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:14:"button[cancel]";s:7:"onclick";s:27:"self.close(); return false;";s:8:"tabindex";i:18;}}i:2;a:6:{s:4:"type";s:6:"button";s:5:"label";s:6:"Delete";s:4:"name";s:14:"button[delete]";s:7:"onclick";s:65:"return confirm(\'Are you shure you want to delete this contact?\');";s:5:"align";s:5:"right";s:8:"tabindex";i:20;}}}i:6;a:1:{s:1:"A";a:2:{s:4:"type";s:8:"template";s:4:"name";s:22:"addressbook.editphones";}}}s:4:"rows";i:6;s:4:"cols";i:1;}}','size' => '','style' => '.redItalic { color: red; font-style: italic; }','modified' => '1130404011',); $templ_data[] = array('name' => 'addressbook.edit','template' => '','lang' => '','group' => '0','version' => '1.0.1.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:6:{i:0;a:5:{s:1:"A";s:3:"450";s:2:"c3";s:4:",top";s:2:"h4";s:5:",!@id";s:2:"h5";s:13:",@hidebuttons";s:2:"h1";s:6:",!@msg";}i:1;a:2:{s:1:"A";a:4:{s:4:"type";s:5:"label";s:4:"span";s:13:"all,redItalic";s:4:"name";s:3:"msg";s:7:"no_lang";s:1:"1";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:2;a:2:{s:1:"A";a:5:{s:4:"type";s:4:"grid";s:4:"span";s:3:"all";s:4:"data";a:2:{i:0;a:2:{s:1:"B";s:11:",!@org_name";s:1:"A";s:11:",!@org_name";}i:1;a:3:{s:1:"A";a:3:{s:4:"type";s:4:"text";s:4:"name";s:8:"org_name";s:8:"readonly";s:1:"1";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:1:":";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"name";s:2:"fn";s:8:"readonly";s:1:"1";s:4:"span";s:3:"all";}}}s:4:"rows";i:1;s:4:"cols";i:3;}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:3;a:2:{s:1:"A";a:3:{s:4:"type";s:3:"tab";s:5:"label";s:38:"Personal|Company|Private|Details|Links";s:4:"name";s:40:"personal|organisation|home|details|links";}s:1:"B";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:5:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"1";s:5:"label";s:13:"Phone Numbers";i:1;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:5:{i:0;a:2:{s:1:"B";s:3:"120";s:1:"A";s:2:"20";}i:1;a:3:{s:1:"A";a:2:{s:4:"type";s:5:"image";s:4:"name";s:12:"kaddressbook";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:5:"label";s:8:"business";s:4:"size";s:11:",,,tel_work";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"name";s:8:"tel_work";s:4:"size";s:5:"28,40";s:8:"tabindex";i:10;}}i:2;a:3:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:5:"label";s:12:"mobile phone";s:4:"size";s:11:",,,tel_cell";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"name";s:8:"tel_cell";s:4:"size";s:5:"28,40";s:8:"tabindex";i:11;}}i:3;a:3:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:5:"label";s:7:"Private";s:4:"size";s:11:",,,tel_home";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"name";s:8:"tel_home";s:4:"size";s:5:"28,40";s:8:"tabindex";i:12;}}i:4;a:3:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:5:{s:4:"type";s:6:"button";s:5:"label";s:8:"More ...";s:7:"onclick";s:36:"showphones(this.form); return false;";s:8:"tabindex";i:13;s:9:"accesskey";s:1:"m";}}}s:4:"rows";i:4;s:4:"cols";i:3;}s:4:"span";s:11:",phoneGroup";}i:2;a:5:{s:4:"type";s:8:"groupbox";s:4:"size";s:1:"1";s:5:"label";s:16:"Email & Internet";i:1;a:5:{s:4:"type";s:4:"grid";s:4:"data";a:4:{i:0;a:2:{s:1:"A";s:2:"20";s:1:"B";s:3:"120";}i:1;a:3:{s:1:"A";a:2:{s:4:"type";s:5:"image";s:4:"name";s:15:"package_network";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:5:"label";s:3:"url";s:4:"size";s:6:",,,url";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"name";s:3:"url";s:4:"size";s:6:"28,128";s:8:"tabindex";i:15;}}i:2;a:3:{s:1:"A";a:2:{s:4:"type";s:5:"image";s:4:"name";s:10:"email_icon";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:5:"label";s:14:"business email";s:4:"size";s:8:",,,email";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"name";s:5:"email";s:4:"size";s:5:"28,64";s:8:"tabindex";i:16;}}i:3;a:3:{s:1:"A";a:1:{s:4:"type";s:5:"label";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:5:"label";s:10:"home email";s:4:"size";s:13:",,,email_home";}s:1:"C";a:4:{s:4:"type";s:4:"text";s:4:"name";s:10:"email_home";s:4:"size";s:5:"28,64";s:8:"tabindex";i:17;}}}s:4:"rows";i:3;s:4:"cols";i:3;s:7:"options";a:0:{}}s:4:"span";s:11:",emailGroup";}}}i:4;a:2:{s:1:"A";a:4:{s:4:"type";s:14:"select-account";s:4:"name";s:5:"owner";s:8:"readonly";s:1:"1";s:5:"label";s:5:"Owner";}s:1:"B";a:5:{s:4:"type";s:4:"hbox";s:5:"align";s:5:"right";s:4:"size";s:1:"2";i:1;a:2:{s:4:"type";s:5:"label";s:5:"label";s:13:"Last modified";}i:2;a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:8:"last_mod";s:8:"readonly";s:1:"1";}}}i:5;a:2:{s:1:"A";a:9:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"7";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Edit";s:4:"name";s:12:"button[edit]";s:7:"onclick";s:185:"window.open(egw::link(\'/index.php\',\'menuaction=addressbook.uicontacts.edit&contact_id=$cont[id]\'),\'_blank\',\'dependent=yes,width=850,height=440,scrollbars=yes,status=yes\'); return false;";}i:2;a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Copy";s:4:"name";s:12:"button[copy]";s:7:"onclick";s:194:"window.open(egw::link(\'/index.php\',\'menuaction=addressbook.uicontacts.edit&contact_id=$cont[id]&makecp=1\'),\'_blank\',\'dependent=yes,width=850,height=440,scrollbars=yes,status=yes\'); return false;";}i:3;a:4:{s:4:"type";s:6:"button";s:5:"label";s:5:"vCard";s:4:"name";s:13:"button[vcard]";s:4:"help";s:35:"download this contact as vCard file";}i:4;a:5:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:12:"button[save]";s:8:"tabindex";i:20;s:9:"accesskey";s:1:"s";}i:5;a:4:{s:4:"type";s:6:"button";s:5:"label";s:5:"Apply";s:4:"name";s:13:"button[apply]";s:8:"tabindex";i:21;}i:6;a:5:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:14:"button[cancel]";s:7:"onclick";s:57:"if($cont[view]0) return true; self.close(); return false;";s:8:"tabindex";i:22;}i:7;a:2:{s:4:"type";s:8:"template";s:4:"name";s:22:"addressbook.editphones";}}s:1:"B";a:6:{s:4:"type";s:6:"button";s:5:"label";s:6:"Delete";s:4:"name";s:14:"button[delete]";s:7:"onclick";s:65:"return confirm(\'Are you shure you want to delete this contact?\');";s:5:"align";s:5:"right";s:8:"tabindex";i:25;}}}s:4:"rows";i:5;s:4:"cols";i:2;s:5:"align";s:6:"center";s:7:"options";a:0:{}}}','size' => '','style' => '','modified' => '1131890364',); diff --git a/addressbook/sitemgr/class.module_addressbook_display.inc.php b/addressbook/sitemgr/class.module_addressbook_display.inc.php new file mode 100755 index 0000000000..0f1c21e9c1 --- /dev/null +++ b/addressbook/sitemgr/class.module_addressbook_display.inc.php @@ -0,0 +1,94 @@ + + * @package addressbook + * @copyright (c) 2008 by stefan Becker + * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License + * @version $Id: class.module_addressbook_display.inc.php 24028 2008-02-18 09:04:36Z stefanbecker $ + */ + +require_once(EGW_INCLUDE_ROOT.'/etemplate/inc/class.sitemgr_module.inc.php'); + +/** + * SiteMgr contact form for the addressbook + * + */ +class module_addressbook_display extends sitemgr_module +{ + /** + * Constructor + * + * @return module_addressbook_showcontactblock + */ + function module_addressbook_display() + { + $this->arguments = array(); // get's set in get_user_interface + $this->title = lang('Display Contact'); + $this->description = lang('This module displays Block from a Adddressbook Group.'); + + $this->etemplate_method = 'addressbook.addressbook_display.display'; + } + + /** + * Reimplemented to add the addressbook translations and fetch the addressbooks only if needed for the user-interface + * + * @return array + */ + function get_user_interface() + { + $GLOBALS['egw']->translation->add_app('addressbook'); + + include_once(EGW_INCLUDE_ROOT.'/addressbook/inc/class.uicontacts.inc.php'); + $uicontacts = new uicontacts(); + + $default = $fields = array( + 'org_name' => lang('Company'), + 'org_unit' => lang('Department'), + 'n_fn' => lang('Prefix').', '.lang('Firstname').' + '.lang('Lastname'), + 'sep1' => '----------------------------', + 'email' => lang('email'), + 'tel_work' => lang('work phone'), + 'tel_cell' => lang('mobile phone'), + 'tel_fax' => lang('fax'), + 'tel_home' => lang('home phone'), + 'url' => lang('url'), + 'sep2' => '----------------------------', + 'adr_one_street' => lang('street'), + 'adr_one_street2' => lang('address line 2'), + 'adr_one_locality' => lang('city').' + '.lang('zip code'), + 'country' => lang('country'), + ); + foreach($uicontacts->customfields as $name => $data) + { + $fields['#'.$name] = $data['label']; + } + + $this->arguments = array( + 'arg1' => array( + 'type' => 'select', + 'label' => lang('Addressbook the contact should be shown').' ('.lang('The anonymous user needs read it!').')', + 'options' => array( + '' => lang('All'), + )+$uicontacts->get_addressbooks(EGW_ACL_ADD) // add to not show the accounts! + ), + 'arg2' => array( + 'type' => 'select', + 'label' => lang('Contact fields to show'), + 'multiple' => true, + 'options' => $fields, + 'default' => $default, + 'params' => array('size' => 9), + ), + 'arg5' => array( + 'type' => 'textfield', + 'label' => lang('Custom eTemplate for the contactform'), + 'params' => array('size' => 40), + 'default' => 'addressbook.display', + ), + ); + return parent::get_user_interface(); + } +}