Changeset 4984 for branches/2.2
- Timestamp:
- 08/24/11 16:00:47 (13 years ago)
- Location:
- branches/2.2/reports/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/reports/inc/class.functions.inc.php
r4570 r4984 1111 1111 return $total_count; 1112 1112 } 1113 1113 1114 function get_num_users_sector($query, $contexts) { 1115 $dn = $GLOBALS['phpgw_info']['server']['ldap_root_dn']; 1116 $passwd = $GLOBALS['phpgw_info']['server']['ldap_root_pw']; 1117 $ldap_conn = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 1118 ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3); 1119 ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0); 1120 ldap_bind($ldap_conn,$dn,$passwd); 1121 1122 $filter="(phpgwAccountType=u)"; 1123 $justthese = array("uidnumber"); 1124 $count = 0; 1125 foreach ($contexts as $index=>$context) { 1126 $search = ldap_search($ldap_conn, $query, $filter, $justthese); 1127 $count+=ldap_count_entries($ldap_conn, $search); 1128 } 1129 return $count; 1130 } 1131 1114 1132 function get_list_user_sector_logon($query, $contexts,$sizelimit,$numacesso) 1115 1133 { -
branches/2.2/reports/inc/class.uireports_logon.inc.php
r4570 r4984 473 473 // ************ PAGINAÇÃO ******************************* 474 474 475 // verifica se exixte usuarios no LDAP 476 $account_info = $this->functions->get_list_user_sector_logon($setordn,$contexts,0,$numacesso); 477 478 if (!count($account_info)) 479 { 480 $p->set_var('message',lang('No user found')); 481 $p->parse('rows','row_empty',True); 482 } 483 else if (count($account_info)) 484 { 485 if ($vnumacesso==0){ 475 476 if ($vnumacesso==0){ 477 $numreg = $this->functions->get_num_users_sector($setordn,$contexts); 478 if ($numreg==0){ 479 $p->set_var('message',lang('No user found')); 480 $p->parse('rows','row_empty',True); 481 } 482 else { 486 483 //url do paginador 487 484 $url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/index.php?menuaction=reports.uireports_logon.report_logon_group_setor_print'; … … 506 503 507 504 // conta total dos registros 508 $numreg = count($account_info);509 505 510 506 // numero de registro por paginação … … 692 688 $p->set_var($vart); 693 689 // ************************* FIM PAGINAÇÃO *********************** 694 695 }else{ 690 } 691 } 692 else{ 696 693 // ******** caso não for zero não vai paginar ***************** 697 //url do paginador 698 $url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/index.php?menuaction=reports.uireports_logon.report_logon_group_setor_print'; 699 700 // conta total dos registros 701 $numreg = count($account_info); 702 694 //url do paginador 695 $url = $GLOBALS['phpgw_info']['server']['webserver_url'].'/index.php?menuaction=reports.uireports_logon.report_logon_group_setor_print'; 696 697 // conta total dos registros 698 699 // ********** busca no LDAP as informação total e imprime **************** 700 $paginas =$this->functions->get_list_user_sector_logon($setordn,$contexts,0,$numacesso); 701 702 if(count($paginas)==0) { 703 $p->set_var('message',lang('No user found')); 704 $p->parse('rows','row_empty',True); 705 } 706 else { 703 707 // Imprime valores de contagen de registro e pagina 704 $p->set_var('cont_user', $numreg);708 $p->set_var('cont_user',count($paginas)); 705 709 $p->set_var('cont_page',"1"); 706 710 $p->set_var('page_now',"1"); 707 708 // ********** busca no LDAP as informação paginada e imprime **************** 709 $paginas =$this->functions->get_list_user_sector_logon($setordn,$contexts,0,$numacesso); 710 711 711 712 $tmpp = array(); 712 713 $contap = 0; … … 748 749 } 749 750 } 750 751 751 752 if (count($sortp)) 752 753 { … … 788 789 $p->parse('rows','row',True); 789 790 } 790 // ********************** Fim ****************************791 }791 } 792 // ********************** Fim **************************** 792 793 } 793 794
Note: See TracChangeset
for help on using the changeset viewer.