Ignore:
Timestamp:
08/17/10 16:17:12 (14 years ago)
Author:
viani
Message:

Ticket #1135 - Merged r1990:3166 from /trunk/workflow into /branches/2.2/workflow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/workflow/inc/class.so_move_instances.inc.php

    r795 r3167  
    1111\**************************************************************************/ 
    1212 
    13 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php'); 
    14 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php'); 
    1513 
    1614/** 
     
    9189                $this->userID = $_SESSION['phpgw_info']['workflow']['account_id']; 
    9290                $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; 
    9593        } 
    9694 
     
    113111                                $where[] = 'wf_p_id IS NULL'; 
    114112                } 
    115                 $processManager = new ProcessManager($this->db); 
     113                $processManager = &Factory::getInstance('ProcessManager'); 
    116114 
    117115                /* workaround to sort the result using two columns */ 
     
    137135                $this->_checkAccess($processID); 
    138136 
    139                 $activityManager = new ActivityManager($this->db); 
     137                $activityManager = &Factory::newInstance('ActivityManager'); 
    140138                $activities = $activityManager->list_activities($processID, 0, -1, 'wf_name__ASC', '', 'wf_type <> \'standalone\' AND wf_type <> \'view\''); 
    141139                $output = array(); 
     
    320318                } 
    321319 
    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  
    341320                /* in case of success, commit the modifications */ 
    342321                $this->db->CompleteTrans(); 
Note: See TracChangeset for help on using the changeset viewer.