Changeset 1276
- Timestamp:
- 08/05/09 16:53:15 (15 years ago)
- Location:
- trunk/workflow
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/workflow/inc/class.so_userinterface.inc.php
r1269 r1276 590 590 591 591 $employees = $result -> GetArray( -1 ); 592 592 593 $cachedLDAP = $GLOBALS[ 'workflow' ][ 'factory' ] -> newInstance( 'CachedLDAP' ); 593 594 $cachedLDAP -> setOperationMode( $cachedLDAP -> OPERATION_MODE_LDAP_DATABASE ); … … 612 613 } 613 614 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 { 615 625 $categoryID = $employees[ $i ][ 'funcionario_categoria_id' ]; 616 626 if ( isset( $categoriesCount[ $categoryID ] ) ) … … 623 633 $availableCategories = $this -> getCategoriesList( $organizationID ); 624 634 $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 627 640 foreach ( $availableCategories as $category ) 628 641 { … … 634 647 } 635 648 636 usort( $output[ 'employees' ], create_function( '$a,$b', 'return strcasecmp($a[\'cn\'],$b[\'cn\']);' ) );637 638 649 return $output; 639 650 } -
trunk/workflow/js/userinterface/orgchart.js
r1269 r1276 35 35 var content = '<ul class="horizontalMenu">'; 36 36 content += '<li style="margin: 5px 5px 0 5px">Visualizar : <select>' 37 content += '<option>-- Selecione uma opção de visualização --</option>'38 37 content += '<option onclick="getAlphabeticalEmployees( )">Alfabética</option>' 39 content += '<option onclick="getHierarchicalArea( );">Áreas</option>' 38 content += '<option onclick="getHierarchicalArea( );" selected="true">Áreas</option>' 39 content += '<option onclick="getCostCenters( );">Centros de Custo</option>' 40 40 content += '<option onclick="getManning( )">Lotação</option>' 41 content += '<option onclick="getAreaWithSubtituteBoss( )">Substituição de Chefia</option>' 41 42 content += '<option onclick="getUsefulPhones( );">Telefones Úteis</option>' 42 content += '<option onclick="getAreaWithSubtituteBoss( )">Substituição de Chefia</option>'43 content += '<option onclick="getCostCenters( );">Centros de Custo</option>'44 43 content += '<option onclick="getCategoriesList( )">Vínculos</option>' 45 44 content += '</select></li>'; … … 133 132 } 134 133 135 var content = ' <center><h3>TELEFONES ÚTEIS</strong></h3>';134 var content = ''; 136 135 content += '<table class="employeeList">'; 137 136 content += '<tr><th>Localidade</th><th>Número</th></tr>'; … … 162 161 } 163 162 164 var content = ' <center><h3>Áreas com Substituição de Chefia</strong></h3>';163 var content = ''; 165 164 content += '<table class="employeeList">'; 166 165 content += '<tr><th>Área</th><th>Titular</th><th>Substituto</th></tr>'; … … 251 250 var content = '<center><strong>Lotalidades</strong></center>'; 252 251 for ( var i = 0; i < data.length; i++ ) 253 content += '<br/>' + ' <a href="javascript:void(0)" id="localidade_' + data[i]['localidade_id'] + '" onclick="tmp = $$(\'div#orgchartAreas a.destaque\'); if (tmp[0]) tmp[0].removeClassName(\'destaque\'); this.addClassName(\'destaque\');loadManningEmployees(' + data[i]['localidade_id'] + ')">' + data[i]['descricao'] + '</a>';252 content += '<br/>' + ' <a href="javascript:void(0)" id="localidade_' + data[i]['localidade_id'] + '" onclick="tmp = $$(\'div#orgchartAreas a.destaque\'); if (tmp[0]) tmp[0].removeClassName(\'destaque\'); this.addClassName(\'destaque\');loadManningEmployees(' + data[i]['localidade_id'] + ')">' + data[i]['descricao'] + '</a>'; 254 253 255 254 content += '<br/><br/>'; … … 373 372 { 374 373 workflowUserInterfaceCurrentAreaID = 0; 375 cExecute('$this.bo_userinterface.getAlphabeticalEmployees', printEmployeesHandler); 374 375 var div = $('orgchartEmployees'); 376 div.innerHTML = ''; 377 378 var p_page = 0; 379 if ( arguments.length ) 380 { 381 p_page = parseInt(arguments[ 0 ]); 382 if ( isNaN( p_page ) ) 383 p_page = 0; 384 } 385 cExecute('$this.bo_userinterface.getAlphabeticalEmployees', function( data ) 386 { 387 var pagingData = data['paging_links']; 388 var output = ''; 389 if (pagingData) 390 { 391 var pagingSize = pagingData.length; 392 for (var i = 0; i < pagingSize; i++) 393 { 394 if (pagingData[i].do_link == true) 395 output += '<a style="font-size: medium" href="#" onclick="getAlphabeticalEmployees(' + pagingData[i].p_page + ');">' + pagingData[i].name + '</a> '; 396 else 397 output += '<strong style="font-size: large">' + pagingData[i].name + '</strong> '; 398 } 399 } 400 401 printEmployeesHandler( data ); 402 403 div.innerHTML += '<br /><center>' + output + '</center>'; 404 }, 'p_page='+p_page); 376 405 } 377 406
Note: See TracChangeset
for help on using the changeset viewer.