Code

Added grey restore vutton to top of divlist
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Jun 2006 05:47:48 +0000 (05:47 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Jun 2006 05:47:48 +0000 (05:47 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3922 594d385d-05f5-0310-b6e9-bd551577e9d8

14 files changed:
plugins/admin/departments/class_departmentManagement.inc
plugins/admin/departments/class_divListDepartment.inc
plugins/admin/fai/class_divListFai.inc
plugins/admin/fai/class_faiManagement.inc
plugins/admin/groups/class_divListGroup.inc
plugins/admin/groups/class_groupManagement.inc
plugins/admin/ogroups/class_divListOGroup.inc
plugins/admin/ogroups/class_ogroupManagement.inc
plugins/gofax/blocklists/class_blocklistManagement.inc
plugins/gofax/blocklists/class_divListBlocklists.inc
plugins/gofon/conference/class_divListConferences.inc
plugins/gofon/conference/class_phoneConferenceManagment.inc
plugins/gofon/macro/class_divListMacros.inc
plugins/gofon/macro/class_gofonMacroManagement.inc

index 128639d12540887409452ccb6a489149994e03ae..c21927f09a08fd225ba3f744085f98f91240fea4 100644 (file)
@@ -309,7 +309,8 @@ class departmentManagement extends plugin
     }else{
 
       /* Check if there is a snapshot dialog open */
-      if($str = $this->showSnapshotDialog($this->DivListDepartment->selectedBase,$this->DivListDepartment->selectedBase)){
+      $base = $this->DivListDepartment->selectedBase;
+      if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
         return($str);
       }
 
@@ -324,6 +325,14 @@ class departmentManagement extends plugin
   }
 
 
+  /* Return departments, that will be included within snapshot detection */
+  function get_used_snapshot_bases()
+  {
+    return(array($this->DivListDepartment->selectedBase));
+  }
+
+
+
   function reload()
   {
     /* Vairaible init */
index e2b1509e63cc78e0eef04032205a99f3d2e7062b..9d4af1e2d750b9c7b8ee814cfb0e9f77bdb98535 100755 (executable)
@@ -80,13 +80,7 @@ class divListDepartment 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' src='images/list_new_department.png' 
         align='middle' alt='"._("Create new department")."' name='dep_new'>&nbsp; ".
       " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
index fcbb7246872740921a01dd2b8c973421e6ed82d5..d9912120fbf54d6e707ffbc104e2a80382fcd00e 100644 (file)
@@ -131,13 +131,7 @@ _("Submit")."'>&nbsp;".
       title='"._("New profile")."' name='Create_profile' alt='"._("P")."'>&nbsp;".
 
       "<img class='center' src=\"images/list_seperator.png\" alt=\"\" align=\"middle\" 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' src='images/fai_new_partitionTable.png' align='middle'
       title='"._("New partition table")."' name='Create_partition' alt='"._("PT")."'>&nbsp;".
 
index 5dde279a3a83fb1684c77b30dc910621f142b582..85c9049095e97660edaf0374281c7239efcc04c2 100644 (file)
@@ -562,16 +562,8 @@ class faiManagement extends plugin
      ****************/
 
     /* Check if there is a snapshot dialog open */
-    $tmp = array();
-    $types = array("hooks","scripts","disk","packages","profiles","templates","variables");
-    foreach($types as $type){
-      if($this->DivListFai->selectedBranch == "main"){
-        $tmp[] = "ou=".$type.",ou=fai,ou=configs,ou=systems,".$this->DivListFai->selectedBase;
-      }else{
-        $tmp[] = "ou=".$type.",".$this->DivListFai->selectedBranch;
-      }
-    }
-    if($str = $this->showSnapshotDialog($this->DivListFai->selectedBase,$tmp)){
+    $base = $this->DivListFai->selectedBase;
+    if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
       return($str);
     }
 
@@ -585,6 +577,22 @@ class faiManagement extends plugin
        }
 
 
+  /* Return departments, that will be included within snapshot detection */
+  function get_used_snapshot_bases()
+  {
+    $tmp = array();
+    $types = array("hooks","scripts","disk","packages","profiles","templates","variables");
+    foreach($types as $type){
+      if($this->DivListFai->selectedBranch == "main"){
+        $tmp[] = "ou=".$type.",ou=fai,ou=configs,ou=systems,".$this->DivListFai->selectedBase;
+      }else{
+        $tmp[] = "ou=".$type.",".$this->DivListFai->selectedBranch;
+      }
+    }
+    return($tmp);
+  }
+
+
   /* Get available branches for current base */
   function getBranches($base = false,$prefix = "")
   {
index 06c9b5b4750696e56dea2ebe2ccd50b5e4450e88..1605e4cf1a2a88ccb240b17ad0fa756a13b2ddda 100644 (file)
@@ -101,14 +101,7 @@ class divListGroup extends MultiSelectWindow
       " <input type='image' class='center' src='images/list_home.png' 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' 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 type='image' class='center' src='images/list_new_group.png' title='"._("Create new group")."' alt='"._("New")."' name='group_new'>&nbsp;".
       $Copy_Paste.
       " <img class='center' src='images/list_seperator.png' alt='' height='16' width='1'>&nbsp;".
index e7751d531927774d2b53e81f619c64fe2f595c7f..2d2bc5248012c18dd0ae9282a4e354ab381505c7 100644 (file)
@@ -340,12 +340,13 @@ class groupManagement extends plugin
       return ($display);
     }
 
-    
+
     /* Check if there is a snapshot dialog open */
-    if($str = $this->showSnapshotDialog($this->DivListGroup->selectedBase,array(get_groups_ou().$this->DivListGroup->selectedBase))){
+    $base = $this->DivListGroup->selectedBase;
+    if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
       return($str);
     }
-
+   
     /* Display dialog with group list */
     $this->DivListGroup->parent = $this;
     $this->DivListGroup->execute();
@@ -359,6 +360,15 @@ class groupManagement extends plugin
     return($this->DivListGroup->Draw());
   }
 
