Mailing List Archive

rt branch 5.0/subscription-rows-config created. rt-5.0.5-74-g74b7d6a341
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/subscription-rows-config has been created
at 74b7d6a341ef23b6d952cc563a3ac51c1dfee787 (commit)

- Log -----------------------------------------------------------------
commit 74b7d6a341ef23b6d952cc563a3ac51c1dfee787
Author: Ronaldo Richieri <ronaldo@bestpractical.com>
Date: Thu Dec 7 16:44:59 2023 -0300

Add option to set number of rows in dashboard subscriptions

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.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 31e3163168..767e74edc0 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -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


diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 04fbe3dcd5..04e8ba061b 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -1994,6 +1994,9 @@ our %META;
EmailDashboardInlineCSS => {
Widget => '/Widgets/Form/Boolean',
},
+ DashboardSubscriptionRows => {
+ Type => 'ARRAY',
+ },
DefaultErrorMailPrecedence => {
Widget => '/Widgets/Form/String',
},
diff --git a/share/html/Dashboards/Subscription.html b/share/html/Dashboards/Subscription.html
index c1db86230b..6064b4b625 100644
--- a/share/html/Dashboards/Subscription.html
+++ b/share/html/Dashboards/Subscription.html
@@ -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>

-----------------------------------------------------------------------


hooks/post-receive
--
rt
_______________________________________________
rt-commit mailing list
rt-commit@lists.bestpractical.com
https://lists.bestpractical.com/mailman/listinfo/rt-commit