Code

Updated systems listing
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Apr 2010 15:34:09 +0000 (15:34 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Apr 2010 15:34:09 +0000 (15:34 +0000)
-we now colour rows for locked systems .

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17976 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_filterSYSTEMS.inc
gosa-plugins/systems/admin/systems/class_systemManagement.inc
gosa-plugins/systems/admin/systems/system-filter.xml
gosa-plugins/systems/admin/systems/system-list.xml

index dc9eb972cc1e2f998ab17ff781bb46628d4e622c..d4f66f2cbc1b37a0e7e7685df839f7795bb13bdb 100644 (file)
@@ -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);
     }
 }
index d9b59cf6613075d01291be5cc10fc7ad1cdb5777..56d1c62fb1c01a761bd5919e392e07c50f28809a 100644 (file)
@@ -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]:"&nbsp;";
-      $rc = "<rowClass:entry-locked/>";
       $rc = "";
+      switch($state){
+        case 'locked' : $rc = "<rowClass:entry-locked/>"; break;
+        case 'error' : $rc = "<rowClass:entry-locked/>"; break;
+      }
       return("<a href='?plug=".$_GET['plug']."&amp;PID={$pid}&amp;act=listing_edit_{$row}' title='{$dn}'>{$desc}</a>{$rc}");
   }
 
index 6e2d395288b772288fae52c7f7bb5e480f8b64f4..5f6dc1de730e0b8fff209f33a36946962c8f651e 100644 (file)
@@ -23,6 +23,7 @@
     <attribute>FAIclass</attribute>
     <attribute>macAddress</attribute>
     <attribute>gotoLastUser</attribute>
+    <attribute>state</attribute>
   </definition>
 
   <search>
index 754f5a1f2240d1d160d5cd0b7bfd60375eaa3e58..e719021e7280769617f9ff7f7553f388493a3f12 100644 (file)
       <label>Description</label>
       <sortAttribute>description</sortAttribute>
       <sortType>string</sortType>
-      <value>%{filter:filterSystemDescription(row,dn,pid,description)}</value>
+      <value>%{filter:filterSystemDescription(row,dn,pid,state,description)}</value>
       <export>true</export>
     </column>