From: Marcin Haba Date: Sat, 3 Feb 2018 19:22:50 +0000 (+0100) Subject: baculum: Fix saving boolean values in schedule Run directive X-Git-Tag: Release-9.0.7~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=007a911f9f9142c9a849b3508200727c65672a3c;p=bacula%2Fbacula baculum: Fix saving boolean values in schedule Run directive --- 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}\""; } }