From 1d7e912782ed15ea9f06bc109af3641492c0964c Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 16 May 2011 07:48:09 +0000 Subject: [PATCH] Fixed size calculations git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20829 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/goto/Device/class_AddPartitionDialog.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 dea20dcb3..5be549117 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_AddPartitionDialog.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_AddPartitionDialog.inc @@ -305,7 +305,7 @@ class AddPartitionDialog return($size * $multiplicator); } } - return(intval(preg_replace("/[^0-9]/", $size))); + return(intval(preg_replace("/[^0-9]/", "", $size))); } @@ -430,10 +430,11 @@ class AddPartitionDialog // Collect options $size = $this->convertSize($this->p_size); $maxSize = NULL; - if($this->p_size_options == 2){ + if($this->p_size_options == 1){ $maxSize = $this->p_size_max_value; } - $grow = $this->p_size_options == 1; + $grow = $this->p_size_options == 2; + $format = $this->p_format == 1; $boot = $this->p_bootable == 1; $primary = $this->p_forcePrimary; @@ -469,6 +470,9 @@ class AddPartitionDialog @$this->partitionObject->addPartition($target,$size, $maxSize, $grow, $format, $boot, $primary, $fsType, $fsOptions , $encrypt, $passphrase, $disk); + print_a(array($target,$size, $maxSize, $grow, $format, $boot, $primary, + $fsType, $fsOptions , $encrypt, $passphrase, $disk)); + // Display potential errors if(!$this->partitionObject->success()){ $msg = sprintf(_("Failed to add '%s': %s"), _("Partition"), $this->partitionObject->getError()); -- 2.30.2