From 384be1553a51a23a2c8b02a76ef9044ae5317c7b Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 29 Apr 2010 15:34:09 +0000 Subject: [PATCH] Updated systems listing -we now colour rows for locked systems . git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17976 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/admin/systems/class_filterSYSTEMS.inc | 12 +++++++++--- .../systems/admin/systems/class_systemManagement.inc | 7 +++++-- gosa-plugins/systems/admin/systems/system-filter.xml | 1 + gosa-plugins/systems/admin/systems/system-list.xml | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc b/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc index dc9eb972c..d4f66f2cb 100644 --- a/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc +++ b/gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc @@ -40,6 +40,7 @@ class filterSYSTEMS { // Detect Workstation & templates }elseif(in_array('gotoWorkstation', $entry['objectClass'])){ if(!isset($entry['macAddress'][0]) || $entry['macAddress'][0] == "-"){ + unset($entries[$key]); continue; // We do not need templates anymore, we've ogroups now. //$entries[$key]['objectClass'][] = 'FAKE_OC_WorkstationTemplate'; } @@ -51,6 +52,7 @@ class filterSYSTEMS { // Detect Terminal & templates }elseif(in_array('gotoTerminal', $entry['objectClass'])){ if(!isset($entry['macAddress'][0]) || $entry['macAddress'][0] == "-"){ + unset($entries[$key]); continue; // We do not need templates anymore, we've ogroups now. //$entries[$key]['objectClass'][] = 'FAKE_OC_TerminalTemplate'; } @@ -62,6 +64,7 @@ class filterSYSTEMS { // Detect Server & templates }elseif(in_array('goServer', $entry['objectClass'])){ if(!isset($entry['macAddress'][0]) || $entry['macAddress'][0] == "-"){ + unset($entries[$key]); continue; // We do not need templates anymore, we've ogroups now. //$entries[$key]['objectClass'][] = 'FAKE_OC_ServerTemplate'; } @@ -79,6 +82,7 @@ class filterSYSTEMS { } // Detect object states + $state = 'none'; foreach(array('gotoWorkstation','gotoTerminal','goServer') as $type){ if(in_array($type, $entry['objectClass'])){ @@ -96,18 +100,20 @@ class filterSYSTEMS { case 'scheduledupdate': $state= 'busy'; break; - default: $state =""; } } } } - if(!empty($state)){ + + if(isset($entries[$key])){ $entries[$key][$entries[$key]['count']]= 'state'; $entries[$key]['state']= $state; $entries[$key]['count'] ++; } - } + + + } return($entries); } } diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index d9b59cf66..56d1c62fb 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -1363,12 +1363,15 @@ class systemManagement extends management } - static function filterSystemDescription($row,$dn,$pid,$description=array()) + static function filterSystemDescription($row,$dn,$pid,$state,$description=array()) { $dn= LDAP::fix(func_get_arg(1)); $desc = isset($description[0])?$description[0]:" "; - $rc = ""; $rc = ""; + switch($state){ + case 'locked' : $rc = ""; break; + case 'error' : $rc = ""; break; + } return("{$desc}{$rc}"); } diff --git a/gosa-plugins/systems/admin/systems/system-filter.xml b/gosa-plugins/systems/admin/systems/system-filter.xml index 6e2d39528..5f6dc1de7 100644 --- a/gosa-plugins/systems/admin/systems/system-filter.xml +++ b/gosa-plugins/systems/admin/systems/system-filter.xml @@ -23,6 +23,7 @@ FAIclass macAddress gotoLastUser + state diff --git a/gosa-plugins/systems/admin/systems/system-list.xml b/gosa-plugins/systems/admin/systems/system-list.xml index 754f5a1f2..e719021e7 100644 --- a/gosa-plugins/systems/admin/systems/system-list.xml +++ b/gosa-plugins/systems/admin/systems/system-list.xml @@ -177,7 +177,7 @@ description string - %{filter:filterSystemDescription(row,dn,pid,description)} + %{filter:filterSystemDescription(row,dn,pid,state,description)} true -- 2.30.2