Code

Updated system listing
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 26 Jul 2010 08:13:20 +0000 (08:13 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 26 Jul 2010 08:13:20 +0000 (08:13 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19098 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index d6518ad9aef543c6ac83f54534b0643f4c81eba2..d49555a2a2d0790ebf5efd6d9ae8e7fea9c4f2a4 100644 (file)
@@ -99,6 +99,7 @@ class systemManagement extends management
         $headpage = new listing(get_template_path("system-list.xml", true));
         $headpage->registerElementFilter("systemRelease", "systemManagement::systemRelease");
         $headpage->registerElementFilter("filterSystemDescription", "systemManagement::filterSystemDescription");
+        $headpage->registerElementFilter("filterLink", "systemManagement::filterLink");
         $headpage->setFilter($filter);
         $filter->setConverter('systemManagement::incomingFilterConverter');
 
@@ -1367,7 +1368,8 @@ class systemManagement extends management
     static function filterSystemDescription($row,$dn,$pid,$state,$description=array())
     {
         $dn= LDAP::fix(func_get_arg(1));
-        $desc = isset($description[0])?$description[0]:"";
+        $desc = isset($description[0])?set_post($description[0]):"";
+    
         $rc = "";
         switch($state){
             case 'locked' : $rc = "<rowClass:entry-locked/><rowLabel:locked/>"; break;
@@ -1375,9 +1377,37 @@ class systemManagement extends management
             case 'busy' : $rc = "<rowClass:entry-busy/><rowLabel:busy/>"; break;
             case 'warning' : $rc = "<rowClass:entry-warning/><rowLabel:warning/>"; break;
         }
-        return("<a href='?plug=".$_GET['plug']."&amp;PID={$pid}&amp;act=listing_edit_{$row}' title='{$dn}'>".set_post($desc)."</a>{$rc}");
+        return("<a href='?plug=".$_GET['plug']."&amp;PID={$pid}&amp;act=listing_edit_{$row}' title='{$dn}'>".$desc."</a>{$rc}");
     }
 
+
+    static function filterLink()
+    {
+        $result= "&nbsp;";
+        $row= func_get_arg(0);
+        $pid= func_get_arg(4);
+        $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 e719021e7280769617f9ff7f7553f388493a3f12..146537b70858a09b27016f7f537546a9d4784776 100644 (file)
       <label>Name</label>
       <sortAttribute>cn</sortAttribute>
       <sortType>string</sortType>
-      <value>%{filter:link(row,dn,"%s",cn)}</value>
+      <value>%{filter:filterLink(row,dn,"%s",cn,pid)}</value>
       <export>true</export>
     </column>