Bugzilla – Attachment 36576 Details for
Bug 12344
Multi transport types for issues and checkins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12344 - Multi transport types for issues and checkins
Bug-12344---Multi-transport-types-for-issues-and-c.patch (text/plain), 3.83 KB, created by
Jonathan Druart
on 2015-03-05 12:48:28 UTC
(
hide
)
Description:
Bug 12344 - Multi transport types for issues and checkins
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-03-05 12:48:28 UTC
Size:
3.83 KB
patch
obsolete
>From c4cef1619e6c01328e893404e11394436f214932 Mon Sep 17 00:00:00 2001 >From: Koha instance knakk-koha <knakk-koha@vagrant-saucy64> >Date: Mon, 2 Jun 2014 14:18:30 +0200 >Subject: [PATCH] Bug 12344 - Multi transport types for issues and checkins > >This small patch corrects the order of generating notices for issues and returns (checkout/checkin) so that borrower's notices are rendered correctly (for sms,email,etc.) > >Test plan: > >1) Edit SMSSendDriver syspref to use driver 'Test' >2) Edit CHECKOUT template for sms to 'SMS test' >3) select SMS for test patron's messaging prefs for item checkout >4) checkout an item >5) check the table message_queue, verify that template sms is > not used (message content is not 'SMS test') > >6) apply patch, make new checkout >7) check that message_queue table now has a correctly generated > notice with 'SMS test' > >For a real world test use a real SMS::Send driver and run the >cronjob process-message-queue.pl to send messages immediately. > >Signed-off-by: Sophie Meynieux <sophie.meynieux@biblibre.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > C4/Circulation.pm | 43 +++++++++++++++++++++++++++++-------------- > 1 file changed, 29 insertions(+), 14 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 14dfb0e..9f7a93f 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3252,19 +3252,6 @@ sub SendCirculationAlert { > message_name => $message_name{$type}, > }); > my $issues_table = ( $type eq 'CHECKOUT' || $type eq 'RENEWAL' ) ? 'issues' : 'old_issues'; >- my $letter = C4::Letters::GetPreparedLetter ( >- module => 'circulation', >- letter_code => $type, >- branchcode => $branch, >- tables => { >- $issues_table => $item->{itemnumber}, >- 'items' => $item->{itemnumber}, >- 'biblio' => $item->{biblionumber}, >- 'biblioitems' => $item->{biblionumber}, >- 'borrowers' => $borrower, >- 'branches' => $branch, >- } >- ) or return; > > my @transports = keys %{ $borrower_preferences->{transports} }; > # warn "no transports" unless @transports; >@@ -3273,15 +3260,43 @@ sub SendCirculationAlert { > my $message = C4::Message->find_last_message($borrower, $type, $_); > if (!$message) { > #warn "create new message"; >+ my $letter = C4::Letters::GetPreparedLetter ( >+ module => 'circulation', >+ letter_code => $type, >+ branchcode => $branch, >+ message_transport_type => $_, >+ tables => { >+ $issues_table => $item->{itemnumber}, >+ 'items' => $item->{itemnumber}, >+ 'biblio' => $item->{biblionumber}, >+ 'biblioitems' => $item->{biblionumber}, >+ 'borrowers' => $borrower, >+ 'branches' => $branch, >+ } >+ ) or return; > C4::Message->enqueue($letter, $borrower, $_); > } else { > #warn "append to old message"; >+ my $letter = C4::Letters::GetPreparedLetter ( >+ module => 'circulation', >+ letter_code => $type, >+ branchcode => $branch, >+ message_transport_type => $_, >+ tables => { >+ $issues_table => $item->{itemnumber}, >+ 'items' => $item->{itemnumber}, >+ 'biblio' => $item->{biblionumber}, >+ 'biblioitems' => $item->{biblionumber}, >+ 'borrowers' => $borrower, >+ 'branches' => $branch, >+ } >+ ) or return; > $message->append($letter); > $message->update; > } > } > >- return $letter; >+ return; > } > > =head2 updateWrongTransfer >-- >2.1.0
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 12344
:
28605
|
28606
|
36406
|
36568
|
36570
| 36576 |
36577