Bugzilla – Attachment 120312 Details for
Bug 14723
Additional delivery notes to messages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14723: Add error codes and replace strings with them in template
0001-Bug-14723-Add-error-codes-and-replace-strings-with-t.patch (text/plain), 5.20 KB, created by
Emmi Takkinen
on 2021-04-29 12:03:21 UTC
(
hide
)
Description:
Bug 14723: Add error codes and replace strings with them in template
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2021-04-29 12:03:21 UTC
Size:
5.20 KB
patch
obsolete
>From 0ad005265f1c702ca8259328354ed49606955dd3 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Wed, 28 Apr 2021 08:55:02 +0300 >Subject: [PATCH] Bug 14723: Add error codes and replace strings with them in > template > >This patch adds error codes for delivery notes and replaces English >strings with them in template. > >To test confirm everything works as intended. >--- > C4/Letters.pm | 15 ++++++++++----- > .../prog/en/modules/members/notices.tt | 14 +++++++------- > 2 files changed, 17 insertions(+), 12 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index d9a7ea8d8b..c80b328f1d 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -1335,7 +1335,8 @@ sub _send_message_by_email { > warn "FAIL: No 'to_address' and INVALID borrowernumber ($message->{borrowernumber})"; > _set_message_status( { message_id => $message->{'message_id'}, > status => 'failed', >- delivery_note => 'Invalid borrowernumber '.$message->{borrowernumber} } ); >+ delivery_note => 'Invalid borrowernumber '.$message->{borrowernumber}, >+ error_code => 'INVALID_BORNUMBER' } ); > return; > } > $to_address = $patron->notice_email_address; >@@ -1344,7 +1345,8 @@ sub _send_message_by_email { > # warning too verbose for this more common case? > _set_message_status( { message_id => $message->{'message_id'}, > status => 'failed', >- delivery_note => 'Unable to find an email address for this borrower' } ); >+ delivery_note => 'Unable to find an email address for this borrower', >+ error_code => 'NO_EMAIL' } ); > return; > } > } >@@ -1483,14 +1485,16 @@ sub _send_message_by_sms { > unless ( $patron and $patron->smsalertnumber ) { > _set_message_status( { message_id => $message->{'message_id'}, > status => 'failed', >- delivery_note => 'Missing SMS number' } ); >+ delivery_note => 'Missing SMS number', >+ error_code => 'MISSING_SMS' } ); > return; > } > > if ( _is_duplicate( $message ) ) { > _set_message_status( { message_id => $message->{'message_id'}, > status => 'failed', >- delivery_note => 'Message is duplicate' } ); >+ delivery_note => 'Message is duplicate', >+ error_code => 'DUPLICATE_MESSAGE' } ); > return; > } > >@@ -1499,7 +1503,8 @@ sub _send_message_by_sms { > } ); > _set_message_status( { message_id => $message->{'message_id'}, > status => ($success ? 'sent' : 'failed'), >- delivery_note => ($success ? '' : 'No notes from SMS driver') } ); >+ delivery_note => ($success ? '' : 'No notes from SMS driver'), >+ error_code => 'NO_NOTES' } ); > > return $success; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >index e6db22d3c3..d0ff7c9f37 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >@@ -91,13 +91,13 @@ > </td> > <td data-order="[% QUEUED_MESSAGE.updated_on | html %]">[% QUEUED_MESSAGE.updated_on | $KohaDates with_hours => 1 %]</td> > <td data-order="[% QUEUED_MESSAGE.time_queued | html %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</td> >- <td> >- [% IF ( QUEUED_MESSAGE.delivery_note ) %] >- [% IF ( QUEUED_MESSAGE.delivery_note == "Invalid borrowernumber $borrowernumber" ) %]Invalid borrowernumber [% borrowernumber | html %] >- [% ELSIF ( QUEUED_MESSAGE.delivery_note == 'Unable to find an email address for this borrower' ) %]Unable to find an email address for this borrower >- [% ELSIF ( QUEUED_MESSAGE.delivery_note == 'Missing SMS number' ) %]Missing SMS number >- [% ELSIF ( QUEUED_MESSAGE.delivery_note == 'Message is duplicate' ) %]Message is duplicate >- [% ELSIF ( QUEUED_MESSAGE.delivery_note == 'No notes from SMS driver' ) %]No notes from SMS driver >+ <td> >+ [% IF ( QUEUED_MESSAGE.error_code ) %] >+ [% IF ( QUEUED_MESSAGE.error_code == "INVALID_BORNUMBER" ) %]Invalid borrowernumber [% borrowernumber | html %] >+ [% ELSIF ( QUEUED_MESSAGE.error_code == 'NO_EMAIL' ) %]Unable to find an email address for this borrower >+ [% ELSIF ( QUEUED_MESSAGE.error_code == 'MISSING_SMS' ) %]Missing SMS number >+ [% ELSIF ( QUEUED_MESSAGE.error_code == 'DUPLICATE_MESSAGE' ) %]Message is duplicate >+ [% ELSIF ( QUEUED_MESSAGE.error_code == 'NO_NOTES' ) %]No notes from SMS driver > [% ELSE %]Error occured while sending email. > [% END %] > [% END %] >-- >2.25.1 >
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 14723
:
42053
|
42074
|
42159
|
42170
|
42227
|
42228
|
42384
|
42453
|
42455
|
42466
|
42505
|
42553
|
42574
|
42668
|
42669
|
44367
|
44413
|
62080
|
62138
|
78313
|
87525
|
87531
|
105776
|
105777
|
116642
|
116643
|
118225
|
120252
|
120309
|
120310
|
120312
|
120314
|
120376
|
120487
|
120488
|
120489
|
120490
|
120491
|
120492
|
120667