Code

Converted FAI package selection dialog - partly...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 28 Jan 2010 12:31:38 +0000 (12:31 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 28 Jan 2010 12:31:38 +0000 (12:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15413 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiPackage.inc

index bbfa30c33429b47b331af09abd09e5e89f3e132e..86830bfc9b8e04f1ce9dafde8c3c6014fe64a490 100644 (file)
@@ -47,6 +47,8 @@ class faiPackage extends plugin
   var $base;
   var $FAIpackage ;
 
+  var $packageSelect ;
+
   var $FAIinstallMethods  = array( "install", "ninstall", "remove", 
       "dselect-upgrade", "taskinst", "taskrm",
       "hold", "clean", "aptitude", "aptitude-r",
@@ -271,14 +273,29 @@ class faiPackage extends plugin
       }
     }
 
-    /* + was pressed to open the package dialog */
-    if(isset($_POST['Addpkg']) && 
-        $this->acl_is_writeable("FAIpackage") && 
-        !preg_match("/freeze/",$this->FAIstate)){
-      $this->dialog = new faiPackageEntry($this->config, $this->FAIdebianRelease,$this->usedPackages);
+    // Open the packageSelect dialog to allow adding packages out of a list.
+    if(isset($_POST['Addpkg']) && $this->acl_is_writeable("FAIpackage") && !preg_match("/freeze/",$this->FAIstate)){
+      $this->packageSelect = new packageSelect($this->config, get_userinfo());
       $this->is_dialog =true;
     }
 
+    // Close packageSelect dialog.
+    if(isset($_POST['packageSelect_cancel'])){
+      $this->packageSelect = FALSE;
+      $this->is_dialog =FALSE;
+    }
+
+    // Close packageSelect dialog and add the selected packages.
+    if(isset($_POST['packageSelect_save'])){
+      $this->packageSelect = FALSE;
+      $this->is_dialog =FALSE;
+    }
+
+    // Display package add dialog 
+    if($this->packageSelect instanceOf packageSelect){
+      return $this->packageSelect->execute();
+    }
+
 
     /* Check image Posts 
      */