[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 3 require_once(dirname(__FILE__) . SEP . 'class.monitor.inc.php'); 4 5 class ui_monitorprocesses extends monitor 6 { 7 8 var $public_functions = array( 9 'form' => true, 10 ); 11 //new filters for this monitor child 12 var $filter_active; 13 var $filter_valid; 14 15 function ui_monitorprocesses() 16 { 17 parent::monitor('monitor_processes'); 18 } 19 20 function form() 21 { 22 $this->filter_active = get_var('filter_active', 'any', ''); 23 $this->filter_valid = get_var('filter_valid', 'any', ''); 24 //override default monitor settings 25 $this->order = get_var('order', 'any', 'wf_last_modif'); 26 $this->sort_mode = $this->order . '__' . $this->sort; 27 28 if ($this->filter_process) $this->wheres[] = "wf_p_id='" . $this->filter_process . "'"; 29 if ($this->filter_active) $this->wheres[] = "wf_is_active='" . $this->filter_active . "'"; 30 if ($this->filter_valid) $this->wheres[] = "wf_is_valid='" . $this->filter_valid . "'"; 31 $this->wheres = implode(' and ', $this->wheres); 32 33 $this->link_data = array( 34 'filter_process' => $this->filter_process, 35 'filter_valid' => $this->filter_valid, 36 'filter_active' => $this->filter_active, 37 'search_str' => $this->search_str, 38 'offset' => $this->offset, 39 'start' => $this->start, 40 ); 41 $processes_list =& $this->process_monitor->monitor_list_processes($this->start, $this->offset, $this->sort_mode, $this->search_str, $this->wheres); 42 //_debug_array($processes_list); 43 44 $this->show_monitor_tabs($this->class_name); 45 $this->show_filter_process(); 46 $this->show_filter_active($this->filter_active); 47 $this->show_filter_valid($this->filter_valid); 48 $this->show_process_table($processes_list['data'],$processes_list['cant']); 49 50 $this->fill_general_variables(); 51 $this->finish(); 52 53 } 54 55 function show_filter_active($filter_active) 56 { 57 //set variable for other forms 58 $this->t->set_var(array('filter_active_up'=>$filter_active)); 59 //show the select 60 $this->t->set_var(array( 61 'selected_active_all' => ($filter_active == '')? 'selected="selected"' : '', 62 'selected_active_active' => ($filter_active == 'y')? 'selected="selected"' : '', 63 'selected_active_inactive' => ($filter_active == 'n')? 'selected="selected"' : '', 64 )); 65 } 66 67 function show_filter_valid($filter_valid) 68 { 69 //set variable for other forms 70 $this->t->set_var(array('filter_valid_up'=>$filter_valid)); 71 //show the select 72 $this->t->set_var(array( 73 'selected_valid_all' => ($filter_valid == '')? 'selected="selected"' : '', 74 'selected_valid_valid' => ($filter_valid == 'y')? 'selected="selected"' : '', 75 'selected_valid_invalid' => ($filter_valid == 'n')? 'selected="selected"' : '', 76 )); 77 } 78 79 function show_process_table(&$processes_list_data, $total_number) 80 { 81 //warning header names are header_[name or alias of the column in the query without a dot] 82 //this is necessary for sorting 83 $header_array = array( 84 'wf_name' => lang('Name'), 85 'wf_is_active' => lang('active'), 86 'wf_is_valid' => lang('valid'), 87 ); 88 $this->fill_nextmatchs($header_array,$total_number); 89 90 $this->t->set_block('monitor_processes', 'block_listing', 'listing'); 91 foreach ($processes_list_data as $process) 92 { 93 $this->t->set_var(array( 94 'process_href' => $GLOBALS['egw']->link('/index.php', 'menuaction=workflow.ui_adminprocesses.form&p_id='. $process['wf_p_id']), 95 'process_name' => $process['wf_name'], 96 'process_version' => $process['wf_version'], 97 'process_href_activities' => $GLOBALS['egw']->link('/index.php', 'menuaction=workflow.ui_monitoractivities.form&filter_process='. $process['wf_p_id']), 98 'process_activities' => $process['activities'], 99 'process_active_img' => ($process['wf_is_active'] == 'y')? '<img src="'. $GLOBALS['egw']->common->image('workflow', 'refresh2') .'" alt="'. lang('Active') .'" title="'. lang('Active') .'" />' : '', 100 'process_valid_img' => $GLOBALS['egw']->common->image('workflow', ($process['wf_is_valid'] == 'y')? 'green_dot' : 'red_dot'), 101 'process_valid_alt' => ($process['wf_is_valid'] == 'y')? lang('Valid') : lang('Invalid'), 102 'process_href_inst_active' => $GLOBALS['egw']->link('/index.php', 'menuaction=workflow.ui_monitorinstances.form&filter_process='. $process['wf_p_id'] .'&filter_status=active'), 103 'process_inst_active' => $process['active_instances'], 104 'process_href_inst_comp' => $GLOBALS['egw']->link('/index.php', 'menuaction=workflow.ui_monitorinstances.form&filter_process='. $process['wf_p_id'] .'&filter_status=completed'), 105 'process_inst_comp' => $process['completed_instances'], 106 'process_href_inst_abort' => $GLOBALS['egw']->link('/index.php', 'menuaction=workflow.ui_monitorinstances.form&filter_process='. $process['wf_p_id'] .'&filter_status=aborted'), 107 'process_inst_abort' => $process['aborted_instances'], 108 'process_href_inst_excep' => $GLOBALS['egw']->link('/index.php', 'menuaction=workflow.ui_monitorinstances.form&filter_process='. $process['wf_p_id'] .'&filter_status=exception'), 109 'process_inst_excep' => $process['exception_instances'], 110 'class_alternate_row' => $this->nextmatchs->alternate_row_color($tr_color, true), 111 )); 112 $this->t->parse('listing', 'block_listing', true); 113 } 114 if (!count($processes_list_data)) $this->t->set_var('listing', '<tr><td colspan="5" align="center">'.lang('There are no processes').'</tr>'); 115 } 116 } 117 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |