Code

Fixed Lvm disks in FAI partition handling.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 6 Aug 2009 07:27:33 +0000 (07:27 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 6 Aug 2009 07:27:33 +0000 (07:27 +0000)
-Display correct devices in available list.
-Fixed info list of used partitions.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13975 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc
gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
gosa-plugins/fai/admin/fai/faiDiskEntry.tpl

index 48815b6806bd9d57c4a17d9bace34f3411e47612..a3819d5cece1bb74199064ece9796d43f90417a7 100644 (file)
@@ -278,18 +278,30 @@ class faiDiskEntry extends plugin
     $objs = $disks;
     foreach($disks as $disk){
       foreach($disk['partitions'] as $id => $part){
-        $objs[$disk['cn']] = $part;
+        $part['parentDisk'] = $disk;
+        $objs[$part['cn']] = $part;
       }
     }
 
     $list = array();
     foreach($this->lvmDevices as $device){
-      $list[$device] = $device;
 
-      if(isset($objs[$device]['FAIpartitionSize'])){
-        $list[$device].= _("Size").":&nbsp;";
-        $list[$device].= $objs[$device]['FAIpartitionSize'];
+      $str = $device;
+      $str = preg_replace("/ /","&nbsp;",str_pad($str,20," "));
+
+      if(isset($objs[$device])){
+
+        if(isset($objs[$device]['FAIpartitionSize'])){
+          if($objs[$device]['parentDisk']['FAIdiskType'] == "raid"){
+            $str .= _("Disks").":&nbsp;";
+            $str .= $objs[$device]['FAIpartitionSize'];
+          }else{
+            $str .= _("Size").":&nbsp;";
+            $str .= $objs[$device]['FAIpartitionSize'];
+          } 
+        }
       }
+      $list[$device] = $str;
     }
     return($list);
   }
@@ -299,7 +311,7 @@ class faiDiskEntry extends plugin
     $array = array();
     foreach($this->parent->disks as $disk){
       foreach($disk['partitions'] as $key => $part){
-        $name = $disk['cn'];
+        $name = $part['cn'];
         if(!isset($this->lvmDevices[$name])){
           $array[$name] = $name;
         }
index dd66cffbc929619bde05d55ddff416bb857d4467..492d3c882d545ffbfdbd19ae3843056f005102af 100644 (file)
@@ -137,7 +137,7 @@ class faiPartitionTable extends plugin
       if ($this->FAIpartitionMethod == "setup-storage") {
         if(isset($_POST['AddDisk'])) $type = "disk";
         if(isset($_POST['AddRaid'])) $type = "raid";
-        if(isset($_POST['AddAddVolgroup'])) $type = "lvm";
+        if(isset($_POST['AddVolgroup'])) $type = "lvm";
         $this->dialog = new faiDiskEntry($this->config,$this->dn,$this, array(),$type); 
       } else {
         $this->dialog = new faiPartitionTableEntry($this->config,$this->dn,$this); 
index 3b489d3682009745c8b324a48b94911568ddcd0b..7e25562fae4a05e226ff773ba5449279dae6dde5 100644 (file)
@@ -70,7 +70,8 @@
     <td>
       <h2>{t}Combined physical partitions{/t}</h2>
 
-      <select name='physicalPartition' size=5 style="width:100%;">
+      <select style='font-family: monospace; width: 100%;' 
+        name='physicalPartition' size=5> 
         {html_options options=$plist}
       </select>
       <br>