]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/baculum/protected/Pages/RestoreWizard.php
baculum: Open jobs window just after restore start
[bacula/bacula] / gui / baculum / protected / Pages / RestoreWizard.php
index 29f7ef94197ca240812ab398e3f05d905fb7111b..b9223eecd1dedeeb8d7ad82ec3104ad473d478a7 100644 (file)
@@ -3,7 +3,7 @@
  * Bacula® - The Network Backup Solution
  * Baculum - Bacula web interface
  *
- * Copyright (C) 2013-2014 Marcin Haba
+ * Copyright (C) 2013-2015 Marcin Haba
  *
  * The main author of Baculum is Marcin Haba.
  * The main author of Bacula is Kern Sibbald, with contributions from many
@@ -304,8 +304,8 @@ class RestoreWizard extends BaculumPage
                                }
                        }
                } else {
-                       $jobsRecent = $this->getModule('api')->get(array('jobs', 'recent', $this->GroupBackupToRestore->SelectedValue, $this->BackupClientName->SelectedValue));
-                       if(isset($jobsRecent->output)) {
+                       $jobsRecent = $this->getModule('api')->get(array('jobs', 'recent', urlencode($this->GroupBackupToRestore->SelectedValue), $this->BackupClientName->SelectedValue));
+                       if(isset($jobsRecent->output) && count($jobsRecent->output) > 0) {
                                $ids = $jobsRecent->output;
                                $jobids = implode(',', $ids);
                        }
@@ -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'));
        }
 }
-?>
\ No newline at end of file
+?>