Ignore:
Timestamp:
08/07/09 16:06:07 (15 years ago)
Author:
gbisotto
Message:

Ticket #609 - Modificada a classe Factory e ProcessFactory? para automatizaro acesso ao objetos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/2.0/inc/class.bo_userinterface.inc.php

    r795 r1293  
    4343        function bo_userinterface() 
    4444        { 
    45                 parent::bo_ajaxinterface();      
     45                parent::bo_ajaxinterface(); 
    4646                $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); 
    4848        } 
    4949 
     
    6868                $webserver_url = $_SESSION['phpgw_info']['workflow']['server']['webserver_url']; 
    6969 
    70                 $templateServer = &$GLOBALS['workflow']['factory']->getInstance('TemplateServer'); 
     70                $templateServer =& Factory::getInstance('TemplateServer'); 
    7171                foreach ($result['data'] as $line) 
    7272                { 
     
    7878                                $iconweb = $webserver_url . '/workflow/redirect.php?pid=' . $line['wf_p_id'] . '&file=/icon.png'; 
    7979                        else 
    80                                 $iconweb = $templateServer->generateImageLink('navbar.png'); 
     80                                $iconweb = $templateServer->generateImageLink('default_process.png'); 
    8181                        $procname_ver = $line['wf_normalized_name']; 
    8282                        if (!isset($recset[$procname_ver])) 
     
    120120                $pid = $params['pid']; 
    121121                $result = array(); 
    122                  
    123                 $process = new Process($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID); 
     122 
     123                $process = new Process(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
    124124                $process->getProcess($pid); 
    125125                $result['wf_procname'] = $process->name; 
    126126                $result['wf_version'] = $process->version; 
    127127                $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); 
    130130                $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; 
    135135        } 
    136136 
     
    263263                                else 
    264264                                        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']); 
    266266 
    267267                                /* unset unneeded information */ 
     
    495495                } 
    496496 
    497                 $instance = new Instance($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID); 
     497                $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
    498498                $instance->getInstance($instanceID); 
    499499 
    500                 $process = new Process($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID); 
     500                $process = new Process(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
    501501                $process->getProcess($instance->pId); 
    502502 
     
    508508                        'wf_instance_id' => $instance->instanceId, 
    509509                        'wf_priority' => $instance->priority, 
    510                         'wf_owner' => $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($instance->owner), 
     510                        'wf_owner' => Factory::getInstance('WorkflowLDAP')->getName($instance->owner), 
    511511                        '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), 
    513513                        'wf_name' => $instance->name, 
    514514                        'wf_category' => $instance->category, 
     
    526526                $result['wf_ended'] = ""; 
    527527 
    528                 $ldap = &$GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP'); 
     528                $ldap = &Factory::getInstance('WorkflowLDAP'); 
    529529                foreach ($instance->workitems as $line) 
    530530                { 
     
    570570 
    571571        /** 
    572          * Retorna os idiomas   
    573          * @return array   
    574          * @access public 
    575          */      
     572         * Retorna os idiomas 
     573         * @return array 
     574         * @access public 
     575         */ 
    576576        function getLang(){ 
    577                          
     577 
    578578                $keys = array(); 
    579579                $values = array(); 
     
    586586                return $langs; 
    587587        } 
    588          
    589         /** 
    590          * Return  a given duration in human readable form, usefull for workitems duration  
    591          *  
     588 
     589        /** 
     590         * Return  a given duration in human readable form, usefull for workitems duration 
     591         * 
    592592         *  @param $to 
    593593         *  @return string a given duration in human readable form, usefull for workitems duration 
     
    599599                $to = $to - ($hours*3600); 
    600600                $min = date("i", $to); 
    601                 $to = $to - ($min*60);                   
     601                $to = $to - ($min*60); 
    602602                $sec = date("s", $to); 
    603603 
    604604                return tra('%1 days, %2:%3:%4',$days,$hours,$min,$sec); 
    605605        } 
    606          
     606 
    607607        /** 
    608608         *  Instances 
     
    657657                $cod_process = array(); 
    658658 
    659                 $ldap = &$GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP'); 
     659                $ldap = &Factory::getInstance('WorkflowLDAP'); 
    660660                $viewActivitiesID = array(); 
    661661                foreach ($result['data'] as $row) 
     
    740740        /** 
    741741         * Aplicacoes externas do usuario 
    742          * @return array  
     742         * @return array 
    743743         * @access public 
    744744         */ 
     
    746746        { 
    747747                $webserver_url = $_SESSION['phpgw_info']['workflow']['server']['webserver_url']; 
    748                 $templateServer = &$GLOBALS['workflow']['factory']->getInstance('TemplateServer'); 
     748                $templateServer = &Factory::getInstance('TemplateServer'); 
    749749 
    750750                /* load the sites that the user can access */ 
     
    790790        /** 
    791791         * Organograma 
    792          * @return array com as areas da organizacao  
     792         * @return array com as areas da organizacao 
    793793         * @access public 
    794794         */ 
     
    819819        /** 
    820820         * Get the hierarchical Area 
    821          * @return array  
     821         * @return array 
    822822         * @access public 
    823823         */ 
Note: See TracChangeset for help on using the changeset viewer.