Changeset 5246 for branches/2.3
- Timestamp:
- 12/13/11 13:05:05 (12 years ago)
- Location:
- branches/2.3/expressoMail1_2
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3/expressoMail1_2/inc/class.ldap_functions.inc.php
r4906 r5246 171 171 172 172 // New search only on user sector 173 if ($ count_entries > $this->max_result)173 if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['cloud_ldap'] || $count_entries > $this->max_result) 174 174 { 175 175 // Close old ldap conection … … 190 190 return $return; 191 191 } 192 else 193 { 194 $quickSearch_only_in_userSector = true; 192 elseif($count_entries < 1){ 193 $return = array(); 194 return $return; 195 196 }else 197 { 198 if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['cloud_ldap']) 199 $quickSearch_cloud = true; 200 else 201 $quickSearch_only_in_userSector = true; 195 202 } 196 203 } … … 226 233 for ($i=0; $i<$info["count"]; $i++) 227 234 { 228 if ($quickSearch_only_in_userSector )235 if ($quickSearch_only_in_userSector || $quickSearch_cloud) 229 236 { 230 237 $tmp[$info[$i]["mail"][0] . '%' . $info[$i]["telephonenumber"][0] . '%'. $info[$i]["mobile"][0] . '%' . $info[$i]["uid"][0] . '%' . $info[$i]["jpegphoto"]['count'] . '%' . $info[$i]["employeenumber"][0] . '%' . $info[$i]["ou"][0]] = utf8_decode($info[$i]["cn"][0]); … … 260 267 } 261 268 $contacts_result['quickSearch_only_in_userSector'] = $quickSearch_only_in_userSector; 269 $contacts_result['quickSearch_cloud'] = $quickSearch_cloud; 262 270 } 263 271 else … … 303 311 return $return; 304 312 } 313 } 314 if ($quickSearch_cloud) 315 { 316 $head_option = 317 '<tr class="quicksearchcontacts_unselected">' . 318 '<td colspan="2" width="100%" align="center">' . 319 $this->functions->getLang('Showing only the results found in your organization') . '.'. 320 '<input id="QuickSearchUser_button_search" type="button" onclick="QuickSearchUser.close_window();openListUsers(\'1\');" value="busca avançada">'. 321 '</td>' . 322 '</tr>'; 323 324 325 326 $contacts_result = $head_option . $options_users_from_user_org . $options; 327 305 328 } 306 329 else … … 414 437 $organizations = array(); 415 438 $params['referral']?$referral = $params['referral']:$referral = false; 439 $params['organization']?$org = "ou=".$params['organization'].",":$org = ""; 416 440 $cat = $params['catalog']; 417 418 $this->ldapConnect($referral,$cat); 419 420 if($this->branch != '') { 421 $filter="(&(".$this->branch."=*)(!(phpgwAccountVisible=-1)))"; 422 $justthese = array("$this->branch"); 423 $sr = ldap_list($this->ds, $this->ldap_context, $filter, $justthese); 424 $info = ldap_get_entries($this->ds, $sr); 425 426 if($info["count"] == 0) 427 { 428 $organizations[0]['ou'] = $this->ldap_context; 429 } 430 431 for ($i=0; $i<$info["count"]; $i++) 432 $organizations[$i] = $info[$i]["ou"][0]; 433 434 ldap_close($this->ds); 435 sort($organizations); 436 return $organizations; 437 }else{ 441 // primeiro nível de ou 442 $this->ldapConnect($referral,$cat); 443 if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['cloud_ldap'] && $cat == 0) 444 { 445 $fistOu = substr($_SESSION['phpgw_info']['expressomail']['user']['account_dn'],strripos($_SESSION['phpgw_info']['expressomail']['user']['account_dn'], "ou=")); 446 } 447 else 448 { 449 $fistOu = $this->ldap_context; 450 } 451 if($this->branch != '') { 452 $filter="(&(".$this->branch."=*)(!(phpgwAccountVisible=-1)))"; 453 $justthese = array("$this->branch"); 454 $sr = ldap_list($this->ds, $org.$fistOu, $filter, $justthese); 455 $info = ldap_get_entries($this->ds, $sr); 456 if($info["count"] == 0) 457 { 458 return null; 459 } 460 for ($i=0; $i<$info["count"]; $i++) 461 $organizations[$i] = $info[$i]["ou"][0]; 462 ldap_close($this->ds); 463 sort($organizations); 464 return $organizations; 465 }else{ 438 466 return null; 439 467 } 440 468 } 441 469 function get_organizations2($params){ … … 540 568 $this->ldapConnect(true,$catalog); 541 569 542 $params['organization'] == 'all' ? $user_context = $this->ldap_context :$user_context = $this->branch."=".$params['organization'].",".$this->ldap_context; 543 570 if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['cloud_ldap'] && $catalog == 0) 571 $fistOu = substr($_SESSION['phpgw_info']['expressomail']['user']['account_dn'],strripos($_SESSION['phpgw_info']['expressomail']['user']['account_dn'], "ou=")); 572 else 573 $fistOu = $this->ldap_context; 574 575 if($params['organization_sub'] =="") 576 $params['organization_sub'] =="all"; 577 578 $params['organization'] == 'all' ? $user_context = $fistOu :$user_context = $this->branch."=".$params['organization'].",".$fistOu; 579 $params['organization_sub'] == 'all' ? $user_context = $user_context :$user_context = $this->branch."=".$params['organization_sub'].",".$user_context; 544 580 if ($this->ds) { 545 581 if ($catalog == 0){ -
branches/2.3/expressoMail1_2/index.php
r4324 r5246 78 78 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['telephone_number'] = $GLOBALS['phpgw_info']['user']['telephonenumber']; 79 79 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_cache'] = $current_config['expressoMail_enable_cache']; 80 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['cloud_ldap'] = $current_config['expressoMail_cloud_ldap']; 80 81 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_x_origin'] = $current_config['expressoMail_use_x_origin']; 81 82 $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['number_of_contacts'] = $current_config['expressoMail_Number_of_dynamic_contacts'] ? $current_config['expressoMail_Number_of_dynamic_contacts'] : "0"; -
branches/2.3/expressoMail1_2/js/QuickCatalogSearch.js
r5102 r5246 66 66 title_innerHTML += "<font color='BLACK' nowrap> ("+get_lang('Showing only the results found in your organization')+".)</font>" 67 67 68 if (preferences.cloud_ldap) 69 { 70 title_innerHTML += "<font color='BLACK' nowrap> ("+get_lang('Showing only the results found in your organization')+".)</font>"; 71 } 72 68 73 var title = document.createElement("SPAM"); 69 74 title.id = 'window_QuickCatalogSearch_title'; … … 98 103 butt.onclick = func_add_contact; 99 104 el_A.appendChild(butt); 105 if(preferences.cloud_ldap) 106 { 107 var butt = document.createElement('BUTTON'); 108 butt.id = "QuickCatalogSearch_button_search"; 109 var buttext = document.createTextNode(get_lang("Advanced search")); 110 butt.appendChild(buttext); 111 butt.onclick = function(){openListUsers("1");QuickCatalogSearch.close_QuickSearch_window(data.field, data.ID);}; 112 el_A.appendChild(butt); 113 } 100 114 101 115 if (document.getElementById('select_QuickCatalogSearch') == null){ … … 321 335 win = this.arrayWin[el.id]; 322 336 win.open(); 337 Element('search_for').value = ""; 338 if(this.search){ 339 Element('search_for').value = this.search; 340 write_msg("No user found by this search in you organization"); 341 this.search = null; 342 } 323 343 return; 324 344 } … … 344 364 '<table border="0" cellpading="0" cellspacing="0">'+ 345 365 '<tr><td>'+get_lang("Select an organization and click on button <b>Search</b>")+' :</td></tr>'+ 346 '<tr><td><select style="display:none;width:150px" id="select_catalog" name="select_catalog" onchange="javascript:QuickCatalogSearch.update_organizations();"></select> '+ 347 '<select id="select_organization" style="width:150px" name="select_organization"></select> '+ 366 '<tr><td><select style="display:none;width:100px" id="select_catalog" name="select_catalog" onchange="javascript:QuickCatalogSearch.update_organizations();"></select> '+ 367 '<select id="select_organization" style="width:100px" name="select_organization" onchange="javascript:QuickCatalogSearch.update_organizations_sub();" ></select> '+ 368 '<select id="select_organization_sub" style="width:100px;display:none;" name="select_organization_sub"></select> '+ 348 369 '<input type="text" id="search_for" name="search_for" value="" size="30" maxlength="30"/> <input type="button" onclick="QuickCatalogSearch.searchCatalogList(true)" class="button" value="'+get_lang('Search')+'"> <input style="display:visible" type="button" onclick="QuickCatalogSearch.searchCatalogList(false)" class="button" value="'+get_lang('List All')+'"></td></tr>'+ 349 370 '<tr><td><input onclick="javascript:QuickCatalogSearch.changeOptions(this.value)" id="type_l" type="radio" name="type" value="l"/>'+get_lang('Public Lists')+' <input type="radio" id="type_u" name="type" value="u" onclick="javascript:QuickCatalogSearch.changeOptions(this.value)" checked/>'+get_lang('Users')+' '+ … … 386 407 }; 387 408 388 win = new dJSWin({ 409 if(this.search){ 410 Element('search_for').value = this.search; 411 this.search = null; 412 write_msg("No user found by this search in you organization"); 413 } 414 win = new dJSWin({ 389 415 id: 'win_'+el.id, 390 416 content_id: el.id, … … 495 521 } 496 522 } 523 if(preferences.cloud_ldap) 524 QuickCatalogSearch.update_organizations_sub(); 497 525 } 498 cExecute ("$this.ldap_functions.get_organizations&referral=false&catalog="+Element('select_catalog').value, handler_org); 499 } 526 cExecute ("$this.ldap_functions.get_organizations&referral=false&catalog="+Element('select_catalog').value, handler_org); 527 } 528 529 emQuickCatalogSearch.prototype.update_organizations_sub = function(){ 530 while(Element('select_organization_sub').options.length > 0) { 531 Element('select_organization_sub').remove(0); 532 } 533 var handler_org = function(data){ 534 Element('select_organization_sub').style.display = ''; 535 Element('select_organization_sub').options[0] = new Option(get_lang('all'),'all'); 536 if (data != null){ 537 //var user_organization = Element('user_organizations').value; 538 for(x = 0; x < data.length; x++) { 539 Element('select_organization_sub').options[x+1] = new Option(data[x].toUpperCase(),data[x]); 540 // if(user_organization.toUpperCase() == data[x].toUpperCase()) 541 542 } 543 Element('select_organization_sub').options[0].selected = true; 544 } 545 546 } 547 cExecute ("$this.ldap_functions.get_organizations&referral=false&catalog="+Element('select_catalog').value+"&organization="+Element('select_organization').value, handler_org); 548 } 549 500 550 501 551 emQuickCatalogSearch.prototype.changeOptions = function(type){ … … 566 616 return false; 567 617 } 568 var organization = Element('select_organization').value; 618 var organization = Element('select_organization').value; 619 var organization_sub = Element('select_organization_sub').value; 569 620 var search = itemSearch ? Element('search_for').value : ''; 570 621 var catalog = Element('select_catalog').value; … … 641 692 642 693 Element('msg_search').style.visibility = 'visible'; 643 cExecute ("$this.ldap_functions.catalogsearch&max_result="+max_result+"&organization="+organization+"& search_for="+search+"&catalog="+catalog, handler_searchResults);694 cExecute ("$this.ldap_functions.catalogsearch&max_result="+max_result+"&organization="+organization+"&organization_sub="+organization_sub+"&search_for="+search+"&catalog="+catalog, handler_searchResults); 644 695 } 645 696 -
branches/2.3/expressoMail1_2/js/common_functions.js
r5162 r5246 571 571 if ((field != 'null') && (ID != 'null')) 572 572 { 573 QuickCatalogSearch.showList(data, quickSearchKeyBegin, quickSearchKeyEnd);573 QuickCatalogSearch.showList(data, quickSearchKeyBegin, quickSearchKeyEnd); 574 574 } 575 575 else … … 577 577 QuickSearchUser.showList(data); 578 578 } 579 } 580 else 581 alert(get_lang('None result was found.')); 582 return true; 579 } 580 else{ 581 if(preferences.cloud_ldap) 582 openListUsers("1",emailList); 583 else 584 alert(get_lang('None result was found.')); 585 } 586 return true; 583 587 } 584 588 -
branches/2.3/expressoMail1_2/js/doiMenuData.js
r3388 r5246 137 137 } 138 138 139 function openListUsers(border_id ) {139 function openListUsers(border_id,search) { 140 140 connector.loadScript("QuickCatalogSearch"); 141 141 if (typeof(QuickCatalogSearch) == 'undefined'){ 142 setTimeout('openListUsers('+border_id+')',500); 142 if(typeof(search) == 'undefined') 143 setTimeout('openListUsers('+border_id+')',500); 144 else 145 setTimeout('openListUsers('+border_id+',"'+search+'")',500); 143 146 return false; 144 147 } 148 QuickCatalogSearch.search = search; 145 149 QuickCatalogSearch.showCatalogList(border_id); 146 150 } -
branches/2.3/expressoMail1_2/setup/phpgw_pt-br.lang
r4906 r5246 665 665 Exporting selected messages, this can take some time. expressoMail1_2 pt-br Exportando mensagens, isso pode levar algum tempo. 666 666 You cant manipulate messages from multiple folders on search expressoMail1_2 pt-br Impossível manipular mensagens de múltiplas pastas a partir de uma busca. 667 No user found by this search in you organization expressoMail1_2 pt-br Nenhum resultado encontrado para essa pesquisa na sua organização. 668 Advanced Search expressoMail1_2 pt-br Busca detalhada -
branches/2.3/expressoMail1_2/templates/default/config.tpl
r4533 r5246 37 37 </select> 38 38 </td> 39 </tr> 40 <tr bgcolor="{row_off}"> 41 <td>{lang_Do_you_want_to_use_cloud_ldap_structure?}</td> 42 <td> 43 <select name="newsettings[expressoMail_cloud_ldap]"> 44 <option value=""{selected_expressoMail_cloud_ldap_False}>{lang_No}</option> 45 <option value="True"{selected_expressoMail_cloud_ldap_True}>{lang_Yes}</option> 46 </select> 47 </td> 39 48 </tr> 40 49 <tr bgcolor="{row_off}">
Note: See TracChangeset
for help on using the changeset viewer.