- Timestamp:
- 08/17/10 16:17:12 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/workflow/inc/class.so_move_instances.inc.php
r795 r3167 11 11 \**************************************************************************/ 12 12 13 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php');14 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php');15 13 16 14 /** … … 91 89 $this->userID = $_SESSION['phpgw_info']['workflow']['account_id']; 92 90 $this->isAdmin = $_SESSION['phpgw_info']['workflow']['user_is_admin']; 93 $this->acl = &$GLOBALS['ajax']->acl;94 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID;91 $this->acl =& $GLOBALS['ajax']->acl; 92 $this->db =& Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 95 93 } 96 94 … … 113 111 $where[] = 'wf_p_id IS NULL'; 114 112 } 115 $processManager = new ProcessManager($this->db);113 $processManager = &Factory::getInstance('ProcessManager'); 116 114 117 115 /* workaround to sort the result using two columns */ … … 137 135 $this->_checkAccess($processID); 138 136 139 $activityManager = new ActivityManager($this->db);137 $activityManager = &Factory::newInstance('ActivityManager'); 140 138 $activities = $activityManager->list_activities($processID, 0, -1, 'wf_name__ASC', '', 'wf_type <> \'standalone\' AND wf_type <> \'view\''); 141 139 $output = array(); … … 320 318 } 321 319 322 /* format the array elements for use in a SELECT SQL statement, e.g. [iid => 12, aid = 27] would produce (12, 27) */323 $instanceActivityList = array_map(create_function('$e', 'return \'(\' . $e[\'iid\'] . \', \' . $e[\'aid\'] . \')\';'), $instanceActivityList);324 325 /* update the interinstance relations of the modified rows of the instance_activities table */326 $resultSet = $this->db->query("SELECT wf_parent_instance_id, wf_parent_activity_id FROM egw_wf_interinstance_relations WHERE ((wf_parent_instance_id, wf_parent_activity_id) IN (" . implode(', ', $instanceActivityList) . "))");327 $rows = $resultSet->GetArray(-1);328 if (is_array($rows))329 {330 foreach ($rows as $row)331 {332 /* update the activity ID */333 if (!$this->db->query("UPDATE egw_wf_interinstance_relations SET wf_parent_activity_id = ? WHERE (wf_parent_instance_id = ?) AND (wf_parent_activity_id = ?)", array($activitiesConvert[$row['wf_parent_activity_id']], $row['wf_parent_instance_id'], $row['wf_parent_activity_id'])))334 {335 $this->db->FailTrans();336 return array('error' => 'Erro atualizando a tabela de relacionamento inter-instância. Nenhuma modificação foi salva');337 }338 }339 }340 341 320 /* in case of success, commit the modifications */ 342 321 $this->db->CompleteTrans();
Note: See TracChangeset
for help on using the changeset viewer.