Changeset 1598
- Timestamp:
- 11/06/09 09:50:22 (14 years ago)
- Location:
- trunk/contactcenter
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/inc/class.bo_contactcenter.inc.php
r752 r1598 206 206 207 207 */ 208 function find($what, $rules=false, $other=false )209 { 210 return $this->catalog->find($what, $rules, $other );208 function find($what, $rules=false, $other=false, $area=false) 209 { 210 return $this->catalog->find($what, $rules, $other, $area); 211 211 } 212 212 -
trunk/contactcenter/inc/class.bo_global_ldap_catalog.inc.php
r1419 r1598 41 41 'pgp_key' => true, 42 42 'notes' => true, 43 44 /* Array fields */45 43 'companies' => true, 46 44 'relations' => true, … … 115 113 116 114 */ 117 function find($what, $rules=false, $other=false )115 function find($what, $rules=false, $other=false, $area=false) 118 116 { 119 117 $restric_fields = $this->get_restrictions_without_branch($rules); … … 128 126 } 129 127 } 130 128 131 129 $fields = array_unique($fields); 132 133 $filter = $this->process_restrictions($rules, $trans_f); 134 // Find objects where 'mail' attribute is not null. 130 131 //Testa se a busca foi realizada com aspas 132 $rules_search = $rules[3]['value']; 133 $rules_len = (strlen($rules_search)) -1; 134 135 if((($rules_search{1}) == "\"") && (($rules_search{$rules_len -1}) == "\"")){ 136 $rules_search = substr($rules_search,2,$rules_len-3); 137 $filter = "(&(|(objectClass=phpgwAccount))(&(!(phpgwAccountVisible=-1)))(|(cn=* $rules_search *)(cn=$rules_search *)(cn=* $rules_search)))"; 138 } 139 else{ 140 $filter = $this->process_restrictions($rules, $trans_f); 141 } 142 143 if ($area) 144 { 145 $obj = CreateObject('phpgwapi.config','contactcenter'); 146 $opts = $obj->read_repository(); 147 $filter = substr($filter,0,-1) .'(' . $opts['cc_ldap_atrib'] . '=*' . $area . '*))'; 148 $opts = null; 149 $obj = null; 150 } 151 // Find objects where 'mail' attribute is not null. 135 152 $filter = "(&".$filter."(mail=*))"; 136 if("ou" === strtolower(substr($this->src_info['context'], 0, 2)) || 137 (trim($rules[0]['value']) == "phpgwAccount")) 138 { 139 $ldap = $GLOBALS['phpgw']->common->ldapConnect($this->src_info['host'], $this->src_info['acc'], $this->src_info['pw'], true); 140 $result_r = ldap_search($ldap , $this->src_info['context'], $filter, $fields, 0, $this->src_info['max_results']); 141 } 153 154 if(strstr($this->src_info['context'], "ldap://")) { 155 $refer_context = str_replace("??base","",preg_replace('!^(ldap://[^/]+)/(.*$)!', '\\2', $this->src_info['context'])); 156 $host = preg_replace('!^(ldap://[^/]+)/.*$!', '\\1', $this->src_info['context']); 157 $this->src_info['host'] = $host; 158 } 159 if($refer_context || "ou" === strtolower(substr($this->src_info['context'], 0, 2))) 160 { 161 $followReferral = false; 162 } 163 elseif(trim($rules[4]['value']) != "inetOrgPerson") 164 { 165 $followReferral = true; 166 } 142 167 else 143 168 { … … 145 170 } 146 171 172 $ldap = $GLOBALS['phpgw']->common->ldapConnect($this->src_info['host'], $this->src_info['acc'], $this->src_info['pw'], $followReferral); 173 $result_r = ldap_search($ldap ,($refer_context ? $refer_context : $this->src_info['context']), $filter, $fields, 0, $this->src_info['max_results']); 147 174 148 175 if (!$result_r) … … 192 219 $i++; 193 220 } 194 usort($return, array($this, "compareObjects")); 221 usort($return, array($this, "compareObjects")); 195 222 return $return; 196 223 } 197 224 // Compare function for usort. 198 function compareObjects($a, $b) { 225 function compareObjects($a, $b) { 199 226 return strnatcasecmp($a['names_ordered'], $b['names_ordered']); 200 227 } … … 580 607 } 581 608 582 609 // print_r($contact); 583 610 584 611 // $contact_data = $this->fields; … … 598 625 $l_fields['company_name'] = $this->trans_table['contact.company.company_name']; 599 626 $l_fields['title'] = $this->trans_table['contact.business_info.title']; 600 $l_fields['department'] = $this->trans_table['contact.business_info.department'];627 //$l_fields['department'] = $this->trans_table['contact.business_info.department']; 601 628 $l_fields['company_notes'] = $this->trans_table['contact.company.company_notes']; 602 629 630 //Relaciona o array com o atributo 'ou' do RHDS; tambem verifica se a 631 //preferencia esta configurada para exibir o campo 632 if(isset($_SESSION['phpgw_info']['user']['preferences']['contactcenter']['departmentShow']) && $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['departmentShow']) 633 { 634 $l_fields['department'] = $this->trans_table['contact.business_info.department']; 635 } 636 //Relaciona o array com o atributo 'employeeNumber' do RHDS; tambem verifica se a 637 //preferencia esta configurada para exibir o campo 638 if(isset($_SESSION['phpgw_info']['user']['preferences']['contactcenter']['empNumShow']) && $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['empNumShow']) 639 { 640 $l_fields['empNumber'] = $this->trans_table['contact.business_info.empNumber']; 641 } 642 //Relaciona o array com o atributo 'mobile' do RHDS; tambem verifica se a 643 //preferencia esta configurada para exibir o campo 644 if(isset($_SESSION['phpgw_info']['user']['preferences']['contactcenter']['cellShow']) && $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['cellShow']) 645 { 646 $l_fields['celPhone'] = $this->trans_table['contact.business_info.celPhone']; 647 } 648 603 649 $contact_data['companies'] = array(); 604 650 foreach($l_fields as $l_field => $l_value) … … 920 966 $l_fields['company_notes'] = $this->trans_table['contact.company.company_notes']; 921 967 968 //Relaciona o array com o atributo 'employeeNumber' do RHDS 969 if(isset($_SESSION['phpgw_info']['user']['preferences']['contactcenter']['empNumberShow']) && $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['empNumberShow']) 970 { 971 $l_fields['empNumber'] = $this->trans_table['contact.business_info.empNumber']; 972 } 973 //Relaciona o array com o atributo 'mobile' do RHDS 974 $l_fields['celPhone'] = $this->trans_table['contact.business_info.celPhone']; 975 976 //Relaciona o array com o atributo 'mobile' do RHDS 977 $l_fields['celPhone'] = $this->trans_table['contact.business_info.celPhone']; 978 922 979 $contact_data['companies'] = array(); 923 980 foreach($l_fields as $l_field => $l_value) -
trunk/contactcenter/index.php
r498 r1598 24 24 25 25 $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['telephone_number'] = $GLOBALS['phpgw_info']['user']['telephonenumber']; 26 27 $prefs = CreateObject('contactcenter.ui_preferences'); 28 $actual = $prefs->get_preferences(); 29 30 $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['empNumShow'] = false; 31 $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['cellShow'] = false; 32 $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['departmentShow'] = false; 33 34 if ($actual['empNum']) 35 { 36 $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['empNumShow'] = true; 37 } 38 39 if ($actual['cell']) 40 { 41 $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['cellShow'] = true; 42 } 43 44 if ($actual['department']) 45 { 46 $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['departmentShow'] = true; 47 } 48 49 50 26 51 //Enable/Disable VoIP Service -> Voip Server Config 27 52 $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['voip_enabled'] = false; … … 38 63 } 39 64 } 40 } 65 } 66 41 67 // Verificar se há contatos compartilhados para o usuario logado 42 68 $acl = CreateObject("phpgwapi.acl",$GLOBALS['phpgw_info']['user']['account_id']); … … 47 73 } 48 74 } 49 $obj = CreateObject('contactcenter.ui_data'); 50 $obj->index(); 75 $obj = CreateObject('phpgwapi.config','contactcenter'); 76 $opts = $obj->read_repository(); 77 echo '<script> var v_label = \'' . $opts['cc_ldap_legend'] . '\'; var v_atrib = \'' . $opts['cc_ldap_atrib'] . '\'; v_min = \'' . $opts['cc_ldap_min'] . '\' </script>'; 78 $opts = null; 79 $obj = CreateObject('contactcenter.ui_data'); 80 $obj->index(); 81 82 51 83 $GLOBALS['phpgw']->common->phpgw_footer(); 52 84 ?> -
trunk/contactcenter/js/ccMain.js
r1496 r1598 13 13 var ccSearch, ccTree; 14 14 var Main_load = function () 15 { 15 { 16 16 Connector.setProgressBox(Element('cc_loading'), true); 17 17 Connector.setProgressHolder(Element('cc_loading_inner')); … … 91 91 submenu = []; 92 92 textmenu = []; 93 93 94 94 textmenu[0] = ["cc_msg_contact_qa","cc_msg_contact_full","cc_msg_contact_sh","cc_msg_group"]; 95 95 textmenu[1] = ["cc_quick_add", "cc_full_add_button", "cc_full_add_button_sh", "cc_add_group_button"]; … … 104 104 105 105 if(document.getElementById) { 106 107 106 menu = document.getElementById("Layer1"); 108 107 … … 128 127 Element("cc_full_add_button").onclick = newContact; 129 128 Element("cc_full_add_button_sh").onclick = newSharedContact; 130 129 131 130 132 131 ccQuickAdd.afterSave = function () … … 159 158 } 160 159 else 161 { 160 { 161 162 162 Main_load(); 163 163 -
trunk/contactcenter/js/cc_search.js
r285 r1598 27 27 this.onClose = null; 28 28 this.onOpen = null; 29 30 29 this.DOMholder = params['holder']; 31 30 this.DOMdiv = document.createElement('div'); … … 33 32 this.DOMinput = document.createElement('input'); 34 33 this.DOMbtn = document.createElement('input'); 34 this.DOMbtn2 = document.createElement('input'); 35 this.DOMbtn3 = document.createElement('input'); 36 this.DOMinputx = document.createElement('input'); 35 37 this.DOMprogHold = document.createElement('div'); 36 38 this.DOMresult = document.createElement('div'); … … 59 61 this.DOMinput.type = 'text'; 60 62 this.DOMinput.value = params['value'] ? params['value'] : ''; 63 this.DOMinput.id = 'DOMinput'; 61 64 this.DOMinput.style.width = params['input_width'] ? params['input_width'] : '200px'; 62 65 this.DOMinput.onkeypress = function (e) { … … 70 73 } 71 74 }; 75 76 this.DOMinputx.type = 'text'; 77 this.DOMinputx.value = params['value'] ? params['value'] : ''; 78 this.DOMinputx.id = 'DOMinputx'; 79 this.DOMinputx.style.width = '100px'; 80 this.DOMinputx.onkeypress = function (e) { 81 if (is_ie) 82 { 83 if (window.event.keyCode == 13) _this.go(); 84 } 85 else 86 { 87 if (e.which == 13) _this.go(); 88 } 89 }; 90 72 91 //this.DOMinput.style.height = parseInt(this.DOMdiv.style.height)/2 + 'px'; 73 92 … … 78 97 this.DOMbtn.onclick = function () {_this.go();}; 79 98 99 this.DOMbtn2.type = 'button'; 100 //this.DOMbtn2.style.height = parseInt(this.DOMdiv.style.height)/2 + 'px'; 101 this.DOMbtn2.style.width = '60px'; 102 this.DOMbtn2.value = 'Nome:'; 103 104 this.DOMbtn3.type = 'button'; 105 //this.DOMbtn3.style.height = parseInt(this.DOMdiv.style.height)/2 + 'px'; 106 this.DOMbtn3.style.width = '60px'; 107 this.DOMbtn3.value = v_label; 80 108 this.DOMprogHold.style.position = 'absolute'; 81 109 this.DOMprogHold.style.top = params['progress_top'] ? params['progress_top'] : '0px'; … … 98 126 this.DOMholder.appendChild(this.DOMdiv); 99 127 this.DOMdiv.appendChild(this.DOMfields); 128 this.DOMdiv.appendChild(this.DOMbtn2); 100 129 this.DOMdiv.appendChild(this.DOMinput); 130 if(v_label != false & v_atrib != false) 131 { 132 this.DOMdiv.appendChild(this.DOMbtn3) 133 this.DOMdiv.appendChild(this.DOMinputx); 134 } 101 135 this.DOMdiv.appendChild(spacer); 102 136 this.DOMdiv.appendChild(this.DOMbtn); … … 126 160 127 161 data['search_for'] = this.DOMinput.value; 162 data['search_for_area'] = this.DOMinputx.value; 163 128 164 var search_for = data['search_for'].split(' '); 129 165 var greaterThan4 = false; 166 var use_length = v_min; 167 168 if (search_for.length == 1) 169 { 170 if(search_for[0].length == 0) 171 { 172 search_for[0] = "*"; 173 data['search_for'] = "*"; 174 use_length = 1; 175 } 176 } 130 177 131 178 for (i = 0; i < search_for.length; i++) 132 179 { 133 if (search_for[i].length >= 4)180 if (search_for[i].length >= use_length) 134 181 { 135 182 greaterThan4 = true; … … 138 185 139 186 if (!greaterThan4){ 140 alert("Favor fazer a consulta com pelo menos 4caracteres!");187 alert("Favor fazer a consulta com pelo menos " + v_min + " caracteres!"); 141 188 return; 142 189 } … … 240 287 } 241 288 }; 242 243 289 290 this.Connector.newRequest('search', CC_url+'search&data='+serialize(data), 'GET', handler); 244 291 } -
trunk/contactcenter/js/cc_tree.js
r285 r1598 72 72 } 73 73 }; 74 75 74 Connector.newRequest(this.name+'catalog', CC_url+'set_catalog&catalog='+catalog, 'GET', handler); 76 75 } … … 102 101 103 102 }; 104 105 103 Connector.newRequest(this.name+'catalog', CC_url+'set_catalog&catalog='+catalog, 'GET', handler); 106 104 } -
trunk/contactcenter/templates/default/config.tpl
r1158 r1598 52 52 </tr> 53 53 <tr class="row_off"> 54 <td> Abrir Consulta Automática:</td>54 <td>{lang_Open_automatic_contact} :</td> 55 55 <td> 56 56 <select name="newsettings[cc_ldap_query_automatic]"> … … 60 60 </td> 61 61 </tr> 62 62 <tr class="row_on"> 63 <td>{lang_Minimal_character_to_name_search}:</td> 64 <td> 65 <select name="newsettings[cc_ldap_min]"> 66 <option value="2" {selected_cc_ldap_min_2}>2</option> 67 <option value="3" {selected_cc_ldap_min_3}>3</option> 68 <option value="4" {selected_cc_ldap_min_4}>4</option> 69 </select> 70 </td> 71 </tr> 72 <tr class="th"> 73 <td colspan="2"> </td> 74 </tr> 75 <tr> 76 <td></td> 77 </tr> 78 <tr> 79 <td></td> 80 </tr> 63 81 <!-- <tr class="row_on"> 64 82 <td>{lang_objectClass_to_be_used_as_a_Contact}:</td> … … 104 122 <td><input type="text" size="40" name="newsettings[cc_ldap_ass_fulln0]" value="{value_cc_ldap_ass_fulln0}"></td> 105 123 </tr>--> 124 <tr class="th"> 125 <td colspan="2" align="center"><b>{lang_Extended_search_configuration}:</b></td> 126 </tr> 127 <tr> 128 <td></td> 129 </tr> 130 <tr class="row_off"> 131 <td>{lang_LDAP_attribute_to_search} :</td> 132 <td><input name="newsettings[cc_ldap_atrib]" value="{value_cc_ldap_atrib}" size="40" /></td> 133 </tr> 134 <tr class="row_on"> 135 <td>{lang_Label} :</td> 136 <td><input name="newsettings[cc_ldap_legend]" value="{value_cc_ldap_legend}" size="40" /></td> 137 </tr> 138 106 139 <!-- END body --> 107 140 <!-- BEGIN footer -->
Note: See TracChangeset
for help on using the changeset viewer.