From 007a911f9f9142c9a849b3508200727c65672a3c Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Sat, 3 Feb 2018 20:22:50 +0100 Subject: [PATCH] baculum: Fix saving boolean values in schedule Run directive --- gui/baculum/protected/Common/Class/Params.php | 10 ++++++++++ .../protected/Web/Portlets/DirectiveSchedule.php | 3 +++ 2 files changed, 13 insertions(+) diff --git a/gui/baculum/protected/Common/Class/Params.php b/gui/baculum/protected/Common/Class/Params.php index 02ad37d1ba..67bf60c02a 100644 --- a/gui/baculum/protected/Common/Class/Params.php +++ b/gui/baculum/protected/Common/Class/Params.php @@ -105,4 +105,14 @@ class Params extends CommonModule { return $wday; } + /** + * Get Bacula config boolean value. + * + * @param boolean $value value + * @return string bacula config boolean value + */ + public static function getBoolValue($value) { + return ($value ? 'yes' : 'no'); + } } +?> diff --git a/gui/baculum/protected/Web/Portlets/DirectiveSchedule.php b/gui/baculum/protected/Web/Portlets/DirectiveSchedule.php index e3a37be5fe..8b7ead3167 100644 --- a/gui/baculum/protected/Web/Portlets/DirectiveSchedule.php +++ b/gui/baculum/protected/Web/Portlets/DirectiveSchedule.php @@ -318,6 +318,9 @@ class DirectiveSchedule extends DirectiveListTemplate { // value the same as default value, skip it continue; } + if ($this->directive_types[$i] === 'DirectiveBoolean') { + $directive_value = Params::getBoolValue($directive_value); + } $directive_values[] = "{$directive_name}=\"{$directive_value}\""; } } -- 2.39.2