Code

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3808 594d385d-05f5-0310...
[gosa.git] / plugins / gofax / blocklists / class_blocklistManagement.inc
index bcb4c10d546157845430861da2345df283b9077f..a415e19e9ade5d4ef7638c602f28537667b44c05 100644 (file)
@@ -221,7 +221,7 @@ class blocklist extends plugin
      ***************/
 
     /* What about finish? */
-    if ((isset($_POST['edit_finish'])) && (!empty($this->dn))){
+    if ((isset($_POST['edit_finish']) || isset($_POST['edit_apply'])) && (!empty($this->dn))){
       $message= $this->check();
       $this->remove_lock();
 
@@ -235,9 +235,12 @@ class blocklist extends plugin
 
         $this->save ();
         gosa_log ("Blocklist object'".$this->dn."' has been saved");
-        $this->dn= "";
-        del_lock ($this->ui->dn);
-        unset($_SESSION['objectinfo']);
+      
+        if (!isset($_POST['edit_apply'])){
+          $this->dn= "";
+          del_lock ($this->ui->dn);
+          unset($_SESSION['objectinfo']);
+        }
       } else {
         /* Errors found, show message */
         show_errors ($message);
@@ -251,6 +254,31 @@ class blocklist extends plugin
 
     if($this->dn){
 
+      /* Base select dialog */
+      $once = true;
+      foreach($_POST as $name => $value){
+        if(preg_match("/^chooseBase/",$name) && $once){
+          $once = false;
+          $this->dialog = new baseSelectDialog($this->config);
+          $this->dialog->setCurrentBase($this->base);
+        }
+      }
+
+      /* Dialog handling */
+      if(is_object($this->dialog)){
+        /* Must be called before save_object */
+        $this->dialog->save_object();
+
+        if($this->dialog->isClosed()){
+          $this->dialog = false;
+        }elseif($this->dialog->isSelected()){
+          $this->base = $this->dialog->isSelected();
+          $this->dialog= false;
+        }else{
+          return($this->dialog->execute());
+        }
+      }
+
       /* Set base */
       if ($this->base == ""){
         if ($this->dn == "new"){
@@ -268,9 +296,11 @@ class blocklist extends plugin
       if ($this->dn == "new" || preg_match ("/,ou=incoming,/", $this->dn)){
         $smarty->assign("selectmode", "");
         $smarty->assign("mode", "");
+        $smarty->assign("apply", "0");
       } else {
         $smarty->assign("selectmode", "disabled");
         $smarty->assign("mode", "readonly");
+        $smarty->assign("apply", "1");
       }
       foreach(array("cn", "description", "type", "goFaxBlocklist") as $val){
         $smarty->assign("$val", $this->$val);
@@ -291,6 +321,12 @@ class blocklist extends plugin
         Divlist dialog 
        ***************/
 
+      /* Check if there is a snapshot dialog open */
+      if($str = $this->showSnapshotDialog($this->DivListBlocklist->selectedBase,
+              array("ou=gofax,ou=systems,". $this->DivListBlocklist->selectedBase))){
+        return($str);
+      }
+
       /* Display dialog with system list */
       $this->DivListBlocklist->parent = $this;
       $this->DivListBlocklist->execute();