From: hickert Date: Fri, 6 Jun 2008 11:18:54 +0000 (+0000) Subject: Updated gotmasses X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c06021f9c0031c7b9482ecb5606e8f9d8208ffd6;p=gosa.git Updated gotmasses git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11259 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 ce00d1e93..e913d7162 100644 --- a/gosa-plugins/goto/addons/goto/class_gotomasses.inc +++ b/gosa-plugins/goto/addons/goto/class_gotomasses.inc @@ -240,25 +240,41 @@ class gotomasses extends plugin $ret = $this->o_queue->ids_exist($ids); $ret = $this->o_queue->get_entries_by_id($ret); $tmp = ""; + + $deleteable_jobs = array(); + $not_deleteable_jobs = array(); foreach($ret as $task){ + /* Create a printable job name/description */ + if(isset($this->events['QUEUED'][$task['HEADERTAG']])){ + $evt_name = $this->events['QUEUED'][$task['HEADERTAG']]; + $evt = $this->events['BY_CLASS'][$evt_name]; + $j_name = $task['ID']." - ".$evt['s_Menu_Name']." ".$task['MACADDRESS']; + }else{ + $j_name = $task['ID']." - ".$task['HEADERTAG']." ".$task['MACADDRESS']; + } + /* Only remove WAITING or ERROR entries */ if(in_array($task['STATUS'],array("waiting","error","processed")) || - ($task['STATUS'] == "processing" && !preg_match("/install/",$task['HEADERTAG'])) ){ + ($task['STATUS'] == "processing" && !preg_match("/install/",$task['HEADERTAG'])) ){ $this->ids_to_remove[] = $task['ID']; - if(isset($this->events['QUEUED'][$task['HEADERTAG']])){ - $evt_name = $this->events['QUEUED'][$task['HEADERTAG']]; - $evt = $this->events['BY_CLASS'][$evt_name]; - $tmp.= "\n".$task['ID']." - ".$evt['s_Menu_Name']." ".$task['MACADDRESS']; - }else{ - $tmp.= "\n".$task['ID']." - ".$task['HEADERTAG']." ".$task['MACADDRESS']; - } + $deleteable_jobs[] = $j_name; + }else{ + $not_deleteable_jobs[] = $j_name; } } - $smarty->assign("multiple", TRUE); - $smarty->assign("info",msgPool::deleteInfo("
".$tmp."
")); - $this->current = $s_entry; - return($smarty->fetch(get_template_path('remove.tpl', TRUE))); + if(count($not_deleteable_jobs)){ + msg_dialog::display(_("Remove"), + sprintf(_("The following jobs couldn't be deleted, they have to be aborted: %s"), + "
".msgPool::buildList($not_deleteable_jobs)),INFO_DIALOG); + } + + if(count($this->ids_to_remove)){ + $smarty->assign("multiple", TRUE); + $smarty->assign("info",msgPool::deleteInfo($deleteable_jobs)); + $this->current = $s_entry; + return($smarty->fetch(get_template_path('remove.tpl', TRUE))); + } } } }