Skip to content

Commit

Permalink
Add option to set number of rows in dashboard subscriptions
Browse files Browse the repository at this point in the history
In some situations, it is desirable to limit the number of rows
returned by a dashboard subscriptions.  This patch adds a new
option to the dashboard subscriptions to allow the administrator
to change the available options for the number of rows returned.
  • Loading branch information
richieri-bps committed Dec 7, 2023
1 parent eeb33b2 commit 74b7d6a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions etc/RT_Config.pm.in
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,16 @@ With this enabled, some parts of the email won't look exactly like RT.

Set($EmailDashboardInlineCSS, 0);

=item C<@DashboardSubscriptionRows>

Define the options available in the Rows dropdown on the dashboard
subscription page. Add "0" to the list to allow users to select
"Unlimited" rows.

=cut

Set(@DashboardSubscriptionRows, (1, 2, 5, 10, 15, 20, 25, 50, 75, 100, 0));

=back


Expand Down
3 changes: 3 additions & 0 deletions lib/RT/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1994,6 +1994,9 @@ our %META;
EmailDashboardInlineCSS => {
Widget => '/Widgets/Form/Boolean',
},
DashboardSubscriptionRows => {
Type => 'ARRAY',
},
DefaultErrorMailPrecedence => {
Widget => '/Widgets/Form/String',
},
Expand Down
2 changes: 1 addition & 1 deletion share/html/Dashboards/Subscription.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
<div class="row">
<div class="col-auto">
<select name="Rows" class="form-control selectpicker">
% for my $rows (1, 2, 5, 10, 15, 20, 25, 50, 75, 100, 0) {
% for my $rows ( RT->Config->Get('DashboardSubscriptionRows') ) {
<option value="<% $rows %>" <% $fields{'Rows'} eq $rows ? 'selected="selected"' : '' |n %>><% loc($rows || 'Unlimited') %></option>
% }
</select>
Expand Down

0 comments on commit 74b7d6a

Please sign in to comment.