From de910eb65f75610977b30264dc6c91911c6318e6 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 11 Jan 2006 09:44:20 +0000 Subject: [PATCH] Added multi deletion for Partition Tables git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2443 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiPartitionTable.inc | 37 +++++++++++-------- plugins/admin/fai/faiPartitionTable.tpl | 2 +- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/plugins/admin/fai/class_faiPartitionTable.inc b/plugins/admin/fai/class_faiPartitionTable.inc index fc35fd188..f6adfeb34 100644 --- a/plugins/admin/fai/class_faiPartitionTable.inc +++ b/plugins/admin/fai/class_faiPartitionTable.inc @@ -107,13 +107,16 @@ class faiPartitionTable extends plugin if((isset($_POST['EditDisk']))&&(isset($_POST['disks']))){ $usedDiskNames =array(); + + $Udisk = $_POST['disks'][0]; + foreach($this->disks as $key=>$disk){ - if($key != $_POST['disks']){ + if($key != $Udisk){ $usedDiskNames[]= $key; } } - $this->dialog = new faiPartitionTableEntry($this->config,$this->dn,$usedDiskNames,$this->disks[$_POST['disks']]); - $_SESSION['objectinfo'] = $this->disks[$_POST['disks']]['dn']; + $this->dialog = new faiPartitionTableEntry($this->config,$this->dn,$usedDiskNames,$this->disks[$Udisk]); + $_SESSION['objectinfo'] = $this->disks[$Udisk]['dn']; $this->is_dialog = true; } @@ -165,21 +168,23 @@ class faiPartitionTable extends plugin * Assign delete status for all its partitions */ if((isset($_POST['DelDisk']))&&(!empty($_POST['disks']))){ - $disk = $_POST['disks']; - if($this->disks[$disk]['status']=="edited"){ - $this->disks[$disk."-delete"]=$this->disks[$disk]; - unset($this->disks[$disk]); - $disk = $disk."-delete"; - $this->disks[$disk]['status']="delete"; - foreach($this->disks[$disk]['partitions'] as $name => $value ){ - if($value['status']=="edited"){ - $this->disks[$disk]['partitions'][$name]['status']="delete"; - }else{ - unset($this->disks[$disk]['partitions'][$name]); + + foreach($_POST['disks'] as $disk) { + if($this->disks[$disk]['status']=="edited"){ + $this->disks[$disk."-delete"]=$this->disks[$disk]; + unset($this->disks[$disk]); + $disk = $disk."-delete"; + $this->disks[$disk]['status']="delete"; + foreach($this->disks[$disk]['partitions'] as $name => $value ){ + if($value['status']=="edited"){ + $this->disks[$disk]['partitions'][$name]['status']="delete"; + }else{ + unset($this->disks[$disk]['partitions'][$name]); + } } + }else{ + unset($this->disks[$disk]); } - }else{ - unset($this->disks[$disk]); } } diff --git a/plugins/admin/fai/faiPartitionTable.tpl b/plugins/admin/fai/faiPartitionTable.tpl index 0389b6f13..feb0f443f 100644 --- a/plugins/admin/fai/faiPartitionTable.tpl +++ b/plugins/admin/fai/faiPartitionTable.tpl @@ -37,7 +37,7 @@
- {html_options values=$diskKeys output=$disks}
-- 2.30.2