From: Marcin Haba Date: Fri, 9 Aug 2019 03:57:19 +0000 (+0200) Subject: baculum: Tweak fix loading config controls on regular pages X-Git-Tag: Release-9.6.0~147 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a4fcec562a6e96d729dedeb8c6f409e405cb3de;p=thirdparty%2Fbacula.git baculum: Tweak fix loading config controls on regular pages --- diff --git a/gui/baculum/protected/Web/Pages/ClientView.php b/gui/baculum/protected/Web/Pages/ClientView.php index 665fbbd09..0e8436456 100644 --- a/gui/baculum/protected/Web/Pages/ClientView.php +++ b/gui/baculum/protected/Web/Pages/ClientView.php @@ -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); } } diff --git a/gui/baculum/protected/Web/Pages/FileSetView.php b/gui/baculum/protected/Web/Pages/FileSetView.php index 306e5bf5a..4e9029042 100644 --- a/gui/baculum/protected/Web/Pages/FileSetView.php +++ b/gui/baculum/protected/Web/Pages/FileSetView.php @@ -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'])) { diff --git a/gui/baculum/protected/Web/Pages/NewResource.php b/gui/baculum/protected/Web/Pages/NewResource.php index ffd9d5e68..679efa134 100644 --- a/gui/baculum/protected/Web/Pages/NewResource.php +++ b/gui/baculum/protected/Web/Pages/NewResource.php @@ -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; } diff --git a/gui/baculum/protected/Web/Pages/PoolView.php b/gui/baculum/protected/Web/Pages/PoolView.php index ee7df16c2..f826d3e3a 100644 --- a/gui/baculum/protected/Web/Pages/PoolView.php +++ b/gui/baculum/protected/Web/Pages/PoolView.php @@ -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()); diff --git a/gui/baculum/protected/Web/Pages/ScheduleView.php b/gui/baculum/protected/Web/Pages/ScheduleView.php index c381c442e..677c8d139 100644 --- a/gui/baculum/protected/Web/Pages/ScheduleView.php +++ b/gui/baculum/protected/Web/Pages/ScheduleView.php @@ -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());