From 8bdb0d3a07fea3fd6fcd005114d80e6bc813b0ad Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 8 Jun 2006 04:13:04 +0000 Subject: [PATCH] Added sorting to service list only show action icons if service was saved git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3683 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/class_divListSystemService.inc | 20 +++++++++++++++---- plugins/admin/systems/class_serverService.inc | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/plugins/admin/systems/class_divListSystemService.inc b/plugins/admin/systems/class_divListSystemService.inc index 7ba7bcf44..f50af48da 100644 --- a/plugins/admin/systems/class_divListSystemService.inc +++ b/plugins/admin/systems/class_divListSystemService.inc @@ -69,32 +69,44 @@ class divListSystemService extends MultiSelectWindow function setEntries($list) { foreach($list as $name => $entry){ + $tmp[$name] = $entry['Message']; + } + + natcasesort($tmp); + $tmp2 = array(); + foreach($tmp as $name => $value){ + $tmp2[$name] = $list[$name]; + } + + foreach($tmp2 as $name => $entry){ switch($entry['Status']){ - case '' : $str ="";break; + case '' : $str =" ";break; case SERVICE_STOPPED : $str =""; break; case SERVICE_STARTED : $str =""; break; case SERVICE_RESTARTED : $str ="R"; break; default: $str= "".$entry["; } + $WasAccount = $this->parent->plugins[$name] -> initially_was_account; + $field1 = array("string" => $str ,"attach" => "style='width:20px;'"); $field2 = array("string" => $entry['Message'] ); $actions =""; - if($entry['AllowStart']){ + if($entry['AllowStart'] && $WasAccount){ $actions .= " "; }else{ $actions .= " "; } - if($entry['AllowStart']){ + if($entry['AllowStart'] && $WasAccount){ $actions .= " "; }else{ $actions .= " "; } - if($entry['AllowStart']){ + if($entry['AllowStart'] && $WasAccount){ $actions .= " "; }else{ diff --git a/plugins/admin/systems/class_serverService.inc b/plugins/admin/systems/class_serverService.inc index fab65db69..f88ea3486 100644 --- a/plugins/admin/systems/class_serverService.inc +++ b/plugins/admin/systems/class_serverService.inc @@ -271,7 +271,7 @@ class ServerService extends plugin if($service == ALL_SERVICES){ foreach($this->plugins as $name => $obj){ - if($this->plugins[$name]->is_account){ + if($this->plugins[$name]->initially_was_account && $this->plugins[$name]->is_account){ $this->plugins[$name]->setStatus($action); } } -- 2.39.5