Code

Added checkboxes to filter
[gosa.git] / include / class_MultiSelectWindow.inc
index 0babe89645c57e0916684eabb34c3af39715fbff..9dd83864c87abca7542ae2ccb0f2686a501b7a49 100644 (file)
@@ -360,6 +360,11 @@ class MultiSelectWindow{
           Store data also into a session var, to keep the checkboxes check after reload  */
        function save_object()
        {
+    /* Get up to date config */
+    if(isset($this->parent->config)){
+      $this->config = $this->parent->config;
+    }
+
                /* Update current base */
                if($this->DepartmentsAdded){
                        $s_action ="";
@@ -476,12 +481,56 @@ class MultiSelectWindow{
                                        $val = preg_replace("/\*\**/","*",$val);
                                        $this->array_Regexes[$key]['value'] = $val;
                                        $this->$box['name'] = $val;
+          $_SESSION['MultiDialogFilters'][$this->filterName][$box['name']] =  $val;
                                }
                        }
                }
-
        }
 
+
+  /* Create header snapshot value */
+  function get_snapshot_header()
+  {
+    $str = " ";
+    if($this->parent->snapshotEnabled()){
+      $ok = false;
+      foreach($this->parent->get_used_snapshot_bases() as $base){
+        $ok |= count($this->parent->getAllDeletedSnapshots($base)) >= 1 ;
+      }
+      if($ok){
+        $str = "<input class='center' type='image' align='middle' src='images/restore.png'
+          title='"._("Restore snapshopts of already deleted objects")."' 
+          alt='"._("Restore")."' name='RestoreDeletedSnapShot'>&nbsp;"; 
+      }else{
+        $str = "<img class='center' src='images/restore_grey.png'>&nbsp;";
+      }
+
+      $str .= "<img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
+    }
+    return($str);
+  }
+
+
+  function GetSnapShotActions($dn)
+  {
+    $str= "";
+    if($this->parent->snapshotEnabled()){
+
+      if(count($this->parent->Available_SnapsShots($dn))){
+        $str.= "<input class='center' type='image' src='images/restore.png'
+          alt='"._("Restore snapshot")."' name='RestoreSnapShotDialog_".base64_encode($dn)."' title='"._("Restore snapshot")."'>&nbsp;";
+      } else {
+        $str = "<img class='center' src='images/restore_grey.png'>&nbsp;";
+      }
+
+      $str.= "<input class='center' type='image' src='images/snapshot.png'
+        alt='"._("Create snapshot")."' name='CreateSnapShotDialog_".base64_encode($dn)."' title='"._("Create a new snapshot from this object")."'>&nbsp;";
+    }
+
+    return($str);
+  }
+
+
        /* this function adds the sub-departments of the current tree to the list */
        function AddDepartments($base = false,$numtabs = 3)
        {