[Bps-public-commit] rtx-calendar branch add-callback-to-modify-query created. 1.04-2-gba8cfad

BPS Git Server git at git.bestpractical.com
Sun Jan 29 17:23:19 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, add-callback-to-modify-query has been created
        at  ba8cfad5b3a47c4da62270324f5835799cdd8e76 (commit)

- Log -----------------------------------------------------------------
commit ba8cfad5b3a47c4da62270324f5835799cdd8e76
Author: Brad Embree <brad at bestpractical.com>
Date:   Sun Jan 29 09:22:27 2023 -0800

    Prep version 1.05

diff --git a/CHANGES b/CHANGES
index 8acc2f4..80ace77 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+1.05 2023-01-29
+ - add a callback named BeforeFindTickets so user can modify the query
+   or format of the calendar search
+
 1.04 2022-09-21
  - Include user's groups and system when looking for calendar saved search
 
diff --git a/META.yml b/META.yml
index d975b94..d7cb0e0 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.04'
+version: '1.05'
 x_module_install_rtx_version: '0.43'
 x_requires_rt: 4.2.0
diff --git a/lib/RTx/Calendar.pm b/lib/RTx/Calendar.pm
index edb7507..9bb375d 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.04";
+our $VERSION = "1.05";
 
 RT->AddStyleSheets('calendar.css');
 

commit d3f1aa5da83c07f3adb6d4746bb1d5dfd0908be5
Author: Brad Embree <brad at bestpractical.com>
Date:   Fri Sep 30 09:42:16 2022 -0700

    Add a callback named BeforeFindTickets
    
    This callback will allow a user to modify the calendar query and/or format as
    desired before the search is run.

diff --git a/html/Elements/MyCalendar b/html/Elements/MyCalendar
index 068dd84..175c7e9 100644
--- a/html/Elements/MyCalendar
+++ b/html/Elements/MyCalendar
@@ -78,7 +78,7 @@ my %DateTypes = map { $_ => 1 } @Dates;
 
 $Query .= RTx::Calendar::DatesClauses(\@Dates, $begin->strftime("%F"), $end->strftime("%F"));
 
-# print STDERR $Query, "\n";
+$m->callback( CallbackName => 'BeforeFindTickets', ARGSRef => \%ARGS, QueryRef => \$Query, FormatRef => \$Format );
 
 my %Tickets = RTx::Calendar::FindTickets($session{'CurrentUser'}, $Query, \@Dates);
 
diff --git a/html/Search/Calendar.html b/html/Search/Calendar.html
index 5eceb0c..9c5e71e 100644
--- a/html/Search/Calendar.html
+++ b/html/Search/Calendar.html
@@ -250,7 +250,7 @@ my %DateTypes = map { $_ => 1 } @Dates;
 
 $TempQuery .= RTx::Calendar::DatesClauses(\@Dates, $date->strftime("%F"), $end->strftime("%F"));
 
-# print STDERR ("-" x 30), "\n", $TempQuery, "\n";
+$m->callback( CallbackName => 'BeforeFindTickets', ARGSRef => \%ARGS, QueryRef => \$TempQuery, FormatRef => \$TempFormat );
 
 my %Tickets = RTx::Calendar::FindTickets($session{'CurrentUser'}, $TempQuery, \@Dates, $date->strftime("%F"), $end->strftime("%F"));
 

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


hooks/post-receive
-- 
rtx-calendar


More information about the Bps-public-commit mailing list