Index: /trunk/workflow/inc/class.ui_userinterface.inc.php
===================================================================
--- /trunk/workflow/inc/class.ui_userinterface.inc.php	(revision 3167)
+++ /trunk/workflow/inc/class.ui_userinterface.inc.php	(revision 6477)
@@ -170,4 +170,7 @@
 		}
 
+		//Verifica a permissão do usuário
+		$so->_checkAccess($organizationID);
+
 		/* make the array flat (for a simpler handling) */
 		$flatAreas = array();
@@ -184,5 +187,5 @@
 			}
 			unset($currentArea['children']);
-
+			
 			$employees = $so->getAreaEmployees($currentArea['area_id'], $organizationID);
 			if (is_array($employees))
Index: /trunk/workflow/inc/class.so_userinterface.inc.php
===================================================================
--- /trunk/workflow/inc/class.so_userinterface.inc.php	(revision 5242)
+++ /trunk/workflow/inc/class.so_userinterface.inc.php	(revision 6477)
@@ -13,5 +13,28 @@
 	 */
 	var $db;
-
+	/**
+	 * @var bool True se o usuário for administrador do expresso.
+	 * @access private
+	 */
+	private $isAdmin;
+
+	/**
+	 * @var int ID do usuário logado no Expresso
+	 * @access private
+	 */
+	private $userID;
+
+	/**
+	 * @var object Link para a ACL do Workflow.
+	 * @access private
+	 */
+	private $acl;
+	
+	/**
+	 * @var bool indicando se o usuário possui ou não acesso aos dados restritos.
+	 * @access private
+	 */
+	private	$authorized;
+	
 	/**
 	 * Constructor
@@ -21,4 +44,8 @@
 	function so_userinterface()
 	{
+		$this->authorized= false;
+		$this->userID = $_SESSION['phpgw_info']['workflow']['account_id'];
+		$this->isAdmin = $_SESSION['phpgw_info']['workflow']['user_is_admin'];
+		$this->acl = Factory::getInstance('workflow_acl');
 		$this->db =& Factory::getInstance('WorkflowObjects')->getDBWorkflow()->Link_ID;
 		$this->db->SetFetchMode(ADODB_FETCH_ASSOC);
@@ -218,4 +245,23 @@
 
 		return $output;
+	}	
+
+	/**
+	 * Checa se o usuário possui permissão para visualizar informações restritas.
+	 * @param int $organizationID O ID da organização do Orgranograma.
+	 * @return void
+	 * @access public
+	 */
+	public function _checkAccess($organizationID = null)
+	{
+		/* the user is an administrator */
+		if ($this->isAdmin)
+			$this->$authorized=true;
+
+		if (!is_numeric($organizationID))
+			$this->authorized = false;
+		else
+			$this->authorized = $this->acl->checkUserAccessToResource('ORG', $this->userID, (int) $organizationID, 1);
+		
 	}
 
@@ -232,4 +278,7 @@
 		$areaID = (int) $areaID;
 
+		require_once dirname(__FILE__) . '/local/classes/class.wf_orgchart.php';
+		$orgchart = new wf_orgchart();
+		
 		/* gather some info from the area */
 		$areaInfo = $this->db->query('SELECT COALESCE(a.titular_funcionario_id, -1) AS titular_funcionario_id, COALESCE(s.funcionario_id, -1) AS substituto_funcionario_id FROM area a LEFT OUTER JOIN substituicao s ON ((a.area_id = s.area_id) AND (CURRENT_DATE BETWEEN s.data_inicio AND s.data_fim)) WHERE (a.organizacao_id = ?) AND (a.area_id = ?)', array($organizationID, $areaID))->GetArray(-1);
@@ -252,5 +301,5 @@
 			for ($j = 0; $j < $result->_numOfFields; $j++)
 				unset($employees[$i][$j]);
-
+			
 			$employees[$i]['cn'] = '';
 			$employees[$i]['telephoneNumber'] = '';
@@ -268,4 +317,25 @@
 				$employees[$i]['removed'] = is_null($entry['last_update']);
 			}
