Code

Made apps compatible to snapshots
[gosa.git] / plugins / admin / applications / class_applicationManagement.inc
index d0f1d793476a2ef5f571538296cc0abd6e6cbf5c..117ef50df85bbf5e43f94ada3eb6a90854f0910d 100644 (file)
@@ -197,7 +197,7 @@ class applicationManagement extends plugin
     /* Finish apps edit is triggered by the tabulator dialog, so
        the user wants to save edited data. Check and save at this
        point. */
-    if ((isset($_POST['edit_finish'])) && (isset($this->apptabs->config))){
+    if ((isset($_POST['edit_finish']) || isset($_POST['edit_apply']) ) && (isset($this->apptabs->config))){
 
       /* Check tabs, will feed message array */
       $this->apptabs->last= $this->apptabs->current;
@@ -212,14 +212,16 @@ class applicationManagement extends plugin
         $this->apptabs->save();
         gosa_log ("Application object'".$this->dn."' has been saved");
 
-        /* Application has been saved successfully, remove lock from
-           LDAP. */
-        if ($this->dn != "new"){
-          del_lock ($this->dn);
+        if (!isset($_POST['edit_apply'])){
+          /* Application has been saved successfully, remove lock from
+             LDAP. */
+          if ($this->dn != "new"){
+            del_lock ($this->dn);
+          }
+          unset ($this->apptabs);
+          $this->apptabs= NULL;
+          unset ($_SESSION['objectinfo']);
         }
-        unset ($this->apptabs);
-        $this->apptabs= NULL;
-        unset ($_SESSION['objectinfo']);
       } else {
         /* Ok. There seem to be errors regarding to the tab data,
            show message and continue as usual. */
@@ -345,8 +347,12 @@ class applicationManagement extends plugin
       /* Don't show buttons if tab dialog requests this */
       if (!$this->apptabs->by_object[$this->apptabs->current]->dialog){
         $display.= "<p style=\"text-align:right\">\n";
-        $display.= "<input type=\"submit\" name=\"edit_finish\" value=\""._("Save")."\">\n";
+        $display.= "<input type=\"submit\" name=\"edit_finish\" style=\"width:80px\" value=\""._("Ok")."\">\n";
         $display.= "&nbsp;\n";
+        if ($this->dn != "new"){
+          $display.= "<input type=submit name=\"edit_apply\" value=\""._("Apply")."\">\n";
+          $display.= "&nbsp;\n";
+        }
         $display.= "<input type=\"submit\" name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
         $display.= "</p>";
       }
@@ -358,7 +364,13 @@ class applicationManagement extends plugin
       Dialog display
      ****************/
 
+    /* Check if there is a snapshot dialog open */
+    if($str = $this->showSnapshotDialog($this->DivListApplication->selectedBase,"ou=apps,")){
+      return($str);
+    }
+
     /* Display dialog with system list */
+    $this->DivListApplication->parent = $this;
     $this->DivListApplication->execute();
     $this->DivListApplication->AddDepartments($this->DivListApplication->selectedBase);
     $this->reload();