Code

Updated blocklists.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Nov 2007 14:49:08 +0000 (14:49 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Nov 2007 14:49:08 +0000 (14:49 +0000)
-We can copy & paste blocklists now

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7917 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_CopyPasteHandler.inc
include/class_tabs.inc
plugins/gofax/blocklists/class_blocklistGeneric.inc
plugins/gofax/blocklists/class_blocklistManagement.inc

index 1d6a1f04ac07b87f3308f9074ec63a0eea69e489..5c021bfbcc4a31696193c48dcfbc6edfdfdac239 100644 (file)
@@ -400,7 +400,7 @@ class CopyPasteHandler {
   {
     $ret = array();
     foreach($this->current['object']->by_object as $obj){
-      if($obj->is_account){
+      if($obj->is_account || $obj->ignore_account){
         $ret = array_merge($ret , $obj->check());
       }
     }
index f75847a3a54503f521f7b2ad5f7833bfb18a799e..7e9c593a109d8e3cd5dda6a78002df51bec14c87 100644 (file)
@@ -307,7 +307,7 @@ class tabs
   function saveCopyDialog()
   {
          foreach ($this->by_object as &$obj){
-                 if($obj->is_account){
+                 if($obj->is_account || $obj->ignore_account){
                          $obj->saveCopyDialog();
                  }
          }
@@ -321,7 +321,7 @@ class tabs
     $ret = "";
     $this->SubDialog = false;
     foreach ($this->by_object as &$obj){
-      if($obj->is_account){
+      if($obj->is_account || $obj->ignore_account){
         $tmp = $obj->getCopyDialog();
         if($tmp['status'] == "SubDialog"){
           $this->SubDialog = true;
index 4504dfb278d7dbeb7cc29d7b73a518b6070405d1..4a5e013d5df9ab2a9bf637168d552492493500a3 100644 (file)
@@ -290,6 +290,28 @@ class blocklistGeneric extends plugin
 
 
 
+  function getCopyDialog()
+  { 
+    $smarty = get_smarty();
+    $smarty->assign("cn",$this->cn);
+    $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE,dirname(__FILE__)));
+    $ret = array();
+    $ret['string'] = $str;
+    $ret['status'] = "";
+    return($ret);
+  }
+
+  function saveCopyDialog()
+  {
+    if(isset($_POST['cn'])){
+      $this->cn = get_post('cn');
+    }
+  }
+
+  function PrepareForCopyPaste($source)
+  {
+    plugin::PrepareForCopyPaste($source);
+  }
 
 
 
index 16fa5e08f9591173c8d0602125e893ff4998762e..f9b19ea2a94c94f2ca7f42981f47dbfce276aae0 100644 (file)
@@ -5,18 +5,12 @@ class blocklist extends plugin
   var $plHeadline= "FAX Blocklists";
   var $plDescription= "This does something";
 
-  /* CLI vars */
-  var $cli_summary= "Handling of GOfax block lists";
-  var $cli_description= "Some longer text\nfor help";
-  var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
   var $blocklists       = array();
   var $DivListBlocklist = NULL;
   var $CopyPasteHandler = NULL;
 
   var $start_pasting_copied_objects = FALSE;
   
-
   function blocklist (&$config, $ui)
   {
     $this->ui     = $ui;
@@ -239,7 +233,7 @@ class blocklist extends plugin
       Delete MULTIPLE entries confirmed
      ********************/
 
-    /* Confirmation for deletion has been passed. Users should be deleted. */
+    /* Confirmation for deletion has been passed. */
     if (isset($_POST['delete_multiple_blocklist_confirm'])){
 
       /* Remove user by user and check acls before removeing them */
@@ -428,7 +422,7 @@ class blocklist extends plugin
       /* Cleanup object queue */
       $this->CopyPasteHandler->cleanup_queue();
       $dn = $this->blocklists[$s_entry]['dn'];
-      $this->CopyPasteHandler->add_to_queue($dn,$s_action,"blocklistGeneric","","users");
+      $this->CopyPasteHandler->add_to_queue($dn,$s_action,"faxblocktabs","FAXBLOCKTABS","gofaxlist");
     }
 
     /* Add entries to queue */
@@ -442,10 +436,10 @@ class blocklist extends plugin
         $dn = $this->blocklists[$id]['dn'];
 
         if($s_action == "copy_multiple"){
-          $this->CopyPasteHandler->add_to_queue($dn,"copy","usertabs","USERTABS","users");
+          $this->CopyPasteHandler->add_to_queue($dn,"copy","faxblocktabs","FAXBLOCKTABS","gofaxlist");
         }
         if($s_action == "cut_multiple"){
-          $this->CopyPasteHandler->add_to_queue($dn,"cut","usertabs","USERTABS","users");
+          $this->CopyPasteHandler->add_to_queue($dn,"cut","faxblocktabs","FAXBLOCKTABS","gofaxlist");
         }
       }
     }
@@ -460,24 +454,13 @@ class blocklist extends plugin
 
       /* Load entry from queue and set base */
       $this->CopyPasteHandler->load_entry_from_queue();
-      $this->CopyPasteHandler->SetVar("base",$this->DivListUsers->selectedBase);
+      $this->CopyPasteHandler->SetVar("base",$this->DivListBlocklist->selectedBase);
 
       /* Get dialog */
       $data = $this->CopyPasteHandler->execute();
 
-      /* Set CPPasswordChange to s_entry which indicates that this entry requires a new password. */
-      if(isset($_POST['passwordTodo']) && ($_POST['passwordTodo'] == "new")){
-        $s_entry = $this->CopyPasteHandler->last_entry();
-        $this->reload();
-        foreach($this->blocklists as $key => $entry){
-          if($entry['dn'] == $s_entry){
-            $this->CPPasswordChange = $key;
-          }
-        }
-      }
-
       /* Return dialog data */
-      if(!empty($data) && $this->CPPasswordChange == ""){
+      if(!empty($data)){
         return($data);
       }
     }