+			
+			/*busca o cargo do funcionario*/
+			$employeeInfo = $orgchart->getEmployee($employees[$i]['funcionario_id']);
+
+			$cargo = '';
+
+			if ($this->authorized && !empty($employeeInfo['cargo_id']))
+			{
+				$jobTitleInfo = $orgchart->getJobTitle($employeeInfo['cargo_id']);
+				$cargo = $jobTitleInfo['descricao'];
+			}
+			$employees[$i]['cargo'] = utf8_encode($cargo);	
+			
+			/*busca o vínculo do funcionario*/
+			$vinculo = '';
+			if ($this->authorized && !empty($employeeInfo['funcionario_categoria_id']))
+			{
+				$categoryInfo = $orgchart->getEmployeeCategory($employeeInfo['funcionario_categoria_id']);
+				$vinculo=$categoryInfo['descricao'];
+			}			
+			$employees[$i]['vinculo'] = utf8_encode($vinculo);
 
 			/* count the number of employees in each category */
@@ -274,5 +344,5 @@
 				$categoriesCount[$categoryID]++;
 			else
-				$categoriesCount[$categoryID] = 1;
+				$categoriesCount[$categoryID] = 1;					
 		}
 		$usedCategories = array_keys($categoriesCount);
Index: /trunk/workflow/js/adminaccess/main.js
===================================================================
--- /trunk/workflow/js/adminaccess/main.js	(revision 3255)
+++ /trunk/workflow/js/adminaccess/main.js	(revision 6477)
@@ -34,5 +34,5 @@
 permissionListORG[0]['name'] = "Administrar Organograma";
 permissionListORG[0]['value'] = 0;
-permissionListORG[1]['name'] = "Visualizar Telefones Pessoais";
+permissionListORG[1]['name'] = "Visualizar Informações Restritas";
 permissionListORG[1]['value'] = 1;
 
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 = $('<tr></tr>')
-				/* name: first column */
-				.append(
-						$('<td></td>')
-							.append(
-								$('<span></span>')
-									.addClass(class_name)
-									.append(areas[area_id].employees[user_id].cn)
-							)
-							.css('width', '70%')
-						);
+	element = $('<tr></tr>');
+
+
+	/* photo: zero (optional) column */
+	if (showUserPhoto){
+		var content = '<img src="workflow/showUserPicture.php?userID=' + areas[area_id].employees[user_id].funcionario_id + '"/>';
+		element.append($('<td>' + content + '</td>').css('width', '8%'));
+	}
+
+	/* name: first column */
+	element.append(
+				$('<td></td>')
+					.append(
+						$('<span></span>')
+							.addClass(class_name)
+							.append(areas[area_id].employees[user_id].cn)
+						)
+							.css('width', '30%')
+			);
 
 	/* area: second (optional) column */
@@ -83,12 +106,32 @@
 		element.append(
 						$('<td>' + areas[area_id].sigla + '</td>')
-							.css('width', '15%')
+							.css('width', '10%')
 					);
 
+	/* login: show uid attribute */
+	element.append(
+					$('<td>' + areas[area_id].employees[user_id].uid + '</td>')
+						.css('width', '15%')
+					)
+					
+	
 	/* telephone: last column */
 	element.append(
 					$('<td>' + areas[area_id].employees[user_id].telephoneNumber + '</td>')
-						.css('width', '20%')
-					)
+						.css('width', '15%')
+					)
+					
+	/* VÃ­nculo: show cargo vÃ­nculo */
+	element.append(
+					$('<td>' + areas[area_id].employees[user_id].vinculo + '</td>')
+						.css('width', '15%')
+					)
+
+	/* Cargo: show cargo attribute */
+	element.append(
+					$('<td>' + areas[area_id].employees[user_id].cargo + '</td>')
+						.css('width', '15%')
+					)
+
 				.addClass('employees');
 
@@ -102,5 +145,10 @@
 {
 	var table = $('<table></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 @@
 				$('<tr></tr>')
 				.append(
-					$('<th></th>')
+					$('<td colspan="2"></td>')
+						.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 = $('<table></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();
