Changeset 1276 for trunk/workflow/inc


Ignore:
Timestamp:
08/05/09 16:53:15 (15 years ago)
Author:
rodsouza
Message:

Ticket #589 - Adicionando paginacao para a listagem alfabetica

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/workflow/inc/class.so_userinterface.inc.php

    r1269 r1276  
    590590 
    591591                $employees = $result -> GetArray( -1 ); 
     592 
    592593                $cachedLDAP = $GLOBALS[ 'workflow' ][ 'factory' ] -> newInstance( 'CachedLDAP' ); 
    593594                $cachedLDAP -> setOperationMode( $cachedLDAP -> OPERATION_MODE_LDAP_DATABASE ); 
     
    612613                        } 
    613614 
    614                         // count the number of employees in each category 
     615                } 
     616 
     617                usort( $employees, create_function( '$a,$b', 'return strcasecmp($a[\'cn\'],$b[\'cn\']);' ) ); 
     618 
     619                $paging = $GLOBALS['workflow']['factory']->newInstance('Paging', 100, $_POST); 
     620                $employees = $paging->restrictItems( $employees ); 
     621 
     622                // count the number of employees in each category 
     623                for ( $i = 0; $i < count( $employees ); $i++ ) 
     624                { 
    615625                        $categoryID = $employees[ $i ][ 'funcionario_categoria_id' ]; 
    616626                        if ( isset( $categoriesCount[ $categoryID ] ) ) 
     
    623633                $availableCategories = $this -> getCategoriesList( $organizationID ); 
    624634                $output = array( ); 
    625                 $output[ 'employees' ] = $employees; 
    626                 $output[ 'categories' ] = array( ); 
     635 
     636                $output['employees'] = $employees; 
     637                $output['categories'] = array( ); 
     638                $output['paging_links'] = $paging -> commonLinks(); 
     639 
    627640                foreach ( $availableCategories as $category ) 
    628641                { 
     
    634647                } 
    635648 
    636                 usort( $output[ 'employees' ], create_function( '$a,$b', 'return strcasecmp($a[\'cn\'],$b[\'cn\']);' ) ); 
    637  
    638649                return $output; 
    639650        } 
Note: See TracChangeset for help on using the changeset viewer.