From: hickert Date: Fri, 29 Jan 2010 14:49:53 +0000 (+0000) Subject: Removed old divlist stuff X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4dd9ce7a4ac930e29f5bcfb9e2becc8da0a65a19;p=gosa.git Removed old divlist stuff git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15453 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/addons/goto/class_gotomasses.inc b/gosa-plugins/goto/addons/goto/class_gotomasses.inc index e42b46478..5e7c1aa6a 100644 --- a/gosa-plugins/goto/addons/goto/class_gotomasses.inc +++ b/gosa-plugins/goto/addons/goto/class_gotomasses.inc @@ -449,249 +449,6 @@ class gotomasses extends management 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 = "/\"; - }else{ - $sort_img = "\/"; - } - - 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(""); - - $plug = $_GET['plug']; - $chk = ""; - - /* set Page header */ - $divlist->AddHeader(array("string"=> $chk, "attach"=>"style='width:20px;'")); - $divlist->AddHeader(array("string"=>""._("Target").$sort_img_1."")); - $divlist->AddHeader(array("string"=>""._("Task").$sort_img_2."", - "attach"=>"style='width:120px;'")); - $divlist->AddHeader(array("string"=>_("Period"), - "attach"=>"style='width:60px;'")); - $divlist->AddHeader(array("string"=>""._("Schedule").$sort_img_3."", - "attach"=>"style='width:140px;'")); - $divlist->AddHeader(array("string"=>""._("Status").$sort_img_4."", - "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.= " "; - $prio_actions.= " "; - } - - /* If WAITING add pause action - */ - if(in_array($task['STATUS'],array("waiting")) && $this->acl_is_writeable("")){ - $prio_actions.= " "; - } - - /* If PAUSED add resume action - */ - if(in_array($task['STATUS'],array("paused")) && $this->acl_is_writeable("")){ - $prio_actions.= " "; - } - - /* If PAUSED or WAITING add execution action - */ - if(in_array($task['STATUS'],array("paused","waiting")) && $this->acl_is_writeable("")){ - $prio_actions.= " "; - } - - /* Add logview button, currently ever. - */ - if($this->acl_is_readable("")){ - $action .= " "; - } - - /* If PAUSED or WAITING add edit action - */ - if(in_array($task['STATUS'],array("waiting")) && $this->acl_is_writeable("")){ - $action.= ""; - } - - /* If PROCESSING add abort action - */ - if(in_array($task['STATUS'],array("processing")) && preg_match("/install/",$task['HEADERTAG']) && $this->acl_is_writeable("")){ - $action.= ""; - $action.= ""; - } - - /* If WAITING or ERROR add remove action - */ - if( $this->acl_is_removeable() && in_array($task['STATUS'],array("waiting","error","processed"))){ - $action.= ""; - } - if($this->acl_is_writeable("") && in_array($task['STATUS'],array("processing")) && !preg_match("/install/",$task['HEADERTAG'])){ - $action.= ""; - } - - /* 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 = " "._("Waiting"); - } - if($status == "error"){ - $status = " "._("Error"); - } - if($status == "processed"){ - $status = " "._("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 = " "._("Locked"); - - /* Show hardware detect? */ - } elseif ($percent == "goto-hardware-detection") { - $status = " "._("Detection"); - - /* Real percent */ - } else { - if (preg_match('/install/', $task['HEADERTAG'])){ - $status = ""; - } 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" => "" , - "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. */