Code

Added snap shot abilities to the new role plugin
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 1 Jul 2009 13:24:47 +0000 (13:24 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 1 Jul 2009 13:24:47 +0000 (13:24 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13870 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/roleManagement/admin/roleManagement/class_divListRole.inc
gosa-plugins/roleManagement/admin/roleManagement/class_roleGeneric.inc
gosa-plugins/roleManagement/admin/roleManagement/class_roleManagement.inc

index d83524efebff6eee981188c555dfe84352d02970..18058ceaac08a4883132849de316904033bd0fd4 100644 (file)
@@ -41,7 +41,12 @@ class divListRole extends MultiSelectWindow
     
     $this->parent       = $parent;
     $this->ui           = get_userinfo();
+
+    // Dynamic action col, depending on snapshot icons 
     $action_col_size = 90;
+    if($this->parent->snapshotEnabled()){
+      $action_col_size += 38;
+    }
 
     // Set list strings 
     $this->SetTitle(_("List of roles"));
@@ -127,6 +132,9 @@ class divListRole extends MultiSelectWindow
     $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Remove")."|"."remove_multiple_roles|\n";
 
+    /* Add snapshot icons */
+    $s .= $this->parent->get_snapshot_header($this->selectedBase,$this->module);
+
     $this->SetDropDownHeaderMenu($s);
     $this->SetListHeader($listhead);
   }
@@ -143,7 +151,11 @@ class divListRole extends MultiSelectWindow
     // Defining Links
     $editlink = "<a href='?plug=".$_GET['plug']."&amp;id=%s&amp;act=edit_entry'>%s</a>";
 
+    // Dynamic action col, depending on snapshot icons 
     $action_col_size = 90;
+    if($this->parent->snapshotEnabled()){
+      $action_col_size += 38;
+    }
   
     $ui = get_userinfo();
 
index 2bfe6d1df26904d8ad3295509308dd6813670a6a..dc914b0b5548cc64cfd8b3160ed4cdf530b852bc 100644 (file)
@@ -190,7 +190,16 @@ class roleGeneric extends plugin {
     return($bases);
   }
 
-  
+
+  function save_object()
+  {
+    plugin::save_object();  
+    if(isset($_POST['base'])){
+      $this->base = get_post('base');
+    }
+  }  
+
   static function plInfo()
   {
     return (array(
index 0d03e8d484d4251a7506c698dac46c71fbd9224d..1ea9cce8851723f02ec33126349c78135d2734db 100644 (file)
@@ -233,6 +233,7 @@ class roleManagement extends plugin
       }
     }
 
+
     /***************
      * Dialog handling
      ***************/
@@ -261,7 +262,6 @@ class roleManagement extends plugin
     }
 
     if($this->dialog instanceOf tabs){
-      $this->dialog->save_object();
       $display= $this->dialog->execute();
 
       if($this->dialog->read_only   == TRUE){
@@ -291,6 +291,12 @@ class roleManagement extends plugin
      * List handling
      ***************/
 
+    // Check if there is a snapshot dialog open 
+    $base = $this->DivListRoles->selectedBase;
+    if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases(),$this)){
+      return($str);
+    }
+
     // Display dialog with group list 
     $this->DivListRoles->parent = $this;
     $this->DivListRoles->execute();