From 7859b8b3047467324f9b3c30c6ffc1215dc513c9 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 26 Jun 2006 11:55:02 +0000 Subject: [PATCH] Snap shot button is now grey, if there are no snapshots left to restore Application only, other dialog will follow git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3908 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/images/restore_grey.png | Bin 0 -> 495 bytes include/class_MultiSelectWindow.inc | 25 ++++++++++++++++-- .../class_applicationManagement.inc | 14 ++++++++-- .../applications/class_divListApplication.inc | 8 +----- 4 files changed, 36 insertions(+), 11 deletions(-) create mode 100755 html/images/restore_grey.png diff --git a/html/images/restore_grey.png b/html/images/restore_grey.png new file mode 100755 index 0000000000000000000000000000000000000000..b9aa02da70549450c67ace7e3e532928350073a3 GIT binary patch literal 495 zcmV}0;P1VA=4oY$894+O2y(PpP(hS`K!jUF1VLlCG!`|~AJE()G`h6a)?$N2 z3W{W)5_anOqog|T*L(Nwz1F6_`3rLY7u<1COYXCChQyM={^!M;)vNZK3YLZc?o9i7 z>D}Gw`{$!)HJ{8m5@j=;-c+X3$R33cCm-J!C`w$r_hvSl%Mm=uAE@d0YHN3DbX-eA zF7fi?+uM1CFsh$Ybl|w@(Xv!mDDzAC%IT@ja6TM$<<^Y242}sEz4FZ&Z!It6&vdI{jg`t z&uZ9TScoD^N=~X+v*)`VyLQzixh$wy4OubaK+UF_RN}Wpq`+YQCEJL$jTzBnMCOk^ zxn6B8tzhTG{)#l(bjbyQQDd5#5-kl)iJ4Y)F%&gT2oUHK$|O>;SlfCvpC`)G*XgXT lTt^}nizPZ@habX5?k^3~v=bj{<75B;002ovPDHLkV1kb_-WdP@ literal 0 HcmV?d00001 diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc index 59aa9eb22..82aac59ee 100644 --- a/include/class_MultiSelectWindow.inc +++ b/include/class_MultiSelectWindow.inc @@ -480,14 +480,35 @@ class MultiSelectWindow{ } } } - } - function GetSnapShotActions($dn) + /* 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 = " "; + }else{ + $str = " "; + } + + $str .= " "; + } + return($str); + } + + function GetSnapShotActions($dn) + { + $str = ""; if($this->parent->snapshotEnabled()){ $str .="DivListApplication->selectedRelease; /* Check if there is a snapshot dialog open */ - if($str = $this->showSnapshotDialog($this->DivListApplication->selectedBase,$useBase)){ + $base = $this->DivListApplication->selectedBase; + if($str = $this->showSnapshotDialog($base,$this->get_used_snapshot_bases($base))){ return($str); } @@ -380,6 +380,16 @@ class applicationManagement extends plugin } + /* Return departments, that will be included within snapshot detection */ + function get_used_snapshot_bases(){ + if($this->DivListApplication->selectedRelease == "main"){ + return(array($this->DivListApplication->selectedBase)); + }else{ + return(array($this->DivListApplication->selectedRelease)); + } + } + + function reload() { $this->applications= array(); diff --git a/plugins/admin/applications/class_divListApplication.inc b/plugins/admin/applications/class_divListApplication.inc index 52c69425e..86f1aa235 100755 --- a/plugins/admin/applications/class_divListApplication.inc +++ b/plugins/admin/applications/class_divListApplication.inc @@ -104,13 +104,7 @@ class divListApplication extends MultiSelectWindow "  ". "  "; - - if($this->parent->snapshotEnabled()){ - $listhead .= " ". - "  "; - } - + $listhead .= $this->get_snapshot_header($this->selectedBase); $listhead .= "  ". $Copy_Paste. -- 2.30.2