Code

Added status flags
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 22 Jan 2010 15:50:17 +0000 (15:50 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 22 Jan 2010 15:50:17 +0000 (15:50 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15267 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_serverService.inc
gosa-plugins/systems/admin/systems/serverService-list.xml

index 9a69e433ccd3d31f5cf0dcc4df59edcfa8322c84..455a6702af0b485df2af3cb7d65ff98aba206344 100644 (file)
@@ -77,6 +77,7 @@ class ServerService extends management
 
     // Build headpage
     $headpage = new listing(get_template_path("serverService-list.xml", true));
+    $headpage->registerElementFilter("filterServiceStatus", "ServerService::filterServiceStatus");
     $headpage->setFilter($filter);
 
     
@@ -113,6 +114,22 @@ class ServerService extends management
     return(session::get('ServerService'));
   }
 
+  static function filterServiceStatus($a,$b,$c,$d)
+  {
+    $img ="";
+    if(isset($d['0'])){
+      switch($d[0]){
+        case 'Restart' : $img = ('images/status_restarting.png'); break;
+        case 'Stop' : $img = ('images/lists/off.png'); break;
+        case 'Start' : $img = ('images/lists/on.png'); break;
+      }
+    }
+    if(!empty($img)){
+      return('<img src=\''.$img.'\'>');
+    }
+    return("");  
+  }
+  
 
   function execute()
   {
index f93d44e97e8d61c7b6fdc918a18fc81474249109..c179a6d415db59fc0ed108d7b434c749475bb388 100644 (file)
   </definition>
 
   <table>
-    <layout>||250px|170px;r|</layout>
+    <layout>|18px;c||250px|170px;r|</layout>
+
+    <column>
+      <label>!</label>
+      <sortAttribute>Status</sortAttribute>
+      <sortType>string</sortType>
+      <value>%{filter:filterServiceStatus(row,dn,"%s",Status)}</value>
+      <export>true</export>
+    </column>
 
     <column>
       <label>Description</label>