Changeset 4570


Ignore:
Timestamp:
06/01/11 17:01:47 (13 years ago)
Author:
thiagoaos
Message:

Ticket #1955 - Adição de 2 relatórios e ajuste no relatório de cotas.

Location:
branches/2.2/reports
Files:
8 added
11 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/reports/inc/class.functions.inc.php

    r4033 r4570  
    2424                        'array_invert'                          => True, 
    2525                        'Paginate_user'                         => True, 
     26                        'Paginate_cota'                         => True, 
     27                        'Paginate_shareAccount'                 => True, 
     28                        'Paginate_institutionalAccount'         => True, 
    2629                        'Paginate_user_logon'           => True, 
    2730                        'get_list_all'                          => True, 
     
    854857                } 
    855858 
     859                function get_list_cota_sector($query, $contexts,$sizelimit) 
     860                { 
     861                        $dn                     = $GLOBALS['phpgw_info']['server']['ldap_root_dn']; 
     862                        $passwd         = $GLOBALS['phpgw_info']['server']['ldap_root_pw']; 
     863                        $ldap_conn      = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 
     864                        ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3); 
     865                        ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0); 
     866                        ldap_bind($ldap_conn,$dn,$passwd); 
     867 
     868                        $filter="(|(phpgwAccountType=u)(|(phpgwAccountType=s)))"; 
     869                        $justthese = array("uidnumber", "uid", "cn", "mail","accountstatus","dn","createtimestamp","telephoneNumber"); 
     870 
     871                        $tmp = array(); 
     872 
     873                        foreach ($contexts as $index=>$context) 
     874                        { 
     875 
     876                                $search = ldap_search($ldap_conn, $query, $filter, $justthese, 0, $sizelimit); 
     877                                $info = ldap_get_entries($ldap_conn, $search); 
     878 
     879                                for ($i=0; $i < $info['count']; $i++) 
     880                                { 
     881                                        $tmp[$info[$i]['uid'][0]]['account_id']  = $info[$i]['uidnumber'][0]; 
     882                                        $tmp[$info[$i]['uid'][0]]['account_lid'] = $info[$i]['uid'][0]; 
     883                                        $tmp[$info[$i]['uid'][0]]['account_cn']  = $info[$i]['cn'][0]; 
     884                                        $tmp[$info[$i]['uid'][0]]['account_mail']= $info[$i]['mail'][0]; 
     885                                        $tmp[$info[$i]['uid'][0]]['account_phone']= $info[$i]['telephonenumber'][0]; 
     886                                        $tmp[$info[$i]['uid'][0]]['account_accountstatus']= $info[$i]['accountstatus'][0]; 
     887                                        $tmp[$info[$i]['uid'][0]]['createtimestamp']= $info[$i]['createtimestamp'][0]; 
     888                                        $sort[] = $info[$i]['uid'][0]; 
     889                                } 
     890                        } 
     891 
     892                        ldap_close($ldap_conn); 
     893 
     894                        if (count($sort)) 
     895                        { 
     896                                natcasesort($sort); 
     897                                foreach ($sort as $user_uid) 
     898                                        $return[$user_uid] = $tmp[$user_uid]; 
     899                        } 
     900 
     901                        return $return; 
     902 
     903                } 
     904 
     905 
     906                function get_list_shareAccounts_sector($query, $contexts,$sizelimit) 
     907                { 
     908                        $dn             = $GLOBALS['phpgw_info']['server']['ldap_root_dn']; 
     909                        $passwd         = $GLOBALS['phpgw_info']['server']['ldap_root_pw']; 
     910                        $ldap_conn      = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 
     911                        ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3); 
     912                        ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0); 
     913                        ldap_bind($ldap_conn,$dn,$passwd); 
     914 
     915                        $filter="(phpgwAccountType=s)"; 
     916                        $justthese = array("uid", "cn", "mail","accountstatus"); 
     917 
     918                        $tmp = array(); 
     919 
     920                        foreach ($contexts as $index=>$context) 
     921                        { 
     922 
     923                                $search = ldap_search($ldap_conn, $query, $filter, $justthese, 0, $sizelimit); 
     924                                $info = ldap_get_entries($ldap_conn, $search); 
     925 
     926                                for ($i=0; $i < $info['count']; $i++) 
     927                                { 
     928                                        $tmp[$info[$i]['uid'][0]]['account_lid'] = $info[$i]['uid'][0]; 
     929                                        $tmp[$info[$i]['uid'][0]]['account_cn']  = $info[$i]['cn'][0]; 
     930                                        $tmp[$info[$i]['uid'][0]]['account_mail']= $info[$i]['mail'][0]; 
     931                                        $tmp[$info[$i]['uid'][0]]['account_accountstatus']= $info[$i]['accountstatus'][0]; 
     932                                        $sort[] = $info[$i]['uid'][0]; 
     933                                } 
     934                        } 
     935 
     936                        ldap_close($ldap_conn); 
     937 
     938                        if (count($sort)) 
     939                        { 
     940                                natcasesort($sort); 
     941                                foreach ($sort as $user_uid) 
     942                                        $return[$user_uid] = $tmp[$user_uid]; 
     943                        } 
     944 
     945                        return $return; 
     946                } 
     947 
     948                function get_list_institutionalAccounts_sector($query, $contexts,$sizelimit) 
     949                { 
     950                        $dn             = $GLOBALS['phpgw_info']['server']['ldap_root_dn']; 
     951                        $passwd         = $GLOBALS['phpgw_info']['server']['ldap_root_pw']; 
     952                        $ldap_conn      = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 
     953                        ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3); 
     954                        ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0); 
     955                        ldap_bind($ldap_conn,$dn,$passwd); 
     956 
     957                        $filter="(phpgwAccountType=i)"; 
     958                        $justthese = array("uid", "cn", "mail","accountstatus","mailForwardingAddress"); 
     959 
     960                        $tmp = array(); 
     961 
     962                        foreach ($contexts as $index=>$context) 
     963                        { 
     964 
     965                                $search = ldap_search($ldap_conn, $query, $filter, $justthese, 0, $sizelimit); 
     966                                $info = ldap_get_entries($ldap_conn, $search); 
     967 
     968                                for ($i=0; $i < $info['count']; $i++) 
     969                                { 
     970                                        $tmp[$info[$i]['uid'][0]]['account_cn']  = $info[$i]['cn'][0]; 
     971                                        $tmp[$info[$i]['uid'][0]]['account_mail']= $info[$i]['mail'][0]; 
     972                                        $tmp[$info[$i]['uid'][0]]['account_accountstatus']= $info[$i]['accountstatus'][0]; 
     973                                        $tmp[$info[$i]['uid'][0]]['account_mailforwardingaddress']= $info[$i]['mailforwardingaddress'];  
     974                                        $sort[] = $info[$i]['uid'][0]; 
     975                                } 
     976                        } 
     977 
     978                        ldap_close($ldap_conn); 
     979 
     980                        if (count($sort)) 
     981                        { 
     982                                natcasesort($sort); 
     983                                foreach ($sort as $user_uid) 
     984                                        $return[$user_uid] = $tmp[$user_uid]; 
     985                        } 
     986 
     987                        return $return; 
     988                } 
     989 
    856990                function get_count_user_sector($query, $contexts,$sizelimit) 
    857991                { 
     
    8711005                                        $entries = ldap_get_entries($ldap_conn, $search); 
    8721006                                        $contexts = array(); 
    873                                         for ($i=0; $i< $entries['count']; $i++){ 
    874                                                 $contexts[] = $entries[$i]['dn']; 
    8751007                                        } 
    8761008                                } 
     1009 
     1010                        $filter="(phpgwAccountType=u)"; 
     1011                        $justthese = array("dn"); 
     1012                        $search = ldap_search($ldap_conn, $context, $filter, $justthese, 0, $sizelimit); 
     1013                        $entries = ldap_get_entries($ldap_conn, $search); 
     1014                        $total_count = $entries["count"]; 
     1015 
     1016                        ldap_close($ldap_conn); 
     1017 
     1018                        return $total_count; 
    8771019                        }        
    878                         $filter="(&(phpgwAccountType=u)(|(uid=*)))"; 
    879                         $justthese = array("uidnumber"); 
    880                         $total_count = 0; 
    881                          
     1020                         
     1021                function get_count_cota_sector($query, $contexts,$sizelimit) 
     1022                { 
     1023                        $dn                     = $GLOBALS['phpgw_info']['server']['ldap_root_dn']; 
     1024                        $passwd         = $GLOBALS['phpgw_info']['server']['ldap_root_pw']; 
     1025                        $ldap_conn      = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 
     1026                        ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3); 
     1027                        ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0); 
     1028                        ldap_bind($ldap_conn,$dn,$passwd); 
     1029                        // counting users by sector. 
    8821030                        foreach ($contexts as $index=>$context) {                                
     1031                                if($context == $GLOBALS['phpgw_info']['server'] ["ldap_context"]) { 
     1032                                        $contexts[$index] = null; 
     1033                                        $justthese = array("dn"); 
     1034                                        $filter="(objectClass=OrganizationalUnit)"; 
     1035                                        $search = ldap_list($ldap_conn, $context, $filter, $justthese); 
     1036                                        $entries = ldap_get_entries($ldap_conn, $search); 
     1037                                        $contexts = array(); 
     1038                                } 
     1039                        } 
     1040 
     1041                        $filter="(|(phpgwAccountType=u)(|(phpgwAccountType=s)))"; 
     1042                        $justthese = array("dn"); 
    8831043                                $search = ldap_search($ldap_conn, $context, $filter, $justthese, 0, $sizelimit); 
    884                                 $total_count += ldap_count_entries($ldap_conn, $search);                                                         
    885                         } 
     1044                        $entries = ldap_get_entries($ldap_conn, $search); 
     1045                        $total_count = $entries["count"]; 
     1046 
     1047                        ldap_close($ldap_conn); 
     1048 
     1049                        return $total_count; 
     1050                        } 
     1051 
     1052                function get_count_shareAccount_sector($query, $contexts,$sizelimit) 
     1053                { 
     1054                        $dn             = $GLOBALS['phpgw_info']['server']['ldap_root_dn']; 
     1055                        $passwd         = $GLOBALS['phpgw_info']['server']['ldap_root_pw']; 
     1056                        $ldap_conn      = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 
     1057                        ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3); 
     1058                        ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0); 
     1059                        ldap_bind($ldap_conn,$dn,$passwd); 
     1060                        // counting users by sector. 
     1061                        foreach ($contexts as $index=>$context) { 
     1062                                if($context == $GLOBALS['phpgw_info']['server'] ["ldap_context"]) { 
     1063                                        $contexts[$index] = null; 
     1064                                        $justthese = array("dn"); 
     1065                                        $filter="(objectClass=OrganizationalUnit)"; 
     1066                                        $search = ldap_list($ldap_conn, $context, $filter, $justthese); 
     1067                                        $entries = ldap_get_entries($ldap_conn, $search); 
     1068                                        $contexts = array(); 
     1069                                } 
     1070                        } 
     1071 
     1072                        $filter="(phpgwAccountType=s)"; 
     1073                        $justthese = array("dn"); 
     1074                        $search = ldap_search($ldap_conn, $context, $filter, $justthese, 0, $sizelimit); 
     1075                        $entries = ldap_get_entries($ldap_conn, $search); 
     1076                        $total_count = $entries["count"]; 
     1077 
     1078                        ldap_close($ldap_conn); 
     1079                         
     1080                        return $total_count; 
     1081                } 
     1082 
     1083                function get_count_institutionalAccount_sector($query, $contexts,$sizelimit) 
     1084                { 
     1085                        $dn             = $GLOBALS['phpgw_info']['server']['ldap_root_dn']; 
     1086                        $passwd         = $GLOBALS['phpgw_info']['server']['ldap_root_pw']; 
     1087                        $ldap_conn      = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 
     1088                        ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3); 
     1089                        ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0); 
     1090                        ldap_bind($ldap_conn,$dn,$passwd); 
     1091                        // counting users by sector. 
     1092                        foreach ($contexts as $index=>$context) { 
     1093                                if($context == $GLOBALS['phpgw_info']['server'] ["ldap_context"]) { 
     1094                                        $contexts[$index] = null; 
     1095                                        $justthese = array("dn"); 
     1096                                        $filter="(objectClass=OrganizationalUnit)"; 
     1097                                        $search = ldap_list($ldap_conn, $context, $filter, $justthese); 
     1098                                        $entries = ldap_get_entries($ldap_conn, $search); 
     1099                                        $contexts = array(); 
     1100                                } 
     1101                        } 
     1102                         
     1103                        $filter="(phpgwAccountType=i)"; 
     1104                        $justthese = array("dn"); 
     1105                        $search = ldap_search($ldap_conn, $context, $filter, $justthese, 0, $sizelimit); 
     1106                        $entries = ldap_get_entries($ldap_conn, $search); 
     1107                        $total_count = $entries["count"]; 
     1108 
    8861109                        ldap_close($ldap_conn); 
     1110 
    8871111                        return $total_count; 
    8881112                } 
     
    8971121                        ldap_bind($ldap_conn,$dn,$passwd); 
    8981122 
    899                         $filter="(&(phpgwAccountType=u)(|(uid=*)))"; 
     1123                        $filter="(phpgwAccountType=u)"; 
    9001124                        $justthese = array("uidnumber", "uid", "cn", "mail","accountstatus","dn","createtimestamp"); 
    9011125                         
     
    12541478                        ldap_bind($ldap_conn,$dn,$passwd); 
    12551479                         
    1256                         $filter="(&(phpgwAccountType=u)(|(uid=*)))"; 
     1480                        $filter="(&(phpgwAccountType=u))"; 
    12571481                        $justthese = array("uidnumber", "uid", "cn", "mail","accountstatus","dn","createtimestamp","telephoneNumber");                                                                                   
    12581482                                                         
     
    13181542                        return $sOrder === "desc" ? array_reverse( $aList ) : $aList; 
    13191543                } 
     1544 
     1545                function Paginate_cota($type, $query, $contexts, $Field, $Order = 'asc', $Page = null, $PerPage = null ) 
     1546                { 
     1547                        $dn                     = $GLOBALS['phpgw_info']['server']['ldap_root_dn']; 
     1548                        $passwd         = $GLOBALS['phpgw_info']['server']['ldap_root_pw']; 
     1549                        $ldap_conn      = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 
     1550                        ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3); 
     1551                        ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0); 
     1552                        ldap_bind($ldap_conn,$dn,$passwd); 
     1553 
     1554                        $filter="(|(phpgwAccountType=u)(|(phpgwAccountType=s)))"; 
     1555                        $justthese = array("uidnumber", "uid", "cn", "mail","accountstatus","dn","createtimestamp","telephoneNumber");                                  
     1556 
     1557                        foreach ($contexts as $index=>$context) 
     1558                        { 
     1559                                $search=ldap_search($ldap_conn, $query, $filter, $justthese); 
     1560 
     1561                                $rConnection = $ldap_conn; 
     1562                                $rSearch = $search; 
     1563                                $sOrder = $Order; 
     1564                                $iPage = $Page; 
     1565                                $iPerPage = $PerPage; 
     1566                                $sField = $Field; 
     1567 
     1568                                $iTotalEntries = ldap_count_entries( $rConnection, $rSearch ); 
     1569 
     1570                                if ( $iPage === null || $iPerPage === null ) 
     1571                                { 
     1572                                        # fetch all in one page 
     1573                                        $iStart = 0; 
     1574                                        $iEnd = $iTotalEntries - 1; 
     1575                                } 
     1576                                else 
     1577                                { 
     1578                                        # calculate range of page 
     1579                                        $iFimPage = ( ceil( $iTotalEntries / $iPerPage ) - 1 ) * $iPage; 
     1580 
     1581                                        $iStart = ( ceil( ($iPage -1) * $iPerPage )); 
     1582                                        $iEnd = $iPage * $iPerPage; 
     1583 
     1584 
     1585                                        if ( $sOrder === "desc" ) 
     1586                                        { 
     1587                                                # revert range 
     1588                                                $iStart = $iTotalEntries - 1 - $iEnd; 
     1589                                                $iEnd = $iStart + $iPerPage - 1; 
     1590                                        } 
     1591                                } 
     1592 
     1593                                /********* Importante Mostra o resultado da paginação ********** 
     1594                                var_dump( $iStart . " " . $iEnd ); 
     1595                                ****************** Só descomentar ******************************/ 
     1596 
     1597                                 # fetch entries 
     1598                                ldap_sort( $rConnection, $rSearch, $sField ); 
     1599 
     1600                                $aList = array(); 
     1601                                for ( 
     1602                                        $iCurrent = 0, $rEntry = ldap_first_entry( $rConnection, $rSearch ); 
     1603                                        $iCurrent <= $iEnd && is_resource( $rEntry ); 
     1604                                        $iCurrent++, $rEntry = ldap_next_entry( $rConnection, $rEntry ) 
     1605                                        ) 
     1606                                { 
     1607                                        if ( $iCurrent >= $iStart ) 
     1608                                        { 
     1609                                                array_push( $aList, ldap_get_attributes( $rConnection, $rEntry )); 
     1610                                        } 
     1611                                } 
     1612                        } 
     1613 
     1614                        ldap_close($ldap_conn); 
     1615 
     1616                        # if order is desc revert page's entries 
     1617                        return $sOrder === "desc" ? array_reverse( $aList ) : $aList; 
     1618                } 
     1619 
     1620                function Paginate_shareAccount($type, $query, $contexts, $Field, $Order = 'asc', $Page = null, $PerPage = null ) 
     1621 
     1622                { 
     1623                        $dn                     = $GLOBALS['phpgw_info']['server']['ldap_root_dn']; 
     1624                        $passwd         = $GLOBALS['phpgw_info']['server']['ldap_root_pw']; 
     1625                        $ldap_conn      = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 
     1626                        ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3); 
     1627                        ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0); 
     1628                        ldap_bind($ldap_conn,$dn,$passwd); 
     1629 
     1630                        $filter="(phpgwAccountType=s)"; 
     1631                        $justthese = array("uid", "cn", "mail","accountstatus");                                  
     1632 
     1633                        foreach ($contexts as $index=>$context) 
     1634                        { 
     1635                                $search=ldap_search($ldap_conn, $query, $filter, $justthese); 
     1636 
     1637                                $rConnection = $ldap_conn; 
     1638                                $rSearch = $search; 
     1639                                $sOrder = $Order; 
     1640                                $iPage = $Page; 
     1641                                $iPerPage = $PerPage; 
     1642                                $sField = $Field; 
     1643 
     1644                                $iTotalEntries = ldap_count_entries( $rConnection, $rSearch ); 
     1645 
     1646                                if ( $iPage === null || $iPerPage === null ) 
     1647                                { 
     1648                                        # fetch all in one page 
     1649                                        $iStart = 0; 
     1650                                        $iEnd = $iTotalEntries - 1; 
     1651                                } 
     1652                                else 
     1653                                { 
     1654                                        # calculate range of page 
     1655                                        $iFimPage = ( ceil( $iTotalEntries / $iPerPage ) - 1 ) * $iPage; 
     1656 
     1657                                        $iStart = ( ceil( ($iPage -1) * $iPerPage )); 
     1658                                        $iEnd = $iPage * $iPerPage; 
     1659 
     1660                                        if ( $sOrder === "desc" ) 
     1661                                        { 
     1662                                                # revert range 
     1663                                                $iStart = $iTotalEntries - 1 - $iEnd; 
     1664                                                $iEnd = $iStart + $iPerPage - 1; 
     1665                                        } 
     1666                                } 
     1667 
     1668                                 # fetch entries 
     1669                                ldap_sort( $rConnection, $rSearch, $sField ); 
     1670 
     1671                                $aList = array(); 
     1672                                for ( 
     1673                                        $iCurrent = 0, $rEntry = ldap_first_entry( $rConnection, $rSearch ); 
     1674                                        $iCurrent <= $iEnd && is_resource( $rEntry ); 
     1675                                        $iCurrent++, $rEntry = ldap_next_entry( $rConnection, $rEntry ) 
     1676                                        ) 
     1677                                { 
     1678                                        if ( $iCurrent >= $iStart ) 
     1679                                        { 
     1680                                                array_push( $aList, ldap_get_attributes( $rConnection, $rEntry )); 
     1681                                        } 
     1682                                } 
     1683                        } 
     1684 
     1685                        ldap_close($ldap_conn); 
     1686 
     1687                        # if order is desc revert page's entries 
     1688                        return $sOrder === "desc" ? array_reverse( $aList ) : $aList; 
     1689                } 
     1690 
     1691                function Paginate_institutionalAccount($type, $query, $contexts, $Field, $Order = 'asc', $Page = null, $PerPage = null ) 
     1692                { 
     1693                        $dn                     = $GLOBALS['phpgw_info']['server']['ldap_root_dn']; 
     1694                        $passwd         = $GLOBALS['phpgw_info']['server']['ldap_root_pw']; 
     1695                        $ldap_conn      = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 
     1696                        ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3); 
     1697                        ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0); 
     1698                        ldap_bind($ldap_conn,$dn,$passwd); 
     1699 
     1700                        $filter="(phpgwAccountType=i)"; 
     1701                        $justthese = array("uid", "cn", "mail","accountstatus","mailforwardingaddress"); 
     1702 
     1703                        foreach ($contexts as $index=>$context) 
     1704                        { 
     1705                                $search=ldap_search($ldap_conn, $query, $filter, $justthese); 
     1706 
     1707                                $rConnection = $ldap_conn; 
     1708                                $rSearch = $search; 
     1709                                $sOrder = $Order; 
     1710                                $iPage = $Page; 
     1711                                $iPerPage = $PerPage; 
     1712                                $sField = $Field; 
     1713 
     1714                                $iTotalEntries = ldap_count_entries( $rConnection, $rSearch ); 
     1715 
     1716                                if ( $iPage === null || $iPerPage === null ) 
     1717                                { 
     1718                                        # fetch all in one page 
     1719                                        $iStart = 0; 
     1720                                        $iEnd = $iTotalEntries - 1; 
     1721                                } 
     1722                                else 
     1723                                { 
     1724                                        # calculate range of page 
     1725                                        $iFimPage = ( ceil( $iTotalEntries / $iPerPage ) - 1 ) * $iPage; 
     1726 
     1727                                        $iStart = ( ceil( ($iPage -1) * $iPerPage )); 
     1728                                        $iEnd = $iPage * $iPerPage; 
     1729 
     1730                                        if ( $sOrder === "desc" ) 
     1731                                        { 
     1732                                                # revert range 
     1733                                                $iStart = $iTotalEntries - 1 - $iEnd; 
     1734                                                $iEnd = $iStart + $iPerPage - 1; 
     1735                                        } 
     1736                                } 
     1737 
     1738                                 # fetch entries 
     1739                                ldap_sort( $rConnection, $rSearch, $sField ); 
     1740 
     1741                                $aList = array(); 
     1742                                for ( 
     1743                                        $iCurrent = 0, $rEntry = ldap_first_entry( $rConnection, $rSearch ); 
     1744                                        $iCurrent <= $iEnd && is_resource( $rEntry ); 
     1745                                        $iCurrent++, $rEntry = ldap_next_entry( $rConnection, $rEntry ) 
     1746                                        ) 
     1747                                { 
     1748                                        if ( $iCurrent >= $iStart ) 
     1749                                        { 
     1750                                                array_push( $aList, ldap_get_attributes( $rConnection, $rEntry )); 
     1751                                        } 
     1752                                } 
     1753                        } 
     1754 
     1755                        ldap_close($ldap_conn); 
     1756 
     1757                        # if order is desc revert page's entries 
     1758                        return $sOrder === "desc" ? array_reverse( $aList ) : $aList; 
     1759                } 
     1760 
    13201761 
    13211762                function get_list_ou_user_logon($query,$contexts,$sizelimit) 
  • branches/2.2/reports/inc/class.imap_functions.inc.php

    r3946 r4570  
    3939                return $quota; 
    4040        } 
     41 
     42        function getMembersShareAccount($uid) 
     43        { 
     44                $owner_user_share = imap_getacl($this->imap, "user" . $this->imapDelimiter . $uid); 
     45 
     46                //Organiza participantes da conta compartilha em um array, retira apenas os members,  
     47                $i =0; 
     48                foreach($owner_user_share as $key => $value) 
     49                { 
     50                        if ($i != 0) 
     51                        { 
     52                                $return[$i] = $key; 
     53                        } 
     54                        $i++; 
     55                } 
     56 
     57                //Ordena os participantes da conta compartilhada 
     58                sort($return); 
     59 
     60                return $return; 
     61        } 
     62 
    4163} 
  • branches/2.2/reports/inc/class.uireports_cota.inc.php

    r4035 r4570  
    3838                        $this->imap_functions = CreateObject('reports.imap_functions'); 
    3939                        $this->fpdf = CreateObject('reports.uireports_fpdf'); // Class para PDF 
    40 //                      $this->fpdf = CreateObject('reports.fpdf'); // Class para PDF 
    4140                                                 
    4241                        $c = CreateObject('phpgwapi.config','reports'); // cria o objeto relatorio no $c 
     
    157156                        { 
    158157                                // Conta a quantidade de Usuario do grupo raiz 
    159                                 $account_user = $this->functions->get_count_user_sector($contextsdn,$contexts,0); 
     158                                $account_user = $this->functions->get_count_cota_sector($contextsdn,$contexts,0); 
    160159                                $totaluser = "(".$account_user.")"; 
    161160 
     
    277276 
    278277                        // verifica se exixte usuarios no LDAP 
    279                         $account_info = $this->functions->get_list_user_sector ($setordn,$contexts,0); 
     278                        $account_info = $this->functions->get_list_cota_sector ($setordn,$contexts,0); 
    280279 
    281280                        if (!count($account_info)) 
     
    357356 
    358357                                // ********** busca no LDAP as informação paginada e imprime **************** 
    359                                 $paginas =  $this->functions->Paginate_user('accounts',$setordn,$contexts,'cn','asc',$npag,$numpage); 
     358                                $paginas =  $this->functions->Paginate_cota('accounts',$setordn,$contexts,'cn','asc',$npag,$numpage); 
    360359 
    361360                                $tmpp = array(); 
     
    418417                                                'row_cn'                        => $accountr['account_cn'], 
    419418                                                'percent_cota'          => $percent_cota_c, 
    420                                                 'row_status'            => $accountr['account_status'] == 'active' ? '<font color="#0033FF">Ativado</font> ' : '<font color="#FF0000">Desativado</font>', 
    421                                                 'row_mail'                      => (!$accountr['account_mail']?'<font color=red>Sem E-mail</font>':$accountr['account_mail']) 
     419                                                'row_status'            => $accountr['account_status'] == 'active' ? '<font color="#0033FF">'.lang('Activated').'</font> ' : '<font color="#FF0000">'.lang('Disabled').'</font>', 
     420                                                'row_mail'                      => (!$accountr['account_mail']?'<font color=red>'.lang('Without E-mail').'</font>':$accountr['account_mail']) 
    422421                                        ); 
    423422                                         
     
    526525                        $pdf->Open(); 
    527526                        $pdf->AddPage(); 
    528                         $pdf->SetTitle('Relatório Gerado pelo Expresso Reports'); 
    529527 
    530528                        //Set font and colors 
     
    537535                        //Table header 
    538536                        $SubTitulo = lang('reports title4'); 
    539                         $SubTituloR = lang('report cota organization'); 
     537                        $SubTituloR = lang('Report Generated by Expresso Reports'); 
    540538                        $SubTitulo1 = $subtitulo1; 
    541539                        $GLOBALS['phpgw_info']['apps']['reports']['subtitle'] = $SubTituloR; 
     
    550548                        $pdf->SetLineWidth(.3); 
    551549 
    552 //                      $pdf->Cell(0,10,$SubTitulo1,0,1,'C',0); 
    553550                        $pdf->MultiCell(0,3,$SubTitulo1,0,'C',0); 
    554551 
     
    558555                        $pdf->Cell(0,5,$titulo_system,0,1,'R',0); 
    559556                                                                                                 
    560                         $account_info = $this->functions->get_list_user_sector($setordn,$contexts,0); 
     557                        $account_info = $this->functions->get_list_cota_sector($setordn,$contexts,0); 
    561558 
    562559                        if (count($account_info)) 
     
    596593                                        $account_lid = $account['account_lid']; 
    597594                                        $row_cn = $account['account_cn']; 
    598                                         $row_mail = (!$account['account_mail']?'<font color=red>Sem E-mail</font>':$account['account_mail']); 
     595                                        $row_mail = (!$account['account_mail']?'<font color=red>'.lang('Without E-mail').'</font>':$account['account_mail']); 
    599596                                        $row_mailquota = $user_mailquota; 
    600597                                        $row_mailquota_used = $user_mailquota_used; 
    601598                                        $row_percent_cota = $percent_cota; 
    602                                         $row_status = $account['account_accountstatus'] == 'active' ? 'Ativado' : 'Desativado'; 
     599                                        $row_status = $account['account_accountstatus'] == 'active' ? lang('Activated') : lang('Disabled'); 
    603600 
    604601                                         
     
    656653                function get_user_info($userdn,$usercontexts,$usersizelimit) 
    657654                { 
    658 //                      $user_info = $this->functions->Paginate_user('accounts',$setordn,$contexts,'cn','asc',$npag,$numpage); 
    659655                        $user_info_imap = $this->imap_functions->get_user_info($user_info_ldap['uid']); 
    660656 
  • branches/2.2/reports/inc/class.uireports_fpdf.inc.php

    r3666 r4570  
    120120        } 
    121121 
    122         /*      function Header() 
    123          { 
    124                 $SubTituloR = lang('report cota organization'); 
    125  
    126                 //Restore font and colors 
    127                 $this->SetFont('Arial','',8); 
    128                 $this->SetFillColor(224,235,255); 
    129                 $this->SetTextColor(0); 
    130  
    131                 $this->Cell(95,5,lang('name'),1,0,'L',1); 
    132                 //                              $pdf->Cell(53,5,lang('report email'),1,0,'L',1); 
    133                 $this->Cell(17,5,lang('cota'),1,0,'C',1); 
    134                 $this->Cell(31,5,lang('cota used'),1,0,'C',1); 
    135                 $this->Cell(29,5,lang('percent cota'),1,0,'C',1); 
    136                 $this->Cell(20,5,lang('status'),1,1,'C',1); 
    137  
    138                 return; 
    139                 } 
    140                 */ 
    141122        function Footer() 
    142123        { 
    143124                // Esta função foi implemantada para realizar o rodapé dos relatórios 
    144  
    145125                $titulo_system = $GLOBALS['phpgw_info']['apps']['reports']['title']; 
    146126                $SubTitulo = $GLOBALS['phpgw_info']['apps']['reports']['subtitle']; 
     
    153133 
    154134                //Imprime o número da página 
    155                 //              $this->Cell(0,5,$titulo_system.'                  '.$SubTitulo.'                  Página n. '.$this->PageNo(),1,0,'C',1); 
    156  
    157135                $this->Rect(9,281,197,6,'D'); 
    158136                $this->Cell(55,4,$titulo_system,0,0,'L',1); 
  • branches/2.2/reports/inc/class.uireports_logon.inc.php

    r4035 r4570  
    7676 
    7777                        if ($vnumacesso==999){ 
    78                                 $numacesso = "Nunca logou"; 
     78                                $numacesso = lang('Never login'); 
    7979                        } 
    8080 
     
    8787                        $pdf->Open(); 
    8888                        $pdf->AddPage(); 
    89                         $pdf->SetTitle('Relatório Gerado pelo Expresso Reports'); 
    9089 
    9190                        //Set font and colors 
     
    9897                        //Table header 
    9998                        $SubTitulo = lang('reports title6'); 
    100                         $SubTituloR = lang('report of time without logging by Organization'); 
     99                        $SubTituloR = lang('Report Generated by Expresso Reports'); 
    101100                        $SubTitulo1 = $subtitulo1; 
    102101                        $GLOBALS['phpgw_info']['apps']['reports']['subtitle'] = $SubTituloR; 
     
    181180                                                $row_cn = $accountr['account_cn']; 
    182181                                                $account_lid = $accountr['account_lid']; 
    183                                                 $row_mail = (!$accountr['account_mail'] ? 'Sem E-mail' : $accountr['account_mail']); 
     182                                                $row_mail = (!$accountr['account_mail'] ? lang('Without E-mail') : $accountr['account_mail']); 
    184183                                                $row_timestamp = substr($accountr['createTimestamp'], 6, 2)."/".substr($accountr['createTimestamp'], 4, 2)."/".substr($accountr['createTimestamp'], 0, 4); 
    185                                                 $row_li_date = $accountr['li_date'] == 'Nunca logou' ? 'Nunca logou' : $accountr['li_date']; 
     184                                                $row_li_date = $accountr['li_date'] == lang('Never login') ? lang('Never login') : $accountr['li_date']; 
    186185                                                $row_li_dias = $accountr['li_dias']; 
    187                                                 $row_status = $accountr['account_status'] == 'active' ? 'Ativado' : 'Desativado'; 
     186                                                $row_status = $accountr['account_status'] == 'active' ? lang('Activated') : lang('Disabled'); 
    188187                                                 
    189188                                                $pdf->Cell(60,5,$account_lid,0,0,'L',0); 
     
    192191                                                $pdf->Cell(25,5,$row_timestamp,0,0,'C',0); 
    193192 
    194                                                 if ($row_li_date == 'Nunca logou') 
     193                                                if ($row_li_date == lang('Never login')) 
    195194                                                { 
    196195                                                        //Muda cor fonte 
     
    612611                                                        'row_mail'              => (!$accountr['account_mail']?'<font color=red>Sem E-mail</font>':$accountr['account_mail']), 
    613612                                                        'row_timestamp'         => substr($accountr['createTimestamp'], 6, 2)."/".substr($accountr['createTimestamp'], 4, 2)."/".substr($accountr['createTimestamp'], 0, 4), 
    614                                                         'row_li_date'           => $accountr['li_date'] =='Nunca logou' ? '<font color="#FF0000">'.$accountr['li_date'].'</font>' : $accountr['li_date'], 
     613                                                        'row_li_date'           => $accountr['li_date'] ==lang('Never login') ? '<font color="#FF0000">'.$accountr['li_date'].'</font>' : $accountr['li_date'], 
    615614                                                        'row_li_dias'           => $accountr['li_dias'] 
    616615                                                ); 
     
    718717                                                $access_log_array = explode("#",$access_log); 
    719718                                                 
    720                                                 if ($numacesso<>"Nunca logou"){ 
     719                                                if ($numacesso<>lang('Never login')){ 
    721720                                                        $accountp['li_dias'] = $access_log_array[1]; 
    722721                                                        $accountp['li_date'] = $access_log_array[0]; 
     
    778777                                                        'row_loginid'   => $accountr['account_lid'], 
    779778                                                        'row_cn'                => $accountr['account_cn'], 
    780                                                         'row_status'    => $accountr['account_status'] == 'active' ? '<font color="#0033FF">Ativado</font> ' : '<font color="#FF0000">Desativado</font>', 
    781                                                         'row_mail'              => (!$accountr['account_mail']?'<font color=red>Sem E-mail</font>':$accountr['account_mail']), 
     779                                                        'row_status'    => $accountr['account_status'] == 'active' ? '<font color="#0033FF">'.lang('Activated').'</font> ' : '<font color="#FF0000">'.lang('Disabled').'</font>', 
     780                                                        'row_mail'              => (!$accountr['account_mail']?'<font color=red>'.lang('Without E-mail').'</font>':$accountr['account_mail']), 
    782781                                                        'row_timestamp'         => substr($accountr['createTimestamp'], 6, 2)."/".substr($accountr['createTimestamp'], 4, 2)."/".substr($accountr['createTimestamp'], 0, 4), 
    783                                                         'row_li_date'           => $accountr['li_date'] =='Nunca logou' ? '<font color="#FF0000">'.$accountr['li_date'].'</font>' : $accountr['li_date'], 
     782                                                        'row_li_date'           => $accountr['li_date'] ==lang('Never login') ? '<font color="#FF0000">'.$accountr['li_date'].'</font>' : $accountr['li_date'], 
    784783                                                        'row_li_dias'           => $accountr['li_dias'] 
    785784                                                ); 
  • branches/2.2/reports/inc/class.uireports_maillists.inc.php

    r4035 r4570  
    7878                        $pdf->Open(); 
    7979                        $pdf->AddPage(); 
    80                         $pdf->SetTitle('Relatório Gerado pelo Expresso Reports'); 
     80                        $pdf->SetTitle(lang('Report Generated by Expresso Reports')); 
    8181 
    8282                        //Set font and colors 
     
    8989                        //Table header 
    9090                        $SubTitulo = lang('reports title8'); 
    91                         $SubTituloR = lang('report organization'); 
     91                        $SubTituloR = lang('Report Generated by Expresso Reports'); 
    9292                        $SubTitulo1 = $subtitulo1; 
    9393                        $GLOBALS['phpgw_info']['apps']['reports']['subtitle'] = $SubTituloR; 
     
    125125                                        $row_loginid = $account['uid']; 
    126126                                        $row_cn = $account['name']; 
    127                                         $row_mail = (!$account['email']?'<font color=red>Sem E-mail</font>':$account['email']); 
     127                                        $row_mail = (!$account['email']?'<font color=red>'.lang('Without E-mail').'</font>':$account['email']); 
    128128                                        $pdf->Cell(40,5,$row_loginid,0,0,'L',0); 
    129129                                        $pdf->Cell(75,5,$row_cn,0,0,'L',0); 
     
    461461                                        $tmpp[$accountp['uid'][0]]['account_lid'] = $accountp['uid'][0]; 
    462462                                        $tmpp[$accountp['uid'][0]]['account_cn']         = $accountp['cn'][0]; 
    463                                         $tmpp[$accountp['uid'][0]]['account_mail']= $accountp['mail'][0]; 
     463                                        $tmpp[$accountp['uid'][0]]['account_mail']      = $accountp['mail'][0]; 
    464464                                        $sortp[] = $accountp['uid'][0]; 
    465465                                        if (count($sortp)) 
     
    478478                                                'row_loginid'   => $accountr['account_lid'], 
    479479                                                'row_cn'                => $accountr['account_cn'], 
    480                                                 'row_mail'              => (!$accountr['account_mail']?'<font color=red>Sem E-mail</font>':$accountr['account_mail']) 
     480                                                'row_mail'              => (!$accountr['account_mail']?'<font color=red>'.lang('Without E-mail').'</font>':$accountr['account_mail']) 
    481481                                        ); 
    482482                                         
  • branches/2.2/reports/inc/class.uireports_users.inc.php

    r4035 r4570  
    7878                        $pdf->Open(); 
    7979                        $pdf->AddPage(); 
    80                         $pdf->SetTitle('Relatório Gerado pelo Expresso Reports'); 
     80                        $pdf->SetTitle(lang('Report Generated by Expresso Reports')); 
    8181 
    8282                        //Set font and colors 
     
    8989                        //Table header 
    9090                        $SubTitulo = lang('reports title2'); 
    91                         $SubTituloR = lang('report organization'); 
     91                        $SubTituloR = lang('Report Generated by Expresso Reports'); 
    9292                        $SubTitulo1 = $subtitulo1; 
    9393                        $GLOBALS['phpgw_info']['apps']['reports']['subtitle'] = $SubTituloR; 
    9494                        $pdf->Cell(0,8,$SubTitulo,0,1,'C',0); 
    95  
    9695 
    9796                        //Set font and colors 
     
    127126                                                $row_loginid = $account['account_lid']; 
    128127                                                $row_cn = $account['account_cn']; 
    129                                                 $row_mail = (!$account['account_mail'] ? '<font color=red>Sem E-mail</font>' : $account['account_mail']); 
     128                                                $row_mail = (!$account['account_mail'] ? '<font color=red>'.lang('Without E-mail').'</font>' : $account['account_mail']); 
    130129                                                $row_phone = (!$account['account_phone'] ? '-' : $account['account_phone']); 
    131                                                 $row_status = $account['account_accountstatus'] == 'active' ? 'Ativado' : 'Desativado'; 
     130                                                $row_status = $account['account_accountstatus'] == 'active' ? lang('Activated') : lang('Disabled'); 
    132131                                                $pdf->Cell(55,5,$row_loginid,0,0,'L',0); 
    133132                                                $pdf->Cell(80,5,$row_cn,0,0,'L',0); 
    134133                                                $pdf->Cell(80,5,$row_mail,0,0,'L',0); 
    135134                                                $pdf->Cell(35,5,$row_phone,0,0,'L',0); 
    136                                         if ($row_status == 'Ativado') 
     135                                        if ($row_status == lang('Activated')) 
    137136                                        { 
    138137                                                //Restaura cor fonte 
     
    499498                                                'row_loginid'   => $accountr['account_lid'], 
    500499                                                'row_cn'                => $accountr['account_cn'], 
    501                                                 'row_status'    => $accountr['account_status'] == 'active' ? '<font color="#0033FF">Ativado</font> ' : '<font color="#FF0000">Desativado</font>', 
     500                                                'row_status'    => $accountr['account_status'] == 'active' ? '<font color="#0033FF">'.lang('Activated').'</font> ' : '<font color="#FF0000">'.lang('Disabled').'</font>', 
    502501                                                'row_phone'             => (!$accountr['account_phone'] ? '-' : $accountr['account_phone']), 
    503                                                 'row_mail'              => (!$accountr['account_mail'] ? '<font color=red>Sem E-mail</font>' : $accountr['account_mail']) 
     502                                                'row_mail'      => (!$accountr['account_mail'] ? '<font color=red>'.lang('Without E-mail').'</font>' : $accountr['account_mail']) 
    504503                                        ); 
    505504                                         
  • branches/2.2/reports/inc/class.uireports_usersgroups.inc.php

    r4035 r4570  
    7878                        $pdf->Open(); 
    7979                        $pdf->AddPage(); 
    80                         $pdf->SetTitle('Relatório Gerado pelo Expresso Reports'); 
     80                        $pdf->SetTitle(lang('Report of institutional accounts of the Organization')); 
    8181 
    8282                        //Set font and colors 
     
    8989                        //Table header 
    9090                        $SubTitulo = lang('reports title10'); 
    91                         $SubTituloR = lang('report organization'); 
     91                        $SubTituloR = lang('Report Generated by Expresso Reports'); 
    9292                        $SubTitulo1 = $subtitulo1; 
    9393                        $GLOBALS['phpgw_info']['apps']['reports']['subtitle'] = $SubTituloR; 
  • branches/2.2/reports/index.php

    r3948 r4570  
    2828                'lang_rel_title'                        => lang('reports'), 
    2929                'lang_rel_user_org'                     => lang('report organization'), 
     30                'lang_rel_share_account_org'            => lang('report share account organization'), 
     31                'lang_rel_institutional_account_org'    => lang('report institutional account organization'), 
    3032                'lang_rel_cota_org'             => lang('report cota organization'), 
    3133                'lang_rel_logon_org'            => lang('report of time without logging by Organization'), 
  • branches/2.2/reports/setup/phpgw_pt-br.lang

    r3666 r4570  
     1Activated       reports pt-br   Ativado 
     2Date    reports pt-br   Data 
     3Without E-mail  reports pt-br   Sem E-mail 
     4Report of shared accounts of the Organization   reports pt-br   Relatório das contas compartilhadas da Organização 
     5Report shared accounts by Organization  reports pt-br   Relatório de contas compartilhadas por Organização 
     6Report Generated by Expresso Reports    reports pt-br   Relatório gerado pelo Expresso Reports 
     7report institutional account organization       reports pt-br   Relatório de contas institucionais por Organização 
     8Report of institutional accounts of the Organization    reports pt-br   Relatório de contas institucionais da Organização 
     9Report institutional accounts by Organization   reports pt-br   Relatório de contas institucionais por Organização 
    110uidNumber       reports pt-br   UID 
    211user login      reports pt-br   Login do usuário 
     
    2736reports reports pt-br   Relatórios 
    2837report organization     reports pt-br   Relatório de usuários por Organização 
     38report share account organization       reports pt-br   Relatório de contas compartilhadas por Organização 
    2939report cota organization        reports pt-br   Relatório de cotas por Organização 
    3040report maillists organization   reports pt-br   Relatório de lista de emails por Organização 
  • branches/2.2/reports/templates/default/index.tpl

    r3948 r4570  
    1212</style> 
    1313<table width="90%" border="0" cellspacing="10" cellpadding="0" align="center"> 
    14 <!-- TODOS OS USUARIOS DO CONTEXTO 
    15         <tr> 
    16           <td width="1%" align="center"><img src='./templates/default/images/user.png'></td> 
    17           <td> 
    18                  <a href="../index.php?menuaction=reports.uireports.report_users_print">{lang_rel_user_all}</a> 
    19           </td> 
    20         </tr> 
    21 -->      
    2214        <tr> 
    2315          <td width="1%" align="center"><img src='./templates/default/images/user.png'></td> 
    2416          <td> 
    2517                 <a href="../index.php?menuaction=reports.uireports_users.report_users_group">{lang_rel_user_org}</a> 
     18          </td> 
     19        </tr> 
     20        <tr> 
     21          <td width="1%" align="center"><img src='./templates/default/images/institutional_account.png'></td> 
     22          <td> 
     23                 <a href="../index.php?menuaction=reports.uireports_institutionalAccounts.report_institutionalAccounts_group">{lang_rel_institutional_account_org}</a> 
     24          </td> 
     25        </tr> 
     26        <tr> 
     27          <td width="1%" align="center"><img src='./templates/default/images/mail_share.png'></td> 
     28          <td> 
     29                 <a href="../index.php?menuaction=reports.uireports_shareAccounts.report_shareAccounts_group">{lang_rel_share_account_org}</a> 
    2630          </td> 
    2731        </tr> 
Note: See TracChangeset for help on using the changeset viewer.