Changeset 5739
- Timestamp:
- 03/16/12 10:03:07 (11 years ago)
- Location:
- trunk/workflow
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/workflow/js/userinterface/orgchartPrint.js
r5242 r5739 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', '60%') 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', '55%') 102 ); 80 103 81 104 /* area: second (optional) column */ … … 108 131 { 109 132 var table = $('<table></table>').css('width', '90%').attr('id', 'employee_table'); 110 var i, j; 133 var i, j, photo; 134 135 if ($('#photoVisibility').attr('checked')) 136 photo = true; 137 else 138 photo = false; 111 139 112 140 /* iterating over areas */ … … 117 145 $('<tr></tr>') 118 146 .append( 119 $('<th></th>') 147 $('<td colspan="2"></td>') 148 .css('font-weight', 'bold') 120 149 .css('text-align', 'left') 121 150 .css('height', '30') … … 131 160 /* creating employee rows */ 132 161 for (j=0; j < areas[i].employees.length; j++) 133 table.append(createEmployeeRow(i, j ));162 table.append(createEmployeeRow(i, j, false, photo)); 134 163 } 135 164 $('#areas_content').append(table); … … 145 174 { 146 175 var table = $('<table></table>').css('width', '90%').attr('id', 'employee_table'); 147 var i, less, end; 176 var i, less, end, photo; 177 178 if ($('#photoVisibility').attr('checked')) 179 photo = true; 180 else 181 photo = false; 148 182 149 183 /* creating and reseting indexes */ … … 178 212 179 213 /* inserting the row */ 180 table.append(createEmployeeRow(less, areas[less].index, true ));214 table.append(createEmployeeRow(less, areas[less].index, true, photo)); 181 215 areas[less].index++; 182 216 } … … 198 232 { 199 233 $('#employeesVisibility').click(toggleEmployeesVisibility); 234 $('#photoVisibility').click(togglePhotoVisibility); 200 235 $('#groupByArea').click(toggleGroupByArea); 201 236 $('#highlightSupervisor').click(toggleHighlightSupervisor); … … 207 242 { 208 243 toggleGroupByArea(); 244 togglePhotoVisibility(); 209 245 toggleEmployeesVisibility(); 210 246 toggleHighlightSupervisor(); -
trunk/workflow/templates/default/orgchartPrint.tpl
r3167 r5739 6 6 {$css} 7 7 {$javaScripts} 8 8 9 <div class="invisiblePrint"> 9 10 <h1>Configurar Impressão</h1> 10 11 <label><input type="checkbox" checked id="employeesVisibility" /> Exibir funcionários</label> 12 <br/> 13 <label><input type="checkbox" id="photoVisibility" /> Exibir foto </label> 11 14 <br/> 12 15 <label><input type="checkbox" checked id="groupByArea" /> Agrupar por área</label>
Note: See TracChangeset
for help on using the changeset viewer.