Code

Display an icon in the system list again, if system is member of an object group
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Feb 2010 16:56:17 +0000 (16:56 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Feb 2010 16:56:17 +0000 (16:56 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15637 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 369d7b649d6c928801af9c69386ab76dcab172ea..08e1ced82a790d296bbf9efcb8ca486d459b0d0e 100644 (file)
@@ -86,16 +86,17 @@ 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
     $headpage = new listing(get_template_path("system-list.xml", true));
+    $headpage->registerElementFilter("systemDescription", "systemManagement::systemDescription");
     $headpage->setFilter($filter);
     $filter->setConverter('INCOMING', 'systemManagement::incomingFilterConverter');
 
@@ -145,6 +146,9 @@ 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);
   }
 
 
@@ -1344,6 +1348,28 @@ class systemManagement extends management
   }
 
 
+  function systemDescription($a,$b,$c,$d)
+  {
+    global $config;
+
+    // A ... solution, but I can't figure out a better solution right now.
+    $headpage = session::get('SYSTEMS_DESCRIPTION_FILTER');
+    if(!is_object($headpage)) return($str);
+    $str = $headpage->filterLink($a,$b,$c,$d);
+    $ldap = $config->get_ldap_link();
+    $ldap->cd($config->current['BASE']);
+    $ldap->search("(&(objectClass=gosaGroupOfNames)(member=".$b."))");
+    while($attrs = $ldap->fetch()){
+      $str .= "&nbsp;<img class='center' src='plugins/ogroups/images/ogroup.png' 
+          title='"._("Object group member")."' 
+          alt='("._("Object group member").")' >";
+      return($str);
+    }
+    
+    return($str);
+  }
+
+
   /*! \brief  !! Incoming dummy acls, required to defined acls for incoming objects
    */
   static function plInfo()
index 0ffe429037d530e1a88c8d4aa5c178aa5ef8c715..d10d8460b47216374d69fc334f2ded7bebe26a65 100644 (file)
       <label>Description</label>
       <sortAttribute>description</sortAttribute>
       <sortType>string</sortType>
-      <value>%{filter:link(row,dn,"%s",description)}</value>
+      <value>%{filter:systemDescription(row,dn,"%s",description)}</value>
       <export>true</export>
     </column>