Code

Added back release information
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 18 Feb 2010 10:47:50 +0000 (10:47 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 18 Feb 2010 10:47:50 +0000 (10:47 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15647 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 95e5b3cffaefd72668e14441bbd5563906e7d438..eb6b8e232232c564d755359399cb84fca7acfaeb 100644 (file)
@@ -86,12 +86,12 @@ class systemManagement extends management
     $this->storagePoints = array_unique($sP);
 
     // Build filter
-#    if (session::global_is_set(get_class($this)."_filter")){
    $filter= session::global_get(get_class($this)."_filter");
#   } else {
+    if (session::global_is_set(get_class($this)."_filter")){
+     $filter= session::global_get(get_class($this)."_filter");
+    } else {
       $filter = new filter(get_template_path("system-filter.xml", true));
       $filter->setObjectStorage($this->storagePoints);
-  #  }
+    }
     $this->setFilter($filter);
 
     // Build headpage
@@ -146,9 +146,6 @@ class systemManagement extends management
       $this->opsi = new opsi($this->config);
     }
     parent::__construct($config, $ui, "systems", $headpage);
-
-    // Used to generate an 'ogroup' icon within the description field.
-    session::set('SYSTEMS_DESCRIPTION_FILTER', $headpage);
   }
 
 
@@ -1348,13 +1345,26 @@ class systemManagement extends management
   }
 
 
-  function systemRelease($a,$b,$c,$d)
+  static function systemRelease($a,$b,$c,$objectclasses= null,$class= null)
   {
     global $config;
 
-    // A ... solution, but I can't figure out a better solution right now.
-    $headpage = session::get('SYSTEMS_DESCRIPTION_FILTER');
-    if(!is_array($d) || !count($d) || !is_object($headpage)) return("&nbsp;");
+    // No objectclasses set - go ahead
+    if(!$objectclasses) return("&nbsp;");
+
+    // Skip non fai objects
+    if (!in_array_ics("FAIobject", $objectclasses)) {
+      return "&nbsp;";
+    }
+
+    // If we've an own fai class, just use this
+    if ($class && is_array($class)) {
+      foreach (explode(' ', $class[0]) as $element) {
+        if ($element[0] == ":") {
+          return mb_substr($element, 1);
+        }
+      }
+    }
 
     $ldap = $config->get_ldap_link();
     $ldap->cd($config->current['BASE']);
index 563d7fd12f89015befeb8c4c46fc651a6314eb59..a7cca5c4d2b665c29b434af89ab52acc03f4251c 100644 (file)
       <label>Release</label>
       <sortAttribute>description</sortAttribute>
       <sortType>string</sortType>
-      <value>%{filter:systemRelease(row,dn,"%s",FAIclass)}</value>
+      <value>%{filter:systemRelease(row,dn,"%s",objectClass,FAIclass)}</value>
       <export>true</export>
     </column>