Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Merge branch 'bareos-17.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergkemper committed Oct 16, 2017
2 parents 04c7342 + 0f1d99f commit 269b31b
Show file tree
Hide file tree
Showing 5 changed files with 309 additions and 95 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -16,3 +16,4 @@ Serefhan Yeter
Pavol Vrba
Tobias Ehrig
Pavel Borecki
Sam Verstraete
25 changes: 22 additions & 3 deletions module/Job/src/Job/Controller/JobController.php
Expand Up @@ -298,15 +298,34 @@ public function runAction()

$this->bsock = $this->getServiceLocator()->get('director');

// Get query parameter jobname
$jobname = $this->params()->fromQuery('jobname') ? $this->params()->fromQuery('jobname') : null;

if ($jobname != null) {
$jobdefaults = $this->getJobModel()->getJobDefaults($this->bsock, $jobname);
}

// Get required form construction data, jobs, clients, etc.
$clients = $this->getClientModel()->getClients($this->bsock);
$jobs = $this->getJobModel()->getJobsByType($this->bsock, null);
$filesets = $this->getFilesetModel()->getFilesets($this->bsock);

// Get the different kind of jobs and merge them. Jobs of the following types
// cannot nor wanted to be run. M,V,R,U,I,C and S.
$job_type_B = $this->getJobModel()->getJobsByType($this->bsock, "B"); // Backup Job
$job_type_D = $this->getJobModel()->getJobsByType($this->bsock, 'D'); // Admin Job
$job_type_A = $this->getJobModel()->getJobsByType($this->bsock, 'A'); // Archive Job
$job_type_c = $this->getJobModel()->getJobsByType($this->bsock, 'c'); // Copy Job
$job_type_g = $this->getJobModel()->getJobsByType($this->bsock, 'g'); // Migration Job
$job_type_O = $this->getJobModel()->getJobsByType($this->bsock, 'O'); // Always Incremental Consolidate Job
$job_type_V = $this->getJobModel()->getJobsByType($this->bsock, 'V'); // Verify Job

$jobs = array_merge($job_type_B, $job_type_D, $job_type_A, $job_type_c, $job_type_g, $job_type_O, $job_type_V);

$filesets = $this->getFilesetModel()->getDotFilesets($this->bsock);
$storages = $this->getStorageModel()->getStorages($this->bsock);
$pools = $this->getPoolModel()->getDotPools($this->bsock, null);

// build form
$form = new RunJobForm($clients, $jobs, $filesets, $storages, $pools);
$form = new RunJobForm($clients, $jobs, $filesets, $storages, $pools, $jobdefaults);

// Set the method attribute for the form
$form->setAttribute('method', 'post');
Expand Down

0 comments on commit 269b31b

Please sign in to comment.