From: Marcin Haba Date: Mon, 22 Apr 2019 05:39:14 +0000 (+0200) Subject: baculum: Tweak add level directive to new job wizard X-Git-Tag: Release-9.4.3~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c209fb79b5bae6d5ca4e2e7456d306656a78b9bc;p=thirdparty%2Fbacula.git baculum: Tweak add level directive to new job wizard --- diff --git a/gui/baculum/protected/Web/Pages/NewJobWizard.page b/gui/baculum/protected/Web/Pages/NewJobWizard.page index e3fd4f0ae..e627dde59 100644 --- a/gui/baculum/protected/Web/Pages/NewJobWizard.page +++ b/gui/baculum/protected/Web/Pages/NewJobWizard.page @@ -318,6 +318,14 @@

<%[ Job directives ]%>

+
+ +
JobDefs
-
<%=$this->JobDefs->getDirectiveValue()%>
+
<%=$this->JobDefs->getDirectiveValue() ?: '-'%>
@@ -536,6 +544,13 @@
<%[ How ]%> +
+
Level
+
+ <%=$this->Level->getDirectiveValue() ?: '-'%> + <%=$this->isInJobDefs('Level', $this->Level->getDirectiveValue()) ? ' (' . Prado::localize('inherited from JobDefs') . ')': ''%> +
+
Accurate
diff --git a/gui/baculum/protected/Web/Pages/NewJobWizard.php b/gui/baculum/protected/Web/Pages/NewJobWizard.php index ade0e2046..3185b8001 100644 --- a/gui/baculum/protected/Web/Pages/NewJobWizard.php +++ b/gui/baculum/protected/Web/Pages/NewJobWizard.php @@ -39,6 +39,7 @@ class NewJobWizard extends BaculumWebPage { $this->FullBackupPool->saveDirective(); $this->IncrementalBackupPool->saveDirective(); $this->DifferentialBackupPool->saveDirective(); + $this->Level->saveDirective(); $this->Messages->saveDirective(); $this->Schedule->saveDirective(); } @@ -72,6 +73,7 @@ class NewJobWizard extends BaculumWebPage { } case 3: { $this->loadBackupJobDirectives(); + $this->loadLevels(); $this->loadMessages(); break; } @@ -360,6 +362,24 @@ class NewJobWizard extends BaculumWebPage { } } + + /** + * Load job levels. + * + * @return none + */ + public function loadLevels() { + // so far backup job levels only + $level_list = array( + 'Full', 'Incremental', 'Differential', 'VirtualFull' + ); + $this->Level->setData($level_list); + $jobdefs = $this->getJobDefs(); + if (key_exists('Level', $jobdefs)) { + $this->Level->setDirectiveValue($jobdefs['Level']); + } + $this->Level->onLoad(null); + } /** * Load messages. * @@ -409,7 +429,7 @@ class NewJobWizard extends BaculumWebPage { $jd = $this->JobDefs->getDirectiveValue(); $directives = array('Client', 'Fileset', 'Storage', 'SpoolData', 'SpoolAttributes', 'SpoolSize', 'Pool', 'FullBackupPool', 'IncrementalBackupPool', 'DifferentialBackupPool', - 'Accurate', 'MaximumConcurrentJobs', 'Priority', 'ReRunFailedLevels', 'Schedule', + 'Level', 'Accurate', 'MaximumConcurrentJobs', 'Priority', 'ReRunFailedLevels', 'Schedule', 'RescheduleOnError', 'RescheduleIncompleteJobs', 'RescheduleInterval', 'RescheduleTimes', 'Messages' );