Changeset 6503
- Timestamp:
- 06/14/12 18:07:50 (11 years ago)
- Location:
- branches/2.4/workflow
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.4/workflow/inc/class.so_userinterface.inc.php
r5242 r6503 13 13 */ 14 14 var $db; 15 15 /** 16 * @var bool True se o usuário for administrador do expresso. 17 * @access private 18 */ 19 private $isAdmin; 20 21 /** 22 * @var int ID do usuário logado no Expresso 23 * @access private 24 */ 25 private $userID; 26 27 /** 28 * @var object Link para a ACL do Workflow. 29 * @access private 30 */ 31 private $acl; 32 33 /** 34 * @var bool indicando se o usuário possui ou não acesso aos dados restritos. 35 * @access private 36 */ 37 private $authorized; 38 16 39 /** 17 40 * Constructor … … 21 44 function so_userinterface() 22 45 { 46 $this->authorized= false; 47 $this->userID = $_SESSION['phpgw_info']['workflow']['account_id']; 48 $this->isAdmin = $_SESSION['phpgw_info']['workflow']['user_is_admin']; 49 $this->acl = Factory::getInstance('workflow_acl'); 23 50 $this->db =& Factory::getInstance('WorkflowObjects')->getDBWorkflow()->Link_ID; 24 51 $this->db->SetFetchMode(ADODB_FETCH_ASSOC); … … 218 245 219 246 return $output; 247 } 248 249 /** 250 * Checa se o usuário possui permissão para visualizar informações restritas. 251 * @param int $organizationID O ID da organização do Orgranograma. 252 * @return void 253 * @access public 254 */ 255 public function _checkAccess($organizationID = null) 256 { 257 /* the user is an administrator */ 258 if ($this->isAdmin) 259 $this->authorized=true; 260 261 if (!is_numeric($organizationID)) 262 $this->authorized = false; 263 else 264 $this->authorized = $this->acl->checkUserAccessToResource('ORG', $this->userID, (int) $organizationID, 1); 265 220 266 } 221 267 … … 232 278 $areaID = (int) $areaID; 233 279 280 require_once dirname(__FILE__) . '/local/classes/class.wf_orgchart.php'; 281 $orgchart = new wf_orgchart(); 282 234 283 /* gather some info from the area */ 235 284 $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 301 for ($j = 0; $j < $result->_numOfFields; $j++) 253 302 unset($employees[$i][$j]); 254 303 255 304 $employees[$i]['cn'] = ''; 256 305 $employees[$i]['telephoneNumber'] = ''; … … 268 317 $employees[$i]['removed'] = is_null($entry['last_update']); 269 318 } 319 320 /*busca o cargo do funcionario*/ 321 $employeeInfo = $orgchart->getEmployee($employees[$i]['funcionario_id']); 322 323 $cargo = ''; 324 325 if ($this->authorized && !empty($employeeInfo['cargo_id'])) 326 { 327 $jobTitleInfo = $orgchart->getJobTitle($employeeInfo['cargo_id']); 328 $cargo = $jobTitleInfo['descricao']; 329 } 330 $employees[$i]['cargo'] = utf8_encode($cargo); 331 332 /*busca o vÃnculo do funcionario*/ 333 $vinculo = ''; 334 if ($this->authorized && !empty($employeeInfo['funcionario_categoria_id'])) 335 { 336 $categoryInfo = $orgchart->getEmployeeCategory($employeeInfo['funcionario_categoria_id']); 337 $vinculo=$categoryInfo['descricao']; 338 } 339 $employees[$i]['vinculo'] = utf8_encode($vinculo); 270 340 271 341 /* count the number of employees in each category */ … … 274 344 $categoriesCount[$categoryID]++; 275 345 else 276 $categoriesCount[$categoryID] = 1; 346 $categoriesCount[$categoryID] = 1; 277 347 } 278 348 $usedCategories = array_keys($categoriesCount); -
branches/2.4/workflow/inc/class.ui_userinterface.inc.php
r3167 r6503 170 170 } 171 171 172 //Verifica a permissão do usuário 173 $so->_checkAccess($organizationID); 174 172 175 /* make the array flat (for a simpler handling) */ 173 176 $flatAreas = array(); … … 184 187 } 185 188 unset($currentArea['children']); 186 189 187 190 $employees = $so->getAreaEmployees($currentArea['area_id'], $organizationID); 188 191 if (is_array($employees)) -
branches/2.4/workflow/js/adminaccess/main.js
r3255 r6503 34 34 permissionListORG[0]['name'] = "Administrar Organograma"; 35 35 permissionListORG[0]['value'] = 0; 36 permissionListORG[1]['name'] = "Visualizar Telefones Pessoais";36 permissionListORG[1]['name'] = "Visualizar Informações Restritas"; 37 37 permissionListORG[1]['value'] = 1; 38 38 -
branches/2.4/workflow/js/userinterface/orgchartPrint.js
r5739 r6503 99 99 .append(areas[area_id].employees[user_id].cn) 100 100 ) 101 .css('width', ' 55%')101 .css('width', '30%') 102 102 ); 103 103 … … 106 106 element.append( 107 107 $('<td>' + areas[area_id].sigla + '</td>') 108 .css('width', '1 5%')108 .css('width', '10%') 109 109 ); 110 110 … … 112 112 element.append( 113 113 $('<td>' + areas[area_id].employees[user_id].uid + '</td>') 114 .css('width', '10%') 115 ) 114 .css('width', '15%') 115 ) 116 116 117 117 118 /* telephone: last column */ 118 119 element.append( 119 120 $('<td>' + areas[area_id].employees[user_id].telephoneNumber + '</td>') 120 .css('width', '20%') 121 ) 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 122 136 .addClass('employees'); 123 137
Note: See TracChangeset
for help on using the changeset viewer.