Code

Do not allow to copy objects into a freezed release
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Apr 2008 10:31:39 +0000 (10:31 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Apr 2008 10:31:39 +0000 (10:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10408 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_divListFai.inc
gosa-plugins/fai/admin/fai/class_faiManagement.inc

index f1c500ddf1b06b985567500e94ee86208a1d736e..98be0f7ba880232b2ec47a58d1d4a6373d5a2959 100644 (file)
@@ -229,7 +229,8 @@ class divListFai extends MultiSelectWindow
     }
 
     /* Add copy & paste icons, currently disabled, this ability is not implemeneted yet */
-    if(preg_match("/(c.*w|w.*c)/",$acl_all) &&  isset($this->parent->CopyPasteHandler) && $this->parent->CopyPasteHandler){
+    if(!($this->parent->lock_type == "freeze" && !$this->parent->allow_freeze_object_attach) && 
+      preg_match("/(c.*w|w.*c)/",$acl_all) &&  isset($this->parent->CopyPasteHandler) && $this->parent->CopyPasteHandler){
       $s .= "..|---|\n";
       if($this->parent->CopyPasteHandler->entries_queued()){
         $img = "<img border='0' class='center' src='images/editpaste.png' alt=''>";
index e855f87757f4c8298f6a5f8784494a9da71103a6..34144831efa6e1486d16b9fa294a819a5f47486e 100644 (file)
@@ -46,6 +46,10 @@ class faiManagement extends plugin
   var $CopyPasteHandler = FALSE;
   var $base = "";
 
+  /* Allow inserting of new elements if freezed releases 
+  */
+  var $allow_freeze_object_attach = FALSE;
+
   var $no_save;
 
        /* construction/reconstruction 
@@ -884,10 +888,10 @@ class faiManagement extends plugin
     }
 
     /* Display dialog with system list */
+    $this->reload();
     $this->DivListFai->parent = $this;
     $this->DivListFai->execute();
     $this->DivListFai->AddDepartments($this->DivListFai->selectedBase,4,1);
-    $this->reload();
     $this->DivListFai->setEntries($this->objects);
     return($this->DivListFai->Draw());
        }
@@ -1162,7 +1166,7 @@ class faiManagement extends plugin
     }
 
     /* Start pasting entries */
-    if($s_action == "editPaste"){
+    if($s_action == "editPaste" && !($this->lock_type == "freeze" && !$this->allow_freeze_object_attach)){
       $this->start_pasting_copied_objects = TRUE;
     }