From 515c3aa1d74365df93b1bf6fe3c17f5005267dcb Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 11 May 2011 11:13:55 +0000 Subject: [PATCH] Updated partition handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20804 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/Device/AddPartitionDialog.tpl | 155 ++++++++++-------- .../goto/Device/class_AddPartitionDialog.inc | 37 ++--- 2 files changed, 102 insertions(+), 90 deletions(-) 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"){ -- 2.30.2