Code

Prepared systemManagement to colour the list rows for type of systems
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Apr 2010 14:54:57 +0000 (14:54 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Apr 2010 14:54:57 +0000 (14:54 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17973 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 5130a1c28e65868b7629aa53d0bf5ef71e1bbf29..94f8a7bc48479dd711d60a945beee6e430d9bc1a 100644 (file)
@@ -97,6 +97,7 @@ class systemManagement extends management
     // Build headpage
     $headpage = new listing(get_template_path("system-list.xml", true));
     $headpage->registerElementFilter("systemRelease", "systemManagement::systemRelease");
+    $headpage->registerElementFilter("filterSystemDescription", "systemManagement::filterSystemDescription");
     $headpage->setFilter($filter);
     $filter->setConverter('systemManagement::incomingFilterConverter');
 
@@ -1362,6 +1363,33 @@ class systemManagement extends management
   }
 
 
+  static function filterSystemDescription($row,$dn,$pid,$description=array())
+  {
+      $result= "&nbsp;";
+
+      $row= func_get_arg(0);
+      $dn= LDAP::fix(func_get_arg(1));
+      $params= array(func_get_arg(2));
+
+      // Collect sprintf params
+      for ($i = 3;$i < func_num_args();$i++) {
+          $val= func_get_arg($i);
+          if (is_array($val)){
+              $params[]= $val[0];
+              continue;
+          }
+          $params[]= $val;
+      }
+
+      $result= "&nbsp;";
+      $trans= call_user_func_array("sprintf", $params);
+      if ($trans != "") {
+          return("<a href='?plug=".$_GET['plug']."&amp;PID=$pid&amp;act=listing_edit_$row' title='$dn'>$trans</a>");
+      }
+
+      return $result;
+  }
+
   static function systemRelease($a,$b,$c,$objectclasses= null,$class= null)
   {
     global $config;
index b9c68c856c5d7c0446057ef852a6ddad6a27b330..754f5a1f2240d1d160d5cd0b7bfd60375eaa3e58 100644 (file)
       <label>Description</label>
       <sortAttribute>description</sortAttribute>
       <sortType>string</sortType>
-      <value>%{filter:link(row,dn,"%s",description)}</value>
+      <value>%{filter:filterSystemDescription(row,dn,pid,description)}</value>
       <export>true</export>
     </column>