Bugzilla – Attachment 102335 Details for
Bug 20844
Reset a hold when it is missing after allocation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20844: (follow-up) SendLostHoldNotices
Bug-20844-follow-up-SendLostHoldNotices.patch (text/plain), 33.89 KB, created by
Aleisha Amohia
on 2020-04-03 03:49:09 UTC
(
hide
)
Description:
Bug 20844: (follow-up) SendLostHoldNotices
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2020-04-03 03:49:09 UTC
Size:
33.89 KB
patch
obsolete
>From 7bbcd5049fa214961cccc1ad48419aed4ee1ac74 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 26 Mar 2020 17:13:15 +0000 >Subject: [PATCH] Bug 20844: (follow-up) SendLostHoldNotices > >This patch adds a new syspref SendLostHoldNotices > >Test: >1) Update database and restart memcached >2) Enable the SendLostHoldNotices system preference >3) Place a hold on an item >4) Check in the item and set the hold to waiting >5) Go to edit the item and set an item lost status >6) Check the borrower's notices and confirm the notice has been enqueued >7) Confirm the notice is not sent twice when reverting or cancelling the >hold >8) Confirm notice enqueues as expected for a bib-level hold > >Sponsored-by: Catalyst IT >--- > C4/Circulation.pm | 15 +++++++++++++++ > catalogue/updateitem.pl | 2 ++ > .../bug_20844-add_LOST_WAITING_HOLD_notice.perl | 6 ++++++ > .../bug_20844-add_SendLostHoldNotices_syspref.perl | 6 ++++++ > .../data/mysql/de-DE/mandatory/sample_notices.sql | 4 +++- > .../data/mysql/en/mandatory/sample_notices.yml | 20 ++++++++++++++++++++ > .../data/mysql/es-ES/mandatory/sample_notices.sql | 4 +++- > .../mysql/fr-CA/obligatoire/sample_notices.sql | 4 +++- > .../mysql/fr-FR/1-Obligatoire/sample_notices.sql | 4 +++- > installer/data/mysql/it-IT/necessari/notices.sql | 4 +++- > .../mysql/nb-NO/1-Obligatorisk/sample_notices.sql | 4 +++- > .../data/mysql/pl-PL/mandatory/sample_notices.sql | 4 +++- > .../data/mysql/ru-RU/mandatory/sample_notices.sql | 4 +++- > .../data/mysql/uk-UA/mandatory/sample_notices.sql | 4 +++- > .../en/modules/admin/preferences/circulation.pref | 6 ++++++ > t/db_dependent/Reserves.t | 22 ++++++++++++++++++++-- > 16 files changed, 102 insertions(+), 11 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_20844-add_LOST_WAITING_HOLD_notice.perl > create mode 100644 installer/data/mysql/atomicupdate/bug_20844-add_SendLostHoldNotices_syspref.perl > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 69b4c1fed6..c0223a4115 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3836,6 +3836,21 @@ sub LostItem{ > $hold = C4::Reserves::RevertWaitingStatus({ itemnumber => $itemnumber }); > } > } >+ >+ # SendLostHoldNotices >+ my $item = Koha::Items->find( $itemnumber ); >+ if ( C4::Context->preference('SendLostHoldNotices') && defined $hold && $item->itemlost ){ >+ my $letter = C4::Letters::GetPreparedLetter( >+ module => 'reserves', >+ letter_code => 'LOST_WAITING_HOLD', >+ branchcode => $hold->branchcode, >+ tables => { >+ borrowers => $hold->borrowernumber, >+ branches => $hold->branchcode, >+ }, >+ ); >+ C4::Message->enqueue($letter, $hold->borrower->unblessed, 'email'); >+ } > } > > sub GetOfflineOperations { >diff --git a/catalogue/updateitem.pl b/catalogue/updateitem.pl >index f99fb8b55c..3c389686b6 100755 >--- a/catalogue/updateitem.pl >+++ b/catalogue/updateitem.pl >@@ -48,6 +48,8 @@ if ( defined $cancelhold ){ > } elsif ( defined $reverthold ){ > $cancelhold = 0; > LostItem($itemnumber, 'moredetail', 0, $cancelhold); >+} else { >+ $cancelhold = undef; > } > if ( defined $redirecturl ){ > print $cgi->redirect( $redirecturl . $biblionumber ); >diff --git a/installer/data/mysql/atomicupdate/bug_20844-add_LOST_WAITING_HOLD_notice.perl b/installer/data/mysql/atomicupdate/bug_20844-add_LOST_WAITING_HOLD_notice.perl >new file mode 100644 >index 0000000000..4dc14f9606 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_20844-add_LOST_WAITING_HOLD_notice.perl >@@ -0,0 +1,6 @@ >+$DBversion = 'XXX'; >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q{INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, message_transport_type, content) VALUES ('reserves','LOST_WAITING_HOLD','','Waiting hold marked lost','0','Your waiting hold has been marked lost','email',"Dear [% borrower.firstname %] [% borrowers.surname %],<br><br>Your hold awaiting pickup is no longer available. The item is lost.<br><br>Please contact the library for more information.<br><br>Thank you,<br><br>[% branch.branchname %]") }); >+ >+ NewVersion( $DBversion, 20844, "Add LOST_WAITING_HOLD notice"); >+} >diff --git a/installer/data/mysql/atomicupdate/bug_20844-add_SendLostHoldNotices_syspref.perl b/installer/data/mysql/atomicupdate/bug_20844-add_SendLostHoldNotices_syspref.perl >new file mode 100644 >index 0000000000..46b5f69da4 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_20844-add_SendLostHoldNotices_syspref.perl >@@ -0,0 +1,6 @@ >+$DBversion = 'XXX'; >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('SendLostHoldNotices', '0', NULL, 'Send a notice to a borrower if their reserved and waiting item is marked as lost', 'YesNo') }); >+ >+ NewVersion( $DBversion, 20844, "Add SendLostHoldNotices system preference"); >+} >diff --git a/installer/data/mysql/de-DE/mandatory/sample_notices.sql b/installer/data/mysql/de-DE/mandatory/sample_notices.sql >index 3c9b418095..542e387076 100644 >--- a/installer/data/mysql/de-DE/mandatory/sample_notices.sql >+++ b/installer/data/mysql/de-DE/mandatory/sample_notices.sql >@@ -20,7 +20,9 @@ VALUES ('circulation','ODUE','Mahnung','Mahnung','Liebe/r <<borrowers.firstname> > ('suggestions','ORDERED','Vorgeschlagenes Medium bestellt', 'Das vorgeschlagene Medium wurde im Buchhandel bestellt','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haben der Bibliothek folgendes Medium zur Anschaffung vorgeschlaten: <<suggestions.title>> von <<suggestions.author>>.\n\nWir freuen uns Ihnen mitteilen zu können, dass dieser Titel jetzt im Buchhandel bestellt wurde. Nach Eintreffen wird er in unseren Bestand eingearbeitet.\n\nSie erhalten Nachricht, sobald das Medium verfügbar ist.\n\nBei Nachfragen erreichen Sie uns unter der Emailadresse <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>', 'email'), > ('suggestions','REJECTED','Anschaffungsvorschlag nicht angenommen', 'Ihr Anschaffungsvorschlag wurde nicht angenommen','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSie haven der Bibliothek folgendes Medium zur Anschaffung vorgeschlagen: <<suggestions.title>> von <<suggestions.author>>.\n\nDie Bibliothek hat diesen Titel heute recherchiert und sich gegen eine Anschaffung entschieden.\n\nBegründung: <<suggestions.reason>>\n\nWenn Sie Fragen haben, richten Sie Ihre Mail bitte an: <<branches.branchemail>>.\n\nVielen Dank,\n\n<<branches.branchname>>', 'email'), > ('suggestions','TO_PROCESS','Benachrichtigung an Besitzer des Kontos (Erwerbung)', 'Anschaffungsvorschlag wartet auf Bearbeitung','Liebe(r) <<borrowers.firstname>> <<borrowers.surname>>,\n\nEin neuer Anschaffungsvorschlag wartet auf Bearbeitung: <<suggestions.title>> von <<suggestions.author>>.\n\nVielen Dank,\n\n<<branches.branchname>>', 'email'), >-('suggestions', 'NOTIFY_MANAGER', 'Notify manager of a suggestion', "A suggestion has been assigned to you", "Dear [% borrower.firstname %] [% borrower.surname %],\nA suggestion has been assigned to you: [% suggestion.title %].\nThank you,\n[% branch.branchname %]", 'email'); >+('suggestions', 'NOTIFY_MANAGER', 'Notify manager of a suggestion', "A suggestion has been assigned to you", "Dear [% borrower.firstname %] [% borrower.surname %],\nA suggestion has been assigned to you: [% suggestion.title %].\nThank you,\n[% branch.branchname %]", 'email'), >+('reserves','LOST_WAITING_HOLD','Waiting hold marked lost','Your waiting hold has been marked lost',"Dear [% borrower.firstname %] [% borrowers.surname %],\n\nYour hold awaiting pickup is no longer available. The item is lost.\n\nPlease contact the library for more information.\n\nThank you,\n\n[% branch.branchname %]",'email') >+; > > INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) > VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin g approval</h3> >diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml >index a378e4d370..0baa7743a1 100644 >--- a/installer/data/mysql/en/mandatory/sample_notices.yml >+++ b/installer/data/mysql/en/mandatory/sample_notices.yml >@@ -1162,3 +1162,23 @@ tables: > - "Thank you," > - "" > - "[% branch.branchname %]" >+ >+ - module: reserves >+ code: LOST_WAITING_HOLD >+ branchcode: "" >+ name: "Waiting hold marked lost" >+ is_html: 0 >+ title: "Your waiting hold has been marked lost" >+ message_transport_type: email >+ lang: default >+ content: >+ - "Dear [% borrower.firstname %] [% borrowers.surname %]," >+ - "" >+ - "Your hold awaiting pickup is no longer available. The item is lost." >+ - "" >+ - "Please contact the library for more information." >+ - "" >+ - "Thank you," >+ - "" >+ - "[% branch.branchname %]" >+ >diff --git a/installer/data/mysql/es-ES/mandatory/sample_notices.sql b/installer/data/mysql/es-ES/mandatory/sample_notices.sql >index c9d1713872..bd52095c99 100644 >--- a/installer/data/mysql/es-ES/mandatory/sample_notices.sql >+++ b/installer/data/mysql/es-ES/mandatory/sample_notices.sql >@@ -20,7 +20,9 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f > ('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>', 'email'), > ('suggestions','TO_PROCESS','Notify fund owner', 'A suggestion is ready to be processed','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nA new suggestion is ready to be processed: <<suggestions.title>> by <<suggestions.author>>.\n\nThank you,\n\n<<branches.branchname>>', 'email'), > ('suggestions', 'NOTIFY_MANAGER', 'Notify manager of a suggestion', "A suggestion has been assigned to you", "Dear [% borrower.firstname %] [% borrower.surname %],\nA suggestion has been assigned to you: [% suggestion.title %].\nThank you,\n[% branch.branchname %]", 'email'), >-('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n <<borrowers.firstname>> <<borrowers.surname>>\r\n Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.', 'email'); >+('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n <<borrowers.firstname>> <<borrowers.surname>>\r\n Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.', 'email'), >+('reserves','LOST_WAITING_HOLD','Waiting hold marked lost','Your waiting hold has been marked lost',"Dear [% borrower.firstname %] [% borrowers.surname %],\n\nYour hold awaiting pickup is no longer available. The item is lost.\n\nPlease contact the library for more information.\n\nThank you,\n\n[% branch.branchname %]",'email') >+; > > INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) > VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin g approval</h3> >diff --git a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql b/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql >index 47b0ca7526..49a79b0f60 100644 >--- a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql >+++ b/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql >@@ -22,7 +22,9 @@ INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, m > ('suggestions','ACCEPTED','','Suggestion d\'achat acceptée',0,'Suggestion d\'achat acceptée','Bonjour <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nVous nous avez suggéré l\'achat du document <<suggestions.title>> par <<suggestions.author>>.\r\n\r\nNous avons évalué votre suggestion aujourdhui. Le document sera commandé dès que possible. Vous serez tenu au courant par courriel quand le document aura été commandé et quand il sera disponible à la bibliothèque.\r\n\r\nPour toute question, veuillez nous contacter à l\'adresse suivante : <<branches.branchemail>>.\r\n\r\nMerci.\r\n\r\n<<branches.branchname>>','email'), > ('suggestions','AVAILABLE','','Suggestion d\'achat disponible',0,'Suggestion d\'achat disponible','Bonjour <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nVous nous avez suggéré l\'achat du document <<suggestions.title>> par <<suggestions.author>>.\r\n\r\nNous avons le plaisir de vous informer que le document fait aujourd\'hui partie de nos collection et qu\'il est disponible à la bibliothèque.\r\n\r\nPour toute question, veuillez nous contacter à l\'adresse suivante : <<branches.branchemail>>.\r\n\r\nMerci.\r\n\r\n<<branches.branchname>>','email'), > ('suggestions','ORDERED','','Suggestion d\'achat commandée',0,'Suggestion d\'achat commandée','Bonjour <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nVous nous avez suggéré l\'achat du document <<suggestions.title>> par <<suggestions.author>>.\r\n\r\nNous avons le plaisir de vous informer que le document a été commandé.\r\n\r\nVous recevrez une nouvelle notification quand le document sera disponible à bibliothèque.\r\n\r\nPour toute question, veuillez nous contacter à l\'adresse suivante : <<branches.branchemail>>.\r\n\r\nMerci.\r\n\r\n<<branches.branchname>>','email'), >-('suggestions','REJECTED','','Suggestion d\'achat rejetée',0,'Suggestion d\'achat rejetée','Bonjour <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nVous nous avez suggéré l\'achat du document <<suggestions.title>> par <<suggestions.author>>.\r\n\r\nNous avons évalué votre suggestion aujourd\'hui et décidé de ne pas l\'acheter cette fois.\r\n\r\nLa raison de notre refus est : <<suggestions.reason>>\r\n\r\nPour toute question, veuillez nous contacter à l\'adresse suivante : <<branches.branchemail>>.\r\n\r\nMerci.\r\n\r\n<<branches.branchname>>','email'); >+('suggestions','REJECTED','','Suggestion d\'achat rejetée',0,'Suggestion d\'achat rejetée','Bonjour <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nVous nous avez suggéré l\'achat du document <<suggestions.title>> par <<suggestions.author>>.\r\n\r\nNous avons évalué votre suggestion aujourd\'hui et décidé de ne pas l\'acheter cette fois.\r\n\r\nLa raison de notre refus est : <<suggestions.reason>>\r\n\r\nPour toute question, veuillez nous contacter à l\'adresse suivante : <<branches.branchemail>>.\r\n\r\nMerci.\r\n\r\n<<branches.branchname>>','email'), >+('reserves','LOST_WAITING_HOLD','','Waiting hold marked lost',0,'Your waiting hold has been marked lost',"Dear [% borrower.firstname %] [% borrowers.surname %],\n\nYour hold awaiting pickup is no longer available. The item is lost.\n\nPlease contact the library for more information.\n\nThank you,\n\n[% branch.branchname %]",'email') >+; > > INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) > VALUES ('suggestions','NEW_SUGGESTION','Nouvelle suggestion','Nouvelle suggestion','<h3>Suggestion en attente</h3> >diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql >index d0171862d9..7fcbd6b045 100644 >--- a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql >+++ b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql >@@ -22,7 +22,9 @@ VALUES > ('suggestions','REJECTED','Suggestion rejetée', 'Suggestion d\'achat rejeté','Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez fait la demande du document <<suggestions.title>> de <<suggestions.author>>.\n\nla Bibliothèque a examiné votre demande ce jour, et a décidé de ne pas retenir la suggestion pour l\'instant.\n\nLa raison est la suivante: <<suggestions.reason>>\n\nSi vous avez des questions, merci de nous contacter à l\'adresse <<branches.branchemail>>.\n\nMerci,\n\n<<branches.branchname>>', 'email'), > ('suggestions','TO_PROCESS','Avis au propriétaire du poste budgétaire', 'Une suggestion est prête à être traitée','<<borrowers.firstname>> <<borrowers.surname>>,\n\nUne nouvelle suggestion est prête à être traitée : <<suggestions.title>> / <<suggestions.author>>.\n\nMerci,\n\n<<branches.branchname>>', 'email'), > ('suggestions', 'NOTIFY_MANAGER', 'Notify manager of a suggestion', "A suggestion has been assigned to you", "Dear [% borrower.firstname %] [% borrower.surname %],\nA suggestion has been assigned to you: [% suggestion.title %].\nThank you,\n[% branch.branchname %]", 'email'), >-('members', 'DISCHARGE', 'Quitus', 'Quitus pour <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Quitus</h1>\r\n\r\nLa librairie <<borrowers.branchcode>> certifies que lecteur suivant :\r\n\r\n <<borrowers.firstname>> <<borrowers.surname>>\r\n Numéro de carte : <<borrowers.cardnumber>>\r\n\r\na bien retourné tous ses documents.', 'email'); >+('members', 'DISCHARGE', 'Quitus', 'Quitus pour <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Quitus</h1>\r\n\r\nLa librairie <<borrowers.branchcode>> certifies que lecteur suivant :\r\n\r\n <<borrowers.firstname>> <<borrowers.surname>>\r\n Numéro de carte : <<borrowers.cardnumber>>\r\n\r\na bien retourné tous ses documents.', 'email'), >+('reserves','LOST_WAITING_HOLD','Waiting hold marked lost','Your waiting hold has been marked lost',"Dear [% borrower.firstname %] [% borrowers.surname %],\n\nYour hold awaiting pickup is no longer available. The item is lost.\n\nPlease contact the library for more information.\n\nThank you,\n\n[% branch.branchname %]",'email') >+; > > INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) > VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin g approval</h3> >diff --git a/installer/data/mysql/it-IT/necessari/notices.sql b/installer/data/mysql/it-IT/necessari/notices.sql >index 37b6d93b3b..631ed0b64a 100644 >--- a/installer/data/mysql/it-IT/necessari/notices.sql >+++ b/installer/data/mysql/it-IT/necessari/notices.sql >@@ -27,7 +27,9 @@ biblio.title>>\r\n----\r\nGrazie per aver visitaro <<branches.branchname>>.', 'e > ('suggestions','REJECTED','Suggerimento d\'acquisto rifiutato', 'Suggerimento d\'acquisto rifiutato','Salve <<borrowers.firstname>> <<borrowers.surname>>,\n\nHai suggerito di acquistare <<suggestions.title>> di <<suggestions.author>>.\n\na biblioteca ha revisionato il suggerimento oggi e ha deciso di non seguire il suggerimento.\n\nLa motivazione è: <<suggestions.reason>>\n\nSe hai domande, scrivici pure all\' email <<branches.branchemail>>.\n\nGrazie di tuttp,\n\n<<branches.branchname>>', 'email'), > ('suggestions','TO_PROCESS','Notifica al proprietario del fondo', 'Un suggeerimento è pronto per essere lavorato','Caro bibliotecario <<borrowers.firstname>> <<borrowers.surname>>,\n\n c\'è un nuovo suggerimento pronto per essere lavorato: <<suggestions.title>> by <<suggestions.author>>.\n\n Grazie dell\'attenzione,\n\n<<branches.branchname>>', 'email'), > ('suggestions', 'NOTIFY_MANAGER', 'Notify manager of a suggestion', "A suggestion has been assigned to you", "Dear [% borrower.firstname %] [% borrower.surname %],\nA suggestion has been assigned to you: [% suggestion.title %].\nThank you,\n[% branch.branchname %]", 'email'), >-('members', 'DISCHARGE', 'Liberatoria', 'Liberatoria per <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Liberatoria</h1>\r\n\r\nLa biblioteca <<borrowers.branchcode>> certifica che il seguente utente :\r\n\r\n <<borrowers.firstname>> <<borrowers.surname>>\r\n Numero tessera : <<borrowers.cardnumber>>\r\n\r\nha restituito tutti i documenti ricevuti.', 'email'); >+('members', 'DISCHARGE', 'Liberatoria', 'Liberatoria per <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Liberatoria</h1>\r\n\r\nLa biblioteca <<borrowers.branchcode>> certifica che il seguente utente :\r\n\r\n <<borrowers.firstname>> <<borrowers.surname>>\r\n Numero tessera : <<borrowers.cardnumber>>\r\n\r\nha restituito tutti i documenti ricevuti.', 'email'), >+('reserves','LOST_WAITING_HOLD','Waiting hold marked lost','Your waiting hold has been marked lost',"Dear [% borrower.firstname %] [% borrowers.surname %],\n\nYour hold awaiting pickup is no longer available. The item is lost.\n\nPlease contact the library for more information.\n\nThank you,\n\n[% branch.branchname %]",'email') >+; > > INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) > VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin g approval</h3> >diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql >index 38662d4527..7a9059554c 100644 >--- a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql >+++ b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql >@@ -43,7 +43,9 @@ VALUES ('circulation','ODUE','Purring','Purring pÃ¥ dokument','<<borrowers.first > ('suggestions','REJECTED','Innkjøpsforslag avslÃ¥tt', 'Innkjøpsforslag avslÃ¥tt','<<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foreslÃ¥tt at biblioteket kjøper inn <<suggestions.title>> av <<suggestions.author>>.\n\nBiblioteket har vurdert innkjøpsforslaget ditt i dag, og bestemt seg for Ã¥ ikke ta det til følge.\n\nBegrunnelse: <<suggestions.reason>>\n\nEr det noe du lurer pÃ¥, vennligst kontakt oss pÃ¥ <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>', 'email'), > ('suggestions','TO_PROCESS','Notify fund owner', 'A suggestion is ready to be processed','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nA new suggestion is ready to be processed: <<suggestions.title>> by <<suggestions.author>>.\n\nThank you,\n\n<<branches.branchname>>', 'email'), > ('suggestions', 'NOTIFY_MANAGER', 'Notify manager of a suggestion', "A suggestion has been assigned to you", "Dear [% borrower.firstname %] [% borrower.surname %],\nA suggestion has been assigned to you: [% suggestion.title %].\nThank you,\n[% branch.branchname %]", 'email'), >-('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n <<borrowers.firstname>> <<borrowers.surname>>\r\n Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.', 'email'); >+('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n <<borrowers.firstname>> <<borrowers.surname>>\r\n Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.', 'email'), >+('reserves','LOST_WAITING_HOLD','Waiting hold marked lost','Your waiting hold has been marked lost',"Dear [% borrower.firstname %] [% borrowers.surname %],\n\nYour hold awaiting pickup is no longer available. The item is lost.\n\nPlease contact the library for more information.\n\nThank you,\n\n[% branch.branchname %]",'email') >+; > > INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) > VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin g approval</h3> >diff --git a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql b/installer/data/mysql/pl-PL/mandatory/sample_notices.sql >index 52b778e4c0..ef7b0a73ea 100644 >--- a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql >+++ b/installer/data/mysql/pl-PL/mandatory/sample_notices.sql >@@ -21,7 +21,9 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f > ('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>', 'email'), > ('suggestions','TO_PROCESS','Notify fund owner', 'A suggestion is ready to be processed','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nA new suggestion is ready to be processed: <<suggestions.title>> by <<suggestions.author>>.\n\nThank you,\n\n<<branches.branchname>>', 'email'), > ('suggestions', 'NOTIFY_MANAGER', 'Notify manager of a suggestion', "A suggestion has been assigned to you", "Dear [% borrower.firstname %] [% borrower.surname %],\nA suggestion has been assigned to you: [% suggestion.title %].\nThank you,\n[% branch.branchname %]", 'email'), >-('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n <<borrowers.firstname>> <<borrowers.surname>>\r\n Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.', 'email'); >+('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n <<borrowers.firstname>> <<borrowers.surname>>\r\n Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.', 'email'), >+('reserves','LOST_WAITING_HOLD','Waiting hold marked lost','Your waiting hold has been marked lost',"Dear [% borrower.firstname %] [% borrowers.surname %],\n\nYour hold awaiting pickup is no longer available. The item is lost.\n\nPlease contact the library for more information.\n\nThank you,\n\n[% branch.branchname %]",'email') >+; > > INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) > VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin g approval</h3> >diff --git a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql b/installer/data/mysql/ru-RU/mandatory/sample_notices.sql >index 0a8ea1707b..5c5e4d460b 100644 >--- a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql >+++ b/installer/data/mysql/ru-RU/mandatory/sample_notices.sql >@@ -20,7 +20,9 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f > ('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>', 'email'), > ('suggestions','TO_PROCESS','Notify fund owner', 'A suggestion is ready to be processed','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nA new suggestion is ready to be processed: <<suggestions.title>> by <<suggestions.author>>.\n\nThank you,\n\n<<branches.branchname>>', 'email'), > ('suggestions', 'NOTIFY_MANAGER', 'Notify manager of a suggestion', "A suggestion has been assigned to you", "Dear [% borrower.firstname %] [% borrower.surname %],\nA suggestion has been assigned to you: [% suggestion.title %].\nThank you,\n[% branch.branchname %]", 'email'), >-('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n <<borrowers.firstname>> <<borrowers.surname>>\r\n Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.', 'email'); >+('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n <<borrowers.firstname>> <<borrowers.surname>>\r\n Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.', 'email'), >+('reserves','LOST_WAITING_HOLD','Waiting hold marked lost','Your waiting hold has been marked lost',"Dear [% borrower.firstname %] [% borrowers.surname %],\n\nYour hold awaiting pickup is no longer available. The item is lost.\n\nPlease contact the library for more information.\n\nThank you,\n\n[% branch.branchname %]",'email') >+; > > INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) > VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin g approval</h3> >diff --git a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql b/installer/data/mysql/uk-UA/mandatory/sample_notices.sql >index 81b9f723af..3d18d79b09 100644 >--- a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql >+++ b/installer/data/mysql/uk-UA/mandatory/sample_notices.sql >@@ -83,7 +83,9 @@ INSERT INTO `letter` (module, code, name, title, content, message_transport_type > 'ÐоÑог(ий/а) <<borrowers.firstname>> <<borrowers.surname>>,\n\n нова пÑопозиÑÑÑ Ð³Ð¾Ð¾Ñова до обÑобки: â<<suggestions.title>>â / <<suggestions.author>>.\n\n СпаÑибÑ,\n\n<<branches.branchname>>', > 'email'), > >-('suggestions', 'NOTIFY_MANAGER', 'Notify manager of a suggestion', "A suggestion has been assigned to you", "Dear [% borrower.firstname %] [% borrower.surname %],\nA suggestion has been assigned to you: [% suggestion.title %].\nThank you,\n[% branch.branchname %]", 'email') >+('suggestions', 'NOTIFY_MANAGER', 'Notify manager of a suggestion', "A suggestion has been assigned to you", "Dear [% borrower.firstname %] [% borrower.surname %],\nA suggestion has been assigned to you: [% suggestion.title %].\nThank you,\n[% branch.branchname %]", 'email'), >+ >+('reserves','LOST_WAITING_HOLD','Waiting hold marked lost','Your waiting hold has been marked lost',"Dear [% borrower.firstname %] [% borrowers.surname %],\n\nYour hold awaiting pickup is no longer available. The item is lost.\n\nPlease contact the library for more information.\n\nThank you,\n\n[% branch.branchname %]",'email') > ; > > INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index f8b2101f1c..a730b37958 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -603,6 +603,12 @@ Circulation: > no: "Don't revert" > - waiting status of a hold if the allocated item is marked as Lost. > - >+ - pref: SendLostHoldNotices >+ choices: >+ yes: Send >+ no: "Don't send" >+ - a notice to a borrower if their reserved and waiting item is marked as Lost. >+ - > - In the staff client, split the holds queue into separate tables by > - pref: HoldsSplitQueue > choices: >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 0b7a15c993..026ce5b49f 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -1037,13 +1037,14 @@ subtest 'MoveReserve additional test' => sub { > > subtest 'Waiting item is marked as lost' => sub { > >- plan tests => 15; >+ plan tests => 17; > > # Set up data > my $biblio = $builder->build_sample_biblio(); > my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); > my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >- >+ t::lib::Mocks::mock_preference( 'SendLostHoldNotices', 0 ); >+ $dbh->do(q|DELETE FROM message_queue|); > ## TEST 1: BIBLIO-LEVEL HOLD > > # place biblio-level hold >@@ -1054,6 +1055,8 @@ subtest 'Waiting item is marked as lost' => sub { > }); > my $hold = Koha::Holds->find( $reserve_id ); > >+ $dbh->do(q{INSERT IGNORE INTO letter (module, code, branchcode, name, is_html, title, message_transport_type, content) VALUES ('reserves','LOST_WAITING_HOLD','','Waiting hold marked lost','0','Your waiting hold has been marked lost','email',"Dear [% borrower.firstname %] [% borrowers.surname %],<br><br>Your hold awaiting pickup is no longer available. The item is lost.<br><br>Please contact the library for more information.<br><br>Thank you,<br><br>[% branch.branchname %]") }); >+ > is( $hold->item_level_hold, 0, 'Biblio-level hold placed' ); > > # set hold as waiting and assign item >@@ -1121,7 +1124,15 @@ subtest 'Waiting item is marked as lost' => sub { > $hold->cancel; > $item->itemlost( 0 ); > >+ my $message_count = $dbh->selectall_arrayref(q{ >+ SELECT COUNT(*) >+ FROM message_queue >+ WHERE letter_code = 'LOST_WAITING_HOLD' >+ }); >+ is( $message_count->[0]->[0], 0, 'No notices enqueued because SendLostHoldNotices disabled' ); >+ > # TEST 3: ITEM-LEVEL HOLD, CANCEL >+ t::lib::Mocks::mock_preference( 'SendLostHoldNotices', 1 ); > > # place item-level hold > $reserve_id = AddReserve({ >@@ -1155,6 +1166,13 @@ subtest 'Waiting item is marked as lost' => sub { > C4::Circulation::LostItem( $item->itemnumber, 'test', 0, 1 ); > $hold = Koha::Holds->find( $reserve_id ); > is( Koha::Holds->find( $reserve_id ), undef, 'Hold has been cancelled with RevertLostBibLevelHolds enabled' ); >+ >+ $message_count = $dbh->selectall_arrayref(q{ >+ SELECT COUNT(*) >+ FROM message_queue >+ WHERE letter_code = 'LOST_WAITING_HOLD' >+ }); >+ is( $message_count->[0]->[0], 2, 'LOST_WAITING_HOLD notice enqueued with each call to LostItem' ); > }; > > sub count_hold_print_messages { >-- >2.11.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 20844
:
79267
|
80760
|
80761
|
80890
|
80891
|
81045
|
81531
|
81623
|
81624
|
81640
|
81697
|
81698
|
81710
|
81711
|
81712
|
102334
|
102335
|
102336
|
113208
|
113209
|
113210
|
118264
|
118265
|
118266
|
125437
|
125438
|
125439
|
140214
|
140215
|
140216
|
150348
|
150349
|
150350
|
150480
|
159062
|
159063
|
159064
|
159065
|
159111
|
170263
|
170264