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