Changeset 6481
- Timestamp:
- 06/13/12 16:14:48 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/workflow/js/userinterface/orgchartPrint.js
r6477 r6481 9 9 $('tr.employees').hide(); 10 10 } 11 12 11 13 12 /** … … 56 55 } 57 56 58 59 /**60 * Show / Hide all photo employees61 */62 function togglePhotoVisibility()63 {64 $('#employee_table').remove();65 66 if ($('#groupByArea').attr('checked'))67 showGroupedByArea();68 else69 showUngrouped();70 }71 72 57 /** 73 58 * Centralize the creation of table rows for employees. 74 59 * 'showAreaColumn' specifies whether the second column will be shown 75 60 */ 76 function createEmployeeRow(area_id, user_id, showAreaColumn , showUserPhoto)61 function createEmployeeRow(area_id, user_id, showAreaColumn) 77 62 { 78 63 /* set a special 'class' if the employee is a supervisor one */ … … 82 67 83 68 /* 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 ); 103 80 104 81 /* area: second (optional) column */ … … 106 83 element.append( 107 84 $('<td>' + areas[area_id].sigla + '</td>') 108 .css('width', '1 0%')85 .css('width', '15%') 109 86 ); 110 87 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 118 88 /* telephone: last column */ 119 89 element.append( 120 90 $('<td>' + areas[area_id].employees[user_id].telephoneNumber + '</td>') 121 .css('width', ' 15%')91 .css('width', '20%') 122 92 ) 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 136 93 .addClass('employees'); 137 94 … … 145 102 { 146 103 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; 153 105 154 106 /* iterating over areas */ … … 159 111 $('<tr></tr>') 160 112 .append( 161 $('<td colspan="2"></td>') 162 .css('font-weight', 'bold') 113 $('<th></th>') 163 114 .css('text-align', 'left') 164 115 .css('height', '30') … … 174 125 /* creating employee rows */ 175 126 for (j=0; j < areas[i].employees.length; j++) 176 table.append(createEmployeeRow(i, j , false, photo));127 table.append(createEmployeeRow(i, j)); 177 128 } 178 129 $('#areas_content').append(table); … … 188 139 { 189 140 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; 196 142 197 143 /* creating and reseting indexes */ … … 226 172 227 173 /* inserting the row */ 228 table.append(createEmployeeRow(less, areas[less].index, true , photo));174 table.append(createEmployeeRow(less, areas[less].index, true)); 229 175 areas[less].index++; 230 176 } … … 246 192 { 247 193 $('#employeesVisibility').click(toggleEmployeesVisibility); 248 $('#photoVisibility').click(togglePhotoVisibility);249 194 $('#groupByArea').click(toggleGroupByArea); 250 195 $('#highlightSupervisor').click(toggleHighlightSupervisor); … … 256 201 { 257 202 toggleGroupByArea(); 258 togglePhotoVisibility();259 203 toggleEmployeesVisibility(); 260 204 toggleHighlightSupervisor();
Note: See TracChangeset
for help on using the changeset viewer.