summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e63d8ea)
raw | patch | inline | side by side (parent: e63d8ea)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 24 Oct 2007 11:55:35 +0000 (11:55 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 24 Oct 2007 11:55:35 +0000 (11:55 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7639 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_hostActionQueue.inc | patch | blob | history | |
plugins/addons/gotomasses/class_divListMasses.inc | patch | blob | history | |
plugins/addons/gotomasses/class_gotomasses.inc | patch | blob | history |
index a6aa4a697e22212c13d20e361d96a50fe9c0ae78..efe3359a4e12e59e74139848cdb8356728ae902c 100644 (file)
$entry_id=preg_replace("/^.*entryid:([0-9]*).*$/","\\1",$comment);
$desc =preg_replace("/^.*desc:(.*)$/","\\1",$comment);
}
- if($task_id == 0 || !is_numeric($task_id)){
+ if($task_id == 0 || empty($task_id)){
$task_id = preg_replace("/[^0-9]*/","",microtime());
}
- if($entry_id == 0 || !is_numeric($entry_id)){
+ if($entry_id == 0 || empty($entry_id)){
$entry_id = preg_replace("/[^0-9]*/","",microtime());
}
private function _add_entry($entry,$task_id = 0)
{
- if($task_id == 0 || !is_numeric($task_id) || !isset($entry['TASK_ID']) || !is_numeric($entry['TASK_ID'])){
+ if($task_id == 0 || empty($task_id)){
$task_id=preg_replace("/[^0-9]*/","",microtime());
- $entry['TASK_ID'] = $task_id;
}
- if(!isset($entry['ID']) || !is_numeric($entry['ID'])){
+ $entry['TASK_ID'] = $task_id;
+ if(!isset($entry['ID']) || empty($entry['ID']) || !isset($entry['ID']) || empty($entry['ID'])){
$entry['ID'] = preg_replace("/[^0-9]*/","",microtime());
}
$this->a_queue[] = $entry;
diff --git a/plugins/addons/gotomasses/class_divListMasses.inc b/plugins/addons/gotomasses/class_divListMasses.inc
index 92bf31e3584b25ac8a10870b2c7a0f0190a74499..ea4794b685f46e67a673187e335d1aae5d952c3a 100644 (file)
}
$id = $task['ID'];
+ $color= "background-color: #".$task['color'];
$action = "<input type='image' src='images/edit.png' name='edit_task_".$id."' class='center' alt='"._("Edit")."'>";
if($this->parent->acl_is_removeable()){
$field0 = array("string" => "<input type='checkbox' id='item_selected_".$id."' name='item_selected_".$id."'>" ,
"attach" => "style='width:20px;'");
- $field1 = array("string" => preg_replace(array("/%id%/","/%str%/"),array($id,$this->parent->target_to_string($task)),$edit_link));
- $field2 = array("string" => $this->parent->time_to_string($task),"attach" => "style='width:100px;'");
- $field3 = array("string" => $this->parent->action_to_string($task),"attach" => "style='width:80px;'");
- $field4 = array("string" => $action,"attach" => "style='text-align:right;width:40px;border-right:0px;'");
+ $field1 = array("string" => preg_replace(array("/%id%/","/%str%/"),array($id,$this->parent->target_to_string($task)),$edit_link),
+ "attach" => "style='".$color."'");
+ $field2 = array("string" => $this->parent->time_to_string($task),"attach" => "style='".$color.";width:100px;'");
+ $field3 = array("string" => $this->parent->action_to_string($task),"attach" => "style='".$color.";width:80px;'");
+ $field4 = array("string" => $action,"attach" => "style='".$color.";text-align:right;width:40px;border-right:0px;'");
$this->AddElement(array($field0,$field1,$field2,$field3,$field4));
}
}
diff --git a/plugins/addons/gotomasses/class_gotomasses.inc b/plugins/addons/gotomasses/class_gotomasses.inc
index a71170fd7a395a335d7c8ec7124bbe5f3089c892..2b304d31ff4f7c89ce6f5b34664a51969f190fc2 100644 (file)
function get_queue_entries()
{
- if(!$this->o_queue->load()){
- print_red("ERROR:".$this->o_queue->get_error());
- return(FALSE);
- }
+ if(!$this->o_queue->load()){
+ print_red("ERROR:".$this->o_queue->get_error());
+ return(FALSE);
+ }
+
+ $tasks = array();
$ret = array();
while($entry = $this->o_queue->fetch()){
+ $task = $entry['TASK_ID'];
+ if(!isset($tasks[$task])){
+ $tasks[$task] = dechex(rand(100,240)).dechex(rand(100,240)).dechex(rand(100,240));
+ }
+
+ $entry['color'] = $tasks[$task];
$ret[]= $entry;
}
return($ret);
}
-
+
function target_to_string($data)
{