Changeset 2233
- Timestamp:
- 03/12/10 10:59:32 (14 years ago)
- Location:
- sandbox/workflow/branches/609
- Files:
-
- 76 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/workflow/branches/609/controller.php
r1484 r2233 16 16 { 17 17 require_once dirname(__FILE__) . '/inc/common.inc.php'; 18 $GLOBALS['workflow']['factory']->getInstance('WorkflowMacro')->prepareEnvironment();18 Factory::getInstance('WorkflowMacro')->prepareEnvironment(); 19 19 } 20 20 -
sandbox/workflow/branches/609/inc/class.CachedLDAP.inc.php
r1310 r2233 97 97 98 98 /* load the information and establish a connection */ 99 $tmpLDAP = &$GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');99 $tmpLDAP =& Factory::getInstance('WorkflowLDAP'); 100 100 $this->userContext = $tmpLDAP->getUserContext(); 101 101 $this->groupContext = $tmpLDAP->getGroupContext(); 102 $this->dataSource = &$GLOBALS['workflow']['workflowObjects']->getLDAP();102 $this->dataSource =& Factory::getInstance('WorkflowObjects')->getLDAP(); 103 103 } 104 104 … … 115 115 116 116 /* establish a connection */ 117 $this->DBLink = &$GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID;117 $this->DBLink =& Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 118 118 } 119 119 -
sandbox/workflow/branches/609/inc/class.JobRunner.inc.php
r795 r2233 43 43 $this->parameters = unserialize(base64_decode($parameters)); 44 44 $this->parameters['currentDate'] = new DateTime($this->parameters['currentDate']); 45 $this->jobManager = &$GLOBALS['workflow']['factory']->getInstance('WorkflowJobManager');45 $this->jobManager =& Factory::getInstance('WorkflowJobManager'); 46 46 } 47 47 … … 66 66 { 67 67 /* activate the security policy */ 68 $GLOBALS['workflow']['factory']->getInstance('WorkflowSecurity')->enableSecurityPolicy();68 Factory::getInstance('WorkflowSecurity')->enableSecurityPolicy(); 69 69 70 70 if (!file_exists($this->parameters['file'])) … … 94 94 95 95 require_once 'common.inc.php'; 96 $GLOBALS['workflow']['factory']->getInstance('WorkflowMacro')->prepareEnvironment();96 Factory::getInstance('WorkflowMacro')->prepareEnvironment(); 97 97 98 98 $jobRunner = new JobRunner($argv[1]); -
sandbox/workflow/branches/609/inc/class.JobScheduler.inc.php
r795 r2233 57 57 { 58 58 $this->currentDate = new DateTime(date('Y-n-j G:i:00')); 59 $this->db = & $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID;60 $this->jobManager = & $GLOBALS['workflow']['factory']->getInstance('WorkflowJobManager');59 $this->db = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 60 $this->jobManager = &Factory::getInstance('WorkflowJobManager'); 61 61 } 62 62 … … 171 171 $previousDir = getcwd(); 172 172 chdir(GALAXIA_LIBRARY . '/../'); 173 $output = $GLOBALS['workflow']['factory']->newInstance('Thread', 'class.JobRunner.inc.php "' . $parameters . '"');173 $output = Factory::newInstance('Thread', 'class.JobRunner.inc.php "' . $parameters . '"'); 174 174 chdir($previousDir); 175 175 return $output; … … 192 192 { 193 193 require_once 'common.inc.php'; 194 $GLOBALS['workflow']['factory']->getInstance('WorkflowMacro')->prepareEnvironment();194 Factory::getInstance('WorkflowMacro')->prepareEnvironment(); 195 195 196 196 $job = new JobScheduler(); -
sandbox/workflow/branches/609/inc/class.Logger.inc.php
r900 r2233 80 80 { 81 81 82 $this->db =& $GLOBALS['workflow']['workflowObjects']->getDBExpresso()->Link_ID;82 $this->db =& Factory::getInstance('WorkflowObjects')->getDBExpresso()->Link_ID; 83 83 84 84 if(!empty($curProcessName)){ -
sandbox/workflow/branches/609/inc/class.ResourcesRedirector.inc.php
r795 r2233 54 54 if (!isset($_SESSION['workflow']['ResourcesRedirector'][$this->pid])) 55 55 { 56 $result = $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID->query('SELECT wf_normalized_name FROM egw_wf_processes WHERE wf_p_id = ?', array($this->pid));56 $result = Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID->query('SELECT wf_normalized_name FROM egw_wf_processes WHERE wf_p_id = ?', array($this->pid)); 57 57 if ($result->numRows() != 1) 58 58 return; … … 94 94 { 95 95 /* em último caso, tenta buscar a informação em banco de dados */ 96 $result = $GLOBALS['workflow']['workflowObjects']->getDBExpresso()->Link_ID->query('SELECT config_value FROM phpgw_config WHERE config_app = ? AND config_name = ?', array('phpgwapi', 'files_dir'));96 $result = Factory::getInstance('WorkflowObjects')->getDBExpresso()->Link_ID->query('SELECT config_value FROM phpgw_config WHERE config_app = ? AND config_name = ?', array('phpgwapi', 'files_dir')); 97 97 if (empty($result)) 98 98 return; -
sandbox/workflow/branches/609/inc/class.TemplateServer.inc.php
r795 r2233 99 99 else 100 100 { 101 $GLOBALS['workflow']['factory']->getInstance('WorkflowMacro')->prepareEnvironment();101 Factory::getInstance('WorkflowMacro')->prepareEnvironment(); 102 102 if (!isset($GLOBALS['phpgw_info']['login_template_set'])) 103 103 return false; … … 131 131 { 132 132 /* se não for encontrado em nenhuma variável de ambiente, tenta carregar do banco de dados */ 133 $webServerURL = (string) $GLOBALS['workflow']['workflowObjects']->getDBExpresso()->Link_ID->GetOne('SELECT config_value FROM phpgw_config WHERE config_app = ? AND config_name = ?', array('phpgwapi', 'webserver_url'));133 $webServerURL = (string) Factory::getInstance('WorkflowObjects')->getDBExpresso()->Link_ID->GetOne('SELECT config_value FROM phpgw_config WHERE config_app = ? AND config_name = ?', array('phpgwapi', 'webserver_url')); 134 134 $this->WEB_WORKFLOW_BASE = str_replace('//', '/', "{$webServerURL}/workflow"); 135 135 } -
sandbox/workflow/branches/609/inc/class.UserPictureProvider.inc.php
r795 r2233 114 114 /* em último caso, tenta buscar a informação em banco de dados */ 115 115 /* prepara o ambiente para a carga de informações sobre o banco de dados */ 116 $result = $GLOBALS['workflow']['workflowObjects']->getDBExpresso()->Link_ID->query('SELECT config_value FROM phpgw_config WHERE config_app = ? AND config_name = ?', array('phpgwapi', 'files_dir'));116 $result = Factory::getInstance('WorkflowObjects')->getDBExpresso()->Link_ID->query('SELECT config_value FROM phpgw_config WHERE config_app = ? AND config_name = ?', array('phpgwapi', 'files_dir')); 117 117 if (empty($result)) 118 118 return; … … 141 141 mkdir($baseDirectory, 0770, true); 142 142 143 $contents = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getUserPicture($this->userID);143 $contents = Factory::getInstance('WorkflowLDAP')->getUserPicture($this->userID); 144 144 $success = true; 145 145 if ($contents !== false) … … 165 165 } 166 166 167 $GLOBALS['workflow']['factory']->getInstance('ResourcesRedirector')->show($filename);167 Factory::getInstance('ResourcesRedirector')->show($filename); 168 168 } 169 169 } -
sandbox/workflow/branches/609/inc/class.WorkflowJobManager.inc.php
r795 r2233 16 16 public function WorkflowJobManager() 17 17 { 18 parent::JobManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);18 parent::JobManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 19 19 } 20 20 } -
sandbox/workflow/branches/609/inc/class.WorkflowLDAP.inc.php
r795 r2233 50 50 function WorkflowLDAP() 51 51 { 52 $this->dataSource = &$GLOBALS['workflow']['workflowObjects']->getLDAP();52 $this->dataSource =& Factory::getInstance('WorkflowObjects')->getLDAP(); 53 53 54 54 /* get the required parameters */ -
sandbox/workflow/branches/609/inc/class.WorkflowMacro.inc.php
r795 r2233 40 40 require dirname(__FILE__) . '/../setup/setup.inc.php'; /* DO NOT USE require_once */ 41 41 $GLOBALS['phpgw_info']['apps']['workflow'] = $setup_info['workflow']; 42 $row = $GLOBALS['workflow']['workflowObjects']->getDBExpresso()->Link_ID->query('SELECT config_value FROM phpgw_config WHERE config_app = ? AND config_name = ?', array('phpgwapi', 'files_dir'))->fetchRow();42 $row = Factory::getInstance('WorkflowObjects')->getDBExpresso()->Link_ID->query('SELECT config_value FROM phpgw_config WHERE config_app = ? AND config_name = ?', array('phpgwapi', 'files_dir'))->fetchRow(); 43 43 $_SESSION['phpgw_info']['workflow']['vfs_basedir'] = ($row !== false) ? $row['config_value'] : '/home/expressolivre'; 44 44 $_SESSION['phpgw_info']['workflow']['phpgw_api_inc'] = PHPGW_API_INC; … … 67 67 require_once PHPGW_SERVER_ROOT . '/workflow/inc/local/functions/local.functions.php'; 68 68 69 $runtime = new WfRuntime( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);69 $runtime = new WfRuntime(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 70 70 $runtime->loadProcess($processID); 71 71 -
sandbox/workflow/branches/609/inc/class.WorkflowObjects.inc.php
r795 r2233 87 87 { 88 88 /* connect to the database */ 89 $this->cache['DBGalaxia'] = $GLOBALS['workflow']['factory']->newInstance('WorkflowWatcher', $GLOBALS['workflow']['factory']->newForeignInstance('phpgwapi','db'));89 $this->cache['DBGalaxia'] = Factory::newInstance('WorkflowWatcher', Factory::newInstance('db')); 90 90 $this->cache['DBGalaxia']->disconnect(); /* for some reason it won't connect to the desired database unless we disconnect it first */ 91 91 $this->cache['DBGalaxia']->Halt_On_Error = 'no'; … … 98 98 $dbConfigValues['workflow_database_type'] 99 99 ); 100 $GLOBALS['workflow']['factory']->getInstance('WorkflowSecurity')->removeSensitiveInformationFromDatabaseObject($this->cache['DBGalaxia']);101 $this->cache['DBGalaxia']->Link_ID = $GLOBALS['workflow']['factory']->newInstance('WorkflowWatcher', $this->cache['DBGalaxia']->Link_ID);100 Factory::getInstance('WorkflowSecurity')->removeSensitiveInformationFromDatabaseObject($this->cache['DBGalaxia']); 101 $this->cache['DBGalaxia']->Link_ID = Factory::newInstance('WorkflowWatcher', $this->cache['DBGalaxia']->Link_ID); 102 102 } 103 103 else … … 128 128 if (!isset($connectionInfo['db_name'])) 129 129 { 130 $GLOBALS['workflow']['factory']->getInstance('WorkflowMacro')->prepareEnvironment();130 Factory::getInstance('WorkflowMacro')->prepareEnvironment(); 131 131 if (isset($GLOBALS['phpgw_info']['server'])) 132 132 $connectionInfo = $GLOBALS['phpgw_info']['server']; … … 136 136 137 137 /* connect to the database */ 138 $this->cache['DBExpresso'] = $GLOBALS['workflow']['factory']->newInstance('WorkflowWatcher', $GLOBALS['workflow']['factory']->newForeignInstance('phpgwapi','db'));138 $this->cache['DBExpresso'] = Factory::newInstance('WorkflowWatcher', Factory::newInstance('db')); 139 139 $this->cache['DBExpresso']->disconnect(); /* for some reason it won't connect to the desired database unless we disconnect it first */ 140 140 $this->cache['DBExpresso']->Halt_On_Error = 'no'; … … 147 147 $connectionInfo['db_type'] 148 148 ); 149 $GLOBALS['workflow']['factory']->getInstance('WorkflowSecurity')->removeSensitiveInformationFromDatabaseObject($this->cache['DBExpresso']);150 $this->cache['DBExpresso']->Link_ID = $GLOBALS['workflow']['factory']->newInstance('WorkflowWatcher', $this->cache['DBExpresso']->Link_ID);149 Factory::getInstance('WorkflowSecurity')->removeSensitiveInformationFromDatabaseObject($this->cache['DBExpresso']); 150 $this->cache['DBExpresso']->Link_ID = Factory::newInstance('WorkflowWatcher', $this->cache['DBExpresso']->Link_ID); 151 151 } 152 152 … … 177 177 178 178 /* connect to the database */ 179 $this->cache['DBWorkflow'] = $GLOBALS['workflow']['factory']->newInstance('WorkflowWatcher', $GLOBALS['workflow']['factory']->newForeignInstance('phpgwapi','db'));179 $this->cache['DBWorkflow'] = Factory::newInstance('WorkflowWatcher', Factory::newInstance('db')); 180 180 $this->cache['DBWorkflow']->disconnect(); /* for some reason it won't connect to the desired database unless we disconnect it first */ 181 181 $this->cache['DBWorkflow']->Halt_On_Error = 'no'; … … 188 188 $dbConfigValues['database_type'] 189 189 ); 190 $GLOBALS['workflow']['factory']->getInstance('WorkflowSecurity')->removeSensitiveInformationFromDatabaseObject($this->cache['DBWorkflow']);191 $this->cache['DBWorkflow']->Link_ID = $GLOBALS['workflow']['factory']->newInstance('WorkflowWatcher', $this->cache['DBWorkflow']->Link_ID);190 Factory::getInstance('WorkflowSecurity')->removeSensitiveInformationFromDatabaseObject($this->cache['DBWorkflow']); 191 $this->cache['DBWorkflow']->Link_ID = Factory::newInstance('WorkflowWatcher', $this->cache['DBWorkflow']->Link_ID); 192 192 } 193 193 -
sandbox/workflow/branches/609/inc/class.WorkflowSecurity.inc.php
r795 r2233 51 51 { 52 52 /* garante que o objeto de DataBase do Expresso estará disponível */ 53 $GLOBALS['workflow']['workflowObjects']->getDBExpresso();53 Factory::getInstance('WorkflowObjects')->getDBExpresso(); 54 54 } 55 55 … … 77 77 continue; 78 78 $this->removeSensitiveInformationFromDatabaseObject($variable); 79 $variable = $GLOBALS['workflow']['factory']->newInstance('WorkflowWatcher', $variable);79 $variable = Factory::newInstance('WorkflowWatcher', $variable); 80 80 } 81 81 } -
sandbox/workflow/branches/609/inc/class.WorkflowUtils.inc.php
r795 r2233 107 107 /** 108 108 * Fill the process bar 109 * 109 * 110 110 * @param array $proc_info 111 111 * @access public … … 116 116 //echo "proc_info: <pre>";print_r($proc_info);echo "</pre>"; 117 117 $this->t->set_file('proc_bar_tpl', 'proc_bar.tpl'); 118 $templateServer = & $GLOBALS['workflow']['factory']->getInstance('TemplateServer');118 $templateServer = &Factory::getInstance('TemplateServer'); 119 119 120 120 if ($proc_info['wf_is_valid'] == 'y') … … 170 170 /** 171 171 * Select activity representation icon 172 * 172 * 173 173 * @var string $type type of activity 174 174 * @var bool $interactive interactive? … … 207 207 $ic="no-activity.gif"; 208 208 } 209 return '<img src="'. $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateImageLink($ic) .'" alt="'. lang($type) .'" title="'. lang($type) .'" />';210 } 211 209 return '<img src="'. Factory::getInstance('TemplateServer')->generateImageLink($ic) .'" alt="'. lang($type) .'" title="'. lang($type) .'" />'; 210 } 211 212 212 /** 213 213 * Translate template file 214 * @param string $template_name template name 214 * @param string $template_name template name 215 215 * @return void 216 216 * @access public … … 387 387 { 388 388 $file = "css/$css_name" . (($print_mode !== false) ? '_print' : '') . '.css'; 389 return $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->getWebFile($file);390 } 391 389 return Factory::getInstance('TemplateServer')->getWebFile($file); 390 } 391 392 392 /** 393 393 * Return a given duration in human readable form, usefull for workitems duration 394 394 * @param int $to given duration 395 395 * @return string given duration in human readable form 396 * @access public 396 * @access public 397 397 */ 398 398 function time_diff($to) { -
sandbox/workflow/branches/609/inc/class.bo_adminaccess.inc.php
r795 r2233 43 43 parent::bo_ajaxinterface(); 44 44 45 if (! $GLOBALS['workflow']['factory']->getInstance('workflow_acl')->checkWorkflowAdmin($_SESSION['phpgw_info']['workflow']['account_id']))45 if (!Factory::getInstance('workflow_acl')->checkWorkflowAdmin($_SESSION['phpgw_info']['workflow']['account_id'])) 46 46 exit(serialize(array('error' => 'Você não tem permissão para executar esta operação.'))); 47 47 48 $this->so = new so_adminaccess( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);48 $this->so = new so_adminaccess(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 49 49 } 50 50 … … 57 57 function get_all_processes() 58 58 { 59 $proc_mng = new ProcessManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);59 $proc_mng = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 60 60 $proc_list = $proc_mng->list_processes(0,-1,'wf_name__ASC'); 61 61 -
sandbox/workflow/branches/609/inc/class.bo_adminjobs.inc.php
r795 r2233 100 100 /* paginate the result */ 101 101 $logEntriesPerPage = 30; 102 $paging = &$GLOBALS['workflow']['factory']->newInstance('Paging', $logEntriesPerPage, $params);102 $paging =& Factory::newInstance('Paging', $logEntriesPerPage, $params); 103 103 $logs = $paging->restrictItems($logs); 104 104 -
sandbox/workflow/branches/609/inc/class.bo_adminsource.inc.php
r795 r2233 80 80 $fileSizeUnit[] = 'Mb'; 81 81 $fileSizeUnit[] = 'Gb'; 82 82 83 83 $unitSelect = 0; 84 84 while ($value > 1024.0) … … 87 87 $unitSelect++; 88 88 } 89 89 90 90 $output = round($value, 1); 91 91 $output .= " " . $fileSizeUnit[$unitSelect]; 92 92 93 93 return $output; 94 94 } 95 95 96 96 /** 97 97 * Get process toolbar data 98 * @param array $p process process data 99 * @return array 100 * @access public 101 */ 102 function get_toolbar_data($p) 103 { 104 105 $process_manager = new ProcessManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);106 $proc_info = $process_manager->get_process($p['proc_id']); 107 98 * @param array $p process process data 99 * @return array 100 * @access public 101 */ 102 function get_toolbar_data($p) 103 { 104 105 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 106 $proc_info = $process_manager->get_process($p['proc_id']); 107 108 108 $web_server_url = $_SESSION['phpgw_info']['workflow']['server']['webserver_url']; 109 $img_default_dir = $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateImageLink('');110 109 $img_default_dir = Factory::getInstance('TemplateServer')->generateImageLink(''); 110 111 111 if ($proc_info['wf_is_valid'] == 'y') 112 112 { … … 119 119 $alt_validity = tra('invalid'); 120 120 } 121 121 122 122 // if process is active show stop button. Else show start button, but only if it is valid. If it's not valid, don't show any activation or stop button. 123 123 if ($proc_info['wf_is_active'] == 'y') … … 138 138 $start_stop_img = ''; 139 139 } 140 140 141 141 /* load other processes link */ 142 142 $proc_ids = $GLOBALS['ajax']->acl->get_granted_processes($_SESSION['phpgw_info']['workflow']['account_id']); … … 145 145 else 146 146 $where = ' wf_p_id = -1 '; 147 147 148 148 $processesInfo = &$process_manager->list_processes(0, -1, 'wf_name__asc', '', $where); 149 149 $otherProcesses = array(); 150 150 foreach ($processesInfo['data'] as $pi) 151 151 $otherProcesses[] = array("name" => $pi['wf_name'] . " (v" . $pi['wf_version'] . ")", "link" => $web_server_url . "/index.php?menuaction=workflow.ui_adminsource.form&p_id=" . $pi['wf_p_id'], "pid" => $pi['wf_p_id']); 152 152 153 153 $toolbar_data = array ( 154 154 'proc_name' => $proc_info['wf_name'], … … 177 177 'other_processes' => $otherProcesses 178 178 ); 179 179 180 180 return $toolbar_data; 181 181 } 182 183 182 183 184 184 /** 185 185 * Get process model files 186 * @param array $p process process data 187 * @return array 188 * @access public 186 * @param array $p process process data 187 * @return array 188 * @access public 189 189 */ 190 190 function get_model_files($p) 191 191 { 192 switch($p['type']) 192 switch($p['type']) 193 193 { 194 194 case 'include' : $path = PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'js' . SEP . 'adminsource' . SEP . 'inc'; … … 203 203 $files = array(); 204 204 205 if ($handle = opendir($path)) 206 { 207 while (false !== ($file_name = readdir($handle))) 208 { 209 if (!is_dir($path.SEP.$file_name)) 205 if ($handle = opendir($path)) 206 { 207 while (false !== ($file_name = readdir($handle))) 208 { 209 if (!is_dir($path.SEP.$file_name)) 210 210 { 211 211 $files[] = array('file_name' => $file_name); … … 217 217 array_multisort($col_file_name,SORT_ASC,$files); 218 218 219 return $files; 219 return $files; 220 220 } 221 221 222 222 /** 223 223 * Get process php files 224 * @param array $p process data 225 * @return array 226 * @access public 224 * @param array $p process data 225 * @return array 226 * @access public 227 227 */ 228 228 function get_php_files($p) 229 229 { 230 $process_manager = new ProcessManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);230 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 231 231 $proc_info = $process_manager->get_process($p['proc_id']); 232 $activity_manager = new ActivityManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);232 $activity_manager = new ActivityManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 233 233 $process_activities = $activity_manager->list_activities($p['proc_id'], 0, -1, 'wf_name__asc', '','',false); 234 234 $path = GALAXIA_PROCESSES . SEP . $proc_info['wf_normalized_name'] . SEP . 'code' . SEP .'activities' . SEP; 235 235 236 236 $files = array(); 237 237 … … 242 242 foreach ($process_activities['data'] as $process_activity) 243 243 { 244 244 245 245 $file_name = $process_activity['wf_normalized_name'].'.php'; 246 246 $activity_id = $process_activity['wf_activity_id']; 247 247 $tamanho = filesize($path.$file_name); 248 248 $modificado = date('d/m/Y H:i:s', filemtime($path.$file_name) ); 249 249 250 250 $files[] = array('file_name' => $file_name, 251 251 'activity_id' => $activity_id, … … 258 258 'tipo_codigo' => 'atividade' 259 259 ); 260 260 261 261 $col_file_name[] = $file_name; 262 262 $col_tamanho[] = $tamanho; 263 263 $col_modificado[] = $modificado; 264 264 } 265 266 if (isset($p['sort'])) 265 266 if (isset($p['sort'])) 267 267 { 268 268 $order_by = ($p['order_by'] == 1) ? SORT_ASC : SORT_DESC; … … 279 279 } 280 280 } 281 282 return $files; 283 } 284 285 /** 286 * Delete process file 281 282 return $files; 283 } 284 285 /** 286 * Delete process file 287 287 * @param array $p process data 288 288 * @return array 289 * @access public 289 * @access public 290 290 */ 291 291 function delete_file($p) … … 293 293 if ((strpos($p['file_name'],'/') !== false) || (strpos($p['file_name'],'/') !== false)) 294 294 return 'Não foi possível executar a operação solicitada'; 295 $process_manager = new ProcessManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);296 $proc_info = $process_manager->get_process($p['proc_id']); 295 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 296 $proc_info = $process_manager->get_process($p['proc_id']); 297 297 $file_name = $p['file_name']; 298 $proc_name = $proc_info['wf_normalized_name']; 298 $proc_name = $proc_info['wf_normalized_name']; 299 299 $type = $p['type']; 300 300 if (strpos($file_name,'/')) return 'Nome de arquivo inválido.'; 301 301 if (!strlen($proc_name)) return 'ID de Processo inválido.'; 302 302 303 303 switch($type) 304 304 { … … 315 315 $path = GALAXIA_PROCESSES . '/' . $proc_info['wf_normalized_name'] . '/resources/' . $file_name; 316 316 break; 317 317 318 318 } 319 320 if ($type == 'resource') 319 320 if ($type == 'resource') 321 321 { 322 322 $complete_path = $path; 323 } 324 else 323 } 324 else 325 325 { 326 326 $complete_path = GALAXIA_PROCESSES . SEP . $proc_name . SEP . 'code' . SEP . $path; 327 327 } 328 329 if (file_exists($complete_path)) 328 329 if (file_exists($complete_path)) 330 330 { 331 331 if (unlink($complete_path)) … … 342 342 return 'O arquivo '.$file_name.' não existe.'; 343 343 } 344 } 345 /** 346 * Create process new file 344 } 345 /** 346 * Create process new file 347 347 * @param array $p process 348 348 * @return array 349 * @access public 349 * @access public 350 350 */ 351 351 function create_file($p) 352 352 { 353 $process_manager = new ProcessManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);354 $proc_info = $process_manager->get_process($p['proc_id']); 353 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 354 $proc_info = $process_manager->get_process($p['proc_id']); 355 355 $file_name = $p['file_name']; 356 $proc_name = $proc_info['wf_normalized_name']; 356 $proc_name = $proc_info['wf_normalized_name']; 357 357 $type = $p['type']; 358 358 … … 386 386 } 387 387 388 if (file_exists($complete_path)) 389 { 390 if (!$p['rewrite']) 388 if (file_exists($complete_path)) 389 { 390 if (!$p['rewrite']) 391 391 { 392 392 return FILE_ALREADY_EXISTS; … … 396 396 } 397 397 398 if ($fp = fopen($complete_path, 'w')) 398 if ($fp = fopen($complete_path, 'w')) 399 399 { 400 400 $basepath = PHPGW_SERVER_ROOT.SEP.'workflow'.SEP.'js'.SEP.'adminsource'; … … 409 409 if ($type == 'template' || $type == 'include') 410 410 { 411 if (file_exists($basepath.SEP.$p['modelo'])) 411 if (file_exists($basepath.SEP.$p['modelo'])) 412 412 { 413 413 fwrite($fp,file_get_contents($basepath.SEP.$p['modelo'])); … … 423 423 } 424 424 } 425 425 426 426 /** 427 427 * Get process include files 428 428 * @param array $p process 429 429 * @return array 430 * @access public 430 * @access public 431 431 */ 432 432 function get_include_files($p) 433 433 { 434 $process_manager = new ProcessManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);435 $proc_info = $process_manager->get_process($p['proc_id']); 434 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 435 $proc_info = $process_manager->get_process($p['proc_id']); 436 436 $path = GALAXIA_PROCESSES . SEP . $proc_info['wf_normalized_name'] . SEP . 'code'; 437 437 … … 442 442 $files = array(); 443 443 444 if ($handle = opendir($path)) 445 { 446 while (false !== ($file_name = readdir($handle))) 447 { 448 if (!is_dir($path.SEP.$file_name)) 444 if ($handle = opendir($path)) 445 { 446 while (false !== ($file_name = readdir($handle))) 447 { 448 if (!is_dir($path.SEP.$file_name)) 449 449 { 450 450 $tamanho = filesize($path.SEP.$file_name); … … 467 467 468 468 469 if (isset($p['sort'])) 469 if (isset($p['sort'])) 470 470 { 471 471 $order_by = ($p['order_by'] == 1) ? SORT_ASC : SORT_DESC; … … 483 483 } 484 484 485 return $files; 486 } 487 488 /** 489 * Get process template files 490 * @param array $p process data 491 * @return array 492 * @access public 485 return $files; 486 } 487 488 /** 489 * Get process template files 490 * @param array $p process data 491 * @return array 492 * @access public 493 493 */ 494 494 function get_template_files($p) 495 495 { 496 $process_manager = new ProcessManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);497 $proc_info = $process_manager->get_process($p['proc_id']); 496 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 497 $proc_info = $process_manager->get_process($p['proc_id']); 498 498 $path = GALAXIA_PROCESSES . SEP . $proc_info['wf_normalized_name'] . SEP . 'code' . SEP .'templates'; 499 499 … … 502 502 $col_modificado = array(); 503 503 504 if ($handle = opendir($path)) 505 { 506 while (false !== ($file_name = readdir($handle))) 507 { 508 if (!is_dir($path.SEP.$file_name)) 504 if ($handle = opendir($path)) 505 { 506 while (false !== ($file_name = readdir($handle))) 507 { 508 if (!is_dir($path.SEP.$file_name)) 509 509 { 510 510 $tamanho = filesize($path.SEP.$file_name); … … 541 541 542 542 } 543 } 544 545 return $files; 546 } 547 548 /** 549 * Upload process resource 550 * 543 } 544 545 return $files; 546 } 547 548 /** 549 * Upload process resource 550 * 551 551 * @param array $p process 552 552 * @return array 553 * @access public 553 * @access public 554 554 */ 555 555 function upload_resource($p) 556 556 { 557 $process_manager = new ProcessManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);557 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 558 558 $proc_info = $process_manager->get_process($p['proc_id']); 559 559 $file_name = basename($_FILES['resource_file']['name']); … … 587 587 if (strpos($_REQUEST['file_name'],'/') !== false) 588 588 return 'Não foi possível executar a operação solicitada'; 589 $process_manager = new ProcessManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);589 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 590 590 $proc_info = $process_manager->get_process($_REQUEST['proc_id']); 591 591 … … 617 617 $completePath = GALAXIA_PROCESSES . SEP . $proc_name . SEP . 'code' . SEP . $path; 618 618 619 $GLOBALS['workflow']['factory']->getInstance('ResourcesRedirector')->show($completePath, 'application/force-download');619 Factory::getInstance('ResourcesRedirector')->show($completePath, 'application/force-download'); 620 620 exit; 621 621 } … … 630 630 function get_resource_files($p) 631 631 { 632 $process_manager = new ProcessManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);632 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 633 633 $proc_info = $process_manager->get_process($p['proc_id']); 634 634 -
sandbox/workflow/branches/609/inc/class.bo_ajaxinterface.inc.php
r795 r2233 67 67 { 68 68 $GLOBALS['ajax']->ldap = new ajax_ldap(); 69 $GLOBALS['ajax']->db = &$GLOBALS['workflow']['workflowObjects']->getDBExpresso();69 $GLOBALS['ajax']->db =& Factory::getInstance('WorkflowObjects')->getDBExpresso(); 70 70 $GLOBALS['ajax']->db->Halt_On_Error = 'no'; 71 71 72 $GLOBALS['ajax']->db_workflow = &$GLOBALS['workflow']['workflowObjects']->getDBWorkflow();72 $GLOBALS['ajax']->db_workflow =& Factory::getInstance('WorkflowObjects')->getDBWorkflow(); 73 73 $GLOBALS['ajax']->db_workflow->Halt_On_Error = 'no'; 74 74 75 75 $GLOBALS['phpgw']->ADOdb = &$GLOBALS['ajax']->db->Link_ID; 76 $GLOBALS['ajax']->acl = new so_adminaccess( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);76 $GLOBALS['ajax']->acl = new so_adminaccess(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 77 77 } 78 78 else -
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 -
sandbox/workflow/branches/609/inc/class.bo_participants.inc.php
r795 r2233 34 34 function bo_participants() 35 35 { 36 $this->ldap = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');36 $this->ldap = &Factory::getInstance('WorkflowLDAP'); 37 37 } 38 38 -
sandbox/workflow/branches/609/inc/class.bo_userinterface.inc.php
r2085 r2233 43 43 function bo_userinterface() 44 44 { 45 parent::bo_ajaxinterface(); 45 parent::bo_ajaxinterface(); 46 46 $this->so = new so_userinterface(); 47 $GLOBALS['ajax']->gui = new GUI( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);47 $GLOBALS['ajax']->gui = new GUI(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 48 48 } 49 49 … … 68 68 $webserver_url = $_SESSION['phpgw_info']['workflow']['server']['webserver_url']; 69 69 70 $templateServer = &$GLOBALS['workflow']['factory']->getInstance('TemplateServer');70 $templateServer =& Factory::getInstance('TemplateServer'); 71 71 foreach ($result['data'] as $line) 72 72 { … … 78 78 $iconweb = $webserver_url . '/workflow/redirect.php?pid=' . $line['wf_p_id'] . '&file=/icon.png'; 79 79 else 80 $iconweb = $templateServer->generateImageLink(' navbar.png');80 $iconweb = $templateServer->generateImageLink('default_process.png'); 81 81 $procname_ver = $line['wf_normalized_name']; 82 82 if (!isset($recset[$procname_ver])) … … 120 120 $pid = $params['pid']; 121 121 $result = array(); 122 123 $process = new Process( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);122 123 $process = new Process(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 124 124 $process->getProcess($pid); 125 125 $result['wf_procname'] = $process->name; 126 126 $result['wf_version'] = $process->version; 127 127 $result['wf_description'] = $process->description; 128 129 $activ_manager = new ActivityManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);128 129 $activ_manager = new ActivityManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 130 130 $result['wf_activities'] = $activ_manager->get_process_activities($pid); 131 132 $this->disconnect_all(); 133 134 return $result; 131 132 $this->disconnect_all(); 133 134 return $result; 135 135 } 136 136 … … 263 263 else 264 264 if ($row['wf_user'] != '') 265 $row['wf_user_fullname'] = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($row['wf_user']);265 $row['wf_user_fullname'] = Factory::getInstance('WorkflowLDAP')->getName($row['wf_user']); 266 266 267 267 /* unset unneeded information */ … … 495 495 } 496 496 497 $instance = new Instance( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);497 $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 498 498 $instance->getInstance($instanceID); 499 499 500 $process = new Process( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);500 $process = new Process(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 501 501 $process->getProcess($instance->pId); 502 502 … … 508 508 'wf_instance_id' => $instance->instanceId, 509 509 'wf_priority' => $instance->priority, 510 'wf_owner' => $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($instance->owner),510 'wf_owner' => Factory::getInstance('WorkflowLDAP')->getName($instance->owner), 511 511 'wf_next_activity' => $instance->nextActivity, 512 'wf_next_user' => $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($instance->nextUser),512 'wf_next_user' => Factory::getInstance('WorkflowLDAP')->getName($instance->nextUser), 513 513 'wf_name' => $instance->name, 514 514 'wf_category' => $instance->category, … … 526 526 $result['wf_ended'] = ""; 527 527 528 $ldap = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');528 $ldap = &Factory::getInstance('WorkflowLDAP'); 529 529 foreach ($instance->workitems as $line) 530 530 { … … 657 657 $cod_process = array(); 658 658 659 $ldap = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');659 $ldap = &Factory::getInstance('WorkflowLDAP'); 660 660 $viewActivitiesID = array(); 661 661 foreach ($result['data'] as $row) … … 740 740 /** 741 741 * Aplicacoes externas do usuario 742 * @return array 742 * @return array 743 743 * @access public 744 744 */ … … 746 746 { 747 747 $webserver_url = $_SESSION['phpgw_info']['workflow']['server']['webserver_url']; 748 $templateServer = & $GLOBALS['workflow']['factory']->getInstance('TemplateServer');748 $templateServer = &Factory::getInstance('TemplateServer'); 749 749 750 750 /* load the sites that the user can access */ -
sandbox/workflow/branches/609/inc/class.bo_utils.inc.php
r795 r2233 34 34 { 35 35 parent::bo_ajaxinterface(); 36 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBExpresso();36 $this->db =& Factory::getInstance('WorkflowObjects')->getDBExpresso(); 37 37 } 38 38 -
sandbox/workflow/branches/609/inc/class.external_bridge.inc.php
r795 r2233 52 52 function external_bridge() 53 53 { 54 $this->db = $GLOBALS['workflow']['workflowObjects']->getDBGalaxia();55 $this->acl = new so_adminaccess( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);54 $this->db = Factory::getInstance('WorkflowObjects')->getDBGalaxia(); 55 $this->acl = new so_adminaccess(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 56 56 } 57 57 /** … … 156 156 157 157 /* assign variables to the template */ 158 $smarty = $GLOBALS['workflow']['factory']->getInstance('workflow_smarty', false);158 $smarty = Factory::getInstance('workflow_smarty', false); 159 159 $smarty->assign('encodedForm', $encodedForm); 160 160 $smarty->assign('siteAddress', $this->siteAddress); -
sandbox/workflow/branches/609/inc/class.run_activity.inc.php
r2072 r2233 301 301 $this->process_version = $this->process->getVersion(); 302 302 $this->activity_name = $activity->getName(); 303 $this->user_name = $GLOBALS['phpgw']->accounts->id2name($GLOBALS['user']);303 $this->user_name = Factory::getForeignInstance('phpgwapi', 'phpgw')->accounts->id2name($GLOBALS['user']); 304 304 $this->view_activity = $this->GUI->gui_get_process_view_activity($this->process_id); 305 305 … … 318 318 $GLOBALS['workflow']['wf_workflow_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'; 319 319 $GLOBALS['workflow']['wf_resources_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'workflow/redirect.php?pid=' . $this->process_id . '&file='; 320 $GLOBALS['workflow']['wf_default_resources_path'] = $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateLink('processes');321 $GLOBALS['workflow']['wf_workflow_resources_path'] = $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateLink('');320 $GLOBALS['workflow']['wf_default_resources_path'] = Factory::getInstance('TemplateServer')->generateLink('processes'); 321 $GLOBALS['workflow']['wf_workflow_resources_path'] = Factory::getInstance('TemplateServer')->generateLink(''); 322 322 $GLOBALS['workflow']['wf_activity_url'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'index.php?menuaction=workflow.'.get_class($this).'.go&activity_id='.$activity_id; 323 $GLOBALS['workflow']['wf_user_cnname'] = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($GLOBALS['user']);323 $GLOBALS['workflow']['wf_user_cnname'] = Factory::getInstance('WorkflowLDAP')->getName($GLOBALS['user']); 324 324 $GLOBALS['workflow']['wf_back_link'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'index.php?start_tab=1'; 325 325 $GLOBALS['workflow']['wf_js_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'js'.SEP.'jscode'; … … 376 376 377 377 /* check some permissions */ 378 if (($newUser == '*') || (!$this->runtime->checkUserRun($newUser)) || ( $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($newUser) === false))378 if (($newUser == '*') || (!$this->runtime->checkUserRun($newUser)) || (Factory::getInstance('WorkflowLDAP')->getName($newUser) === false)) 379 379 { 380 380 $_SESSION['phpgw_info']['workflow']['user_groups'] = $actualUserGroups; … … 472 472 473 473 /* activate the security policy */ 474 $GLOBALS['workflow']['factory']->getInstance('WorkflowSecurity')->enableSecurityPolicy();474 Factory::getInstance('WorkflowSecurity')->enableSecurityPolicy(); 475 475 476 476 /* include the files */ … … 661 661 $GLOBALS['workflow']['wf_workflow_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'; 662 662 $GLOBALS['workflow']['wf_resources_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . SEP . 'workflow/redirect.php?pid=' . $this->process_id . '&file='; 663 $GLOBALS['workflow']['wf_default_resources_path'] = $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateLink('processes');664 $GLOBALS['workflow']['wf_workflow_resources_path'] = $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateLink('');663 $GLOBALS['workflow']['wf_default_resources_path'] = Factory::getInstance('TemplateServer')->generateLink('processes'); 664 $GLOBALS['workflow']['wf_workflow_resources_path'] = Factory::getInstance('TemplateServer')->generateLink(''); 665 665 $GLOBALS['workflow']['wf_activity_url'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'index.php?menuaction=workflow.'.get_class($this).'.go&activity_id='.$activity_id; 666 $GLOBALS['workflow']['wf_user_cnname'] = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($GLOBALS['user']);666 $GLOBALS['workflow']['wf_user_cnname'] = Factory::getInstance('WorkflowLDAP')->getName($GLOBALS['user']); 667 667 $GLOBALS['workflow']['wf_back_link'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'index.php?start_tab=1'; 668 668 $GLOBALS['workflow']['wf_js_path'] = $GLOBALS['phpgw_info']['server']['webserver_url'].SEP.'workflow'.SEP.'js'.SEP.'jscode'; … … 712 712 713 713 /* activate the security policy */ 714 $GLOBALS['workflow']['factory']->getInstance('WorkflowSecurity')->enableSecurityPolicy();714 Factory::getInstance('WorkflowSecurity')->enableSecurityPolicy(); 715 715 716 716 $GLOBALS['workflow_env'] = &$env; -
sandbox/workflow/branches/609/inc/class.so_adminaccess.inc.php
r795 r2233 77 77 { 78 78 $output = array(); 79 $names = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getNames($userIDs);79 $names = Factory::getInstance('WorkflowLDAP')->getNames($userIDs); 80 80 foreach ($names as $name) 81 81 $output[] = array( … … 201 201 if (!is_object($GLOBALS['phpgw']->acl)) 202 202 { 203 $GLOBALS['phpgw']->db = &$GLOBALS['workflow']['workflowObjects']->getDBExpresso();204 $GLOBALS['phpgw']->acl = &$GLOBALS['workflow']['factory']->getForeignInstance('phpgwapi', 'acl', $userID);203 $GLOBALS['phpgw']->db =& Factory::getInstance('WorkflowObjects')->getDBExpresso(); 204 $GLOBALS['phpgw']->acl =& Factory::getForeignInstance('phpgwapi', 'acl', $userID); 205 205 } 206 206 -
sandbox/workflow/branches/609/inc/class.so_adminjobs.inc.php
r795 r2233 96 96 $this->isAdmin = $_SESSION['phpgw_info']['workflow']['user_is_admin']; 97 97 $this->acl = &$GLOBALS['ajax']->acl; 98 $this->db = & $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID;98 $this->db = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 99 99 $this->jobManager = new JobManager(&$this->db); 100 100 } … … 229 229 $output = array(); 230 230 $job = $this->jobManager->getJob($jobID); 231 $jobScheduler = &$GLOBALS['workflow']['factory']->getInstance('JobScheduler');231 $jobScheduler =& Factory::getInstance('JobScheduler'); 232 232 $totalTime = microtime(true); 233 233 $thread = $jobScheduler->execute($job, true); -
sandbox/workflow/branches/609/inc/class.so_agent.inc.php
r795 r2233 26 26 { 27 27 //public functions 28 28 29 29 /** 30 30 * @var array $public_functions Array of public functions 31 * @access public 31 * @access public 32 32 */ 33 33 var $public_functions = array( … … 36 36 ); 37 37 /** 38 * @var array $wf_table 38 * @var array $wf_table 39 39 * @access public 40 40 */ 41 41 var $wf_table = 'egw_wf_agent_'; 42 42 /** 43 * @var string $agent_table 43 * @var string $agent_table 44 44 * @access public 45 45 */ 46 46 var $agent_table = ''; 47 47 48 48 // link to the global db-object 49 49 50 50 /** 51 * @var object $db objeto para conexao do banco de dados 51 * @var object $db objeto para conexao do banco de dados 52 52 * @access public 53 53 */ 54 54 var $db; 55 55 56 56 /** 57 57 * Constructor of the so_agent class 58 58 * do not forget to call it (parent::so_agent();) in child classes 59 59 * @access public 60 * @return object 60 * @return object 61 61 */ 62 62 63 63 function so_agent() 64 64 { 65 $this->db =& $GLOBALS['workflow']['workflowObjects']->getDBGalaxia();65 $this->db =& Factory::getInstance('WorkflowObjects')->getDBGalaxia(); 66 66 } 67 67 68 68 /** 69 69 * @abstract read all agent datas from the database -
sandbox/workflow/branches/609/inc/class.so_external_applications.inc.php
r795 r2233 130 130 $this->isAdmin = $_SESSION['phpgw_info']['workflow']['user_is_admin']; 131 131 $this->acl = &$GLOBALS['ajax']->acl; 132 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID;132 $this->db =& Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 133 133 $this->EXTERNAL_APPLICATION_PATH = $_SESSION['phpgw_info']['workflow']['server']['files_dir'] . '/workflow//workflow/external_applications'; 134 134 } -
sandbox/workflow/branches/609/inc/class.so_move_instances.inc.php
r795 r2233 91 91 $this->userID = $_SESSION['phpgw_info']['workflow']['account_id']; 92 92 $this->isAdmin = $_SESSION['phpgw_info']['workflow']['user_is_admin']; 93 $this->acl = &$GLOBALS['ajax']->acl;94 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID;93 $this->acl =& $GLOBALS['ajax']->acl; 94 $this->db =& Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 95 95 } 96 96 -
sandbox/workflow/branches/609/inc/class.so_orgchart.inc.php
r2063 r2233 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 … … 1096 1096 $outputInfo = array(); 1097 1097 1098 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP');1098 $cachedLDAP = Factory::newInstance('CachedLDAP'); 1099 1099 1100 1100 /* here we need fresh information. Let's access ldap first */ … … 1262 1262 ); 1263 1263 1264 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP');1264 $cachedLDAP = Factory::newInstance('CachedLDAP'); 1265 1265 $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP_DATABASE); 1266 1266 if (!empty($areaInfo['titular_funcionario_id'])) … … 1512 1512 1513 1513 /* we must query ldap to get full user names. In workflow db we just store uids */ 1514 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP');1514 $cachedLDAP = Factory::newInstance('CachedLDAP'); 1515 1515 1516 1516 $cachedLDAP->getEntryByID(); -
sandbox/workflow/branches/609/inc/class.so_userinterface.inc.php
r2094 r2233 22 22 function so_userinterface() 23 23 { 24 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBWorkflow()->Link_ID;24 $this->db =& Factory::getInstance('WorkflowObjects')->getDBWorkflow()->Link_ID; 25 25 $this->db->SetFetchMode(ADODB_FETCH_ASSOC); 26 26 } … … 93 93 if (!empty($externalApplicationsID)) 94 94 { 95 $result = $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID->query("SELECT DISTINCT external_application_id, name, address, image, authentication, intranet_only FROM egw_wf_external_application WHERE (external_application_id IN (" . implode(', ', $externalApplicationsID) . ")) ORDER BY name");95 $result = Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID->query("SELECT DISTINCT external_application_id, name, address, image, authentication, intranet_only FROM egw_wf_external_application WHERE (external_application_id IN (" . implode(', ', $externalApplicationsID) . ")) ORDER BY name"); 96 96 $preOutput = $result->GetArray(-1); 97 97 … … 245 245 246 246 $employees = $result->GetArray(-1); 247 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP');247 $cachedLDAP = Factory::newInstance('CachedLDAP'); 248 248 $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_NORMAL); 249 249 $categoriesCount = array(); … … 318 318 319 319 $employees = $result->GetArray(-1); 320 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP');320 $cachedLDAP = Factory::newInstance('CachedLDAP'); 321 321 $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_NORMAL); 322 322 for ($i = 0; $i < count($employees); $i++) … … 370 370 371 371 /* searching employees by name in the ldap server */ 372 $list = @ldap_search($ldap, $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getLDAPContext(), ('(&(cn=*' . $searchTerm . '*)(phpgwaccounttype=u))'), array('uidNumber', 'cn', 'telephoneNumber'));372 $list = @ldap_search($ldap, Factory::getInstance('WorkflowLDAP')->getLDAPContext(), ('(&(cn=*' . $searchTerm . '*)(phpgwaccounttype=u))'), array('uidNumber', 'cn', 'telephoneNumber')); 373 373 if ($list === false) 374 374 return false; … … 466 466 467 467 /* executing it */ 468 $list = @ldap_search($ldap, $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getLDAPContext(), $ldap_query, array('uidNumber', 'cn', 'telephoneNumber'));468 $list = @ldap_search($ldap, Factory::getInstance('WorkflowLDAP')->getLDAPContext(), $ldap_query, array('uidNumber', 'cn', 'telephoneNumber')); 469 469 $entries = ldap_get_entries($ldap, $list); 470 470 … … 475 475 476 476 /* we will need to search into database 'cache' for users deleted in ldap */ 477 $cachedLDAP = $GLOBALS[ 'workflow' ][ 'factory' ] ->newInstance( 'CachedLDAP' );477 $cachedLDAP = Factory::newInstance( 'CachedLDAP' ); 478 478 $cachedLDAP -> setOperationMode( $cachedLDAP -> OPERATION_MODE_DATABASE ); 479 479 … … 531 531 532 532 /* searching employees by telephoneNumber in the ldap server */ 533 $list = @ldap_search($ldap, $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getLDAPContext(), ('(&(telephoneNumber=*' . $searchTerm . '*)(phpgwaccounttype=u))'), array('uidNumber', 'cn', 'telephoneNumber'));533 $list = @ldap_search($ldap, Factory::getInstance('WorkflowLDAP')->getLDAPContext(), ('(&(telephoneNumber=*' . $searchTerm . '*)(phpgwaccounttype=u))'), array('uidNumber', 'cn', 'telephoneNumber')); 534 534 535 535 if (!$list) return false; … … 652 652 $result = $this -> db -> query( "SELECT a.sigla as area, a.titular_funcionario_id as titular, s.funcionario_id as substituto, s.data_inicio, s.data_fim FROM area a INNER JOIN substituicao s ON ((a.area_id = s.area_id) AND (CURRENT_DATE BETWEEN s.data_inicio AND s.data_fim)) WHERE (organizacao_id = ?) ORDER BY area", array( $organizationID ) ); 653 653 654 $cachedLDAP = $GLOBALS[ 'workflow' ][ 'factory' ] ->newInstance( 'CachedLDAP' );654 $cachedLDAP = Factory::newInstance( 'CachedLDAP' ); 655 655 $cachedLDAP -> setOperationMode( $cachedLDAP -> OPERATION_MODE_LDAP_DATABASE ); 656 656 … … 719 719 720 720 $employees = $result -> GetArray( -1 ); 721 $cachedLDAP = $GLOBALS[ 'workflow' ][ 'factory' ] ->newInstance( 'CachedLDAP' );721 $cachedLDAP = Factory::newInstance( 'CachedLDAP' ); 722 722 $cachedLDAP -> setOperationMode( $cachedLDAP -> OPERATION_MODE_NORMAL ); 723 723 … … 791 791 $employees = $result -> GetArray( -1 ); 792 792 793 $cachedLDAP = $GLOBALS[ 'workflow' ][ 'factory' ] ->newInstance( 'CachedLDAP' );793 $cachedLDAP = Factory::newInstance( 'CachedLDAP' ); 794 794 $cachedLDAP -> setOperationMode( $cachedLDAP -> OPERATION_MODE_NORMAL ); 795 795 … … 817 817 usort( $employees, create_function( '$a,$b', 'return strcasecmp($a[\'cn\'],$b[\'cn\']);' ) ); 818 818 819 $paging = $GLOBALS['workflow']['factory']->newInstance('Paging', 50, $_POST);819 $paging = Factory::newInstance('Paging', 50, $_POST); 820 820 $employees = $paging->restrictItems( $employees ); 821 821 -
sandbox/workflow/branches/609/inc/class.ui_adminaccess.inc.php
r795 r2233 41 41 function ui_adminaccess() 42 42 { 43 if (! $GLOBALS['workflow']['factory']->getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']))43 if (!Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id'])) 44 44 { 45 45 $GLOBALS['phpgw']->common->phpgw_header(); -
sandbox/workflow/branches/609/inc/class.ui_adminactivities.inc.php
r1710 r2233 374 374 // fill proc_bar 375 375 $this->t->set_var('proc_bar', $this->fill_proc_bar($proc_info)); 376 376 377 377 //collect some messages from used objects 378 378 $this->message[] = $this->activity_manager->get_error(false, _DEBUG); … … 380 380 $this->message[] = $this->role_manager->get_error(false, _DEBUG); 381 381 382 $templateServer = & $GLOBALS['workflow']['factory']->getInstance('TemplateServer');382 $templateServer = &Factory::getInstance('TemplateServer'); 383 383 384 384 // fill the general variables of the template … … 732 732 $this->translate_template('block_process_activities_header'); 733 733 $this->t->parse('process_activities_header', 'block_process_activities_header', True); 734 $templateServer = & $GLOBALS['workflow']['factory']->getInstance('TemplateServer');734 $templateServer = &Factory::getInstance('TemplateServer'); 735 735 foreach ($process_activities_data as $activity) 736 736 { … … 792 792 'trans_href_from' => $GLOBALS['phpgw']->link('/index.php', 'menuaction=workflow.ui_adminactivities.form&where2='. $where2 .'&sort_mode2='. $sort_mode2 .'&p_id='. $this->wf_p_id .'&find='. $find .'&where='. $where .'&sort_mode='. $this->sort_mode .'&activity_id='. $transition['wf_act_from_id']), 793 793 'trans_actFromName' => $transition['wf_act_from_name'], 794 'trans_arrow' => $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateImageLink('next.gif'),794 'trans_arrow' => Factory::getInstance('TemplateServer')->generateImageLink('next.gif'), 795 795 'trans_href_to' => $GLOBALS['phpgw']->link('/index.php', 'menuaction=workflow.ui_adminactivities.form&where2='. $where2 .'&sort_mode2='. $sort_mode2 .'&p_id='. $this->wf_p_id .'&find='. $find .'&where='. $where .'&sort_mode='. $this->sort_mode .'&activity_id='. $transition['wf_act_to_id']), 796 796 'trans_actToName' => $transition['wf_act_to_name'], … … 1036 1036 $image_name = $proc_info['wf_normalized_name'] . SEP . 'graph' . SEP . $proc_info['wf_normalized_name'] . '.png'; 1037 1037 $image = GALAXIA_PROCESSES . SEP . $image_name; 1038 if ( $GLOBALS['workflow']['factory']->getInstance('BrowserInfo')->isOpera())1038 if (Factory::getInstance('BrowserInfo')->isOpera()) 1039 1039 $maximumDimension = 1000000; 1040 1040 else … … 1069 1069 } 1070 1070 } 1071 1071 1072 1072 /** 1073 1073 * Dislays the activity agents config rows … … 1090 1090 } 1091 1091 $this->translate_template('admin_agents'); 1092 1092 $this->t->parse('agents_config_rows', 'admin_agents'); 1093 1093 } 1094 1094 } -
sandbox/workflow/branches/609/inc/class.ui_adminjobs.inc.php
r795 r2233 41 41 'app_header' => $GLOBALS['phpgw_info']['apps']['workflow']['title'] . ' - ' . lang('Jobs') 42 42 ); 43 $smarty = & $GLOBALS['workflow']['factory']->getInstance('workflow_smarty');43 $smarty = &Factory::getInstance('workflow_smarty'); 44 44 45 45 $javaScripts = $this->get_common_js(); … … 54 54 $css .= $this->get_css_link('adminjobs'); 55 55 56 $processInfo = $GLOBALS['workflow']['factory']->getInstance('workflow_processmanager')->get_process((int) $_REQUEST['p_id']);56 $processInfo = Factory::getInstance('workflow_processmanager')->get_process((int) $_REQUEST['p_id']); 57 57 $smarty->assign('processNameVersion', "{$processInfo['wf_name']} v{$processInfo['wf_version']}"); 58 58 $smarty->assign('processID', (int) $processInfo['wf_p_id']); -
sandbox/workflow/branches/609/inc/class.ui_adminprocesses.inc.php
r989 r2233 127 127 } 128 128 129 if (! $GLOBALS['workflow']['factory']->getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']))129 if (!Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id'])) 130 130 { 131 131 $proc_ids = $this->workflow_acl->get_granted_processes($GLOBALS['phpgw_info']['user']['account_id']); … … 589 589 590 590 $myp_id = $item['wf_p_id']; 591 $templateServer = & $GLOBALS['workflow']['factory']->getInstance('TemplateServer');591 $templateServer = &Factory::getInstance('TemplateServer'); 592 592 $this->t->set_var(array( 593 593 'item_wf_p_id' => $myp_id, -
sandbox/workflow/branches/609/inc/class.ui_adminroles.inc.php
r795 r2233 254 254 $this->t->set_var('list_mappings', '<tr><td colspan="3" align="center">'. lang('There are no mappings defined for this process') .'</td></tr>'); 255 255 } 256 else { 256 else { 257 257 /* load the LDAP information */ 258 $cachedLDAP = $GLOBALS['workflow']['factory']->getInstance('CachedLDAP');259 $tmpLDAP = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');258 $cachedLDAP = Factory::getInstance('CachedLDAP'); 259 $tmpLDAP = &Factory::getInstance('WorkflowLDAP'); 260 260 $userContext = $tmpLDAP->getUserContext(); 261 261 $groupContext = $tmpLDAP->getGroupContext(); … … 264 264 { 265 265 if ($mapping['wf_account_type'] == 'g') { 266 $sri = ldap_search( $GLOBALS['workflow']['workflowObjects']->getLDAP(),267 $groupContext, 266 $sri = ldap_search(Factory::getInstance('WorkflowObjects')->getLDAP(), 267 $groupContext, 268 268 '(&(gidnumber=' . (int)$mapping['wf_user'] . ')(phpgwAccountType=g))'); 269 270 $allValues = ldap_get_entries( $GLOBALS['workflow']['workflowObjects']->getLDAP(), $sri);271 269 270 $allValues = ldap_get_entries(Factory::getInstance('WorkflowObjects')->getLDAP(), $sri); 271 272 272 $cname = $GLOBALS['phpgw']->translation->convert($allValues[0]['cn'][0],'utf-8'); 273 273 $glabel = '[' . lang('Group') . ']'; … … 280 280 $glabel = '<font color="red">(excluído)</font>'; 281 281 } 282 282 283 283 $this->t->set_var(array( 284 284 'map_user_id' => $mapping['wf_user'], … … 313 313 * Show users roles selects 314 314 * @param string $all_roles_data 315 * @return 315 * @return 316 316 */ 317 317 function show_users_roles_selects($all_roles_data) 318 318 { 319 $templateServer = & $GLOBALS['workflow']['factory']->getInstance('TemplateServer');319 $templateServer = &Factory::getInstance('TemplateServer'); 320 320 $imgaddusers = $templateServer->generateImageLink('add_group.png'); 321 321 $imgdelusers = $templateServer->generateImageLink('delete_group.png'); … … 325 325 'src_img_del_users' => $imgdelusers 326 326 )); 327 327 328 328 $this->t->set_block('admin_roles', 'block_select_roles', 'select_roles'); 329 329 foreach ($all_roles_data as $role) -
sandbox/workflow/branches/609/inc/class.ui_adminsource.inc.php
r795 r2233 78 78 function form() 79 79 { 80 $smarty = $GLOBALS['workflow']['factory']->getInstance('workflow_smarty', false);80 $smarty = Factory::getInstance('workflow_smarty', false); 81 81 $smarty->setHeader(workflow_smarty::SHOW_HEADER | workflow_smarty::SHOW_NAVIGATION_BAR | workflow_smarty::SHOW_FOOTER, $GLOBALS['phpgw_info']['apps']['workflow']['title'] . ' - ' . lang('Admin Processes Sources')); 82 82 -
sandbox/workflow/branches/609/inc/class.ui_ajaxinterface.inc.php
r1452 r2233 56 56 $vfs = createobject('phpgwapi.vfs'); 57 57 $_SESSION['phpgw_info']['workflow']['vfs_basedir'] = $vfs->basedir; 58 $_SESSION['phpgw_info']['workflow']['server'] = $GLOBALS['phpgw_info']['server']; 58 $_SESSION['phpgw_info']['workflow']['server'] = $GLOBALS['phpgw_info']['server']; 59 59 $_SESSION['phpgw_info']['workflow']['lang'] = $GLOBALS['lang']; 60 60 $_SESSION['phpgw_info']['workflow']['account_id'] = $GLOBALS['phpgw_info']['user']['account_id']; 61 $_SESSION['phpgw_info']['workflow']['user_groups'] = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getUserGroups($GLOBALS['phpgw_info']['user']['account_id']);61 $_SESSION['phpgw_info']['workflow']['user_groups'] = Factory::getInstance('WorkflowLDAP')->getUserGroups($GLOBALS['phpgw_info']['user']['account_id']); 62 62 $user_is_admin = $acl->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']); 63 $_SESSION['phpgw_info']['workflow']['user_is_admin'] = $user_is_admin; 63 $_SESSION['phpgw_info']['workflow']['user_is_admin'] = $user_is_admin; 64 64 $_SESSION['phpgw_info']['workflow']['user_can_admin_process'] = ($user_is_admin || ($GLOBALS['phpgw']->acl->check('admin_workflow',1,'workflow'))); 65 $_SESSION['phpgw_info']['workflow']['user_can_admin_instance'] = ($user_is_admin || ($GLOBALS['phpgw']->acl->check('admin_instance_workflow',1,'workflow'))); 65 $_SESSION['phpgw_info']['workflow']['user_can_admin_instance'] = ($user_is_admin || ($GLOBALS['phpgw']->acl->check('admin_instance_workflow',1,'workflow'))); 66 66 67 67 $can_monitor = $acl->checkUserGroupAccessToType('MON', $GLOBALS['phpgw_info']['user']['account_id']); … … 118 118 { 119 119 $CSSName = "css/{$CSSName}.css"; 120 $templateServer = & $GLOBALS['workflow']['factory']->getInstance('TemplateServer');120 $templateServer = &Factory::getInstance('TemplateServer'); 121 121 $CSSLink = $templateServer->getWebFile($CSSName); 122 122 $CSSFile = $templateServer->getSystemFile($CSSName); -
sandbox/workflow/branches/609/inc/class.ui_external_applications.inc.php
r795 r2233 49 49 function draw() 50 50 { 51 if (! $GLOBALS['workflow']['factory']->getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']))51 if (!Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id'])) 52 52 { 53 53 $GLOBALS['phpgw']->common->phpgw_header(); -
sandbox/workflow/branches/609/inc/class.ui_generic_select.inc.php
r795 r2233 79 79 function form() 80 80 { 81 $smarty = $GLOBALS['workflow']['factory']->getInstance('workflow_smarty', false);81 $smarty = Factory::getInstance('workflow_smarty', false); 82 82 $smarty->setHeader(workflow_smarty::SHOW_HEADER | workflow_smarty::SHOW_FOOTER); 83 83 -
sandbox/workflow/branches/609/inc/class.ui_orgchart.inc.php
r795 r2233 153 153 return false; 154 154 155 $ldap = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');155 $ldap = &Factory::getInstance('WorkflowLDAP'); 156 156 for ($i = 0; $i < count($output); $i++) 157 157 { -
sandbox/workflow/branches/609/inc/class.ui_participants.inc.php
r795 r2233 41 41 function ui_participants() 42 42 { 43 $this->bo = $GLOBALS['workflow']['factory']->getInstance('bo_participants');43 $this->bo = Factory::getInstance('bo_participants'); 44 44 } 45 45 … … 51 51 function form() 52 52 { 53 $smarty = $GLOBALS['workflow']['factory']->getInstance('workflow_smarty', false);53 $smarty = Factory::getInstance('workflow_smarty', false); 54 54 $smarty->setHeader(workflow_smarty::SHOW_HEADER | workflow_smarty::SHOW_FOOTER); 55 $ldap = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');55 $ldap = Factory::getInstance('WorkflowLDAP'); 56 56 $userDN = $GLOBALS['phpgw_info']['user']['account_dn']; 57 $account = $GLOBALS['workflow']['factory']->getForeignInstance('phpgwapi','accounts', $userDN);57 $account = Factory::getInstance('accounts', $userDN); 58 58 $organizationList = $this->bo->getOrganizations(); 59 59 -
sandbox/workflow/branches/609/inc/class.ui_phpeditor.inc.php
r795 r2233 62 62 function form() 63 63 { 64 $smarty = $GLOBALS['workflow']['factory']->getInstance('workflow_smarty', false);65 $processManager = new ProcessManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);64 $smarty = Factory::getInstance('workflow_smarty', false); 65 $processManager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 66 66 $proccessInfo = $processManager->get_process($_GET['proc_id']); 67 67 -
sandbox/workflow/branches/609/inc/class.ui_userinterface.inc.php
r2223 r2233 115 115 116 116 // Get a connection to db workflow and galaxia (module) 117 if ( $GLOBALS['workflow']['workflowObjects']->getDBWorkflow()->Error)117 if (Factory::getInstance('WorkflowObjects')->getDBWorkflow()->Error) 118 118 $errors[] = 'Unable to connect to database Workflow'; 119 119 120 if ($errormsg = $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Error)120 if ($errormsg = Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Error) 121 121 $errors[] = 'Unable to connect to database Galaxia'; 122 122 -
sandbox/workflow/branches/609/inc/class.workflow_acl.inc.php
r795 r2233 30 30 function workflow_acl() 31 31 { 32 parent::so_adminaccess( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);32 parent::so_adminaccess(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 33 33 } 34 34 -
sandbox/workflow/branches/609/inc/class.workflow_activitymanager.inc.php
r795 r2233 20 20 function workflow_activitymanager() 21 21 { 22 parent::ActivityManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);22 parent::ActivityManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 23 23 } 24 24 } -
sandbox/workflow/branches/609/inc/class.workflow_baseactivity.inc.php
r795 r2233 17 17 function workflow_baseactivity() 18 18 { 19 parent::BaseActivity( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);19 parent::BaseActivity(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 20 20 } 21 21 } -
sandbox/workflow/branches/609/inc/class.workflow_gui.inc.php
r795 r2233 20 20 function workflow_gui() 21 21 { 22 parent::GUI( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);22 parent::GUI(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 23 23 } 24 24 } -
sandbox/workflow/branches/609/inc/class.workflow_instance.inc.php
r795 r2233 20 20 function workflow_Instance() 21 21 { 22 parent::Instance( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);22 parent::Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 23 23 } 24 24 } -
sandbox/workflow/branches/609/inc/class.workflow_instancemanager.inc.php
r795 r2233 17 17 function workflow_instancemanager() 18 18 { 19 parent::InstanceManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);19 parent::InstanceManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 20 20 } 21 21 } -
sandbox/workflow/branches/609/inc/class.workflow_process.inc.php
r795 r2233 16 16 function workflow_process() 17 17 { 18 parent::Process( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);18 parent::Process(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 19 19 } 20 20 } -
sandbox/workflow/branches/609/inc/class.workflow_processmanager.inc.php
r795 r2233 26 26 'database_user', 27 27 'database_password' 28 ); 28 ); 29 29 /** 30 30 * Constructor … … 34 34 function workflow_processmanager() 35 35 { 36 parent::ProcessManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);36 parent::ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 37 37 $this->workflow_acl = CreateObject('workflow.workflow_acl'); 38 38 39 39 /* allow regular users to see the process graph */ 40 40 if ($_GET['menuaction'] == "workflow.ui_adminactivities.show_graph") -
sandbox/workflow/branches/609/inc/class.workflow_processmonitor.inc.php
r795 r2233 17 17 function workflow_processmonitor() 18 18 { 19 parent::ProcessMonitor( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);19 parent::ProcessMonitor(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 20 20 } 21 21 } -
sandbox/workflow/branches/609/inc/class.workflow_rolemanager.inc.php
r795 r2233 17 17 function workflow_rolemanager() 18 18 { 19 parent::RoleManager( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);19 parent::RoleManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 20 20 } 21 21 } -
sandbox/workflow/branches/609/inc/class.workflow_wfruntime.inc.php
r795 r2233 18 18 function workflow_wfruntime() 19 19 { 20 parent::WfRuntime( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);20 parent::WfRuntime(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 21 21 } 22 22 } -
sandbox/workflow/branches/609/inc/class.workflow_wfsecurity.inc.php
r1712 r2233 18 18 function workflow_wfsecurity() 19 19 { 20 parent::WfSecurity( $GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);20 parent::WfSecurity(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 21 21 } 22 22 } -
sandbox/workflow/branches/609/inc/common.inc.php
r2223 r2233 17 17 * @name EGW_SERVER_ROOT 18 18 */ 19 define('EGW_SERVER_ROOT', $HTTP_SERVER_VARS['DOCUMENT_ROOT']); 19 define('EGW_SERVER_ROOT', $GLOBALS['HTTP_SERVER_VARS']['DOCUMENT_ROOT']); 20 21 /** 22 * Server include base path. We must define our own constants 23 * because there are several cases in which workflow is called 24 * directly, thus PHPGW constants are not defined. 25 * @name EGW_INC_ROOT 26 */ 27 define('EGW_INC_ROOT', EGW_SERVER_ROOT . '/phpgwapi/inc/'); 20 28 21 29 /** -
sandbox/workflow/branches/609/inc/engine/class.ajax_config.inc.php
r795 r2233 45 45 } 46 46 47 $this->db = &$GLOBALS['workflow']['workflowObjects']->getDBExpresso();47 $this->db =& Factory::getInstance('WorkflowObjects')->getDBExpresso(); 48 48 $this->appname = $appname; 49 49 } … … 51 51 /** 52 52 * Reads the whole repository for $this->appname, appname has to be set via the constructor 53 * 53 * 54 54 * @return array the whole config-array for that app 55 55 * @access public -
sandbox/workflow/branches/609/inc/engine/class.ajax_ldap.inc.php
r795 r2233 29 29 function ajax_ldap() 30 30 { 31 $tmpLDAP = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');31 $tmpLDAP = &Factory::getInstance('WorkflowLDAP'); 32 32 $this->user_context = $tmpLDAP->getUserContext(); 33 33 $this->group_context = $tmpLDAP->getGroupContext(); 34 34 35 $this->ds = &$GLOBALS['workflow']['workflowObjects']->getLDAP();35 $this->ds =& Factory::getInstance('WorkflowObjects')->getLDAP(); 36 36 } 37 37 … … 83 83 function id2fullname($account_id) 84 84 { 85 return $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($account_id);85 return Factory::getInstance('WorkflowLDAP')->getName($account_id); 86 86 } 87 87 … … 107 107 $accountID = $_SESSION['phpgw_info']['workflow']['account_id']; 108 108 109 $ldap = &$GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');109 $ldap =& Factory::getInstance('WorkflowLDAP'); 110 110 if (count($output = $ldap->getUserGroups($accountID)) == 0) 111 111 return false; -
sandbox/workflow/branches/609/inc/engine/config.ajax.inc.php
r795 r2233 170 170 if ($loadGroups) 171 171 { 172 $memberships = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getUserGroups($user);172 $memberships = Factory::getInstance('WorkflowLDAP')->getUserGroups($user); 173 173 if ($user == $_SESSION['phpgw_info']['workflow']['account_id']) 174 174 $_SESSION['phpgw_info']['workflow']['user_groups'] = $memberships; … … 196 196 { 197 197 /* get information regarding the members of the group */ 198 $ldap = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');198 $ldap = &Factory::getInstance('WorkflowLDAP'); 199 199 $members = $ldap->getGroupUsers($group); 200 200 -
sandbox/workflow/branches/609/inc/engine/config.egw.inc.php
r795 r2233 151 151 function galaxia_user_can_admin_process() 152 152 { 153 return ( $GLOBALS['workflow']['factory']->getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $GLOBALS['phpgw']->acl->check('admin_workflow', 1, 'workflow'));153 return (Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $GLOBALS['phpgw']->acl->check('admin_workflow', 1, 'workflow')); 154 154 } 155 155 } … … 165 165 function galaxia_user_can_admin_instance() 166 166 { 167 return ( $GLOBALS['workflow']['factory']->getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $GLOBALS['phpgw']->acl->check('admin_instance_workflow', 1, 'workflow'));167 return (Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $GLOBALS['phpgw']->acl->check('admin_instance_workflow', 1, 'workflow')); 168 168 } 169 169 } … … 179 179 function galaxia_user_can_clean_instances() 180 180 { 181 return ( $GLOBALS['workflow']['factory']->getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $GLOBALS['phpgw']->acl->check('cleanup_workflow', 1, 'workflow'));181 return (Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $GLOBALS['phpgw']->acl->check('cleanup_workflow', 1, 'workflow')); 182 182 } 183 183 } … … 191 191 function galaxia_user_can_clean_aborted_instances() 192 192 { 193 return ( $GLOBALS['workflow']['factory']->getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $GLOBALS['phpgw']->acl->check('cleanup_aborted_workflow', 1, 'workflow'));193 return (Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $GLOBALS['phpgw']->acl->check('cleanup_aborted_workflow', 1, 'workflow')); 194 194 } 195 195 } … … 203 203 function galaxia_user_can_monitor() 204 204 { 205 return ( $GLOBALS['workflow']['factory']->getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $GLOBALS['phpgw']->acl->check('monitor_workflow', 1, 'workflow'));205 return (Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']) || $GLOBALS['phpgw']->acl->check('monitor_workflow', 1, 'workflow')); 206 206 } 207 207 } … … 221 221 $user = $GLOBALS['phpgw_info']['user']['account_id']; 222 222 223 $memberships = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getUserGroups($user);223 $memberships = Factory::getInstance('WorkflowLDAP')->getUserGroups($user); 224 224 225 225 if ($memberships === false) … … 245 245 { 246 246 /* get information regarding the members of the group */ 247 $members = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getGroupUsers($group);247 $members = &Factory::getInstance('WorkflowLDAP')->getGroupUsers($group); 248 248 249 249 /* checl for error in the LDAP query */ -
sandbox/workflow/branches/609/inc/engine/src/ProcessManager/RoleManager.php
r795 r2233 247 247 $result = $this->query($query,$bindvars); 248 248 $ret = Array(); 249 $ldap = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');249 $ldap = &Factory::getInstance('WorkflowLDAP'); 250 250 if (!(empty($result))) 251 251 { -
sandbox/workflow/branches/609/inc/smarty/wf_plugins/function.wf_generic_select.php
r795 r2233 53 53 EOF; 54 54 55 $templateServer = & $GLOBALS['workflow']['factory']->getInstance('TemplateServer');55 $templateServer = &Factory::getInstance('TemplateServer'); 56 56 $imageAdd = $templateServer->generateImageLink('add.png'); 57 57 $imageRemove = $templateServer->generateImageLink('close.png'); -
sandbox/workflow/branches/609/inc/smarty/wf_plugins/function.wf_redir_menu.php
r795 r2233 53 53 $select_tag .= "<option value=\"og\">Organograma</option>"; 54 54 55 $user_is_admin = $GLOBALS['workflow']['factory']->getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']); 56 if ($user_is_admin || ($GLOBALS['phpgw']->acl->check('admin_workflow',1,'workflow'))) { 55 $user_is_admin = Factory::getInstance('workflow_acl')->checkWorkflowAdmin($GLOBALS['phpgw_info']['user']['account_id']); 56 $phpgw =& Factory::getForeignInstance('phpgwapi','phpgw'); 57 if ($user_is_admin || ($phpgw->acl->check('admin_workflow',1,'workflow'))) { 57 58 $select_tag .= "<option value=\"ad\">Administração</option>"; 58 59 } 59 if ($user_is_admin || ($ GLOBALS['phpgw']->acl->check('monitor_workflow',1,'workflow'))) {60 if ($user_is_admin || ($phpgw->acl->check('monitor_workflow',1,'workflow'))) { 60 61 $select_tag .= "<option value=\"mo\">Monitoramento</option>"; 61 62 } -
sandbox/workflow/branches/609/inc/smarty/wf_plugins/function.wf_select_city.php
r795 r2233 37 37 if (!array_key_exists($required, $params) || (empty($params[$required]))) 38 38 $smarty->trigger_error("[wf_select_city] missing required parameter(s): $required", E_USER_ERROR); 39 39 40 40 /* atribui valores default para os parâmetros não passados */ 41 41 foreach ($defaultValues as $key => $value) 42 42 if (!isset($params[$key])) 43 43 $params[$key] = $value; 44 44 45 45 /* extrai alguns parâmetros da matriz de parâmetros */ 46 46 foreach ($extractParams as $extract) 47 47 $$extract = $params[$extract]; 48 48 49 49 /* parâmetros extras são "acumulados" em uma única variável */ 50 50 $extraParams = array(); … … 53 53 $extraParams[$key] = $value_params; 54 54 55 $db = & $GLOBALS['workflow']['workflowObjects']->getDBExpresso()->Link_ID;55 $db = &Factory::getInstance('WorkflowObjects')->getDBExpresso()->Link_ID; 56 56 if (isset($params['value'])) 57 57 { -
sandbox/workflow/branches/609/inc/smarty/wf_plugins/function.wf_select_ldap_users.php
r795 r2233 25 25 { 26 26 require_once $smarty->_get_plugin_filepath('function','html_options'); 27 $imagesPath = substr( $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateImageLink(''), 0, -1);27 $imagesPath = substr(Factory::getInstance('TemplateServer')->generateImageLink(''), 0, -1); 28 28 29 29 $requiredParams = array( -
sandbox/workflow/branches/609/inc/smarty/wf_plugins/function.wf_select_state.php
r795 r2233 46 46 $sql = "SELECT id_state, state_name FROM phpgw_cc_state WHERE id_country = 'BR' ORDER BY state_name"; 47 47 48 $result = $GLOBALS['workflow']['workflowObjects']->getDBExpresso()->Link_ID->query($sql);48 $result = Factory::getInstance('WorkflowObjects')->getDBExpresso()->Link_ID->query($sql); 49 49 $estados = array(); 50 50 while ($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) -
sandbox/workflow/branches/609/inc/smarty/wf_plugins/function.wf_select_user.php
r795 r2233 94 94 $extraParams .= "&hideSectors=1"; 95 95 96 $image = $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateImageLink('add_user.png');96 $image = Factory::getInstance('TemplateServer')->generateImageLink('add_user.png'); 97 97 98 98 $output .= <<<EOF -
sandbox/workflow/branches/609/inc/smarty/wf_plugins/function.wf_select_users.php
r795 r2233 16 16 { 17 17 require_once $smarty->_get_plugin_filepath('function','html_options'); 18 $imagesPath = substr( $GLOBALS['workflow']['factory']->getInstance('TemplateServer')->generateImageLink(''), 0, -1);18 $imagesPath = substr(Factory::getInstance('TemplateServer')->generateImageLink(''), 0, -1); 19 19 $requiredParams = array( 20 20 'name'); -
sandbox/workflow/branches/609/inc/smarty/wf_plugins/prefilter.wf_default_template.php
r795 r2233 31 31 { 32 32 /* get the header and footer location */ 33 $templateServer = & $GLOBALS['workflow']['factory']->getInstance('TemplateServer');33 $templateServer = &Factory::getInstance('TemplateServer'); 34 34 $header = $templateServer->getSystemFile('processes/header.tpl'); 35 35 $footer = $templateServer->getSystemFile('processes/footer.tpl'); -
sandbox/workflow/branches/609/lib/factory/BaseFactory.php
r2222 r2233 154 154 /* not found */ 155 155 if (!($entry = $this->_getEntry($className))) 156 throw new Exception('You are not allowed to instantiate '.$className.' class.');156 throw new Exception('You are not allowed to instantiate \''.$className.'\' class.'); 157 157 158 $fullPath = $entry['basePath'] . SEP . $entry['path'] . SEP. $entry['filename'];158 $fullPath = $entry['basePath'] . '/' . $entry['path'] . '/' . $entry['filename']; 159 159 160 160 /* file not found */ -
sandbox/workflow/branches/609/lib/factory/Factory.php
r2223 r2233 64 64 * @static 65 65 */ 66 public static function getInstance() {66 public static function &getInstance() { 67 67 68 68 /* oops. we are in the process space. */ … … 93 93 * Just forward this call to the correct class. 94 94 * 95 * @todo I must implement it!96 95 * @access public 97 96 * @retun object 98 97 * @static 99 98 */ 100 public static function newInstance() { 99 public static function &newInstance() { 100 101 /* oops. we are in the process space. */ 102 if (Security::isEnabled()) { 103 104 /* must instatiate it */ 105 if (is_null(self::$_securedFactory)) 106 self::$_securedFactory = new ProcessFactory(); 107 108 $args = func_get_args(); 109 return call_user_func_array(array(self::$_securedFactory, "newInstance"), $args); 110 111 } 112 /* regular module space */ 113 else { 114 115 /* must instatiate it */ 116 if (is_null(self::$_unsecuredFactory)) 117 self::$_unsecuredFactory = new WorkflowFactory(); 118 119 $args = func_get_args(); 120 return call_user_func_array(array(self::$_unsecuredFactory, "newInstance"), $args); 121 } 101 122 } 102 123 } -
sandbox/workflow/branches/609/lib/factory/WorkflowFactory.php
r2223 r2233 49 49 /* registering allowed classes */ 50 50 $this->registerFileInfo('WorkflowObjects', 'class.WorkflowObjects.inc.php', 'inc'); 51 $this->registerFileInfo('WorkflowWatcher', 'class.WorkflowWatcher.inc.php', 'inc'); 52 $this->registerFileInfo('WorkflowLDAP', 'class.WorkflowLDAP.inc.php', 'inc'); 53 $this->registerFileInfo('WorkflowSecurity', 'class.WorkflowSecurity.inc.php', 'inc'); 54 $this->registerFileInfo('ResourcesRedirector', 'class.ResourcesRedirector.inc.php', 'inc'); 51 55 $this->registerFileInfo('TemplateServer', 'class.TemplateServer.inc.php', 'inc'); 56 $this->registerFileInfo('CachedLDAP', 'class.CachedLDAP.inc.php', 'inc'); 57 $this->registerFileInfo('BrowserInfo', 'class.BrowserInfo.inc.php', 'inc'); 58 52 59 $this->registerFileInfo('workflow_smarty', 'class.workflow_smarty.inc.php', 'inc'); 60 $this->registerFileInfo('workflow_acl', 'class.workflow_acl.inc.php', 'inc'); 61 $this->registerFileInfo('workflow_processmanager', 'class.workflow_processmanager.inc.php', 'inc'); 62 63 $this->registerFileInfo('bo_participants', 'class.bo_participants.inc.php', 'inc'); 53 64 54 65 /* registering egw class example */ 55 //$this->registerFileInfo('db', 'x', 'inc', PHPGW_API_INC); 66 $this->registerFileInfo('phpgw', 'class.phpgw.inc.php', '', EGW_INC_ROOT); 67 $this->registerFileInfo('db', 'class.db.inc.php', '', EGW_INC_ROOT); 68 $this->registerFileInfo('accounts', 'class.accounts.inc.php', '', EGW_INC_ROOT); 56 69 57 70 /* ok. no more instances of this class.. */ -
sandbox/workflow/branches/609/redirect.php
r1468 r2233 12 12 if (empty($_SESSION)) 13 13 exit(0); 14 $GLOBALS['workflow']['factory']->getInstance('ResourcesRedirector')->redirect();14 Factory::getInstance('ResourcesRedirector')->redirect(); 15 15 ?> -
sandbox/workflow/branches/609/showUserPicture.php
r1468 r2233 12 12 if (empty($_SESSION)) 13 13 exit(0); 14 $GLOBALS['workflow']['factory']->getInstance('UserPictureProvider')->serve();14 Factory::getInstance('UserPictureProvider')->serve(); 15 15 ?> -
sandbox/workflow/branches/609/templateFile.php
r2223 r2233 12 12 if (empty($_SESSION)) 13 13 exit(0); 14 //$GLOBALS['workflow']['factory']->getInstance('TemplateServer')->redirect();15 14 Factory::getInstance('TemplateServer')->redirect(); 16 15 ?>
Note: See TracChangeset
for help on using the changeset viewer.