Changeset 381 for trunk/expressoMail1_2
- Timestamp:
- 07/30/08 16:54:18 (16 years ago)
- Location:
- trunk/expressoMail1_2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.ldap_functions.inc.php
r371 r381 150 150 $return = array(); 151 151 $return['status'] = false; 152 $return['error'] = "many results"; 152 $return['error'] = "many results"; 153 153 return $return; 154 154 } … … 393 393 $error = False; 394 394 395 $this->ldapConnect( false,$catalog);395 $this->ldapConnect(true,$catalog); 396 396 397 397 $params['organization'] == 'all' ? $user_context = $this->ldap_context :$user_context = $this->branch."=".$params['organization'].",".$this->ldap_context; … … 410 410 } 411 411 412 $sr=@ldap_search($this->ds, $user_context, $filter, $justthese, 0, $ this->max_result+1);412 $sr=@ldap_search($this->ds, $user_context, $filter, $justthese, 0, $max_result+1); 413 413 if(!$sr) 414 414 return null; 415 415 $count_entries = ldap_count_entries($this->ds,$sr); 416 if ($count_entries > $ this->max_result){416 if ($count_entries > $max_result){ 417 417 $info = null; 418 $error = True; 418 $error = True; 419 419 } 420 420 else … … 430 430 //aqui eh feita a concatenacao do departamento ao cn; 431 431 $u_tmp[$info[$i]["mail"][0]] = utf8_decode($info[$i]["cn"][0]). '%' . $info[$i]["ou"][0]; 432 else432 if((!$catalog==0)||(strtoupper($info[$i]["phpgwaccounttype"][0]) == 'L') && ($info[$i]["phpgwaccountvisible"][0] != '-1')) 433 433 $g_tmp[$info[$i]["mail"][0]] = utf8_decode($info[$i]["cn"][0]); 434 434 } … … 655 655 656 656 if($entry) { 657 $obj = array("cn" => utf8_decode( ldap_get_values($ds, $entry, "cn")),657 $obj = array("cn" => utf8_decode(current(ldap_get_values($ds, $entry, "cn"))), 658 658 "email" => $params['email'], 659 659 "uid" => ldap_get_values($ds, $entry, "uid"), -
trunk/expressoMail1_2/index.php
r373 r381 28 28 'nonavbar' => False, 29 29 'currentapp' => 'expressoMail1_2', 30 'update_version' => '1.23 0',30 'update_version' => '1.231', 31 31 'enable_nextmatchs_class' => True 32 32 ); -
trunk/expressoMail1_2/js/QuickCatalogSearch.js
r353 r381 10 10 id = '1'; 11 11 _this = this; 12 13 12 var el = document.createElement("DIV"); 14 13 el.style.visibility = "hidden"; … … 236 235 '<table border="0" cellpading="0" cellspacing="0">'+ 237 236 '<tr><td>'+get_lang("Select an organization and click on button <b>Search</b>")+' :</td></tr>'+ 238 '<tr><td><select style=" width:150px" id="select_catalog" name="select_catalog" onchange="javascript:QuickCatalogSearch.update_organizations();"></select> '+239 '<select id="select_organization" style="width:1 00px" name="select_organization"></select> '+240 '<input type="text" id="search_for" name="search_for" value="" size="30" maxlength=" 20"/> <input type="button" onclick="QuickCatalogSearch.searchCatalogList(true)" class="button" value="'+get_lang('Search')+'"> <input style="display:none" type="button" onclick="QuickCatalogSearch.searchCatalogList(false)" class="button" value="'+get_lang('List All')+'"></td></tr>'+241 //'<tr><td><input onclick="javascript:QuickCatalogSearch.changeOptions(this.value)" id="type" type="radio" name="type" value="l"/>'+get_lang('Public Lists')+' <input type="radio" name="type" value="u" onclick="javascript:QuickCatalogSearch.changeOptions(this.value)" checked/>'+get_lang('Users')+' '+237 '<tr><td><select style="display:none;width:150px" id="select_catalog" name="select_catalog" onchange="javascript:QuickCatalogSearch.update_organizations();"></select> '+ 238 '<select id="select_organization" style="width:150px" name="select_organization"></select> '+ 239 '<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>'+ 240 '<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')+' '+ 242 241 '<span style="visibility:hidden;background:#cc4444" id=msg_search> <font face="Verdana" size="1" color="WHITE">'+get_lang('Search in Catalog')+'...</font> </span></td></tr>'+ 243 242 '<tr><td>'+ 244 '<span id="list_span"><select multiple style="display:none;width: 450px" size="14" id="list_values"></select></span>'+243 '<span id="list_span"><select multiple style="display:none;width:580px" size="14" id="list_values"></select></span>'+ 245 244 '<span id="user_span"><select multiple style="width:580px" size="14" id="user_values"></select></span>'+ 246 245 '</td></tr>'+ … … 255 254 '<table border="0" cellpading="0" cellspacing="0">'+ 256 255 '<tr><td>'+get_lang("Select the type of contact that you want to view")+' :</td></tr>'+ 257 '<tr><td><input onclick="javascript:QuickCatalogSearch.changeOptions(this.value)" id="type"type="radio" name="type" value="p"/>' + get_lang('People') + ' <input type="radio" name="type" value="g" onclick="javascript:QuickCatalogSearch.changeOptions(this.value)"/>' + get_lang('Groups') + ' '+256 '<tr><td><input onclick="javascript:QuickCatalogSearch.changeOptions(this.value)" type="radio" name="type" value="p"/>' + get_lang('People') + ' <input type="radio" name="type" value="g" onclick="javascript:QuickCatalogSearch.changeOptions(this.value)"/>' + get_lang('Groups') + ' '+ 258 257 '<tr><td>'+ 259 '<span id="personal_span"><select multiple style="width: 400px" size="14" id="list_personal"></select></span>'+260 '<span id="groups_span"><select multiple style="display:none;width: 400px" size="14" id="list_groups"></select></span>'+258 '<span id="personal_span"><select multiple style="width:580px" size="14" id="list_personal"></select></span>'+ 259 '<span id="groups_span"><select multiple style="display:none;width:580px" size="14" id="list_groups"></select></span>'+ 261 260 '</td></tr>'+ 262 261 '<tr><td nowrap><center>'+get_lang('Click here to add into the fields')+': <input type="button" class="button" value="'+get_lang('TO')+'" onClick="javascript:QuickCatalogSearch.addContacts(\'to1\')"> '+ … … 295 294 296 295 var handler_catalogs = function(data){ 297 var user_catalog = "Catalogo Geral"; 298 299 if(data.length <= 1) 300 Element('select_catalog').style.display = 'none'; 301 else { 296 var user_catalog = get_lang("Global Catalog"); 297 if(data.length > 1) { 298 Element('select_catalog').style.display = ''; 302 299 for(i = 0; i < data.length; i++) { 303 300 Element('select_catalog').options[i] = new Option(data[i],i); … … 380 377 } 381 378 var handler_org = function(data){ 382 379 Element('select_organization').options[0] = new Option(get_lang('all'),'all'); 383 380 if (data != null){ 384 385 for(x = 0; x < data.length; x++) { 386 Element('select_organization').options[x+1] = new Option(data[x].toUpperCase(),data[x]); 387 } 388 } 389 381 var user_organization = Element('user_organization').value; 382 for(x = 0; x < data.length; x++) { 383 Element('select_organization').options[x+1] = new Option(data[x].toUpperCase(),data[x]); 384 if(user_organization.toUpperCase() == data[x].toUpperCase()) 385 Element('select_organization').options[x+1].selected = true; 386 } 387 } 390 388 } 391 389 cExecute ("$this.ldap_functions.get_organizations&referral=false&catalog="+Element('select_catalog').value, handler_org); … … 461 459 var search = itemSearch ? Element('search_for').value : ''; 462 460 var catalog = Element('select_catalog').value; 463 var max_result 461 var max_result = 300; 464 462 465 463 var handler_searchResults = function(data){ 466 467 464 Element('msg_search').style.visibility = 'hidden'; 468 465 if(data.error){ 469 466 alert(get_lang('More than %1 results. Please, try to refine your search.',max_result)); 470 467 return false; 471 } 468 }else if(data.users.length == 0 && data.groups.length == 0){ 469 alert(get_lang('None result was found.')); 470 } 471 472 472 473 473 var group = Element('list_span'); … … 487 487 488 488 var arr = new Array(max_result); 489 var display = Element('type').value == 'l'? 'display:none;' : ''; 490 491 for(i = 0; data.groups && i < data.groups.length; i++) {489 490 for(i = 0; data.groups && i < data.groups.length; i++) { 491 // Maneiras diferentes de se montar uma tag OPTION, pois no IE o objeto Option é muito lento. 492 492 if(is_ie) 493 493 arr[i] = '<option value="'+'"'+data.groups[i].name+'" <'+data.groups[i].email+'>">'+data.groups[i].name+' ('+data.groups[i].email+')'+'</option>'; … … 496 496 } 497 497 498 498 499 if(is_ie) 499 group.innerHTML = '<select multiple style=" '+display+'width:400px" size="14" id="list_values">'+ arr.join() +'</select>';500 group.innerHTML = '<select multiple style="display:none;width:580px" size="14" id="list_values">'+ arr.join() +'</select>'; 500 501 501 502 arr = new Array(max_result); 502 display = display ? "" : "display:none;"; 503 504 for(i = 0; data.users && i < data.users.length; i++) { 503 504 for(i = 0; data.users && i < data.users.length; i++) { 505 /*******************************************************************************************/ 506 /* O resultado pratico do bloco de codigo a seguir eh a exibicao dos valores em tela, 507 ja que vai verificar se o departamento e o email estao vazios ou nulos e a partir dai o 508 resultado apresentado em tela sera exibido de maneira mais apresentavel; 509 */ 510 //verifica se departamento eh null ou nao; 511 var department = data.users[i].department ? " - " + data.users[i].department : ""; 512 //verifica se email eh null ou nao; 513 var email = data.users[i].email ? data.users[i].email : ""; 514 515 // Maneiras diferentes de se montar uma tag OPTION, pois no IE o objeto Option é muito lento. 505 516 if(is_ie) 506 arr[i] = '<option value="'+'"'+data.users[i].name+'" <'+ data.users[i].email+'>">'+data.users[i].name+' ('+data.users[i].email+')'+'</option>';517 arr[i] = '<option value="'+'"'+data.users[i].name+'" <'+email+'>">'+data.users[i].name+' ('+email+')'+department+'</option>'; 507 518 else { 508 /*******************************************************************************************/ 509 /* O resultado pratico do bloco de codigo a seguir eh a exibicao dos valores em tela, 510 ja que vai verificar se o departamento e o email estao vazios ou nulos e a partir dai o 511 resultado apresentado em tela sera exibido de maneira mais apresentavel; 512 */ 513 //verifica se departamento eh null ou nao; 514 var departamento_nulo = 'false'; 515 if((data.users[i].department == null) || (data.users[i].department == '')) { 516 data.users[i].department = ''; 517 departamento_nulo = 'true'; 518 } 519 else { 520 data.users[i].department = ' - ' + data.users[i].department; 521 } 522 523 //verifica se email eh null ou nao; 524 if((data.users[i].email == null) || (data.users[i].email == '')) { 525 if(departamento_nulo = 'true') { 526 data.users[i].email = ''; 527 } 528 else { 529 data.users[i].email = ' - '; 530 } 531 } 532 else { 533 data.users[i].email = ' (' + data.users[i].email + ') '; 534 } 535 536 user.options[i] = new Option(data.users[i].name+data.users[i].email+data.users[i].department,'"'+data.users[i].name+'" <'+data.users[i].email+'>'); // incluido data.users[i].department para exibir setor na opcao "Pesquisar" do email; 519 user.options[i] = new Option(data.users[i].name+' ('+email+')'+department,'"'+data.users[i].name+'" <'+email+'>'); // incluido data.users[i].department para exibir setor na opcao "Pesquisar" do email; 537 520 } 538 521 } 539 522 540 523 if(is_ie) 541 user.innerHTML = '<select multiple style="'+display+'width:400px" size="14" id="user_values">'+ arr.join() +'</select>'; 524 user.innerHTML = '<select multiple style="width:580px" size="14" id="user_values">'+ arr.join() +'</select>'; 525 526 // Display entries found. 527 var type = (data.groups.length > 0 && data.users.length == 0) ? 'l' : 'u'; 528 Element("type_"+type).checked = true; 529 QuickCatalogSearch.changeOptions(type); 542 530 } 543 531 -
trunk/expressoMail1_2/js/common_functions.js
r365 r381 662 662 663 663 function exist_className(obj, className){ 664 if ( obj .className.indexOf(className) != -1 )664 if ( obj && obj.className.indexOf(className) != -1 ) 665 665 return true; 666 666 return false; -
trunk/expressoMail1_2/setup/setup.inc.php
r373 r381 12 12 $setup_info['expressoMail1_2']['name'] = 'expressoMail1_2'; 13 13 $setup_info['expressoMail1_2']['title'] = 'ExpressoMail 1.2'; 14 $setup_info['expressoMail1_2']['version'] = '1.23 0';14 $setup_info['expressoMail1_2']['version'] = '1.231'; 15 15 $setup_info['expressoMail1_2']['app_order'] = 2; 16 16 // $setup_info['expressoMail1_2']['tables'][] = 'phpgw_expressoMail1_2';
Note: See TracChangeset
for help on using the changeset viewer.