Code

Fixed size calculations
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 May 2011 07:48:09 +0000 (07:48 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 May 2011 07:48:09 +0000 (07:48 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20829 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Device/class_AddPartitionDialog.inc

index dea20dcb355b0cf1607d6698f836353b54d4a3cd..5be5491175d1f8f4f5a17195b38636d9ec53316d 100644 (file)
@@ -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());