rt 4.2.14 (#13852)
[freeside.git] / rt / share / html / Admin / Scrips / index.html
index a9549f6..e1fd1fe 100644 (file)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
 <& /Admin/Elements/Header, Title => loc('Select a Scrip') &>
 <& /Elements/Tabs &>
 
+<h1><%$caption%></h1>
+
+<form method="post" action="<% RT->Config->Get('WebPath') %>/Admin/Scrips/index.html">
+<input type="checkbox" class="checkbox" id="FindDisabledScrips" name="FindDisabledScrips" value="1" <% $FindDisabledScrips ? 'checked="checked"': '' |n%> />
+<label for="FindDisabledScrips"><&|/l&>Include disabled scrips in listing.</&></label>
+<div align="right"><input type="submit" class="button" value="<&|/l&>Go!</&>" /></div>
+</form>
+
 <& /Elements/CollectionList,
     OrderBy       => 'Description',
     Order         => 'ASC',
     Collection    => $scrips,
     Format        => $Format,
     AllowSorting  => 1,
+    PassArguments => [qw(
+       FindDisabledScrips
+    )], 
 &>
-<%args>
-$Format => undef
-</%args>
+
+
 <%INIT>
 my $scrips = RT::Scrips->new( $session{'CurrentUser'} );
-$scrips->FindAllRows;
+$scrips->FindAllRows if $FindDisabledScrips;
 $scrips->UnLimit;
 
+my ($caption);
+$caption = $FindDisabledScrips 
+  ? loc("All Scrips")
+  : loc("Enabled Scrips");
+
 $m->callback(CallbackName => 'Massage', Scrips => $scrips);
 
 $Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Scrips'};
 my $Rows = RT->Config->Get('AdminSearchResultRows')->{'Scrips'} || 50;
 </%INIT>
+
+<%ARGS>
+$FindDisabledScrips => 0
+$Format => undef
+</%ARGS>
+
+