]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Revert back volume pool name in volume list window
authorMarcin Haba <marcin.haba@bacula.pl>
Sat, 2 Dec 2017 17:39:51 +0000 (18:39 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 9 Dec 2017 14:07:05 +0000 (15:07 +0100)
gui/baculum/protected/Web/Portlets/VolumeList.php
gui/baculum/protected/Web/Portlets/VolumeList.tpl
gui/baculum/themes/Baculum-v1/style.css

index cd9ecf27f0c0d4c9da822baa3820547f9730248a..8e24fad05244ba6810c64d181c31f3c5f423de7f 100644 (file)
@@ -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') {
index 7e138d28bb4ebd852ebe5425eb3d4e5d72dddec3..05f6e2817682f0ddf641d4fce569060ff2f15774 100644 (file)
@@ -3,10 +3,13 @@
        <com:TActivePanel ID="RepeaterShow">
        <com:TActiveRepeater ID="Repeater">
                <prop:ItemTemplate>
+                       <%#$this->SourceTemplateControl->old_pool != $this->SourceTemplateControl->pools[$this->DataItem->poolid] ? '<div class="window-section"><span>' . Prado::localize('Pool:') . ' ' . $this->SourceTemplateControl->pools[$this->DataItem->poolid]  . '<span></div>': ''%>
+
                        <div data-type="item_value" rel="<%#$this->DataItem->mediaid%>" class="slide-window-element" title="<%#($this->DataItem->recycle == 1 && !empty($this->DataItem->lastwritten) && in_array($this->DataItem->volstatus, array('Full', 'Used'))) ? Prado::localize('When expire:') . date( ' Y-m-d H:i:s', (strtotime($this->DataItem->lastwritten) + $this->DataItem->volretention)) : ''%> <%=Prado::localize('Last written:')%> <%=!empty($this->DataItem->lastwritten) ? $this->DataItem->lastwritten : Prado::localize('never written')%>">
                                <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/media-icon.png" alt="" /><%#$this->DataItem->volumename%>
                                <div id="<%#$this->DataItem->volumename%>_sizebar" class="status-bar-<%#strtolower($this->DataItem->volstatus)%>"><%#$this->DataItem->volstatus%></div>
                        </div>
+                       <%#!($this->SourceTemplateControl->old_pool = $this->SourceTemplateControl->pools[$this->DataItem->poolid])%>
                </prop:ItemTemplate>
        </com:TActiveRepeater>
        </com:TActivePanel>
@@ -39,7 +42,7 @@
                />
                <com:TActiveTemplateColumn HeaderText="<%[ Pool ]%>" SortExpression="pool">
                        <prop:ItemTemplate>
-                               <div title="<%=$this->getParent()->Data['pool']['name']%>"><%=$this->getPage()->VolumeWindow->formatVolumeField($this->getParent()->Data['pool']['name'])%></div>
+                               <div title="<%#$this->SourceTemplateControl->pools[$this->getParent()->Data['poolid']]%>"><%#$this->getPage()->VolumeWindow->formatVolumeField($this->SourceTemplateControl->pools[$this->getParent()->Data['poolid']])%></div>
                        </prop:ItemTemplate>
                </com:TActiveTemplateColumn>
                <com:TActiveTemplateColumn HeaderText="<%[ Status ]%>" SortExpression="volstatus">
index 222a8a81f206a2f9459f49b94f119f29b1955ad8..c925fa1a14b8019afe55326d8838c559ec7c958a 100644 (file)
@@ -794,7 +794,7 @@ div.window-section {
        width: 100%;
        height: 25px;
        clear: both;
-       padding-top: 6px;
+       padding-top: 12px;
        font-size: 13px;
 }