From: hickert Date: Mon, 26 Jun 2006 11:55:02 +0000 (+0000) Subject: Snap shot button is now grey, if there are no snapshots left to restore X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7859b8b3047467324f9b3c30c6ffc1215dc513c9;p=gosa.git 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 --- diff --git a/html/images/restore_grey.png b/html/images/restore_grey.png new file mode 100755 index 000000000..b9aa02da7 Binary files /dev/null and b/html/images/restore_grey.png differ 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.