From: hickert Date: Fri, 13 May 2011 08:30:52 +0000 (+0000) Subject: Added device usage informations X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=55d626fb5b12985fc18464a802a257fffc6c10be;p=gosa.git Added device usage informations git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20820 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 1354c623e..225239f66 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/AddPartitionDialog.tpl +++ b/gosa-plugins/goto/admin/systems/goto/Device/AddPartitionDialog.tpl @@ -6,7 +6,7 @@ {t}Physical partition{/t}
-{t}Raid device{/t}
{t}Volume group{/t} @@ -81,7 +85,10 @@ {foreach from=$freeLvmPartitions item=item key=key}  {$item}
+ {if in_array($item, $vg_partitions)} checked {/if}> {$item} + {if isset($deviceUsage.part[$item])}    {$deviceUsage.part[$item].size} {t}MB{/t} + {elseif isset($deviceUsage.raid[$item])}    {$deviceUsage.raid[$item].size} {t}MB{/t}{/if} +
{/foreach} @@ -122,7 +129,10 @@ {foreach from=$freeRaidPartitions item=item key=key}  {$item}
+ {if in_array($item, $r_partitions)} checked {/if}> {$item} + {if isset($deviceUsage.part[$item])}   {$deviceUsage.part[$item].size} {t}MB{/t} + {elseif isset($deviceUsage.raid[$item])}   {$deviceUsage.raid[$item].size} {t}MB{/t}{/if} +
{/foreach} @@ -166,8 +176,12 @@ {t}Allowable drives{/t} - + {foreach from=$disks item=disk} + + {/foreach} 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 9620acf85..e6874c131 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_AddPartitionDialog.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_AddPartitionDialog.inc @@ -181,6 +181,8 @@ class AddPartitionDialog foreach($bool_attrs as $attr){ $smarty->assign("{$attr}_selected", $this->$attr != FALSE); } + + $smarty->assign("deviceUsage", $this->partitionObject->getDeviceUsage()); $smarty->assign('fsTypes', $fsTypes); $smarty->assign('raidLevelList', $this->raidLevelList); $smarty->assign('freeRaidPartitions', $this->freeRaidPartitions); @@ -278,7 +280,7 @@ class AddPartitionDialog $fsOptions = $this->v_fsOptions; $group = $this->v_group; $target = $this->v_mountPoint; - $size = $this->v_size; + $size = intval($this->v_size); $encrypt = $this->v_encrypt; $maxSize = NULL; @@ -347,7 +349,7 @@ class AddPartitionDialog } // Collect options - $size = $this->p_size; + $size = intval($this->p_size); $maxSize = NULL; if($this->p_size_options == 2){ $maxSize = $this->p_size_max_value; diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_DevicePartition.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_DevicePartition.inc index eb2350524..8cab63502 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_DevicePartition.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_DevicePartition.inc @@ -52,6 +52,11 @@ class DevicePartition /***** * Handle add-partition dialog *****/ + + + #echo "a = gosa.openObject('libinst.preseed.diskdefinition', '".$this->object->dump()."')
"; + #echo "a.addPartition('pv.00', 10, None, False, False, True, True, False, '', False, None, 'sda')"; + if(isset($_POST['create_partition'])){ $this->addDialog = new AddPartitionDialog($this->config, $this->object); } @@ -275,6 +280,7 @@ class DevicePartition $this->entryList->update(); $smarty = get_smarty(); + $smarty->assign("deviceUsage", $this->object->getDeviceUsage()); $smarty->assign('list', $this->entryList->render()); return($smarty->fetch(get_template_path('goto/Device/DevicePartition.tpl', TRUE))); }