Changeset 6481


Ignore:
Timestamp:
06/13/12 16:14:48 (12 years ago)
Author:
viani
Message:

Ticket #2851 - Revertido arquivo orgchartPrint que foi comitado por engano no ramo 2.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/workflow/js/userinterface/orgchartPrint.js

    r6477 r6481  
    99                $('tr.employees').hide(); 
    1010} 
    11  
    1211 
    1312/** 
     
    5655} 
    5756 
    58  
    59 /** 
    60 * Show / Hide all photo employees 
    61 */ 
    62 function togglePhotoVisibility() 
    63 { 
    64         $('#employee_table').remove(); 
    65  
    66         if ($('#groupByArea').attr('checked')) 
    67                 showGroupedByArea(); 
    68         else 
    69                 showUngrouped(); 
    70 } 
    71  
    7257/** 
    7358* Centralize the creation of table rows for employees. 
    7459* 'showAreaColumn' specifies whether the second column will be shown 
    7560*/ 
    76 function createEmployeeRow(area_id, user_id, showAreaColumn, showUserPhoto) 
     61function createEmployeeRow(area_id, user_id, showAreaColumn) 
    7762{ 
    7863        /* set a special 'class' if the employee is a supervisor one */ 
     
    8267 
    8368        /* creating the row. */ 
    84         element = $('<tr></tr>'); 
    85  
    86  
    87         /* photo: zero (optional) column */ 
    88         if (showUserPhoto){ 
    89                 var content = '<img src="workflow/showUserPicture.php?userID=' + areas[area_id].employees[user_id].funcionario_id + '"/>'; 
    90                 element.append($('<td>' + content + '</td>').css('width', '8%')); 
    91         } 
    92  
    93         /* name: first column */ 
    94         element.append( 
    95                                 $('<td></td>') 
    96                                         .append( 
    97                                                 $('<span></span>') 
    98                                                         .addClass(class_name) 
    99                                                         .append(areas[area_id].employees[user_id].cn) 
    100                                                 ) 
    101                                                         .css('width', '30%') 
    102                         ); 
     69        element = $('<tr></tr>') 
     70                                /* name: first column */ 
     71                                .append( 
     72                                                $('<td></td>') 
     73                                                        .append( 
     74                                                                $('<span></span>') 
     75                                                                        .addClass(class_name) 
     76                                                                        .append(areas[area_id].employees[user_id].cn) 
     77                                                        ) 
     78                                                        .css('width', '70%') 
     79                                                ); 
    10380 
    10481        /* area: second (optional) column */ 
     
    10683                element.append( 
    10784                                                $('<td>' + areas[area_id].sigla + '</td>') 
    108                                                         .css('width', '10%') 
     85                                                        .css('width', '15%') 
    10986                                        ); 
    11087 
    111         /* login: show uid attribute */ 
    112         element.append( 
    113                                         $('<td>' + areas[area_id].employees[user_id].uid + '</td>') 
    114                                                 .css('width', '15%') 
    115                                         ) 
    116                                          
    117          
    11888        /* telephone: last column */ 
    11989        element.append( 
    12090                                        $('<td>' + areas[area_id].employees[user_id].telephoneNumber + '</td>') 
    121                                                 .css('width', '15%') 
     91                                                .css('width', '20%') 
    12292                                        ) 
    123                                          
    124         /* Vínculo: show cargo vínculo */ 
    125         element.append( 
    126                                         $('<td>' + areas[area_id].employees[user_id].vinculo + '</td>') 
    127                                                 .css('width', '15%') 
    128                                         ) 
    129  
    130         /* Cargo: show cargo attribute */ 
    131         element.append( 
    132                                         $('<td>' + areas[area_id].employees[user_id].cargo + '</td>') 
    133                                                 .css('width', '15%') 
    134                                         ) 
    135  
    13693                                .addClass('employees'); 
    13794 
     
    145102{ 
    146103        var table = $('<table></table>').css('width', '90%').attr('id', 'employee_table'); 
    147         var i, j, photo; 
    148  
    149         if ($('#photoVisibility').attr('checked')) 
    150            photo = true; 
    151         else 
    152            photo = false; 
     104        var i, j; 
    153105 
    154106        /* iterating over areas */ 
     
    159111                                $('<tr></tr>') 
    160112                                .append( 
    161                                         $('<td colspan="2"></td>') 
    162                                                 .css('font-weight', 'bold') 
     113                                        $('<th></th>') 
    163114                                                .css('text-align', 'left') 
    164115                                                .css('height', '30') 
     
    174125                /* creating employee rows */ 
    175126                for (j=0; j < areas[i].employees.length; j++) 
    176                         table.append(createEmployeeRow(i, j, false, photo)); 
     127                        table.append(createEmployeeRow(i, j)); 
    177128        } 
    178129        $('#areas_content').append(table); 
     
    188139{ 
    189140        var table = $('<table></table>').css('width', '90%').attr('id', 'employee_table'); 
    190         var i, less, end, photo; 
    191  
    192         if ($('#photoVisibility').attr('checked')) 
    193            photo = true; 
    194         else 
    195            photo = false; 
     141        var i, less, end; 
    196142 
    197143        /* creating and reseting indexes */ 
     
    226172 
    227173                /* inserting the row */ 
    228                 table.append(createEmployeeRow(less, areas[less].index, true, photo)); 
     174                table.append(createEmployeeRow(less, areas[less].index, true)); 
    229175                areas[less].index++; 
    230176        } 
     
    246192{ 
    247193        $('#employeesVisibility').click(toggleEmployeesVisibility); 
    248         $('#photoVisibility').click(togglePhotoVisibility); 
    249194        $('#groupByArea').click(toggleGroupByArea); 
    250195        $('#highlightSupervisor').click(toggleHighlightSupervisor); 
     
    256201{ 
    257202        toggleGroupByArea(); 
    258         togglePhotoVisibility(); 
    259203        toggleEmployeesVisibility(); 
    260204        toggleHighlightSupervisor(); 
Note: See TracChangeset for help on using the changeset viewer.