Code

Added gray out for removed snap shot icon in div header
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 26 Jun 2006 12:03:13 +0000 (12:03 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 26 Jun 2006 12:03:13 +0000 (12:03 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3910 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_divListSystem.inc
plugins/admin/systems/class_systemManagement.inc
plugins/admin/users/class_divListUsers.inc
plugins/admin/users/class_userManagement.inc

index ef1d87d72c4fc285bfbdb95a2087061fa9a73e79..1f804349ae451a350895928a2df0891b6d96ab42 100644 (file)
@@ -98,13 +98,7 @@ class divListSystem extends MultiSelectWindow
       title='"._("Go to users department")."' alt='"._("Home")."'                     name='dep_home'>&nbsp;".
       " <input class='center' type='image' src='images/list_reload.png' align='middle' title='"._("Reload list")."' name='submit_department' alt='".          _("Submit")."'>&nbsp;".
       " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
-
-    if($this->parent->snapshotEnabled()){ 
-      $listhead .= "  <input class='center' type='image' align='middle' src='images/restore.png'
-        title='"._("Restore snapshopts of already deleted objects")."' alt='"._("Restore")."' name='RestoreDeletedSnapShot'>".
-        " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
-    }
-
+    $listhead .= $this->get_snapshot_header($this->selectedBase);
     $listhead .= " <input class='center' type='image' align='middle' src='images/select_new_terminal.png'
       name='newsystem_terminal'    alt='"._("New Terminal template")."' title='"._("New Terminal")."'>".
       " <input class='center' type='image' align='middle' src='images/select_new_workstation.png'
index e1567f531df92f79cf8713f7be1a543890cce35b..fcad7c7bdd06766339e200bc8db6f3029509f3aa 100644 (file)
@@ -488,12 +488,8 @@ class systems extends plugin
     }
 
     /* Check if there is a snapshot dialog open */
-    $tmp = array();
-    foreach(array("phones","servers","printers","terminals","netdevices","workstations") as $ent){
-      $tmp[] = "ou=".$ent.",ou=systems,".$this->DivListSystem->selectedBase;
-    }
-    
-    if($str = $this->showSnapshotDialog($this->DivListSystem->selectedBase,$tmp)){
+    $base = $this->DivListSystem->selectedBase;
+    if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
       return($str);
     }
 
@@ -511,6 +507,16 @@ class systems extends plugin
   }
 
 
+  /* Return departments, that will be included within snapshot detection */
+  function get_used_snapshot_bases()
+  {
+    $tmp = array();
+    foreach(array("phones","servers","printers","terminals","netdevices","workstations") as $ent){
+      $tmp[] = "ou=".$ent.",ou=systems,".$this->DivListSystem->selectedBase;
+    }
+    return($tmp); 
+  }
+
 
   function remove_from_parent()
   {
index d67c62bfbff89d07ec5206c44b5a68328c5c03f5..af5b0af65076b10bcca3b8b160ed2345e8fe4bd5 100644 (file)
@@ -105,13 +105,7 @@ class divListUsers extends MultiSelectWindow
       " <input class='center' type='image' src='images/list_reload.png' align='middle' 
       title='"._("Reload list")."' name='submit_department' alt='".        _("Submit")."'>&nbsp;".
       " <img   class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
-
-    if($this->parent->snapshotEnabled()){
-      $listhead .= "  <input class='center' type='image' align='middle' src='images/restore.png'
-        title='"._("Restore snapshopts of already deleted objects")."' alt='"._("Restore")."' name='RestoreDeletedSnapShot'>".
-        " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;";
-    }
-
+    $listhead .= $this->get_snapshot_header($this->selectedBase);
     $listhead .= " <input class='center' type='image' align='middle' src='images/list_new_user.png' 
       title='"._("Create new user")."' alt='"._("New user")."'           name='user_new'>&nbsp;".
       " <input class='center' type='image' align='middle' src='images/list_new.png' 
index e0384a51a65c77c03c7fddeda32eef41e13c8578..c59bfc1fa864af577650556d8f33295a673e028f 100644 (file)
@@ -637,7 +637,8 @@ class userManagement extends plugin
     }
     
     /* Check if there is a snapshot dialog open */
-    if($str = $this->showSnapshotDialog($this->DivListUsers->selectedBase,array(get_people_ou().$this->DivListUsers->selectedBase))){
+    $base = $this->DivListUsers->selectedBase;
+    if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
       return($str);
     }
   
@@ -656,6 +657,13 @@ class userManagement extends plugin
   }
 
 
+  /* Return departments, that will be included within snapshot detection */
+  function get_used_snapshot_bases()
+  {
+    return(array(get_people_ou().$this->DivListUsers->selectedBase));
+  }  
+
+
   function reload()
   {
     /* Set base for all searches */