From: hickert Date: Wed, 11 May 2011 11:13:55 +0000 (+0000) Subject: Updated partition handling X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=515c3aa1d74365df93b1bf6fe3c17f5005267dcb;p=gosa.git Updated partition handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20804 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/Device/AddPartitionDialog.tpl b/gosa-plugins/goto/admin/systems/goto/Device/AddPartitionDialog.tpl index ae9cf1a43..315b60b1c 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/AddPartitionDialog.tpl +++ b/gosa-plugins/goto/admin/systems/goto/Device/AddPartitionDialog.tpl @@ -1,76 +1,93 @@ -

{t}Add Partition{/t}

- - - - - - - - - - - - - - - - - - - - - - - - - -
{t}Mount point{/t} - {if $fsType == "raid" || $fsType == "swap" || $fsType == "pv"} - - {else} - - {/if} -
{t}File system type{/t} - -
{t}Allowable drives{/t} - {foreach from=$disks item=item key=key} - {$item} - {/foreach} -
{t}Size{/t} - -
{t}Force to be primary partition{/t}
{t}Encrypt{/t}
+

{t}Type{/t}

+ +{t}Physical partition{/t}
+{t}Raid device{/t}
+{t}LVM Valume group{/t}
+{t}LVM Valume{/t}

-

{t}Additional size options{/t}

- - - - - - - - - - - - - -
{t}Fixed size{/t}
{t}Fill all space up to{/t} -  {t}MB{/t} -
{t}Fill to maximum allowable size{/t}
+ +{if $selected_type==1} +

{t}Add Partition{/t}

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
{t}Mount point{/t} + {if $fsType == "raid" || $fsType == "swap" || $fsType == "pv"} + + {else} + + {/if} +
{t}File system type{/t} + +
{t}Allowable drives{/t} + {foreach from=$disks item=item key=key} + {$item} + {/foreach} +
{t}Size{/t} + +
{t}Force to be primary partition{/t}
{t}Encrypt{/t}
+ +
+ +

{t}Additional size options{/t}

+ + + + + + + + + + + + + +
{t}Fixed size{/t}
{t}Fill all space up to{/t} +  {t}MB{/t} +
{t}Fill to maximum allowable size{/t}
+{/if}
diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_AddPartitionDialog.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_AddPartitionDialog.inc index b76db637c..b6bde4edc 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_AddPartitionDialog.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_AddPartitionDialog.inc @@ -1,24 +1,32 @@ disks[$disk['device']] = $disk['device']; } - if(!count($this->usedDisks)){ - $this->usedDisks[] = key($this->disks); - } + + // Select first disk as default. + $this->used_disk = key($this->disks); } @@ -62,11 +70,6 @@ class AddPartitionDialog foreach($this->attributes as $attr){ $smarty->assign($attr, $this->$attr); } - $used = array(); - foreach($this->disks as $disk){ - $used[$disk] = in_array($disk, $this->usedDisks); - } - $smarty->assign("disk_selected", $used); foreach(array("forcePrimary", "encrypt") as $attr){ $smarty->assign("{$attr}_selected", $this->$attr != FALSE); } @@ -92,14 +95,6 @@ class AddPartitionDialog foreach(array("forcePrimary", "encrypt") as $attr){ $this->$attr = isset($_POST[$attr]); } - - // Get selected disks - $this->usedDisks = array(); - foreach($this->disks as $disk){ - if(isset($_POST['disk_selected_'.$disk])){ - $this->usedDisks[] = $disk; - } - } } @@ -133,7 +128,7 @@ class AddPartitionDialog $fsOptions = ""; $encrypt = $this->encrypt; $passphrase = ""; - $disk = array_shift($this->usedDisks); + $disk = $this->used_disk; // We've to create a raid disk if($this->fsType == "raid"){