]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Fix saving boolean values in schedule Run directive
authorMarcin Haba <marcin.haba@bacula.pl>
Sat, 3 Feb 2018 19:22:50 +0000 (20:22 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sat, 3 Feb 2018 19:26:22 +0000 (20:26 +0100)
gui/baculum/protected/Common/Class/Params.php
gui/baculum/protected/Web/Portlets/DirectiveSchedule.php

index 02ad37d1ba2a3614a303a0240ae768f933e4fd39..67bf60c02a79492b4a5cc27612fea7ce95101a10 100644 (file)
@@ -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');
+       }
 }
+?>
index e3a37be5fe5059e7ef58d3a70747b6b554f1e30e..8b7ead3167ce4e5261a03cbfca7a4e3a2c66b638 100644 (file)
@@ -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}\"";
                        }
                }