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

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

File:
1 edited

Legend:

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

    r1470 r3167  
    1010\**************************************************************************/ 
    1111 
    12 require_once('class.so_userinterface.inc.php'); 
    1312require_once('class.bo_ajaxinterface.inc.php'); 
    14 require_once('class.Paging.inc.php'); 
    15  
    16 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'GUI' . SEP . 'GUI.php'); 
    17 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php'); 
     13 
    1814/** 
    1915 * @package Workflow 
     
    4339        function bo_userinterface() 
    4440        { 
    45                 parent::bo_ajaxinterface();      
    46                 $this->so = new so_userinterface(); 
    47                 $GLOBALS['ajax']->gui = new GUI($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID); 
     41                parent::bo_ajaxinterface(); 
     42                $this->so = &Factory::getInstance('so_userinterface'); 
     43                $GLOBALS['ajax']->gui = &Factory::newInstance('GUI'); 
    4844        } 
    4945 
     
    6864                $webserver_url = $_SESSION['phpgw_info']['workflow']['server']['webserver_url']; 
    6965 
    70                 $templateServer = &$GLOBALS['workflow']['factory']->getInstance('TemplateServer'); 
     66                $templateServer =& Factory::getInstance('TemplateServer'); 
    7167                foreach ($result['data'] as $line) 
    7268                { 
     
    9591                                        $recset[$procname_ver]['useHTTPS'] = 0; 
    9692                        } 
    97                         $recset[$procname_ver][] = array('wf_activity_id'       => $line['wf_activity_id'], 
    98                                                                                 'wf_name'                       => $line['wf_name'], 
    99                                                                                 'wf_menu_path'          => $line['wf_menu_path'], 
    100                                                                                 'wf_type'                       => $line['wf_type'], 
    101                                                                                 'wf_is_autorouted'      => $line['wf_is_autorouted'], 
    102                                                                                 'wf_is_interactive' => $line['wf_is_interactive']); 
     93                        if (!is_dir(GALAXIA_PROCESSES . '/' . $line['wf_normalized_name'])) 
     94                        { 
     95                                $recset[$procname_ver]['wf_iconfile'] = $templateServer->generateImageLink('navbar_nocode.png'); 
     96                        } 
     97                        else 
     98                        { 
     99                                $recset[$procname_ver][] = array('wf_activity_id'       => $line['wf_activity_id'], 
     100                                                                                                'wf_name'                       => $line['wf_name'], 
     101                                                                                                'wf_menu_path'          => $line['wf_menu_path'], 
     102                                                                                                'wf_type'                       => $line['wf_type'], 
     103                                                                                                'wf_is_autorouted'      => $line['wf_is_autorouted'], 
     104                                                                                                'wf_is_interactive' => $line['wf_is_interactive']); 
     105                        } 
    103106                } 
    104107 
     
    120123                $pid = $params['pid']; 
    121124                $result = array(); 
    122                  
    123                 $process = new Process($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID); 
     125 
     126                $process = &Factory::newInstance('Process'); 
    124127                $process->getProcess($pid); 
    125128                $result['wf_procname'] = $process->name; 
    126129                $result['wf_version'] = $process->version; 
    127130                $result['wf_description'] = $process->description; 
    128                  
    129                 $activ_manager = new ActivityManager($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID); 
     131 
     132                $activ_manager = &Factory::newInstance('ActivityManager'); 
    130133                $result['wf_activities'] = $activ_manager->get_process_activities($pid); 
    131                  
    132                 $this->disconnect_all(); 
    133                  
    134                 return $result;  
     134 
     135                $this->disconnect_all(); 
     136 
     137                return $result; 
    135138        } 
    136139 
     
    148151                $itemsPerPage = isset($preferences['ui_items_per_page']) ? $preferences['ui_items_per_page'] : 15; 
    149152                $lightVersion = ((isset($preferences['use_light_interface']) ? $preferences['use_light_interface'] : 0) == 1); 
    150                 $paging = new Paging($itemsPerPage, $_POST); 
     153                $paging = Factory::newInstance('Paging', $itemsPerPage, $_POST); 
    151154 
    152155                /* define the sorting */ 
     
    263266                                else 
    264267                                        if ($row['wf_user'] != '') 
    265                                                 $row['wf_user_fullname'] = $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($row['wf_user']); 
     268                                                $row['wf_user_fullname'] = Factory::getInstance('WorkflowLDAP')->getName($row['wf_user']); 
    266269 
    267270                                /* unset unneeded information */ 
     
    495498                } 
    496499 
    497                 $instance = new Instance($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID); 
     500                $instance = &Factory::newInstance('Instance'); 
    498501                $instance->getInstance($instanceID); 
    499502 
    500                 $process = new Process($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID); 
     503                $process = &Factory::newInstance('Process'); 
    501504                $process->getProcess($instance->pId); 
    502505 
     
    508511                        'wf_instance_id' => $instance->instanceId, 
    509512                        'wf_priority' => $instance->priority, 
    510                         'wf_owner' => $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($instance->owner), 
     513                        'wf_owner' => Factory::getInstance('WorkflowLDAP')->getName($instance->owner), 
    511514                        'wf_next_activity' => $instance->nextActivity, 
    512                         'wf_next_user' => $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($instance->nextUser), 
     515                        'wf_next_user' => Factory::getInstance('WorkflowLDAP')->getName($instance->nextUser), 
    513516                        'wf_name' => $instance->name, 
    514517                        'wf_category' => $instance->category, 
     
    526529                $result['wf_ended'] = ""; 
    527530 
    528                 $ldap = &$GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP'); 
     531                $ldap = &Factory::getInstance('WorkflowLDAP'); 
    529532                foreach ($instance->workitems as $line) 
    530533                { 
     
    657660                $cod_process = array(); 
    658661 
    659                 $ldap = &$GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP'); 
     662                $ldap = &Factory::getInstance('WorkflowLDAP'); 
    660663                $viewActivitiesID = array(); 
    661664                foreach ($result['data'] as $row) 
     
    726729                        /* paginate the result */ 
    727730                        $itemsPerPage = isset($_SESSION['phpgw_info']['workflow']['user']['preferences']['ui_items_per_page']) ? $_SESSION['phpgw_info']['workflow']['user']['preferences']['ui_items_per_page'] : 15; 
    728                         $paging = new Paging($itemsPerPage, $_POST); 
     731                        $paging = Factory::newInstance('Paging', $itemsPerPage, $_POST); 
    729732                        $output['instances'] = $paging->restrictItems($output['instances']); 
    730733                        $output['paging_links'] = $paging->commonLinks(); 
     
    740743        /** 
    741744         * Aplicacoes externas do usuario 
    742          * @return array  
     745         * @return array 
    743746         * @access public 
    744747         */ 
     
    746749        { 
    747750                $webserver_url = $_SESSION['phpgw_info']['workflow']['server']['webserver_url']; 
    748                 $templateServer = &$GLOBALS['workflow']['factory']->getInstance('TemplateServer'); 
     751                $templateServer = &Factory::getInstance('TemplateServer'); 
    749752 
    750753                /* load the sites that the user can access */ 
     
    927930                        return $checkWarnings; 
    928931 
    929                 $result = $this->so->searchEmployee($params['searchTerm'], $this->organizationInfo['organizacao_id']); 
    930                 $this->disconnect_all(); 
    931  
    932                 if ($result === false) 
     932                $result = array(); 
     933 
     934                /* do the search */ 
     935                $result['bytelephone'] = $this->so->searchEmployeeByTelephone($params['searchTerm'], $this->organizationInfo['organizacao_id']); 
     936                $result['employees'] = $this->so->searchEmployeeByName($params['searchTerm'], $this->organizationInfo['organizacao_id']); 
     937                $result['bygroup'] = $this->so->searchEmployeeByArea($params['searchTerm'], $this->organizationInfo['organizacao_id']); 
     938 
     939                $this->disconnect_all(); 
     940 
     941                /* if all searches returned false */ 
     942                if (!is_array($result['employees']) and 
     943                        !is_array($result['bygroup']) and 
     944                        !is_array($result['bytelephone'])) 
    933945                        return array('error' => 'O sistema de busca não pode ser utilizado para sua organização'); 
    934  
    935                 $sort_function = create_function('$a,$b', 'return strcasecmp($a[\'cn\'],$b[\'cn\']);'); 
    936  
    937                 usort($result['employees'], $sort_function ); 
    938                 usort($result['bygroup'], $sort_function ); 
    939946 
    940947                return $result; 
     
    10661073        function callVoipConnect($params) 
    10671074        { 
    1068                 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP'); 
     1075                $cachedLDAP = Factory::newInstance('CachedLDAP'); 
    10691076                $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP); 
    10701077 
Note: See TracChangeset for help on using the changeset viewer.