+
+  /* Return departments, that will be included within snapshot detection */
+  function get_used_snapshot_bases()
+  {
+    return(array(get_groups_ou().$this->DivListGroup->selectedBase));
+  }
+
+
+
   function reload($CreatePosixsList=false)
   {
     $this->grouplist        = array();
index 607a6976ca2474d574a3d9f3a60e7e6d4d7d39e1..861ffe2e905fc49df8ef25f08b6e09a34b23ce52 100755 (executable)
@@ -110,14 +110,7 @@ class divListOGroup 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_ogroup.png' 
       title='"._("Create new object group")."' alt='"._("new")."' name='group_new'>".
       $Copy_Paste.
index 7f5bdeebeb13c884f6b34a4b1514472a73600dbd..5862a766362b164337354791f4c54f3d43170208 100644 (file)
@@ -346,8 +346,9 @@ class ogroupManagement extends plugin
       Display list 
      ****************/
 
-   /* Check if there is a snapshot dialog open */
-    if($str = $this->showSnapshotDialog($this->DivListOGroup->selectedBase,array(get_groups_ou().$this->DivListOGroup->selectedBase))){
+    /* Check if there is a snapshot dialog open */
+    $base = $this->DivListOGroup->selectedBase;
+    if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
       return($str);
     }
 
@@ -365,6 +366,14 @@ class ogroupManagement extends plugin
   }
 
 
+  /* Return departments, that will be included within snapshot detection */
+  function get_used_snapshot_bases()
+  {
+    return(array(get_people_ou().$this->DivListOGroup->selectedBase));
+  }
+
+  
+
   function convert_list($input)
   {
     $temp= "";
index a415e19e9ade5d4ef7638c602f28537667b44c05..d5898fd27d45c81651e4f8200f23ef4ca6e31ac1 100644 (file)
@@ -322,8 +322,8 @@ class blocklist extends plugin
        ***************/
 
       /* Check if there is a snapshot dialog open */
-      if($str = $this->showSnapshotDialog($this->DivListBlocklist->selectedBase,
-              array("ou=gofax,ou=systems,". $this->DivListBlocklist->selectedBase))){
+      $base = $this->DivListBlocklist->selectedBase;
+      if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
         return($str);
       }
 
@@ -342,6 +342,13 @@ class blocklist extends plugin
   }
 
 
