summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fd65bbb)
raw | patch | inline | side by side (parent: fd65bbb)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 29 Jan 2010 14:49:53 +0000 (14:49 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 29 Jan 2010 14:49:53 +0000 (14:49 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15453 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/addons/goto/class_gotomasses.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/addons/goto/class_gotomasses.inc b/gosa-plugins/goto/addons/goto/class_gotomasses.inc
index e42b46478ff06083e925ee533dd91c23c4795c19..5e7c1aa6a4c2c392b7bd979e85fb475981306bed 100644 (file)
management::closeDialogs();
}
- function _execute()
- {
-
- /************
- * ADD
-
- /* Display dialogs if currently opened */
- if(is_object($this->dialog)){
- $this->dialog->save_object();
- $display = $this->dialog->execute();
-
- if($this->dialog instanceOf goto_import_file && $this->dialog->import_successful){
- $this->dialog = FALSE;
- }else{
- return($display);
- }
- }
-
-
- $divlist->SetDropDownHeaderMenu($s);
-
- if($this->sort_dir == "up"){
- $sort_img = "<img src='images/lists/sort-up.png' alt='/\' border=0>";
- }else{
- $sort_img = "<img src='images/lists/sort-down.png' alt='\/' border=0>";
- }
-
- if($this->sort_by == "TargetName"){ $sort_img_1 = $sort_img; } else { $sort_img_1 = "" ;}
- if($this->sort_by == "TaskID"){ $sort_img_2 = $sort_img; } else { $sort_img_2 = "" ;}
- if($this->sort_by == "Schedule"){ $sort_img_3 = $sort_img; } else { $sort_img_3 = "" ;}
- if($this->sort_by == "Action"){ $sort_img_4 = $sort_img; } else { $sort_img_4 = "" ;}
-
- /* Create divlist */
- $divlist->SetListHeader("<input type='image' src='images/lists/reload.png' title='"._("Reload")."'>");
-
- $plug = $_GET['plug'];
- $chk = "<input type='checkbox' id='select_all' name='select_all'
- onClick='toggle_all_(\"^item_selected_[0-9]*$\",\"select_all\");' >";
-
- /* set Page header */
- $divlist->AddHeader(array("string"=> $chk, "attach"=>"style='width:20px;'"));
- $divlist->AddHeader(array("string"=>"<a href='?plug=".$plug."&sort=TargetName'>"._("Target").$sort_img_1."</a>"));
- $divlist->AddHeader(array("string"=>"<a href='?plug=".$plug."&sort=TaskID'>"._("Task").$sort_img_2."</a>",
- "attach"=>"style='width:120px;'"));
- $divlist->AddHeader(array("string"=>_("Period"),
- "attach"=>"style='width:60px;'"));
- $divlist->AddHeader(array("string"=>"<a href='?plug=".$plug."&sort=Schedule'>"._("Schedule").$sort_img_3."</a>",
- "attach"=>"style='width:140px;'"));
- $divlist->AddHeader(array("string"=>"<a href='?plug=".$plug."&sort=Action'>"._("Status").$sort_img_4."</a>",
- "attach"=>"style='width:80px;'"));
- $divlist->AddHeader(array("string"=>_("Action"),
- "attach"=>"style='border-right:0px;width:140px;'"));
-
-
- /* Reload the list of entries */
- $this->reload();
-
- foreach($this->entries as $key => $task){
-
- $prio_actions="";
- $action = "";
-
-
- /* If WAITING add priority action
- */
- if(in_array($task['STATUS'],array("waiting")) && $this->acl_is_writeable("")){
- $prio_actions.= "<input class='center' type='image' src='plugins/goto/images/prio_increase.png'
- title='"._("Move up")."' name='prio_up_".$key."'> ";
- $prio_actions.= "<input class='center' type='image' src='plugins/goto/images/prio_decrease.png'
- title='"._("Move down")."' name='prio_down_".$key."'> ";
- }
-
- /* If WAITING add pause action
- */
- if(in_array($task['STATUS'],array("waiting")) && $this->acl_is_writeable("")){
- $prio_actions.= "<input class='center' type='image' src='images/status_pause.png'
- title='"._("Pause job")."' name='pause_".$key."'> ";
- }
-
- /* If PAUSED add resume action
- */
- if(in_array($task['STATUS'],array("paused")) && $this->acl_is_writeable("")){
- $prio_actions.= "<input class='center' type='image' src='images/status_start.png'
- title='"._("Resume job")."' name='resume_".$key."'> ";
- }
-
- /* If PAUSED or WAITING add execution action
- */
- if(in_array($task['STATUS'],array("paused","waiting")) && $this->acl_is_writeable("")){
- $prio_actions.= "<input class='center' type='image' src='images/rocket.png'
- title='"._("Execute now")."' name='execute_process_".$key."'> ";
- }
-
- /* Add logview button, currently ever.
- */
- if($this->acl_is_readable("")){
- $action .= "<input type='image' src='plugins/goto/images/view_logs.png' name='log_view_".$key."'
- class='center' title='"._("View logs")."' alt='"._("View logs")."'> ";
- }
-
- /* If PAUSED or WAITING add edit action
- */
- if(in_array($task['STATUS'],array("waiting")) && $this->acl_is_writeable("")){
- $action.= "<input type='image' src='images/lists/edit.png' name='edit_task_".$key."'
- class='center' title='"._("Edit")."' alt='"._("Edit")."'>";
- }
-
- /* If PROCESSING add abort action
- */
- if(in_array($task['STATUS'],array("processing")) && preg_match("/install/",$task['HEADERTAG']) && $this->acl_is_writeable("")){
- $action.= "<img src='images/empty.png' alt=''>";
- $action.= "<input class='center' type='image' src='images/small_error.png'
- title='"._("Abort job")."' name='abort_process_".$key."'>";
- }
-
- /* If WAITING or ERROR add remove action
- */
- if( $this->acl_is_removeable() && in_array($task['STATUS'],array("waiting","error","processed"))){
- $action.= "<input type='image' src='images/lists/trash.png' name='remove_task_".$key."'
- class='center' title='"._("Remove")."' alt='"._("Remove")."'>";
- }
- if($this->acl_is_writeable("") && in_array($task['STATUS'],array("processing")) && !preg_match("/install/",$task['HEADERTAG'])){
- $action.= "<input type='image' src='images/lists/trash.png' name='remove_task_".$key."'
- class='center' title='"._("Remove")."' alt='"._("Remove")."'>";
- }
-
- /* Create entry display name and tooltip */
- $color = "";
- $display = $task['MACADDRESS'];
- $tooltip = "";
- if(isset($task['PLAINNAME']) && !preg_match("/none/i",$task['PLAINNAME'])){
- $display = $task['PLAINNAME'];
- $tooltip = " title='".$task['MACADDRESS']."' ";
- }
-
-
- $display2= $task['HEADERTAG'];
-
- /* Check if this event exists as Daemon class
- * In this case, display a more accurate entry.
- */
- if(isset($this->events['QUEUED'][$task['HEADERTAG']])){
- $evt_name = $this->events['QUEUED'][$task['HEADERTAG']];
- $event_type = $this->events['BY_CLASS'][$evt_name];
- $display2 = $event_type['s_Menu_Name'];
-
- if(strlen($display2) > 20){
- $display2 = substr($display2,0,18)."...";
- }
-
- if(isset($event_type['ListImage']) && !empty($event_type['ListImage'])){
- $display2 = $event_type['ListImage']." ".$display2;
- }
- }
-
- $status = $task['STATUS'];
-
- if($status == "waiting"){
- $status = "<img class='center' src='plugins/goto/images/clock.png' alt=''> "._("Waiting");
- }
- if($status == "error"){
- $status = "<img class='center' src='images/false.png' alt=''> "._("Error");
- }
- if($status == "processed"){
- $status = "<img class='center' src='images/true.png' alt=''> "._("Processed");
- }
-
- /* Special handling for all entries that have
- STATUS == "processing" && PROGRESS == NUMERIC
- */
- if($status == "processing" && isset($task['PROGRESS'])){
- $percent = $task['PROGRESS'];
-
- /* Show activation? */
- if ($percent == "goto-activation"){
- $status = "<img class='center' src='images/lists/off.png' alt=''> "._("Locked");
-
- /* Show hardware detect? */
- } elseif ($percent == "goto-hardware-detection") {
- $status = "<img class='center' src='plugins/goto/images/hardware.png' alt=''> "._("Detection");
-
- /* Real percent */
- } else {
- if (preg_match('/install/', $task['HEADERTAG'])){
- $status = "<img src='progress.php?x=80&y=13&p=".$task['PROGRESS']."' alt=''
- id='progress_".preg_replace("/:/","_",$task['MACADDRESS'])."'>";
- } else {
- $status = preg_replace('/ /', ' ', _("in progress"));
- }
- }
- }
-
- // Check whether this is a periodical job or not.
- $period = "";
- if(isset($task['PERIODIC']) && !preg_match("/none/i",$task['PERIODIC'])){
- $tmp = explode("_", $task['PERIODIC']);
- if(count($tmp) == 2){
- $period= $tmp[0]." "._($tmp[1]);
- }
- }
-
- /* Create each field */
- $field0 = array("string" => "<input type='checkbox' id='item_selected_".$task['ID']."' name='item_selected_".$key."'>" ,
- "attach" => "style='width:20px;".$color."'");
- $field1 = array("string" => $display,
- "attach" => $tooltip."style='".$color."'");
- $field1a= array("string" => $display2,
- "attach" => "style='".$color.";width:120px;'");
- $field1b= array("string" => $period,
- "attach" => "style='".$color.";width:60px;'");
- if ($task['TIMESTAMP'] == "19700101000000"){
- $field2 = array("string" => _("immediately"),"attach" => "style='".$color.";width:140px;'");
- } else {
- $field2 = array("string" => date("d.m.Y H:i:s",strtotime($task['TIMESTAMP'])),"attach" => "style='".$color.";width:140px;'");
- }
- $field3 = array("string" => $status,"attach" => "style='".$color.";width:80px;'");
- $field4 = array("string" => $prio_actions.$action,"attach" => "style='".$color.";text-align:right;width:140px;border-right:0px;'");
- $divlist->AddElement(array($field0,$field1,$field1a,$field1b,$field2,$field3,$field4));
- }
-
- $smarty = get_smarty();
- $smarty->assign("events",$this->events);
- $smarty->assign("start",$this->start);
- $smarty->assign("start_real", ($this->start + 1));
- $smarty->assign("ranges", array("10" => "10",
- "20" => "20",
- "25" => "25",
- "50" => "50",
- "100"=> "100",
- "200"=> "200",
- "9999" => "*"));
-
- $count = $this->o_queue->number_of_queued_entries($this->event_tags);
- if(!$count) $count = $this->range;
- $divlist->SetListFooter(range_selector($count, $this->start, $this->range,"range"));
- $smarty->assign("range",$this->range);
- $smarty->assign("div",$divlist->Draw());
-
- return(management::execute());
- return($smarty->fetch (get_template_path('gotomasses.tpl', TRUE, dirname(__FILE__))));
- }
-
-
/*! \brief Resumes to status 'waiting'.
* @return Boolean TRUE in case of success, else FALSE.
*/