Code

Updated dn display to not break at spaces
[gosa.git] / plugins / admin / fai / class_faiSummaryTab.inc
index a2c48016c881427b60fb6a5b4d53b9ef60bcf1be..0db08e8660fcb20403e9dbc768eece4f294fd86e 100644 (file)
@@ -55,7 +55,8 @@ class faiSummaryTab extends plugin{
     $this->Result = array();
     $_SESSION['faiSummaryTab']['UniqueID'] = 0; 
     $tmp = $this->getBranches();
-    
+   
     /* Get classes & release name 
        There are 2 different tabs which use the summary tab
        faiProfile / Workstations */
@@ -74,12 +75,20 @@ class faiSummaryTab extends plugin{
     }elseif(isset($this->parent->by_name['workstartup'])){
       $this->Classes = $this->parent->by_object['workstartup']->FAIclass;
       $this->Release = $this->parent->by_object['workstartup']->FAIrelease;
+
+      /* Append workstation class && LAST */
+      if(isset($this->parent->by_object['workgeneric']->cn)){
+        $this->Classes[] = $this->parent->by_object['workgeneric']->cn;
+      }
+  
       $tmp = array_flip($tmp);
       if(!isset($tmp[$this->Release])) {
         $this->Release = "";
       }
     }
 
+    $this->Classes[] = "LAST";
+
     /* Set all available releases */
     $this->Releases = array_flip($this->getBranches());
     $this->usedClasses = array();
@@ -189,7 +198,7 @@ class faiSummaryTab extends plugin{
   function createSummary($data)
   {
     /* Don't generate any output, if there is no result */ 
-    $str ="<table style='width:100%;background:#F5F5F5;'> ";
+    $str ="<table cellspacing=0 cellpadding=2 style='width:100%;background:#F5F5F5;'> ";
     if(!count($this->Result)){
       $str.="<tr><td>"; 
       $str.= (_("This object has no FAI classes assigned."));
@@ -279,7 +288,10 @@ class faiSummaryTab extends plugin{
             if(isset($data['description'][0])){
               $str .= " [".$data['description'][0]."] ";
             }
-            $str .=" = '".$data['FAIvariableContent'][0]."'";
+            /* Only display FAIvariableContent if description dosn't contain [*] */ 
+            if(isset($data['description'][0]) && !preg_match("#\[\*\]#",$data['description'][0])){
+              $str .=" = '".$data['FAIvariableContent'][0]."'";
+            }
             $str .= "</td><td><i>".$data['CLASS']."</i>";
             $str .="</td></tr>";
           }