- Timestamp:
- 03/12/10 10:59:32 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/workflow/branches/609/inc/class.bo_monitors.inc.php
r795 r2233 134 134 { 135 135 parent::bo_ajaxinterface(); 136 $GLOBALS['ajax']->gui = new GUI( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);136 $GLOBALS['ajax']->gui = new GUI(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 137 137 $this->userID = $_SESSION['phpgw_info']['workflow']['account_id']; 138 138 $this->isWorkflowAdmin = $GLOBALS['ajax']->acl->checkWorkflowAdmin($this->userID); 139 $this->processManager = new ProcessManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);140 $this->activityManager = new ActivityManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);141 $this->instanceManager = new InstanceManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);142 $this->roleManager = new RoleManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);143 $this->processMonitor = new ProcessMonitor( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);139 $this->processManager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 140 $this->activityManager = new ActivityManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 141 $this->instanceManager = new InstanceManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 142 $this->roleManager = new RoleManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 143 $this->processMonitor = new ProcessMonitor(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 144 144 } 145 145 … … 335 335 $filters[] = '(gia.wf_user IS NOT NULL)'; 336 336 337 $ldap = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');337 $ldap = &Factory::getInstance('WorkflowLDAP'); 338 338 if (!$completeData) 339 339 { 340 $paging = $GLOBALS['workflow']['factory']->newInstance('Paging', 500, $_POST);340 $paging = Factory::newInstance('Paging', 500, $_POST); 341 341 $tmp = $this->processMonitor->monitor_list_instances($paging->nextItem, $paging->itemsPerPage, $order, '', implode(' AND ', $filters)); 342 342 $output['data'] = $paging->restrictItems(array_values($tmp['data']), $tmp['cant']); … … 353 353 $activityMapping = array(); 354 354 $instanceCount = count($output['data']); 355 $cachedLDAP = & $GLOBALS['workflow']['factory']->getInstance('CachedLDAP');355 $cachedLDAP = &Factory::getInstance('CachedLDAP'); 356 356 for ($i = 0; $i < $instanceCount; $i++) 357 357 { … … 476 476 /* load the data */ 477 477 $filters[] = '(gp.wf_p_id = ' . $params['pid'] . ')'; 478 $ldap = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');478 $ldap = &Factory::getInstance('WorkflowLDAP'); 479 479 if (!$completeData) 480 480 { 481 $paging = $GLOBALS['workflow']['factory']->newInstance('Paging', 500, $_POST);481 $paging = Factory::newInstance('Paging', 500, $_POST); 482 482 $tmp = $this->processMonitor->monitor_list_completed_instances($paging->nextItem, $paging->itemsPerPage, $order, '', implode(' AND ', $filters)); 483 483 $output['data'] = $paging->restrictItems(array_values($tmp['data']), $tmp['cant']); … … 491 491 } 492 492 493 $cachedLDAP = & $GLOBALS['workflow']['factory']->getInstance('CachedLDAP');493 $cachedLDAP = &Factory::getInstance('CachedLDAP'); 494 494 $userMapping = array(); 495 495 $instanceCount = count($output['data']); … … 627 627 } 628 628 else 629 $output['fullname'] = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($user);629 $output['fullname'] = Factory::getInstance('WorkflowLDAP')->getName($user); 630 630 631 631 $this->instanceManager->set_instance_user($params['iid'], $params['aid'], $user); … … 648 648 if ($params['ns'] == 'aborted') 649 649 { 650 $realInstance = new Instance( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);650 $realInstance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 651 651 $realInstance->getInstance($params['iid']); 652 652 if (!empty($realInstance->instanceId)) … … 684 684 685 685 /* use next user or * for the new instance */ 686 $realInstance = new Instance( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);686 $realInstance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 687 687 $realInstance->getInstance($params['iid'], false, false); 688 688 $user = $realInstance->getNextUser($params['aid']); … … 751 751 752 752 $maximumDisplaySize = 100; 753 $instance = new Instance( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);753 $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 754 754 $instance->getInstance($params['iid']); 755 755 … … 783 783 return "Você não tem permissão para executar este procedimento!"; 784 784 785 $instance = new Instance( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);785 $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 786 786 $instance->getInstance($params['iid']); 787 787 $output = $params; … … 804 804 $maximumDisplaySize = 100; 805 805 806 $instance = new Instance( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);806 $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 807 807 $instance->getInstance($params['iid']); 808 808 $instance->set($params['name'], $params['value']); … … 835 835 return "Você não tem permissão para executar este procedimento!"; 836 836 837 $instance = new Instance( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);837 $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 838 838 $instance->getInstance($params['iid']); 839 839 $instance->clear($params['name']); … … 904 904 /* prepare the data */ 905 905 $aux2 = array(); 906 $ldap = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');906 $ldap = &Factory::getInstance('WorkflowLDAP'); 907 907 foreach ($aux as $user => $count) 908 908 $aux2[] = array( … … 984 984 985 985 /* load LDAP info and sort the result */ 986 $foundUsers = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getNames($users);986 $foundUsers = Factory::getInstance('WorkflowLDAP')->getNames($users); 987 987 usort($foundUsers, create_function('$a,$b', 'return strcasecmp($a[\'name\'],$b[\'name\']);')); 988 988 … … 991 991 if (count($users) > count($foundUsers)) 992 992 { 993 $cachedLDAP = & $GLOBALS['workflow']['factory']->getInstance('CachedLDAP');993 $cachedLDAP = &Factory::getInstance('CachedLDAP'); 994 994 $foundUsersID = array_map(create_function('$a', 'return $a[\'id\'];'), $foundUsers); 995 995 $missingUsers = array_diff($users, $foundUsersID); … … 1242 1242 return $output; 1243 1243 1244 $BOUserInterface = & $GLOBALS['workflow']['factory']->getInstance('bo_userinterface');1244 $BOUserInterface = &Factory::getInstance('bo_userinterface'); 1245 1245 1246 1246 /* initialize some variables */ … … 1344 1344 1345 1345 /* load the recipient e-mail */ 1346 $ldap = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');1346 $ldap = &Factory::getInstance('WorkflowLDAP'); 1347 1347 foreach ($output as $key => $value) 1348 1348 { … … 1396 1396 1397 1397 /* prepare the environment to load some configuration values from other module */ 1398 $GLOBALS['phpgw']->db = &$GLOBALS['workflow']['workflowObjects']->getDBExpresso();1398 $GLOBALS['phpgw']->db =& Factory::getInstance('WorkflowObjects')->getDBExpresso(); 1399 1399 $GLOBALS['phpgw']->common = CreateObject('phpgwapi.common'); 1400 1400 $GLOBALS['phpgw']->session = CreateObject('phpgwapi.sessions'); … … 1402 1402 1403 1403 /* get the required configuration */ 1404 $BOEmailAdmin = $GLOBALS['workflow']['factory']->newForeignInstance('emailadmin', 'bo');1404 $BOEmailAdmin = Factory::newForeignInstance('emailadmin', 'bo'); 1405 1405 $profileList = $BOEmailAdmin->getProfileList(); 1406 1406 $profile = $BOEmailAdmin->getProfile($profileList[0]['profileID']); … … 1494 1494 { 1495 1495 $output = array(); 1496 $cachedLDAP = & $GLOBALS['workflow']['factory']->getInstance('CachedLDAP');1497 $ldap = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');1496 $cachedLDAP = &Factory::getInstance('CachedLDAP'); 1497 $ldap = &Factory::getInstance('WorkflowLDAP'); 1498 1498 foreach ($userIDs as $userID) 1499 1499 { … … 1542 1542 $filters[] = '(gia.wf_user IS NOT NULL)'; 1543 1543 1544 $cachedLDAP = & $GLOBALS['workflow']['factory']->newInstance('CachedLDAP');1544 $cachedLDAP = &Factory::newInstance('CachedLDAP'); 1545 1545 $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP); 1546 1546 $output = array(); … … 1559 1559 } 1560 1560 1561 $validUsers = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getNames(array_keys($userIDs));1561 $validUsers = Factory::getInstance('WorkflowLDAP')->getNames(array_keys($userIDs)); 1562 1562 array_walk($validUsers, create_function('&$a', '$a = $a[\'id\'];')); 1563 1563
Note: See TracChangeset
for help on using the changeset viewer.