]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/baculum/protected/Pages/Home.php
baculum: Add possibility to open configuration windows from URL
[bacula/bacula] / gui / baculum / protected / Pages / Home.php
index f0a21f2e5ac301464666bd23f20aeb44f55dce70..666ceee4175377cc7233ae36e90693b49a1f349f 100644 (file)
@@ -32,10 +32,19 @@ class Home extends BaculumPage
 
        public $openWindow = null;
 
-       public $windowIds = array('Storage', 'Client', 'Media', 'Pool', 'Job', 'JobRun');
+       public $initWindowId = null;
+
+       public $initElementId = null;
+
+       public $windowIds = array('Storage', 'Client', 'Volume', 'Pool', 'Job', 'JobRun');
 
        public function onInit($param) {
                parent::onInit($param);
+
+               if (!$this->IsPostBack && !$this->IsCallBack) {
+                       $this->getModule('api')->initSessionCache(true);
+               }
+
                $isConfigExists = $this->getModule('configuration')->isApplicationConfig();
                if($isConfigExists === false) {
                        $this->goToPage('ConfigurationWizard');
@@ -44,7 +53,7 @@ class Home extends BaculumPage
                $appConfig = $this->getModule('configuration')->getApplicationConfig();
 
                $this->SettingsWizardBtn->Visible = $this->User->getIsAdmin();
-               $this->MediaBtn->Visible = $this->User->getIsAdmin();
+               $this->VolumeBtn->Visible = $this->User->getIsAdmin();
                $this->ClearBvfsCache->Visible = $this->User->getIsAdmin();
                $this->Logging->Visible = $this->User->getIsAdmin();
 
@@ -81,6 +90,7 @@ class Home extends BaculumPage
        public function setDebug($sender, $param) {
                if($this->User->getIsAdmin() === true) {
                        $this->getModule('logging')->enableDebug($this->Logging->Checked);
+                       $this->goToDefaultPage();
                }
        }
 
@@ -116,9 +126,13 @@ class Home extends BaculumPage
        }
 
        public function setWindowOpen() {
-               if (isset($this->Request['open']) && in_array($this->Request['open'], $this->windowIds)) {
+               if (isset($this->Request['open']) && in_array($this->Request['open'], $this->windowIds) && $this->Request['open'] != 'JobRun') {
                        $btn = $this->Request['open'] . 'Btn';
                        $this->openWindow = $this->{$btn}->ClientID;
+                       if (isset($this->Request['id']) && (is_numeric($this->Request['id']))) {
+                               $this->initWindowId = $this->Request['open'];
+                               $this->initElementId = $this->Request['id'];
+                       }
                }
        }
 }