Code

All management dialogs : Added dynamic width to action col
[gosa.git] / plugins / admin / applications / class_applicationManagement.inc
index bfbf623870acf72bbfab8d60ad9e8e4343a4eecf..5a3cecedea1eb7e1cd27033fe9a2762531217ff1 100644 (file)
@@ -34,7 +34,7 @@ class applicationManagement extends plugin
   var $acl                      = "";
   var $enableReleaseManagement  = false;
 
-  function IsReleaseManagementActivated($config)
+  function IsReleaseManagementActivated()
   {
     /* Check if we should enable the release selection */
     $tmp = search_config($this->config->data,"faiManagement","CLASS");
@@ -72,7 +72,7 @@ class applicationManagement extends plugin
     $ldap                   = $this->config->get_ldap_link();
     $dn                     = "ou=apps,".$base;
     $ret                    = array();
-    $ret [$base] = "/";
+    $ret ["ou=apps,".$base] = "/";
 
     $ldap->cd($dn);
     $ldap->search("objectClass=organizationalUnit",array("ou"));
@@ -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,14 @@ class applicationManagement extends plugin
       Dialog display
      ****************/
 
+    $useBase = $this->DivListApplication->selectedRelease;
+    /* Check if there is a snapshot dialog open */
+    if($str = $this->showSnapshotDialog($this->DivListApplication->selectedBase,$useBase)){
+      return($str);
+    }
+
     /* Display dialog with system list */
+    $this->DivListApplication->parent = $this;
     $this->DivListApplication->execute();
     $this->DivListApplication->AddDepartments($this->DivListApplication->selectedBase);
     $this->reload();