Skip to content

Commit

Permalink
Merge branch '5.0/fix-enable-checkbox-on-scrip-creation' into 5.0-trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnavy committed Dec 22, 2023
2 parents 3420fe4 + d4a613f commit b43377f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions share/html/Admin/Scrips/Create.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@
<& /Admin/Elements/SelectStage, Default => $ARGS{"Stage"} &>
</&>

<input type="hidden" class="hidden" name="SetEnabled" value="1" />

<&| /Elements/LabeledValue, Label => '' &>
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input checkbox" name="Enabled" id="Enabled" value="1" <% $ARGS{'Enabled'}? 'checked="checked"': '' |n%> />
% # 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.
<input type="checkbox" class="custom-control-input checkbox" name="Enabled" id="Enabled" value="1" <% ($ARGS{'Enabled'} || !$Create ) ? 'checked="checked"' : '' |n %> />
<label class="custom-control-label" for="Enabled"><&|/l&>Enabled (Unchecking this box disables this scrip)</&></label>
</div>
</&>
Expand Down Expand Up @@ -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'} );
Expand All @@ -120,7 +118,7 @@

Queue => $Queue || 0,
Stage => $ARGS{"Stage"},
Disabled => $ARGS{"Disabled"},
Disabled => $ARGS{"Enabled"} ? 0 : 1,

ScripAction => $ARGS{"ScripAction"},
ScripCondition => $ARGS{"ScripCondition"},
Expand Down

0 comments on commit b43377f

Please sign in to comment.