Changeset 1600 for trunk/contactcenter
- Timestamp:
- 11/06/09 10:11:14 (14 years ago)
- Location:
- trunk/contactcenter
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/contactcenter/inc/class.bo_ldap_manager.inc.php
r1419 r1600 45 45 'acc' => $data['cc_ldap_browse_dn0'], 46 46 'pw' => $data['cc_ldap_pw0'], 47 'obj' => ' phpgwAccount',47 'obj' => 'inetOrgPerson', 48 48 'branch' => strtolower('ou'), 49 49 'visible' => $data['cc_ldap_query_automatic'] … … 83 83 /* 84 84 * @function get_external_ldap_sources 85 * @author M ário César Kolling <mario.kolling@serpro.gov.br>85 * @author Mï¿œrio Cï¿œsar Kolling <mario.kolling@serpro.gov.br> 86 86 * @abstract returns an array with the external sources 87 87 * @return (array) the external sources … … 104 104 105 105 $op_iop = array( 106 'contact.uidnumber' 106 'contact.uidnumber' => array('uidNumber'), 107 107 'contact.id_contact' => array('dn'), 108 108 'contact.photo' => array('jpegPhoto'), … … 123 123 'contact.object_class' => array('objectClass'), 124 124 'contact.business_info.title' => array('title'), 125 'contact.business_info.department' => array('ou'), 126 'contact.company.company_name' => array('o'), 125 'contact.business_info.department' => array('ou'), // Setor do empregado... 126 'contact.business_info.empNumber' => array('employeeNumber'), // Matricula do empregado 127 128 'contact.business_info.celPhone' => array('mobile'), // Celular empresarial do empregado 129 130 'contact.company.company_name' => array('o'), 127 131 'contact.company.company_notes' => array('businessCategory'), 128 132 … … 162 166 'email' => array('mail'), 163 167 'phone' => array('telephoneNumber'), 164 'mobile' => array('mobile'), 165 'pager' => array('pager'), 166 'fax' => array('facsimileTelephoneNumber'), 168 // 'mobile' => array('mobile'), 169 // 'pager' => array('pager'), // idem ao comentario abaixo, do atributo fax; 170 // 'fax' => array('facsimileTelephoneNumber'), //linha comentada para nao trazer 171 // o atributo fax do Ldap; correcao temporaria para nao exibir o fax no ContactCenter 172 //(estava sobrepondo o telefone do usuario) 173 167 174 'telex' => array('telexNumber') 168 175 ), … … 174 181 /* 175 182 * @function get_external_ldap_fields_association 176 * @author M ário César Kolling <mario.kolling@serpro.gov.br>183 * @author Mï¿œrio Cï¿œsar Kolling <mario.kolling@serpro.gov.br> 177 184 * @abstract get the fields association for an external ldap_source 178 185 * @return an array with attribute mappings … … 187 194 /* 188 195 * @function test_connection 189 * @author M ário César Kolling <mario.kolling@serpro.gov.br>196 * @author Mï¿œrio Cï¿œsar Kolling <mario.kolling@serpro.gov.br> 190 197 * @abstract Test if we can bind to a ldap server in a reasonable time 191 198 * @param (string) $host ldap server's hostname … … 250 257 } 251 258 252 $ldap = $GLOBALS['phpgw']->common->ldapConnect($this->srcs[$id_source]['host'], $this->srcs[$id_source]['acc'],$this->srcs[$id_source]['pw'], true);259 $ldap = $GLOBALS['phpgw']->common->ldapConnect($this->srcs[$id_source]['host'], $this->srcs[$id_source]['acc'],$this->srcs[$id_source]['pw'], false); 253 260 if (!$ldap) 254 261 { … … 272 279 @function get_external_ldap_tree 273 280 @abstract Returns the LDAP external tree corresponding to the specified level 274 @author M ário César Kolling <mario.kolling@serpro.gov.br>281 @author Mï¿œrio Cï¿œsar Kolling <mario.kolling@serpro.gov.br> 275 282 @param (integer) $id_source The ID of the external LDAP source 276 283 @param (string) $context The context to be used as root branch … … 285 292 include(PHPGW_INCLUDE_ROOT . '/contactcenter/setup/external_catalogs.inc.php' ); 286 293 //include('external_catalogs.inc.php' ); 287 294 288 295 if (!$external_srcs[$id_source]) 289 296 { 290 297 return null; 291 298 } 292 299 293 300 // calls test_connection first. If succeeded continue, return error message otherwise. 294 301 if (!($response = $this->test_connection($external_srcs[$id_source]['host'], $external_srcs[$id_source]['acc'], $external_srcs[$id_source]['pw'], 10))) … … 411 418 else 412 419 return false; 413 414 415 420 } 416 421 … … 441 446 { 442 447 /* 443 * Esta opera ção resolve o problema causado pela conversão de caracteres acentuados realizada444 * pela fun ção ldap_explode_dn().448 * Esta operaᅵᅵo resolve o problema causado pela conversï¿œo de caracteres acentuados realizada 449 * pela funᅵᅵo ldap_explode_dn(). 445 450 */ 446 451 … … 450 455 function get_ldap_tree_level($id_source, $resource, $context, $objectClass, $branch_dn, $external = 0) 451 456 { 452 457 if(strstr($context, "ldap://")){ 458 $refer_context = str_replace("??base","",preg_replace('!^(ldap://[^/]+)/(.*$)!', '\\2', $context)); 459 $host = preg_replace('!^(ldap://[^/]+)/.*$!', '\\1', $context); 460 $resource = ldap_connect($host); 461 ldap_bind($resource); 462 } 463 453 464 /* 454 465 * TODO: Search timeouts 455 466 */ 456 457 $dn_parts = ldap_explode_dn( $context,1);467 468 $dn_parts = ldap_explode_dn(($refer_context ? $refer_context : $context),1); 458 469 //$filter = '(!(objectClass='.$objectClass.'))'; 459 470 // Don't show OU's whith phpgwAccountVisible equal to '-1' … … 468 479 // and whose attribute phpgwAccountVisible value is different from -1 469 480 $filter = '(&(!(objectClass='.$objectClass.')) (!(phpgwAccountVisible=-1)))'; 470 $context = preg_replace("/dc=(.*)/i",$this->srcs[$id_source]['dn'],$context); 471 } 472 473 $result_res = @ldap_list($resource, $context, $filter, array(), 0, 0); 474 if (!$result_res) 481 } 482 $result_res = @ldap_list($resource, ($refer_context ? $refer_context : $context), $filter, array(), 0, 0); 483 @ldap_sort($resource, $result_res, 'ou'); 484 485 // Timeouts commented out 486 /* 487 if ($result_res === false) 488 { 475 489 return null; 476 477 @ldap_sort($resource, $result_res, 'ou'); 490 } 491 */ 492 478 493 $count = ldap_count_entries($resource,$result_res); 479 494 480 495 if ( $count == 0 ) 481 496 { 482 497 $filter = '(objectClass='.$objectClass.')'; 483 498 // Get only one attribute of the source's objectClass 484 $result_res2 = @ldap_list($resource, $context, $filter, Array('cn'), 0, 1); 485 if (!$result_res2) 486 return null; 487 499 $result_res2 = @ldap_list($resource, ($refer_context ? $refer_context : $context), $filter, Array('cn'), 0, 1); 488 500 $entries_count = ldap_count_entries($resource, $result_res2); 489 501 … … 509 521 } 510 522 } 511 523 512 524 $sub_branch_found = false; 513 525 $i = 0; … … 521 533 list($group) = explode('=',$dn_parts_full[0]); 522 534 523 //Faz a compara ção do branch como case insensitive535 //Faz a comparaᅵᅵo do branch como case insensitive 524 536 if (strtolower($group) == strtolower($branch_dn) or $branch_dn === 'all') 525 537 { … … 527 539 'name' => $this->translate_accentuation($dn_parts_1[0]), 528 540 'type' => 'unknown', 529 'value' => $dn,541 'value' => ($refer_context ? $host."/" : "").$dn, 530 542 'sub_branch' => false 531 543 ); … … 534 546 $i++; 535 547 } 536 548 549 if(! $refer_context) { 550 $array_referral = $this -> get_ldap_sub_branches_referrals($resource, $context,'(objectClass=organizationalUnit)'); 551 for($z = 0; $z < count($array_referral); $z++) { 552 $tree['sub_branch'][$i++] = $array_referral[$z]; 553 } 554 } 555 537 556 $filter = 'objectClass='.$objectClass; 538 $result_res2 = @ldap_list($resource, $context, $filter, Array('cn'), 0, 1);557 $result_res2 = @ldap_list($resource, ($refer_context ? $refer_context : $context), $filter, Array('cn'), 0, 1); 539 558 $entries_count = ldap_count_entries($resource, $result_res2); 540 559 -
trunk/contactcenter/inc/class.ui_preferences.inc.php
r285 r1600 79 79 } 80 80 81 if ($actual['empNum']) 82 { 83 $GLOBALS['phpgw']->template->set_var('empNum', 'checked'); 84 } 85 else 86 { 87 $GLOBALS['phpgw']->template->set_var('empNum', ''); 88 } 89 90 if ($actual['cell']) 91 { 92 $GLOBALS['phpgw']->template->set_var('cell', 'checked'); 93 } 94 else 95 { 96 $GLOBALS['phpgw']->template->set_var('cell', ''); 97 } 98 99 if ($actual['department']) 100 { 101 $GLOBALS['phpgw']->template->set_var('department', 'checked'); 102 } 103 else 104 { 105 $GLOBALS['phpgw']->template->set_var('department', ''); 106 } 107 81 108 $GLOBALS['phpgw']->template->set_var('personCardEmail', $options_email); 82 109 $GLOBALS['phpgw']->template->set_var('personCardPhone', $options_phone); … … 130 157 } 131 158 159 if($_POST['empNum']) 160 { 161 $GLOBALS['phpgw']->preferences->add('contactcenter', 'empNum', '1'); 162 } 163 else 164 { 165 $GLOBALS['phpgw']->preferences->add('contactcenter', 'empNum', '0'); 166 } 167 168 if($_POST['cell']) 169 { 170 $GLOBALS['phpgw']->preferences->add('contactcenter', 'cell', '1'); 171 } 172 else 173 { 174 $GLOBALS['phpgw']->preferences->add('contactcenter', 'cell', '0'); 175 } 176 177 if($_POST['department']) 178 { 179 $GLOBALS['phpgw']->preferences->add('contactcenter', 'department', '1'); 180 } 181 else 182 { 183 $GLOBALS['phpgw']->preferences->add('contactcenter', 'department', '0'); 184 } 185 132 186 $GLOBALS['phpgw']->preferences->save_repository(); 133 187 } -
trunk/contactcenter/templates/default/index.tpl
r1517 r1600 11 11 } 12 12 </style> 13 <script src="js/cc.js" type="text/javascript"></script> 13 14 <!-- JS MESSAGES --> 14 15 <input id="cc_msg_not_allowed" type="hidden" value="{cc_msg_not_allowed}"> … … 86 87 <input id="cc_contact_type" type="hidden" value="{cc_contact_type}"> 87 88 89 88 90 <!-- END JS MESSAGES --> 89 91 <input id="cc_type_contact" type="hidden"> … … 249 251 <!-- _END VIEW CARDS --> 250 252 <!-- BOTTOM DETAILS--> 251 <script src="js/cc.js" type="text/javascript"></script>252 253 <script type="text/javascript" src="js/moo.fx.js"></script> 253 254 <script type="text/javascript" src="js/ccListParticipants.js"></script> -
trunk/contactcenter/templates/default/preferences.tpl
r1158 r1600 63 63 </tr> 64 64 </table> 65 <br> 66 <p align="center" style="font-weight: bold; font-size: medium; border: 0px solid black">Preferências de Visualização</p> 67 <table align="center" style="width: 400px"> 68 <tr class="th"> 69 <td style="text-align: center; font-weight: bold; width: 200px">Campo</td> 70 <td style="text-align: center; font-weight: bold; width: 200px">{lang_Value}</td> 71 </tr> 72 <tr class="row_off"> 73 <td>Matrícula</td> 74 <td align="center"> 75 <input type="checkbox" name="empNum" {empNum} /> 76 </td> 77 </tr> 78 <tr class="row_off"> 79 <td>Celular</td> 80 <td align="center"> 81 <input type="checkbox" name="cell" {cell} /> 82 </td> 83 </tr> 84 <tr class="row_off"> 85 <td>Setor</td> 86 <td align="center"> 87 <input type="checkbox" name="department" {department} /> 88 </td> 89 </tr> 90 <tr> 91 <td></td> 92 <td style="text-align: right;"> 93 <input type="submit" name="save" value="{lang_Save}"> 94 <input type="button" name="cancel" value="{lang_Cancel}" onclick="window.back()"> 95 </td> 96 </tr> 97 </table> 65 98 </div> 66 99 </form>
Note: See TracChangeset
for help on using the changeset viewer.