[Bps-public-commit] rtx-calendar branch multiple-days-events updated. 1.05-28-gda3e131
BPS Git Server
git at git.bestpractical.com
Fri Sep 15 19:14:10 UTC 2023
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 "rtx-calendar".
The branch, multiple-days-events has been updated
via da3e131f28a43e76d72f1213f5fd976601423b85 (commit)
via 55fab9e9a4132b560eef8f1992030b06da48bab6 (commit)
from 827f3be3e369d38d1438d84514bd117b51ea4644 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit da3e131f28a43e76d72f1213f5fd976601423b85
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date: Fri Sep 15 16:14:06 2023 -0300
Update POD with CalendarFilterDefaultStatuses config information
diff --git a/lib/RTx/Calendar.pm b/lib/RTx/Calendar.pm
index 3d2b03e..8b4e742 100644
--- a/lib/RTx/Calendar.pm
+++ b/lib/RTx/Calendar.pm
@@ -440,6 +440,12 @@ F<etc/RT_SiteConfig.pm>:
Set(@CalendarFilterStatuses, qw(new open stalled rejected resolved));
+=head3 Default selected status on Filtering on Status field
+
+You can change the default selected statuses by adding them to the
+C<@CalendarFilterDefaultStatuses> setting to your F<etc/RT_SiteConfig.pm>:
+
+ Set(@CalendarFilterDefaultStatuses, qw(new open));
=head3 Custom icons
commit 55fab9e9a4132b560eef8f1992030b06da48bab6
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date: Fri Sep 15 16:09:23 2023 -0300
Add option to pre-select Filter on Status values
Add CalendarFilterDefaultStatuses option which allows to pre-select
Status values in the Filter on Status box for the first time the
calendar is displayed.
diff --git a/etc/RTxCalendar_Config.pm b/etc/RTxCalendar_Config.pm
index d042d47..6340a1f 100644
--- a/etc/RTxCalendar_Config.pm
+++ b/etc/RTxCalendar_Config.pm
@@ -26,4 +26,6 @@ Set($CalendarSortEvents, sub {
Set(@CalendarFilterStatuses, qw(new open stalled rejected resolved));
+Set(@CalendarFilterDefaultStatuses, qw(new open));
+
1;
diff --git a/html/Elements/Calendar b/html/Elements/Calendar
index c5b1fc9..c621d40 100644
--- a/html/Elements/Calendar
+++ b/html/Elements/Calendar
@@ -189,6 +189,7 @@ while ($date <= $end) {
</&>
</div>
<%INIT>
+my $NotFirstAccess = $DECODED_ARGS->{NotFirstAccess};
my $Month = $DECODED_ARGS->{Month} || (localtime)[4];
my $Year = $DECODED_ARGS->{Year} || (localtime)[5] + 1900;
my $Query = $DECODED_ARGS->{Query};
@@ -207,7 +208,11 @@ if ( $DECODED_ARGS->{FilterOnStatus} ) {
else {
push @FilterOnStatus, $DECODED_ARGS->{FilterOnStatus};
}
+} else {
+ @FilterOnStatus = @{RT->Config->Get('CalendarFilterDefaultStatuses')}
+ unless $NotFirstAccess;
}
+$NotFirstAccess = 1;
if ($FilterOnStatusClear) {
$Query = $BaseQuery if $BaseQuery;
@@ -270,11 +275,12 @@ my $QueryString =
Format => $Format,
Order => $Order,
OrderBy => $OrderBy,
- Rows => $RowsPerPage
+ Rows => $RowsPerPage,
+ NotFirstAccess => $NotFirstAccess,
)
if ($Query);
-$QueryString ||= 'NewQuery=1';
+$QueryString ||= 'NewQuery=1&NotFirstAccess=1';
# we search all date types in Format string
my @CoreDates = grep { $TempFormat =~ m/__${_}(Relative)?__/ } @DateTypes;
-----------------------------------------------------------------------
Summary of changes:
etc/RTxCalendar_Config.pm | 2 ++
html/Elements/Calendar | 10 ++++++++--
lib/RTx/Calendar.pm | 6 ++++++
3 files changed, 16 insertions(+), 2 deletions(-)
hooks/post-receive
--
rtx-calendar
More information about the Bps-public-commit
mailing list