Changeset 3167 for branches/2.2/workflow/inc/class.bo_userinterface.inc.php
- Timestamp:
- 08/17/10 16:17:12 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/workflow/inc/class.bo_userinterface.inc.php
r1470 r3167 10 10 \**************************************************************************/ 11 11 12 require_once('class.so_userinterface.inc.php');13 12 require_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 18 14 /** 19 15 * @package Workflow … … 43 39 function bo_userinterface() 44 40 { 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'); 48 44 } 49 45 … … 68 64 $webserver_url = $_SESSION['phpgw_info']['workflow']['server']['webserver_url']; 69 65 70 $templateServer = &$GLOBALS['workflow']['factory']->getInstance('TemplateServer');66 $templateServer =& Factory::getInstance('TemplateServer'); 71 67 foreach ($result['data'] as $line) 72 68 { … … 95 91 $recset[$procname_ver]['useHTTPS'] = 0; 96 92 } 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 } 103 106 } 104 107 … … 120 123 $pid = $params['pid']; 121 124 $result = array(); 122 123 $process = new Process($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);125 126 $process = &Factory::newInstance('Process'); 124 127 $process->getProcess($pid); 125 128 $result['wf_procname'] = $process->name; 126 129 $result['wf_version'] = $process->version; 127 130 $result['wf_description'] = $process->description; 128 129 $activ_manager = new ActivityManager($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);131 132 $activ_manager = &Factory::newInstance('ActivityManager'); 130 133 $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; 135 138 } 136 139 … … 148 151 $itemsPerPage = isset($preferences['ui_items_per_page']) ? $preferences['ui_items_per_page'] : 15; 149 152 $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); 151 154 152 155 /* define the sorting */ … … 263 266 else 264 267 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']); 266 269 267 270 /* unset unneeded information */ … … 495 498 } 496 499 497 $instance = new Instance($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);500 $instance = &Factory::newInstance('Instance'); 498 501 $instance->getInstance($instanceID); 499 502 500 $process = new Process($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID);503 $process = &Factory::newInstance('Process'); 501 504 $process->getProcess($instance->pId); 502 505 … … 508 511 'wf_instance_id' => $instance->instanceId, 509 512 'wf_priority' => $instance->priority, 510 'wf_owner' => $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP')->getName($instance->owner),513 'wf_owner' => Factory::getInstance('WorkflowLDAP')->getName($instance->owner), 511 514 '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), 513 516 'wf_name' => $instance->name, 514 517 'wf_category' => $instance->category, … … 526 529 $result['wf_ended'] = ""; 527 530 528 $ldap = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');531 $ldap = &Factory::getInstance('WorkflowLDAP'); 529 532 foreach ($instance->workitems as $line) 530 533 { … … 657 660 $cod_process = array(); 658 661 659 $ldap = & $GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP');662 $ldap = &Factory::getInstance('WorkflowLDAP'); 660 663 $viewActivitiesID = array(); 661 664 foreach ($result['data'] as $row) … … 726 729 /* paginate the result */ 727 730 $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); 729 732 $output['instances'] = $paging->restrictItems($output['instances']); 730 733 $output['paging_links'] = $paging->commonLinks(); … … 740 743 /** 741 744 * Aplicacoes externas do usuario 742 * @return array 745 * @return array 743 746 * @access public 744 747 */ … … 746 749 { 747 750 $webserver_url = $_SESSION['phpgw_info']['workflow']['server']['webserver_url']; 748 $templateServer = & $GLOBALS['workflow']['factory']->getInstance('TemplateServer');751 $templateServer = &Factory::getInstance('TemplateServer'); 749 752 750 753 /* load the sites that the user can access */ … … 927 930 return $checkWarnings; 928 931 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'])) 933 945 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 );939 946 940 947 return $result; … … 1066 1073 function callVoipConnect($params) 1067 1074 { 1068 $cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP');1075 $cachedLDAP = Factory::newInstance('CachedLDAP'); 1069 1076 $cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP); 1070 1077
Note: See TracChangeset
for help on using the changeset viewer.