Index: branches/2.2/workflow/js/userinterface/orgchartPrint.js
===================================================================
--- branches/2.2/workflow/js/userinterface/orgchartPrint.js (revision 3167)
+++ branches/2.2/workflow/js/userinterface/orgchartPrint.js (revision 6477)
@@ -9,4 +9,5 @@
$('tr.employees').hide();
}
+
/**
@@ -55,9 +56,23 @@
}
+
+/**
+* Show / Hide all photo employees
+*/
+function togglePhotoVisibility()
+{
+ $('#employee_table').remove();
+
+ if ($('#groupByArea').attr('checked'))
+ showGroupedByArea();
+ else
+ showUngrouped();
+}
+
/**
* Centralize the creation of table rows for employees.
* 'showAreaColumn' specifies whether the second column will be shown
*/
-function createEmployeeRow(area_id, user_id, showAreaColumn)
+function createEmployeeRow(area_id, user_id, showAreaColumn, showUserPhoto)
{
/* set a special 'class' if the employee is a supervisor one */
@@ -67,15 +82,23 @@
/* creating the row. */
- element = $('
')
- /* name: first column */
- .append(
- $(' | ')
- .append(
- $('')
- .addClass(class_name)
- .append(areas[area_id].employees[user_id].cn)
- )
- .css('width', '70%')
- );
+ element = $('
');
+
+
+ /* photo: zero (optional) column */
+ if (showUserPhoto){
+ var content = '';
+ element.append($('' + content + ' | ').css('width', '8%'));
+ }
+
+ /* name: first column */
+ element.append(
+ $(' | ')
+ .append(
+ $('')
+ .addClass(class_name)
+ .append(areas[area_id].employees[user_id].cn)
+ )
+ .css('width', '30%')
+ );
/* area: second (optional) column */
@@ -83,12 +106,32 @@
element.append(
$('' + areas[area_id].sigla + ' | ')
- .css('width', '15%')
+ .css('width', '10%')
);
+ /* login: show uid attribute */
+ element.append(
+ $('' + areas[area_id].employees[user_id].uid + ' | ')
+ .css('width', '15%')
+ )
+
+
/* telephone: last column */
element.append(
$('' + areas[area_id].employees[user_id].telephoneNumber + ' | ')
- .css('width', '20%')
- )
+ .css('width', '15%')
+ )
+
+ /* VÃnculo: show cargo vÃnculo */
+ element.append(
+ $('' + areas[area_id].employees[user_id].vinculo + ' | ')
+ .css('width', '15%')
+ )
+
+ /* Cargo: show cargo attribute */
+ element.append(
+ $('' + areas[area_id].employees[user_id].cargo + ' | ')
+ .css('width', '15%')
+ )
+
.addClass('employees');
@@ -102,5 +145,10 @@
{
var table = $('').css('width', '90%').attr('id', 'employee_table');
- var i, j;
+ var i, j, photo;
+
+ if ($('#photoVisibility').attr('checked'))
+ photo = true;
+ else
+ photo = false;
/* iterating over areas */
@@ -111,5 +159,6 @@
$('
')
.append(
- $(' | ')
+ $(' | ')
+ .css('font-weight', 'bold')
.css('text-align', 'left')
.css('height', '30')
@@ -125,5 +174,5 @@
/* creating employee rows */
for (j=0; j < areas[i].employees.length; j++)
- table.append(createEmployeeRow(i, j));
+ table.append(createEmployeeRow(i, j, false, photo));
}
$('#areas_content').append(table);
@@ -139,5 +188,10 @@
{
var table = $('').css('width', '90%').attr('id', 'employee_table');
- var i, less, end;
+ var i, less, end, photo;
+
+ if ($('#photoVisibility').attr('checked'))
+ photo = true;
+ else
+ photo = false;
/* creating and reseting indexes */
@@ -172,5 +226,5 @@
/* inserting the row */
- table.append(createEmployeeRow(less, areas[less].index, true));
+ table.append(createEmployeeRow(less, areas[less].index, true, photo));
areas[less].index++;
}
@@ -192,4 +246,5 @@
{
$('#employeesVisibility').click(toggleEmployeesVisibility);
+ $('#photoVisibility').click(togglePhotoVisibility);
$('#groupByArea').click(toggleGroupByArea);
$('#highlightSupervisor').click(toggleHighlightSupervisor);
@@ -201,4 +256,5 @@
{
toggleGroupByArea();
+ togglePhotoVisibility();
toggleEmployeesVisibility();
toggleHighlightSupervisor();