Bugzilla – Attachment 155956 Details for
Bug 34854
Add ability to skip Talking Tech Itiva notifications for a patron if a given field matches a given value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34854: Add ability to skip Talking Tech Itiva notifications for a patron if a given field matches a given value
Bug-34854-Add-ability-to-skip-Talking-Tech-Itiva-n.patch (text/plain), 3.90 KB, created by
Kyle M Hall (khall)
on 2023-09-20 17:23:40 UTC
(
hide
)
Description:
Bug 34854: Add ability to skip Talking Tech Itiva notifications for a patron if a given field matches a given value
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-09-20 17:23:40 UTC
Size:
3.90 KB
patch
obsolete
>From 9640e87aff9e6984b8136252bd2dcc90e2f8cd11 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 20 Sep 2023 13:18:54 -0400 >Subject: [PATCH] Bug 34854: Add ability to skip Talking Tech Itiva > notifications for a patron if a given field matches a given value > >Because some notices are mandatory, some libraries would like to allow patrons to opt-in to phone notices. The request is to be able to decide if a patron should get a notice based on the value of a given field ( usually sort1 or sort2 ). > >Test Plan: >1) Apply this patch >2) Enable TalkingTechItivaPhoneNotification >3) Set up some overdue items for a patron >4) Enable phone notices for overdues in the notice status triggers >5) Run the outbound script for OVERDUE with -t OVERDUE >6) Note the output the output contains a line for that patron >7) Set the sort1 field for that patron to TEST >8) Run the script again, adding in the option "-i sort1:TEST" >9) Note the ouput no longer contains that patron! >--- > .../thirdparty/TalkingTech_itiva_outbound.pl | 29 ++++++++++++------- > 1 file changed, 19 insertions(+), 10 deletions(-) > >diff --git a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl >index 5f679a99321..b7deefdfc3d 100755 >--- a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl >+++ b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl >@@ -53,6 +53,7 @@ my $help; > my $outfile; > my $skip_patrons_with_email; > my $patron_branchcode; >+my $if_patron_field_equals; > > # maps to convert I-tiva terms to Koha terms > my $type_module_map = { >@@ -68,15 +69,16 @@ my $type_notice_map = { > }; > > GetOptions( >- 'o|output:s' => \$outfile, >- 'v' => \$verbose, >- 'lang:s' => \$language, >- 'type:s' => \@types, >- 'w|waiting-hold-day:s' => \@holds_waiting_days_to_call, >- 'c|code|library-code:s' => \$library_code, >- 's|skip-patrons-with-email' => \$skip_patrons_with_email, >- 'pb|patron-branchcode:s' => \$patron_branchcode, >- 'h|help' => \$help, >+ 'o|output:s' => \$outfile, >+ 'v' => \$verbose, >+ 'lang:s' => \$language, >+ 'type:s' => \@types, >+ 'w|waiting-hold-day:s' => \@holds_waiting_days_to_call, >+ 'c|code|library-code:s' => \$library_code, >+ 's|skip-patrons-with-email' => \$skip_patrons_with_email, >+ 'i|if-patron-field-equals:s' => \$if_patron_field_equals, >+ 'pb|patron-branchcode:s' => \$patron_branchcode, >+ 'h|help' => \$help, > ); > > $language = uc($language); >@@ -101,6 +103,10 @@ if ( defined $outfile ) { > > my $format = 'V'; # format for phone notifications > >+my ( $if_patron_field_equals_field, $if_patron_field_equals_value ); >+( $if_patron_field_equals_field, $if_patron_field_equals_value ) = split( /:/, $if_patron_field_equals ) >+ if $if_patron_field_equals; >+ > foreach my $type (@types) { > $type = uc($type); #just in case lower or mixed-case was supplied > my $module = $type_module_map->{$type}; #since the module is required to get the letter >@@ -122,7 +128,10 @@ foreach my $type (@types) { > my $patrons; > foreach my $issues (@loop) { > $patrons->{$issues->{borrowernumber}} ||= Koha::Patrons->find( $issues->{borrowernumber} ) if $skip_patrons_with_email; >- next if $skip_patrons_with_email && $patrons->{$issues->{borrowernumber}}->notice_email_address; >+ next if $skip_patrons_with_email && $patrons->{ $issues->{borrowernumber} }->notice_email_address; >+ next >+ if $if_patron_field_equals >+ && $patrons->{ $issues->{borrowernumber} }->$if_patron_field_equals_field eq $if_patron_field_equals_value; > > my $date_dt = dt_from_string ( $issues->{'date_due'} ); > my $due_date = output_pref( { dt => $date_dt, dateonly => 1, dateformat =>'metric' } ); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34854
:
155956
|
158278
|
159140
|
159141