Mailing List Archive

rt branch 5.0/subscription-rows-config created. rt-5.0.5-74-g3d1d2ab5f5
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 3d1d2ab5f5d4d42c519c4e16456e52c1d24470bc (commit)

- Log -----------------------------------------------------------------
commit 3d1d2ab5f5d4d42c519c4e16456e52c1d24470bc
Author: Ronaldo Richieri <ronaldo@bestpractical.com>
Date: Tue Jan 2 10:37:58 2024 -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..a5e47a9ff9 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -943,6 +943,16 @@ See also L</@LexiconLanguages>.

Set(@EmailDashboardLanguageOrder, qw(_subscription _recipient _subscriber en));

+=item C<@EmailDashboardRows>
+
+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(@EmailDashboardRows, (1, 2, 5, 10, 15, 20, 25, 50, 75, 100, 0));
+
=item C<$DashboardTestEmailLimit>

The maximum number of dashboard test emails that can be sent in a
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 04fbe3dcd5..896334c9aa 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -1086,6 +1086,9 @@ our %META;
},
ReferrerWhitelist => { Type => 'ARRAY' },
EmailDashboardLanguageOrder => { Type => 'ARRAY' },
+ EmailDashboardRows => {
+ Type => 'ARRAY',
+ },
CustomFieldValuesCanonicalizers => { Type => 'ARRAY' },
CustomFieldValuesValidations => {
Type => 'ARRAY',
diff --git a/share/html/Dashboards/Subscription.html b/share/html/Dashboards/Subscription.html
index c1db86230b..b766fbca9c 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('EmailDashboardRows') ) {
<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