Bugzilla – Attachment 120252 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-28 06:16:08 UTC
(
hide
)
Description:
Bug 14723: Add error codes and replace strings with them in template
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2021-04-28 06:16:08 UTC
Size:
5.20 KB
patch
obsolete
>From 47ac0934d1b7fda0f8d6474fff85571ed4c7c695 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 that everything works according to the first test plan. >--- > C4/Letters.pm | 15 ++++++++++----- > .../prog/en/modules/members/notices.tt | 12 ++++++------ > 2 files changed, 16 insertions(+), 11 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index a72e1635de..7b30abd9ae 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -1330,7 +1330,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; >@@ -1339,7 +1340,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; > } > } >@@ -1478,14 +1480,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; > } > >@@ -1494,7 +1498,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 b2a37633bf..9fb4ea8f7a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >@@ -91,12 +91,12 @@ > <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 >+ [% 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