Code

Add gotomasses remove template
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 20 Aug 2007 11:20:10 +0000 (11:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 20 Aug 2007 11:20:10 +0000 (11:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7074 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/addons/gotomasses/class_gotomasses.inc

index 9bca37ddcc17a516fb39e49f25b5d4541d4e82d0..ce1b6395c4ae57ebebf1e240ec1be53851a791eb 100644 (file)
@@ -33,6 +33,7 @@ class gotomasses extends plugin
 
   function execute()
   {
+    $smarty = get_smarty();
     /************
      * Handle posts 
      ************/
@@ -55,7 +56,16 @@ class gotomasses extends plugin
 
     /* Remove entry from list */
     if($s_action == "remove" && isset($this->tasks[$s_entry])){
-      unset($this->tasks[$s_entry]);
+      $smarty->assign("info",_("Your are about to delete a gotomasses task."));
+      $this->current = $s_entry;
+      return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+    }
+
+    /* Remove entry, remove is confirmed */
+    if($this->current != -1 && isset($_POST['delete_confirm'])){
+      unset($this->tasks[$this->current]);
+      $this->current = -1;
+      $this->save();
     }
 
     /* Edit selected entry */
@@ -93,6 +103,7 @@ class gotomasses extends plugin
         }
         $this->dialog = FALSE;
         $this->current = -1;
+        $this->save();
       }
     }
  
@@ -107,7 +118,6 @@ class gotomasses extends plugin
      * Handle Divlist 
      ************/
 
-    $smarty = get_smarty();
     $plug = $_GET['plug'];
     $divlist = new MultiSelectWindow($this->config,"GotoMasses","gotomassses");
     $divlist->SetSummary(_("Gotomasses tasks"));