Ignore:
Timestamp:
08/03/09 09:52:13 (15 years ago)
Author:
rodsouza
Message:

Ticket #589 - itens (doc. anexo ao ticket) 1, 2, 3, 4 e 5 integralmente e item 6 parcialmente.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/workflow/js/userinterface/orgchart.js

    r795 r1245  
    3434 
    3535        var content = '<ul class="horizontalMenu">'; 
     36        content += '<li style="margin: 5px 5px 0 5px">Visualizar : <select>' 
     37        content += '<option>-- Selecione uma opção de visualização --</option>' 
     38        content += '<option onclick="">Alfabética</option>' 
     39        content += '<option onclick="getHierarchicalArea( );">Áreas</option>' 
     40        content += '<option onclick="">Lotação</option>' 
     41        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        content += '<option onclick="">Vínculos</option>' 
     45        content += '</select></li>'; 
    3646        content += '<li><a href="#" onclick="window.open(\'' + enderecoImagem + '\', \'extwindow\'); return false;"><img src="templateFile.php?file=images/Process.gif">&nbsp;&nbsp;Gráfico</a></li>'; 
    37         content += '<li><a href="#" onclick="getCostCenters(); return false;"><img src="templateFile.php?file=images/coins.png">&nbsp;Centros de Custo</a></li>'; 
    38         content += '<li><a href="#" onclick="getHierarchicalArea(); return false;"><img src="templateFile.php?file=images/orgchart_tree.png">Lista Hierárquica</a></li>'; 
    39         content += '<li><a href="#" onclick="getAreaList(); return false;"><img src="templateFile.php?file=images/orgchart_list.png">&nbsp;&nbsp;Lista Alfabética</a></li>'; 
    40         content += '<li><a href="#" onclick="getCategoriesList(); return false;"><img src="templateFile.php?file=images/folder_green.png">&nbsp;&nbsp;Listar Vínculos</a></li>'; 
     47        //content += '<li><a href="#" onclick="getCostCenters(); return false;"><img src="templateFile.php?file=images/coins.png">&nbsp;Centros de Custo</a></li>'; 
     48        //content += '<li><a href="#" onclick="getHierarchicalArea(); return false;"><img src="templateFile.php?file=images/orgchart_tree.png">Lista Hierárquica</a></li>'; 
     49        //content += '<li><a href="#" onclick="getAreaList(); return false;"><img src="templateFile.php?file=images/orgchart_list.png">&nbsp;&nbsp;Lista Alfabética</a></li>'; 
     50        //content += '<li><a href="#" onclick="getCategoriesList(); return false;"><img src="templateFile.php?file=images/folder_green.png">&nbsp;&nbsp;Listar Vínculos</a></li>'; 
    4151        content += '<li><a href="#" onclick="printArea(); return false;"><img src="templateFile.php?file=images/imprimir.png" width="16">&nbsp;&nbsp;Imprimir</a></li>'; 
    4252        content += '<li><a><input type="text" name="search_term" id="search_term" onkeypress="if (((event.which) ? event.which : event.keyCode) == 13) $(\'search_span\').onclick(); return true;" /><span id="search_span" style="cursor: pointer;" onclick="tmp = $$(\'div#orgchartAreas a.destaque\'); if (tmp[0]) tmp[0].removeClassName(\'destaque\'); orgchartSearchEmployee($F(\'search_term\')); return false;">&nbsp;busca</span></a></li>'; 
     
    115125} 
    116126 
     127function displayUsefulPhones( data ) 
     128{ 
     129        if ( _checkError( data ) ) 
     130                return; 
     131 
     132        var div = $('orgchartEmployees'); 
     133        if (data.length == 0) 
     134        { 
     135                div.innerHTML = '<br/><br/><center><strong>Nenhum registro encontrado</strong></center>'; 
     136                return; 
     137        } 
     138 
     139        var content = '<center><h3>TELEFONES ÚTEIS</strong></h3>'; 
     140        content += '<table class="employeeList">'; 
     141        content += '<tr><th>Localidade</th><th>Número</th></tr>'; 
     142        var current; 
     143        var usefulPhoneCount = data.length; 
     144        for (var i = 0; i < usefulPhoneCount; i++) 
     145        { 
     146                current = data[i]; 
     147                content += '<tr class="linha'+ i%2 + '">'; 
     148                content += '<td>' + current[ 'descricao' ] + '</td>'; 
     149                content += '<td>' + current[ 'numero' ] + '</td>'; 
     150                content += '</tr>'; 
     151        } 
     152        content += '</table>'; 
     153        div.innerHTML = content; 
     154} 
     155 
     156function displayAreaWithSubtituteBoss( data ) 
     157{ 
     158        if ( _checkError( data ) ) 
     159                return; 
     160 
     161        var div = $('orgchartEmployees'); 
     162        if (data.length == 0) 
     163        { 
     164                div.innerHTML = '<br/><br/><center><strong>Nenhum registro encontrado</strong></center>'; 
     165                return; 
     166        } 
     167 
     168        var content = '<center><h3>Áreas com Substituição de Chefia</strong></h3>'; 
     169        content += '<table class="employeeList">'; 
     170        content += '<tr><th>Área</th><th>Titular</th><th>Substituto</th></tr>'; 
     171        var current; 
     172        var usefulPhoneCount = data.length; 
     173        for (var i = 0; i < usefulPhoneCount; i++) 
     174        { 
     175                current = data[i]; 
     176                content += '<tr class="linha'+ i%2 + '">'; 
     177                content += '<td>' + current['area'] + '</td>'; 
     178                content += '<td>' + current['titular'] + '</td>'; 
     179                content += '<td>' + current['substituto'] + '</td>'; 
     180                content += '</tr>'; 
     181        } 
     182        content += '</table>'; 
     183        div.innerHTML = content; 
     184} 
     185 
    117186function displayHierarchicalAreas(data) 
    118187{ 
     
    133202        div.innerHTML = "<center><strong>ÁREAS</strong></center>"; 
    134203        recursivePrint(data); 
     204} 
     205 
     206function getUsefulPhones( ) 
     207{ 
     208        cExecute("$this.bo_userinterface.getUsefulPhones", displayUsefulPhones, ""); 
     209} 
     210 
     211function getAreaWithSubtituteBoss( ) 
     212{ 
     213        cExecute("$this.bo_userinterface.getAreaWithSubtituteBoss", displayAreaWithSubtituteBoss, ""); 
    135214} 
    136215 
Note: See TracChangeset for help on using the changeset viewer.