[Bps-public-commit] rtx-calendar branch multiple-days-events-2 updated. 1.05-23-g24a4334

BPS Git Server git at git.bestpractical.com
Thu Nov 16 18:04:09 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-2 has been updated
       via  24a4334ef4ae6847adf2264c70b2e84d6dcd1f55 (commit)
       via  e34c243b5fe2a02717f73699777ad41f4fd57515 (commit)
      from  ae3c2303fbe5a0e7cde25fc82c2a24cc9c168155 (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 24a4334ef4ae6847adf2264c70b2e84d6dcd1f55
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date:   Thu Nov 16 15:03:51 2023 -0300

    Prepare version 1.07

diff --git a/CHANGES b/CHANGES
index 65b8f30..9ae8c40 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+1.07 2023-11-16
+ - Fix failing to change months from the select boxes
+ - Fix failing to change month to January
+ - Fix failing to display multiple-days events when event had less than 24h
+ - Prevent infinite loop when rendering the calendar
+
 1.06 2023-10-24
  - Minimum version of RT 5.0
  - Add color-coded display of events by ticket status
diff --git a/META.yml b/META.yml
index 858676f..9215247 100644
--- a/META.yml
+++ b/META.yml
@@ -26,6 +26,6 @@ requires:
   perl: 5.10.1
 resources:
   license: http://opensource.org/licenses/gpl-license.php
-version: '1.06'
+version: '1.07'
 x_module_install_rtx_version: '0.43'
-x_requires_rt: '5.0'
+x_requires_rt: 5.0.0
diff --git a/lib/RTx/Calendar.pm b/lib/RTx/Calendar.pm
index be2486b..7678054 100644
--- a/lib/RTx/Calendar.pm
+++ b/lib/RTx/Calendar.pm
@@ -4,7 +4,7 @@ use strict;
 use DateTime;
 use DateTime::Set;
 
-our $VERSION = "1.06";
+our $VERSION = "1.07";
 
 RT->AddStyleSheets('calendar.css');
 RT->AddJavaScript('calendar.js');

commit e34c243b5fe2a02717f73699777ad41f4fd57515
Author: Ronaldo Richieri <ronaldo at bestpractical.com>
Date:   Thu Nov 16 14:49:25 2023 -0300

    Fix bug when changing month using the select boxes
    
    After changing a month using the links at the top, the querystring
    that is used to pre-populate the action of the form and other elements
    already had a month and year in it.
    
    Since the select boxes for Month and Year had the same name, both
    variables were being considered as an Array and failing to be parsed.
    
    This patch fixes it by changin the select boxes names and trying to get
    values from it first and from the querystring if it fails.

diff --git a/html/Elements/Calendar b/html/Elements/Calendar
index 3c23762..ff41edc 100644
--- a/html/Elements/Calendar
+++ b/html/Elements/Calendar
@@ -162,13 +162,13 @@ while ($date <= $end) {
 <td valign="top" align="center">
 <form method="post" class="changeCalendarMonth" onsubmit="changeCalendarMonth()">
 
-<select name="Month" class="selectpicker form-control col-3">
+<select name="SelectedMonth" class="selectpicker form-control col-3">
 % for (0..11) {
 <option value="<%$_%>" <% $_ == $Month ? 'selected' : ''%> ><%$rtdate->GetMonth($_)%></option>
 % }
 </select>
 % my $year = (localtime)[5] + 1900;
-<select name="Year" class="selectpicker form-control col-3">
+<select name="SelectedYear" class="selectpicker form-control col-3">
 % for ( ($year-5) .. ($year+5)) {
 <option value="<%$_%>" <% $_ == $Year ? 'selected' : ''%>><%$_%></option>
 % }
@@ -192,8 +192,8 @@ 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 $Month = $DECODED_ARGS->{SelectedMonth} // $DECODED_ARGS->{Month} // (localtime)[4];
+my $Year = $DECODED_ARGS->{SelectedYear} // $DECODED_ARGS->{Year}  || (localtime)[5] + 1900;
 my $Query = $DECODED_ARGS->{Query};
 my $Format = $DECODED_ARGS->{Format};
 my $Order = $DECODED_ARGS->{Order};

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

Summary of changes:
 CHANGES                | 6 ++++++
 META.yml               | 4 ++--
 html/Elements/Calendar | 8 ++++----
 lib/RTx/Calendar.pm    | 2 +-
 4 files changed, 13 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
rtx-calendar


More information about the Bps-public-commit mailing list