]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Open jobs window just after restore start
authorMarcin Haba <marcin.haba@bacula.pl>
Sat, 28 Mar 2015 19:55:08 +0000 (20:55 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sat, 28 Mar 2015 19:55:08 +0000 (20:55 +0100)
gui/baculum/protected/Class/BaculumPage.php
gui/baculum/protected/Pages/Home.page
gui/baculum/protected/Pages/Home.php
gui/baculum/protected/Pages/RestoreWizard.php

index 9ae54cb98c68cf94b83d9b74f3fec365afc50709..c4f90affbd887fca9d840ecc87150143dc507704 100644 (file)
@@ -41,12 +41,12 @@ class BaculumPage extends TPage
                return $this->Application->getModule($name);
        }
 
-       public function goToPage($pagePath,$getParameters=null) {
+       public function goToPage($pagePath,$getParameters = null) {
                $this->Response->redirect($this->Service->constructUrl($pagePath,$getParameters,false));
        }
 
-       public function goToDefaultPage() {
-               $this->goToPage($this->Service->DefaultPage);
+       public function goToDefaultPage($getParameters = null) {
+               $this->goToPage($this->Service->DefaultPage, $getParameters);
        }
 
        public function setPrefixForSubdir() {
index be63e8ad8816f9ba99bd4b4353ea9b74c3b16690..6660973a4f89b6c1f08528362f6cafe0ffe31db6 100644 (file)
                <com:Application.Portlets.Console ID="Console" />
        </div>
        <div id="bottom"></div>
+       <script type="text/javascript">
+               document.observe("dom:loaded", function() {
+                       <%=(!is_null($this->openWindow) ?
+                               '$("' . $this->openWindow . '").click(); window.history.pushState("", "", "/");'
+                        : '')%>
+               });
+       </script>
 </com:TContent>
index 84097554c6e19133120b19a44cccef155d66e134..23d7d8a4eca7863da5d3fef182d11e7af51be4ca 100644 (file)
@@ -27,6 +27,10 @@ class Home extends BaculumPage
 {
        public $jobs;
 
+       public $openWindow = null;
+
+       public $windowIds = array('Storage', 'Client', 'Media', 'Pool', 'Job', 'JobRun');
+
        public function onInit($param) {
                parent::onInit($param);
                $isConfigExists = $this->getModule('configuration')->isApplicationConfig();
@@ -55,6 +59,7 @@ class Home extends BaculumPage
                        $this->Director->dataBind();
                        $this->setJobs();
                        $this->setClients();
+                       $this->setWindowOpen();
                }
        }
 
@@ -106,5 +111,12 @@ class Home extends BaculumPage
                $this->Clients->dataBind();
 
        }
+
+       public function setWindowOpen() {
+               if (isset($this->Request['open']) && in_array($this->Request['open'], $this->windowIds)) {
+                       $btn = $this->Request['open'] . 'Btn';
+                       $this->openWindow = $this->{$btn}->ClientID;
+               }
+       }
 }
 ?>
index 22ddb2b40334e33a8b2aeb786bb05b20f0333cc2..b9223eecd1dedeeb8d7ad82ec3104ad473d478a7 100644 (file)
@@ -410,7 +410,7 @@ class RestoreWizard extends BaculumPage
                $restoreProps['replace'] = $this->ReplaceFiles->SelectedValue;
                
                $ret = $this->getModule('api')->create(array('jobs', 'restore'), $restoreProps);
-               $this->goToDefaultPage();
+               $this->goToDefaultPage(array('open' => 'Job'));
        }
 }
 ?>