Code

Added possibility to handle colspans in department chooser
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Aug 2009 15:23:46 +0000 (15:23 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 Aug 2009 15:23:46 +0000 (15:23 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14088 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_listing.inc

index c50453a8ee75fee3228fa7cb581af8febb00310b..7d8138348388885a26eeb771b6259af2ca87dbc7 100644 (file)
@@ -267,11 +267,18 @@ class listing {
         }
 
         // Render defined department columns, fill the rest with some stuff
+        $rest= $this->numColumns - 1;
         foreach ($this->xmlData['table']['department'] as $index => $config) {
-          $result.="<td ".$this->colprops[$index]." class='list1'>".$this->renderCell($config['value'], $entry, $row)."</td>";
+          $colspan= 1;
+          if (isset($config['span'])){
+            $colspan= $config['span'];
+          }
+          $result.="<td colspan='$colspan' ".$this->colprops[$index]." class='list1'>".$this->renderCell($config['value'], $entry, $row)."</td>";
+          $rest-= $colspan;
         }
-        $last= count($this->xmlData['table']['department']) + 1;
-        $rest= $this->numColumns - $last;
+
+        // Fill remaining cols with nothing
+        $last= $this->numColumns - $rest;
         for ($i= 0; $i<$rest; $i++){
           $result.= "<td ".$this->colprops[$last+$i-1]." class='list1'>&nbsp;</td>";
         }