]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/baculum/protected/Web/Pages/RestoreWizard.php
baculum: Add fileset info endpoint and use it in restore wizard
[bacula/bacula] / gui / baculum / protected / Web / Pages / RestoreWizard.php
index 63323e4f9000e811206c3569828e44dd72f5e473..b9c8637b7f6fe0665609db5b823fccefbc30cf35 100644 (file)
@@ -68,7 +68,7 @@ class RestoreWizard extends BaculumWebPage
                parent::onLoad($param);
                        if($this->RestoreWizard->ActiveStepIndex == 0) {
                                $this->jobs = $this->getModule('api')->get(array('jobs'))->output;
-                               $this->filesets = $this->getModule('api')->get(array('filesets'))->output;
+                               $this->filesets = $this->getModule('api')->get(array('filesets', 'info'))->output;
                        }
                        $this->clients = $this->getModule('api')->get(array('clients'))->output;
 
@@ -162,15 +162,16 @@ class RestoreWizard extends BaculumWebPage
                }
 
                $fileset_list = array();
-               foreach($this->filesets as $director => $filesets) {
-                       $fileset_list = array_merge($fileset_list, $filesets);
+               for ($i = 0; $i < count($this->filesets); $i++) {
+                       $fileset_list[$this->filesets[$i]->filesetid] = $this->filesets[$i]->fileset . ' (' . $this->filesets[$i]->createtime . ')';
                }
+               asort($fileset_list);
 
                $this->BackupToRestore->dataSource = $jobs_list;
                $this->BackupToRestore->dataBind();
                $this->GroupBackupToRestore->dataSource = $jobs_group_list;
                $this->GroupBackupToRestore->dataBind();
-               $this->GroupBackupFileSet->dataSource = array_combine($fileset_list, $fileset_list);
+               $this->GroupBackupFileSet->dataSource = $fileset_list;
                $this->GroupBackupFileSet->dataBind();
                $this->setRestoreClients($sender, $param);
        }
@@ -198,30 +199,6 @@ class RestoreWizard extends BaculumWebPage
                }
        }
 
-       public function setStorage($sender, $param) {
-               if(!$this->IsPostBack) {
-                       $storagesList = array();
-                       $storages = $this->getModule('api')->get(array('storages'))->output;
-                       foreach($storages as $storage) {
-                               $storagesList[$storage->storageid] = $storage->name;
-                       }
-                       $this->GroupBackupStorage->dataSource = $storagesList;
-                       $this->GroupBackupStorage->dataBind();
-               }
-       }
-
-       public function setPool($sender, $param) {
-               if(!$this->IsPostBack) {
-                       $poolsList = array();
-                       $pools = $this->getModule('api')->get(array('pools'))->output;
-                       foreach($pools as $pool) {
-                               $poolsList[$pool->poolid] = $pool->name;
-                       }
-                       $this->GroupBackupPool->dataSource = $poolsList;
-                       $this->GroupBackupPool->dataBind();
-               }
-       }
-
        public function setBackupClient($sender, $param) {
                $this->ClientToRestore->SelectedValue = $param->SelectedValue;
        } 
@@ -318,7 +295,7 @@ class RestoreWizard extends BaculumWebPage
                                $this->GroupBackupToRestore->SelectedValue,
                                'client',
                                $this->BackupClientName->SelectedValue,
-                               'fileset',
+                               'filesetid',
                                $this->GroupBackupFileSet->SelectedValue
                        );
                        $jobs_recent = $this->getModule('api')->get($params);