+  /* Return departments, that will be included within snapshot detection */
+  function get_used_snapshot_bases()
+  {
+    return(array("ou=gofax,ou=systems,". $this->DivListBlocklist->selectedBase));
+  }
+
+
   /* Clear garbage from edited lists */
   function clear_fields()
   {
index 171393df625718fc0be3aafab9e06e5a8ce7f089..fc024a1d438c4e1dbe9973f2d5253aae03f79d51 100755 (executable)
@@ -88,13 +88,7 @@ class divListBlocklist 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_blocklist.png' 
       title='"._("Create new blocklist")."' alt='"._("New Blocklist")."' name='user_new'>&nbsp;".
       " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>".
index 073486bb02d4e437fdbb0f2440906407a2aae283..8d40cba52876999445979e6ab758d177c2576b73 100755 (executable)
@@ -89,13 +89,7 @@ class divListConference extends MultiSelectWindow
       " <input class='center' type='image' align='middle' src='images/list_new_conference.png' 
       title='"._("Create new conference")."' alt='"._("New conference")."' name='user_new'>&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 .= _("Base")."&nbsp;<select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
       " <input class='center' type='image' src='images/list_submit.png' align='middle' 
       title='"._("Submit department")."' name='submit_department' alt='".  _("Submit").     "'>&nbsp;".
@@ -168,7 +162,7 @@ class divListConference extends MultiSelectWindow
       $a_field4 = array("string"=> $pin, "attach" =>  $title." style='width:50px;'");
 
       if(($this->parent->ui->dn==$conference['goFonConferenceOwner'][0])&&(chkacl($this->parent->acl,"goFonConferenceOwner")=="")){
-        $a_field5 = array("string"=>preg_replace("/%KEY%/",$conferencekey,$action.$actions), "attach" =>  $title."style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
+        $a_field5 = array("string"=>preg_replace("/%KEY%/",$conferencekey,$actions), "attach" =>  $title."style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
       }elseif(chkacl($this->parent->acl,"goFonConferenceOwner")==""){
         $a_field5 = array("string"=>preg_replace("/%KEY%/",$conferencekey,$action.$actions2), "attach" =>  $title."style='width:52px;border-right:0px;text-align:right;'");
       }else{
index f2b093910e4d6ac414e582a78a267f41aa9bf4f2..0be3ec8e659e22671ccc716807c27aac2273c093 100644 (file)
@@ -256,8 +256,8 @@ class phoneConferenceManagment extends plugin
      ***************/
 
     /* Check if there is a snapshot dialog open */
-    if($str = $this->showSnapshotDialog($this->DivListConference->selectedBase,
-      array("ou=conferences,ou=asterisk,ou=configs,ou=systems,".$this->DivListConference->selectedBase))){
+    $base = $this->DivListConference->selectedBase;
+    if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
       return($str);
     }
 
@@ -276,6 +276,13 @@ class phoneConferenceManagment extends plugin
   }
 
 
+  /* Return departments, that will be included within snapshot detection */
+  function get_used_snapshot_bases()
+  {
+    return(array("ou=conferences,ou=asterisk,ou=configs,ou=systems,".$this->DivListConference->selectedBase));
+  }
+
+
   /* Reload entries for divlist.
    * reload all conferences for the current base, with the given regex
    */
index dc17d6b6050b60413acfdec3f1cbf42408352474..284c939ad7ab5f45f037d5d87bf84dda1aa12b22 100755 (executable)
@@ -85,13 +85,7 @@ class divListMacro 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_macro.png' 
       title='"._("Create new phone macro")."' alt='"._("New")."' name='user_new'>&nbsp;".
       " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'>&nbsp;".
index 3c213883da65b02604f0e03f1897674892b2c303..aab1648bd7c13a2a5346b114b968d6448df15d94 100755 (executable)
@@ -278,8 +278,8 @@ class gofonMacro extends plugin
      *****************/
 
     /* Check if there is a snapshot dialog open */
-    if($str = $this->showSnapshotDialog($this->DivListMacro->selectedBase,
-      array("ou=macros,ou=asterisk,ou=configs,ou=systems,".$this->DivListMacro->selectedBase))){
+    $base = $this->DivListMacro->selectedBase;
+    if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases())){
       return($str);
     }
 
@@ -298,6 +298,13 @@ class gofonMacro extends plugin
   }
 
 
+  /* Return departments, that will be included within snapshot detection */
+  function get_used_snapshot_bases()
+  {
+    return(array("ou=macros,ou=asterisk,ou=configs,ou=systems,".$this->DivListMacro->selectedBase));
+  }
+
+
   function reload()
   {
     /* Set base for all searches */