From d4a613f5e28c19d5bf01011bbfd2c113b364699f Mon Sep 17 00:00:00 2001 From: Ronaldo Richieri Date: Wed, 20 Sep 2023 11:54:21 -0300 Subject: [PATCH] Fix Enable checkbox behavior on Scrip Creation In fee8a9b4f0, the previous EditScrip page was split into Create and Modify. In the process of doing so, some elements were not properly adapted to the Create scrip page. This led to the fact that the "Enable" checkbox had no effect on Scrip Creation page and Scrips were being created as enabled regardless of the checkbox state. --- share/html/Admin/Scrips/Create.html | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/share/html/Admin/Scrips/Create.html b/share/html/Admin/Scrips/Create.html index a5e4b3de9de..7e1b63bf5a2 100644 --- a/share/html/Admin/Scrips/Create.html +++ b/share/html/Admin/Scrips/Create.html @@ -61,11 +61,11 @@ <& /Admin/Elements/SelectStage, Default => $ARGS{"Stage"} &> - - <&| /Elements/LabeledValue, Label => '' &>
- /> +% # If $Create is not defined, it means that it's the first time the user +% # sees the form and we should check the box by default. + />
@@ -96,8 +96,6 @@ <%INIT> my @results; -$ARGS{'Enabled'} = 1 unless $ARGS{'SetEnabled'}; - my $queue_obj; if ( $Queue ) { $queue_obj = RT::Queue->new( $session{'CurrentUser'} ); @@ -120,7 +118,7 @@ Queue => $Queue || 0, Stage => $ARGS{"Stage"}, - Disabled => $ARGS{"Disabled"}, + Disabled => $ARGS{"Enabled"} ? 0 : 1, ScripAction => $ARGS{"ScripAction"}, ScripCondition => $ARGS{"ScripCondition"},