From: Marcin Haba Date: Sat, 2 Dec 2017 17:39:51 +0000 (+0100) Subject: baculum: Revert back volume pool name in volume list window X-Git-Tag: Release-9.0.7~14 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=65be1165423e4d24b81bf1da678fe5ffe237e07a;p=bacula%2Fbacula baculum: Revert back volume pool name in volume list window --- diff --git a/gui/baculum/protected/Web/Portlets/VolumeList.php b/gui/baculum/protected/Web/Portlets/VolumeList.php index cd9ecf27f0..8e24fad052 100644 --- a/gui/baculum/protected/Web/Portlets/VolumeList.php +++ b/gui/baculum/protected/Web/Portlets/VolumeList.php @@ -34,7 +34,8 @@ class VolumeList extends Portlets implements ISlideWindow { public $ID; public $buttonID; public $windowTitle; - public $view; + public $pools = array(); + public $old_pool; public function setID($id) { $this->ID = $id; @@ -61,6 +62,7 @@ class VolumeList extends Portlets implements ISlideWindow { } public function prepareData($sender, $param) { + $this->setPoolList(); $params = $this->getUrlParams(array('volumes'), $this->getPage()->VolumeWindow->ID); $volumes = $this->Application->getModule('api')->get($params); $isDetailView = $_SESSION['view' . $this->getPage()->VolumeWindow->ID] == 'details'; @@ -78,6 +80,13 @@ class VolumeList extends Portlets implements ISlideWindow { } } + private function setPoolList() { + $pools = $this->Application->getModule('api')->get(array('pools')); + for ($i = 0; $i < count($pools->output); $i++) { + $this->pools[$pools->output[$i]->poolid] = $pools->output[$i]->name; + } + } + protected function sortData($data, $key, $id) { if($this->getSortOrder($id) == parent::SORT_DESC) { if($key == 'pool') { diff --git a/gui/baculum/protected/Web/Portlets/VolumeList.tpl b/gui/baculum/protected/Web/Portlets/VolumeList.tpl index 7e138d28bb..05f6e28176 100644 --- a/gui/baculum/protected/Web/Portlets/VolumeList.tpl +++ b/gui/baculum/protected/Web/Portlets/VolumeList.tpl @@ -3,10 +3,13 @@ + <%#$this->SourceTemplateControl->old_pool != $this->SourceTemplateControl->pools[$this->DataItem->poolid] ? '
' . Prado::localize('Pool:') . ' ' . $this->SourceTemplateControl->pools[$this->DataItem->poolid] . '
': ''%> +
<%#$this->DataItem->volumename%>
<%#$this->DataItem->volstatus%>
+ <%#!($this->SourceTemplateControl->old_pool = $this->SourceTemplateControl->pools[$this->DataItem->poolid])%>
@@ -39,7 +42,7 @@ /> -
<%=$this->getPage()->VolumeWindow->formatVolumeField($this->getParent()->Data['pool']['name'])%>
+
<%#$this->getPage()->VolumeWindow->formatVolumeField($this->SourceTemplateControl->pools[$this->getParent()->Data['poolid']])%>
diff --git a/gui/baculum/themes/Baculum-v1/style.css b/gui/baculum/themes/Baculum-v1/style.css index 222a8a81f2..c925fa1a14 100644 --- a/gui/baculum/themes/Baculum-v1/style.css +++ b/gui/baculum/themes/Baculum-v1/style.css @@ -794,7 +794,7 @@ div.window-section { width: 100%; height: 25px; clear: both; - padding-top: 6px; + padding-top: 12px; font-size: 13px; }