Code

Toggle buttons and checkbox accordingly. So the disk headpage may be ready. Go for...
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 10 Jul 2009 07:25:09 +0000 (07:25 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 10 Jul 2009 07:25:09 +0000 (07:25 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13918 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
gosa-plugins/fai/admin/fai/faiPartitionTable.tpl

index 7dad1c3fa523b337cfe8efda169a459846db4e90..de7f3cdc677b95965feefe80d7491b0fee03e13c 100644 (file)
@@ -339,10 +339,21 @@ class faiPartitionTable extends plugin
     /* Assign mode */
     if ($this->FAIpartitionMethod == ""){
       $smarty->assign("mode", "");
+      $smarty->assign("storage_mode", "disabled");
     } else {
       $smarty->assign("mode", "checked");
+      $smarty->assign("storage_mode", "");
+    }
+    if (!count($this->disks)) {
+      $smarty->assign("lockmode", "");
+    } else {
+      $smarty->assign("lockmode", "disabled");
+    }
+    if (isset($this->disks['raid'])){
+      $smarty->assign("addraid", "disabled");
+    } else {
+      $smarty->assign("addraid", "");
     }
-    $smarty->assign("lockmode", "disabled");
 
     /* Divlist containing disks */
     $divlist = new divSelectBox("FAItemplates");
index e1520757ba85e167c006fffeaed887565b80bef9..d7ff43f58df938d4450a11e48cf7169b24d3c19c 100644 (file)
@@ -30,7 +30,7 @@
                                </table>
                                 <p class="seperator">&nbsp;</p>
                                 <p>
-                                <input type="checkbox" name="mode" value="1" {$mode} {$lockmode}> {t}Use 'setup-storage' to partition the disk{/t}                                      </p>
+                                <input type="checkbox" name="mode" value="1" {$mode} {$lockmode} onClick="changeState('AddRaid'); changeState('AddVolgroup');"> {t}Use 'setup-storage' to partition the disk{/t}                                      </p>
                </td>
                <td style="border-left: 1px solid rgb(160, 160, 160);">
                   &nbsp;
@@ -44,8 +44,8 @@
                                 {$Entry_divlist}
 {if $sub_object_is_addable}
                                 <input type="submit" name="AddDisk" value="{t}Add disk{/t}" title="{t}Add disk{/t}">
-                                <input type="submit" name="AddRaid" value="{t}Add RAID{/t}" title="{t}Add RAID{/t}" disabled>
-                                <input type="submit" name="AddVolgroup" value="{t}Add volume group{/t}" title="{t}Add volume group{/t}" disabled>
+                                <input type="submit" id="AddRaid" name="AddRaid" value="{t}Add RAID{/t}" title="{t}Add RAID{/t}" {$storage_mode} {$addraid}>
+                                <input type="submit" id="AddVolgroup" name="AddVolgroup" value="{t}Add volume group{/t}" title="{t}Add volume group{/t}" {$storage_mode}>
 {else}
                                 <input type="submit" name="AddDisk" value="{t}Add disk{/t}" title="{t}Add disk{/t}" disabled>
                                 <input type="submit" name="AddRaid" value="{t}Add RAID{/t}" title="{t}Add RAID{/t}" disabled>