From: hickert Date: Mon, 14 Jan 2008 10:06:23 +0000 (+0000) Subject: Some changes X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c967098faad93ca3233dea502eafc011979e5cdb;p=gosa.git Some changes -Still not working correclty git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8319 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc index 93381e07b..f3d903329 100755 --- a/gosa-core/include/class_gosaSupportDaemon.inc +++ b/gosa-core/include/class_gosaSupportDaemon.inc @@ -5,7 +5,7 @@ class gosaSupportDaemon private $o_sock = NULL; private $s_host = ""; private $i_port = 0; - private $i_timeout = 1; + private $f_timeout = 0.2; private $is_connected = FALSE; private $s_encryption_key = ""; @@ -16,17 +16,17 @@ class gosaSupportDaemon private $s_error = ""; private $b_error = FALSE; - public function __construct($host,$port,$key="secret-gosa-password",$connect=TRUE,$timeout=1) + public function __construct($host,$port,$key="secret-gosa-password",$connect=TRUE,$timeout=0.2) { $this->s_host = $host; $this->i_port = $port; - $this->i_timeout = $timeout; + $this->f_timeout = $timeout; $this->s_encryption_key = $key; } public function connect() { - $this->o_sock = new Socket_Client($this->s_host,$this->i_port,TRUE,$this->i_timeout); + $this->o_sock = new Socket_Client($this->s_host,$this->i_port,TRUE,$this->f_timeout); $this->o_sock->setEncryptionKey($this->s_encryption_key); if($this->o_sock->connected()){ $this->is_connected = TRUE; @@ -46,6 +46,7 @@ class gosaSupportDaemon { echo "Reload"; $this->entries = array(); + $this->pointer = 0; $xml_msg = "
gosa_query_jobdb
*
"; $this->connect(); if($this->is_connected){ diff --git a/gosa-core/include/class_socketClient.inc b/gosa-core/include/class_socketClient.inc index 73a0da5f6..653fc12d6 100644 --- a/gosa-core/include/class_socketClient.inc +++ b/gosa-core/include/class_socketClient.inc @@ -113,6 +113,8 @@ class Socket_Client $str = FALSE; if($this->handle){ + syslog(0,"----------------------------------------HIER----------------------------------"); + /* Check if there is something to read for us */ $read = array("0"=>$this->handle); $write = array(); @@ -149,8 +151,5 @@ class Socket_Client /* Terminate decryption handle and close module */ mcrypt_generic_deinit($this->td); } - } - - ?> diff --git a/gosa-core/plugins/addons/gotomasses/class_divListMasses.inc b/gosa-core/plugins/addons/gotomasses/class_divListMasses.inc index 615c333c4..61bcb1111 100644 --- a/gosa-core/plugins/addons/gotomasses/class_divListMasses.inc +++ b/gosa-core/plugins/addons/gotomasses/class_divListMasses.inc @@ -109,25 +109,15 @@ class divListMasses extends MultiSelectWindow foreach($tasks as $key => $task){ - + $color = ""; /* Skip unchecked actions */ # if(!in_array($task['Action'],$allowed_action)){ # continue; # } - /* Handle coloring */ - $color=""; - if($this->parent->sort_by == "TaskID"){ - if(!in_array($task['TASK_ID'],$c_keys)){ - $c_keys[] = $task['TASK_ID']; - $last_c = !$last_c; - } - $color = "background-color: ".$colors[$last_c]; - } - /* Create actions */ $id = $task['ROWID']; - $queue_pos = $task['Queue_Position']; + $queue_pos = $id; $prio_actions = " "; $prio_actions.= " "; $prio_actions.= " "; diff --git a/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc b/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc index 775a28483..5c8efebcf 100644 --- a/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc +++ b/gosa-core/plugins/addons/gotomasses/class_gotomasses.inc @@ -24,7 +24,7 @@ class gotomasses extends plugin /* Include config object */ $this->config= &$config; $this->divlist = new divListMasses($this->config,$this); - $this->o_queue = new gosaSupportDaemon("10.3.67.111","20082","secret-gosa-password",FALSE,2); + $this->o_queue = new gosaSupportDaemon("10.3.67.111","20082","secret-gosa-password",FALSE,1); } @@ -222,7 +222,8 @@ class gotomasses extends plugin ************/ $this->divlist->execute(); - $this->divlist->SetEntries($this->get_queue_entries()); + $entries = $this->get_queue_entries(); + $this->divlist->SetEntries($entries); return($this->divlist->Draw()); } @@ -240,10 +241,26 @@ class gotomasses extends plugin $ret = array(); while($entry = $this->o_queue->fetch()){ $task = $entry['ROWID']; - $entry['Queue_Position'] = $task; $ret[]= $entry; } - return($ret); + $map = array("QueuePosition" => "ROWID", + "Action" => "STATUS", + "TaskID" => "HEADERTAG", + "TargetName" => "MACADDRESS", + "Schedule" => "TIMESTAMP"); + $sort_tmp = array(); + foreach($ret as $entry_id => $entry){ + $sort_tmp[$entry_id] = $entry[$map[$this->sort_by]]; + } + natcasesort($sort_tmp); + $return = array(); + foreach($sort_tmp as $entry_id => $value){ + $return[] = $ret[$entry_id]; + } + if($this->sort_dir != "up"){ + $return = array_reverse($return); + } + return($return); }