From dc124a1c798a562a53b2c2245e93e85e13b9cc16 Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 31 May 2006 12:27:10 +0000 Subject: [PATCH] Added toggling of remove flag for packages git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3585 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiPackage.inc | 27 ++++++++++++++++++++++++-- plugins/admin/fai/faiPackage.tpl | 1 + 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/plugins/admin/fai/class_faiPackage.inc b/plugins/admin/fai/class_faiPackage.inc index 2a9e4043a..fb845ee41 100644 --- a/plugins/admin/fai/class_faiPackage.inc +++ b/plugins/admin/fai/class_faiPackage.inc @@ -273,6 +273,22 @@ class faiPackage extends plugin $this->is_dialog =true; } + /* Configuration dialog open*/ + if((isset($_POST['Markpkg']))&&(isset($_POST['usedPackages']))&&(!empty($_POST['usedPackages']))){ + foreach($_POST['usedPackages'] as $pkg){ + if (isset($this->usedPackages[$pkg])){ + unset($this->usedPackages[$pkg]); + if (preg_match('/^-/', $pkg)){ + $pkg= preg_replace('/^-/', '', $pkg); + } else { + $pkg= preg_replace('/^/', '-', $pkg); + } + $this->usedPackages[$pkg]= $pkg; + } + } + print_a($this->usedPackages); + } + /* Save Configuration */ if(isset($_POST['SaveObjectConfig'])){ if($this->FAIstate != "freeze"){ @@ -378,10 +394,17 @@ class faiPackage extends plugin $c_str = " - "._("package is configured"); } + /* Adapt used name if we're marked for removal */ + $dsc= ""; + if (preg_match('/^-/', $usedName)){ + $dsc= " - "._("Package marked for removal"); + $usedName= preg_replace('/^-/', '! ', $usedName); + } + if(isset($this->list[$usedName][1])){ - $a_ret[$usedName] = $usedName." [".$this->list[$usedName][1]."]".$c_str; + $a_ret[$usedName] = $usedName." [".$this->list[$usedName][1]."]".$c_str.$dsc; }else{ - $a_ret[$usedName] = $usedName.$c_str; + $a_ret[$usedName] = $usedName.$c_str.$dsc; } } } diff --git a/plugins/admin/fai/faiPackage.tpl b/plugins/admin/fai/faiPackage.tpl index d88ff6443..40c133134 100644 --- a/plugins/admin/fai/faiPackage.tpl +++ b/plugins/admin/fai/faiPackage.tpl @@ -71,6 +71,7 @@ + -- 2.30.2