Changeset 2372 for sandbox/workflow/trunk/inc/class.so_orgchart.inc.php
- Timestamp:
- 03/29/10 14:46:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/workflow/trunk/inc/class.so_orgchart.inc.php
r2063 r2372 127 127 $this->isAdmin = $_SESSION['phpgw_info']['workflow']['user_is_admin']; 128 128 $this->acl = &$GLOBALS['ajax']->acl; 129 $this->db = & $GLOBALS['workflow']['workflowObjects']->getDBWorkflow()->Link_ID;130 $this->db = & $GLOBALS['workflow']['workflowObjects']->getDBWorkflow()->Link_ID;129 $this->db = &Factory::getInstance('WorkflowObjects')->getDBWorkflow()->Link_ID; 130 $this->db = &Factory::getInstance('WorkflowObjects')->getDBWorkflow()->Link_ID; 131 131 $this->db->SetFetchMode(ADODB_FETCH_ASSOC); 132 132 } … … 711 711 712 712 $output = $result->GetArray(-1); 713 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP');713 $cachedLDAP = Factory::newInstance('CachedLDAP'); 714 714 $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP_DATABASE); 715 715 for ($i = 0; $i < count($output); $i++) … … 765 765 766 766 /* search for the $searchTerm in the LDAP */ 767 $ldap = & $GLOBALS['workflow']['workflowObjects']->getLDAP();768 $list = @ldap_search($ldap, $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getLDAPContext(), $ldapSearch, array('uidnumber', 'cn', 'uid'));767 $ldap = &Factory::getInstance('WorkflowObjects')->getLDAP(); 768 $list = @ldap_search($ldap, Factory::getInstance('WorkflowLDAP')->getLDAPContext(), $ldapSearch, array('uidnumber', 'cn', 'uid')); 769 769 if ($list === false) 770 770 die(serialize("O sistema de busca não pode ser utilizado nesta organização.")); … … 774 774 775 775 /* search for the $searchTerm in the DB */ 776 $resultSet = $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID->query($DBSearch, $DBValues)->GetArray(-1);776 $resultSet = Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID->query($DBSearch, $DBValues)->GetArray(-1); 777 777 foreach ($resultSet as $row) 778 778 if (!isset($unifiedResult[$row['uidnumber']])) … … 823 823 { 824 824 $errors = array( 825 "O funcionário \"" . $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($employeeID) . "\" já pertença à área \"{$row['sigla']}\".",825 "O funcionário \"" . Factory::getInstance('WorkflowLDAP')->getName($employeeID) . "\" já pertença à área \"{$row['sigla']}\".", 826 826 '-----------------', 827 827 'Caso você queira colocá-lo na área selecionada, siga o procedimento: faça uma busca por seu nome, clique para editá-lo e, troque pela área desejada.' … … 881 881 { 882 882 $errors = array( 883 "O funcionário \"" . $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($employeeID) . "\" é titular, substituto, já participou de substituição ou é auxiliar administrativo das seguintes áreas: " . implode(", ", $areas),883 "O funcionário \"" . Factory::getInstance('WorkflowLDAP')->getName($employeeID) . "\" é titular, substituto, já participou de substituição ou é auxiliar administrativo das seguintes áreas: " . implode(", ", $areas), 884 884 '-----------------', 885 885 'Se você quiser excluir este funcionário, precisa removê-lo dos "cargos" que ele possui nas áreas citadas.' … … 919 919 $this->_checkError($result); 920 920 921 $ldap = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');921 $ldap = &Factory::getInstance('WorkflowLDAP'); 922 922 while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) 923 923 { … … 999 999 $query = 'SELECT 1 FROM funcionario WHERE (funcionario_id = ?)'; 1000 1000 if (!$this->db->query($query, $checkEmployee)->fetchRow()) 1001 $errors[] = "O funcionário \"" . $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($checkEmployee) . "\" não está vinculado a uma área.";1001 $errors[] = "O funcionário \"" . Factory::getInstance('WorkflowLDAP')->getName($checkEmployee) . "\" não está vinculado a uma área."; 1002 1002 } 1003 1003 … … 1044 1044 $query = 'SELECT 1 FROM funcionario WHERE (funcionario_id = ?)'; 1045 1045 if (!$this->db->query($query, $checkEmployee)->fetchRow()) 1046 $errors[] = "O funcionário \"" . $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($checkEmployee) . "\" não está vinculado a uma área.";1046 $errors[] = "O funcionário \"" . Factory::getInstance('WorkflowLDAP')->getName($checkEmployee) . "\" não está vinculado a uma área."; 1047 1047 } 1048 1048 … … 1091 1091 $this->_checkAccess($organizationID, false, true); 1092 1092 1093 /** 1094 * This is so wrong.. We should always use the factory to 1095 * instantiate stuff. Besides, module class should not 1096 * use process classes; the correct is to do the inverse. 1097 */ 1093 1098 require_once dirname(__FILE__) . '/local/classes/class.wf_orgchart.php'; 1094 1099 $orgchart = new wf_orgchart(); … … 1096 1101 $outputInfo = array(); 1097 1102 1098 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP');1103 $cachedLDAP = Factory::newInstance('CachedLDAP'); 1099 1104 1100 1105 /* here we need fresh information. Let's access ldap first */ … … 1262 1267 ); 1263 1268 1264 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP');1269 $cachedLDAP = Factory::newInstance('CachedLDAP'); 1265 1270 $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP_DATABASE); 1266 1271 if (!empty($areaInfo['titular_funcionario_id'])) … … 1512 1517 1513 1518 /* we must query ldap to get full user names. In workflow db we just store uids */ 1514 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP'); 1515 1516 $cachedLDAP->getEntryByID(); 1519 $cachedLDAP = Factory::getInstance('CachedLDAP'); 1517 1520 1518 1521 $output = $result->GetArray(-1);
Note: See TracChangeset
for help on using the changeset viewer.