]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Tweak fix loading config controls on regular pages
authorMarcin Haba <marcin.haba@bacula.pl>
Fri, 9 Aug 2019 03:57:19 +0000 (05:57 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Sat, 14 Dec 2019 14:55:58 +0000 (15:55 +0100)
gui/baculum/protected/Web/Pages/ClientView.php
gui/baculum/protected/Web/Pages/FileSetView.php
gui/baculum/protected/Web/Pages/NewResource.php
gui/baculum/protected/Web/Pages/PoolView.php
gui/baculum/protected/Web/Pages/ScheduleView.php

index 665fbbd099920345f97b0a205783feb590ec7e96..0e8436456a2370a7491bf2343aad4c413618d10d 100644 (file)
@@ -62,12 +62,19 @@ class ClientView extends BaculumWebPage {
                );
                if ($client->error === 0) {
                        $this->setClientName($client->output->name);
-                       if (!empty($_SESSION['dir'])) {
-                               $this->ClientConfig->setComponentName($_SESSION['dir']);
-                               $this->ClientConfig->setResourceName($this->getClientName());
-                               $this->ClientConfig->setLoadValues(true);
-                               $this->ClientConfig->raiseEvent('OnDirectiveListLoad', $this, null);
-                       }
+               }
+       }
+
+       public function onPreRender($param) {
+               parent::onPreRender($param);
+               if ($this->IsCallBack || $this->IsPostBack) {
+                       return;
+               }
+               if (!empty($_SESSION['dir'])) {
+                       $this->ClientConfig->setComponentName($_SESSION['dir']);
+                       $this->ClientConfig->setResourceName($this->getClientName());
+                       $this->ClientConfig->setLoadValues(true);
+                       $this->ClientConfig->raiseEvent('OnDirectiveListLoad', $this, null);
                }
        }
 
index 306e5bf5aae61131ef88929b22c581bfe186b78d..4e90290429e1a04b9d0bcdbeaacdfb59fce197db 100644 (file)
@@ -42,7 +42,7 @@ class FileSetView extends BaculumWebPage {
 
        public function onPreRender($param) {
                parent::onPreRender($param);
-               if ($this->getPage()->IsCallBack || $this->getPage()->IsPostBack) {
+               if ($this->IsCallBack || $this->IsPostBack) {
                        return;
                }
                if (!empty($_SESSION['dir'])) {
index ffd9d5e68a09d113744d5d28b27cb558d5dc154e..679efa134e49c8b1f4afb38492de78bf5ef37a86 100644 (file)
@@ -31,8 +31,8 @@ class NewResource extends BaculumWebPage {
        const COMPONENT_NAME = 'ComponentName';
        const RESOURCE_TYPE = 'ResourceType';
 
-       public function onInit($param) {
-               parent::onInit($param);
+       public function onPreRender($param) {
+               parent::onPreRender($param);
                if ($this->IsCallBack || $this->IsPostBack) {
                        return;
                }
index ee7df16c23ed3a4128fd92db463f1fa18fc99e1f..f826d3e3a795495430c399f15de1fe69305208cb 100644 (file)
@@ -63,6 +63,13 @@ class PoolView extends BaculumWebPage {
                if ($poolshow->error === 0) {
                        $this->PoolLog->Text = implode(PHP_EOL, $poolshow->output);
                }
+       }
+
+       public function onPreRender($param) {
+               parent::onPreRender($param);
+               if ($this->IsCallBack || $this->IsPostBack) {
+                       return;
+               }
                if (!empty($_SESSION['dir'])) {
                        $this->PoolConfig->setComponentName($_SESSION['dir']);
                        $this->PoolConfig->setResourceName($this->getPoolName());
index c381c442e65fc80411ab651874b4d6336590d77d..677c8d13982109aa4a357ae06df4234f275a5652 100644 (file)
@@ -38,6 +38,13 @@ class ScheduleView extends BaculumWebPage {
                if ($this->Request->contains('schedule')) {
                        $this->setScheduleName($this->Request['schedule']);
                }
+       }
+
+       public function onPreRender($param) {
+               parent::onPreRender($param);
+               if ($this->IsCallBack || $this->IsPostBack) {
+                       return;
+               }
                if (!empty($_SESSION['dir'])) {
                        $this->ScheduleConfig->setComponentName($_SESSION['dir']);
                        $this->ScheduleConfig->setResourceName($this->getScheduleName());