Code

Moved folder image
[gosa.git] / gosa-plugins / goto / admin / applications / class_applicationManagement.inc
index bbf147600c843e9f03b3e9942d4fcabc510f83ff..d144f45c3d9a9e179bd59a8f970e91a92e6b287c 100644 (file)
@@ -246,7 +246,7 @@ class applicationManagement extends plugin
       } else {
         /* Ok. There seem to be errors regarding to the tab data,
            show message and continue as usual. */
-        msgDialog::displayChecks($message);
+        msg_dialog::displayChecks($message);
       }
     }
 
@@ -290,25 +290,20 @@ class applicationManagement extends plugin
 
         foreach($ids as $id){
           $dn = $this->applications[$id]['dn'];
-          if (($user= get_lock($dn)) != ""){
-            return(gen_locked_message ($user, $dn));
-          }
           $this->dns[$id] = $dn;
         }
+        if ($user= get_multiple_locks($this->dns)){
+          return(gen_locked_message($user,$this->dns));
+        }
 
-        $dns_names = "<br><pre>";
+        $dns_names[] = array();
         foreach($this->dns as $dn){
           add_lock ($dn, $this->ui->dn);
-          $dns_names .= $dn."\n";
+          $dns_names[] =@LDAP::fix($dn);
         }
-        $dns_names .="</pre>";
 
         /* Lock the current entry, so nobody will edit it during deletion */
-        if (count($this->dns) == 1){
-          $smarty->assign("intro",     sprintf(_("You're about to delete the following entry %s"), @LDAP::fix($dns_names)));
-        } else {
-          $smarty->assign("intro",     sprintf(_("You're about to delete the following entries %s"), @LDAP::fix($dns_names)));
-        }
+        $smarty->assign("intro",  msgPool::deleteInfo($dns_names,_("application")));
         $smarty->assign("multiple", true);
         return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
       }
@@ -339,7 +334,7 @@ class applicationManagement extends plugin
         } else {
           /* Normally this shouldn't be reached, send some extra
              logs to notify the administrator */
-          print_red (_("You are not allowed to delete this application!"));
+          msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
           new log("security","application/".get_class($this),$dn,array(),"Tried to trick deletion.");
         }
         /* Remove lock file after successfull deletion */
@@ -386,14 +381,14 @@ class applicationManagement extends plugin
         /* Lock the current entry, so nobody will edit it during deletion */
         add_lock ($this->dn, $this->ui->dn);
         $smarty= get_smarty();
-        $smarty->assign("intro", sprintf(_("You're about to delete the application '%s'."), @LDAP::fix($this->dn)));
+        $smarty->assign("intro",msgPool::deleteInfo(@LDAP::fix($this->dn),_("application")));
         $smarty->assign("multiple", false);
         return($smarty->fetch (get_template_path('remove.tpl', TRUE)));
       } else {
 
         /* Obviously the user isn't allowed to delete. Show message and
            clean session. */
-        print_red (_("You are not allowed to delete this application!"));
+        msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
       }
     }
 
@@ -423,7 +418,7 @@ class applicationManagement extends plugin
 
         /* Normally this shouldn't be reached, send some extra
            logs to notify the administrator */
-        print_red (_("You are not allowed to delete this application!"));
+        msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
         new log("security","application/".get_class($this),$dn,array(),"Tried to trick deletion.");
       }
 
@@ -449,13 +444,13 @@ 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\" style=\"width:80px\" value=\""._("Ok")."\">\n";
+        $display.= "<input type=\"submit\" name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
         $display.= "&nbsp;\n";
         if ($this->dn != "new"){
-          $display.= "<input type=submit name=\"edit_apply\" value=\""._("Apply")."\">\n";
+          $display.= "<input type=submit name=\"edit_apply\" value=\"".msgPool::applyButton()."\">\n";
           $display.= "&nbsp;\n";
         }
-        $display.= "<input type=\"submit\" name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
+        $display.= "<input type=\"submit\" name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
         $display.= "</p>";
       }
       return ($display);
@@ -633,12 +628,16 @@ class applicationManagement extends plugin
     }
   }
 
-  function save_object() {
+  function save_object() 
+  {
     $this->DivListApplication->save_object();
+    if(is_object($this->CopyPasteHandler)){
+      $this->CopyPasteHandler->save_object();
+    }
   }
 
   function check() {}
-  function adapt_from_template($dn) {}
+  function adapt_from_template($dn, $skip= array()) {}
   function password_change_needed() {}
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: