View | Details | Raw Unified | Return to bug 20844
Collapse All | Expand All

(-)a/C4/Circulation.pm (+15 lines)
Lines 3844-3849 sub LostItem{ Link Here
3844
            $hold = C4::Reserves::RevertWaitingStatus({ itemnumber => $itemnumber });
3844
            $hold = C4::Reserves::RevertWaitingStatus({ itemnumber => $itemnumber });
3845
        }
3845
        }
3846
    }
3846
    }
3847
3848
    # SendLostHoldNotices
3849
    my $item = Koha::Items->find( $itemnumber );
3850
    if ( C4::Context->preference('SendLostHoldNotices') && defined $hold && $item->itemlost ){
3851
        my $letter = C4::Letters::GetPreparedLetter(
3852
            module => 'reserves',
3853
            letter_code => 'LOST_WAITING_HOLD',
3854
            branchcode => $hold->branchcode,
3855
            tables => {
3856
                borrowers => $hold->borrowernumber,
3857
                branches => $hold->branchcode,
3858
            },
3859
        );
3860
        C4::Message->enqueue($letter, $hold->borrower->unblessed, 'email');
3861
    }
3847
}
3862
}
3848
3863
3849
sub GetOfflineOperations {
3864
sub GetOfflineOperations {
(-)a/catalogue/updateitem.pl (+2 lines)
Lines 49-54 if ( defined $cancelhold ){ Link Here
49
} elsif ( defined $reverthold ){
49
} elsif ( defined $reverthold ){
50
    $cancelhold = 0;
50
    $cancelhold = 0;
51
    LostItem($itemnumber, 'moredetail', 0, { cancel_reserve => $cancelhold });
51
    LostItem($itemnumber, 'moredetail', 0, { cancel_reserve => $cancelhold });
52
} else {
53
    $cancelhold = undef;
52
}
54
}
53
if ( defined $redirecturl ){
55
if ( defined $redirecturl ){
54
    print $cgi->redirect( $redirecturl . $biblionumber );
56
    print $cgi->redirect( $redirecturl . $biblionumber );
(-)a/installer/data/mysql/atomicupdate/bug_20844-add_LOST_WAITING_HOLD_notice.perl (+6 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $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 %]") });
4
5
    NewVersion( $DBversion, 20844, "Add LOST_WAITING_HOLD notice");
6
}
(-)a/installer/data/mysql/atomicupdate/bug_20844-add_SendLostHoldNotices_syspref.perl (+6 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $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') });
4
5
    NewVersion( $DBversion, 20844, "Add SendLostHoldNotices system preference");
6
}
(-)a/installer/data/mysql/en/mandatory/sample_notices.yml (+19 lines)
Lines 1221-1223 tables: Link Here
1221
              - "[%- USE AuthorisedValues -%]"
1221
              - "[%- USE AuthorisedValues -%]"
1222
              - "Dear [% borrower.firstname %] [% borrower.surname %],"
1222
              - "Dear [% borrower.firstname %] [% borrower.surname %],"
1223
              - "Your hold for [% biblio.title %] was canceled for the following reason: [% AuthorisedValues.GetByCode( 'HOLD_CANCELLATION', hold.cancellation_reason ) %]"
1223
              - "Your hold for [% biblio.title %] was canceled for the following reason: [% AuthorisedValues.GetByCode( 'HOLD_CANCELLATION', hold.cancellation_reason ) %]"
1224
1225
        - module: reserves
1226
          code: LOST_WAITING_HOLD
1227
          branchcode: ""
1228
          name: "Waiting hold marked lost"
1229
          is_html: 0
1230
          title: "Your waiting hold has been marked lost"
1231
          message_transport_type: email
1232
          lang: default
1233
          content:
1234
            - "Dear [% borrower.firstname %] [% borrowers.surname %],"
1235
            - ""
1236
            - "Your hold awaiting pickup is no longer available. The item is lost."
1237
            - ""
1238
            - "Please contact the library for more information."
1239
            - ""
1240
            - "Thank you,"
1241
            - ""
1242
            - "[% branch.branchname %]"
(-)a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql (-1 / +3 lines)
Lines 22-28 INSERT INTO `letter` (module, code, branchcode, name, is_html, title, content, m Link Here
22
('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'),
22
('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'),
23
('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'),
23
('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'),
24
('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'),
24
('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'),
25
('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');
25
('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'),
26
('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')
27
;
26
28
27
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
29
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
28
VALUES ('suggestions','NEW_SUGGESTION','Nouvelle suggestion','Nouvelle suggestion','<h3>Suggestion en attente</h3>
30
VALUES ('suggestions','NEW_SUGGESTION','Nouvelle suggestion','Nouvelle suggestion','<h3>Suggestion en attente</h3>
(-)a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql (-1 / +3 lines)
Lines 23-29 VALUES Link Here
23
('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'),
23
('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'),
24
('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'),
24
('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'),
25
('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'),
25
('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'),
26
('members', 'PROBLEM_REPORT','OPAC problem report','OPAC problem report','Username: <<problem_reports.username>>\n\nProblem page: <<problem_reports.problempage>>\n\nTitle: <<problem_reports.title>>\n\nMessage: <<problem_reports.content>>','email');
26
('members', 'PROBLEM_REPORT','OPAC problem report','OPAC problem report','Username: <<problem_reports.username>>\n\nProblem page: <<problem_reports.problempage>>\n\nTitle: <<problem_reports.title>>\n\nMessage: <<problem_reports.content>>','email'),
27
('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')
28
;
27
29
28
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
30
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
29
VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin    g approval</h3>
31
VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin    g approval</h3>
(-)a/installer/data/mysql/it-IT/necessari/notices.sql (-1 / +3 lines)
Lines 28-34 biblio.title>>\r\n----\r\nGrazie per aver visitaro <<branches.branchname>>.', 'e Link Here
28
('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'),
28
('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'),
29
('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'),
29
('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'),
30
('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'),
30
('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'),
31
('members', 'PROBLEM_REPORT','OPAC problem report','OPAC problem report','Username: <<problem_reports.username>>\n\nProblem page: <<problem_reports.problempage>>\n\nTitle: <<problem_reports.title>>\n\nMessage: <<problem_reports.content>>','email');
31
('members', 'PROBLEM_REPORT','OPAC problem report','OPAC problem report','Username: <<problem_reports.username>>\n\nProblem page: <<problem_reports.problempage>>\n\nTitle: <<problem_reports.title>>\n\nMessage: <<problem_reports.content>>','email'),
32
('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')
33
;
32
34
33
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
35
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
34
VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin    g approval</h3>
36
VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin    g approval</h3>
(-)a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql (-1 / +3 lines)
Lines 43-49 VALUES ('circulation','ODUE','Purring','Purring på dokument','<<borrowers.first Link Here
43
('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'),
43
('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'),
44
('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'),
44
('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'),
45
('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'),
45
('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'),
46
('members', 'PROBLEM_REPORT','OPAC problem report','OPAC problem report','Username: <<problem_reports.username>>\n\nProblem page: <<problem_reports.problempage>>\n\nTitle: <<problem_reports.title>>\n\nMessage: <<problem_reports.content>>','email');
46
('members', 'PROBLEM_REPORT','OPAC problem report','OPAC problem report','Username: <<problem_reports.username>>\n\nProblem page: <<problem_reports.problempage>>\n\nTitle: <<problem_reports.title>>\n\nMessage: <<problem_reports.content>>','email'),
47
('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')
48
;
47
49
48
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
50
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
49
VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin    g approval</h3>
51
VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin    g approval</h3>
(-)a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql (-1 / +3 lines)
Lines 22-28 VALUES ('circulation','ODUE','Overdue notice','Item overdue','Dear <<borrowers.f Link Here
22
('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'),
22
('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'),
23
('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'),
23
('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'),
24
('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'),
24
('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'),
25
('members', 'PROBLEM_REPORT','OPAC problem report','OPAC problem report','Username: <<problem_reports.username>>\n\nProblem page: <<problem_reports.problempage>>\n\nTitle: <<problem_reports.title>>\n\nMessage: <<problem_reports.content>>','email');
25
('members', 'PROBLEM_REPORT','OPAC problem report','OPAC problem report','Username: <<problem_reports.username>>\n\nProblem page: <<problem_reports.problempage>>\n\nTitle: <<problem_reports.title>>\n\nMessage: <<problem_reports.content>>','email'),
26
('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')
27
;
26
28
27
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
29
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
28
VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin    g approval</h3>
30
VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin    g approval</h3>
(-)a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql (-1 / +3 lines)
Lines 21-27 VALUES ('circulation','ODUE','Overdue notice','Item overdue','Dear <<borrowers.f Link Here
21
('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'),
21
('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'),
22
('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'),
22
('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'),
23
('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'),
23
('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'),
24
('members', 'PROBLEM_REPORT','OPAC problem report','OPAC problem report','Username: <<problem_reports.username>>\n\nProblem page: <<problem_reports.problempage>>\n\nTitle: <<problem_reports.title>>\n\nMessage: <<problem_reports.content>>','email');
24
('members', 'PROBLEM_REPORT','OPAC problem report','OPAC problem report','Username: <<problem_reports.username>>\n\nProblem page: <<problem_reports.problempage>>\n\nTitle: <<problem_reports.title>>\n\nMessage: <<problem_reports.content>>','email'),
25
('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')
26
;
25
27
26
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
28
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
27
VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin    g approval</h3>
29
VALUES ('suggestions','NEW_SUGGESTION','New suggestion','New suggestion','<h3>Suggestion pendin    g approval</h3>
(-)a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql (-1 / +3 lines)
Lines 85-91 INSERT INTO `letter` (module, code, name, title, content, message_transport_type Link Here
85
85
86
('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'),
86
('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'),
87
87
88
('members', 'PROBLEM_REPORT','OPAC problem report','OPAC problem report','Username: <<problem_reports.username>>\n\nProblem page: <<problem_reports.problempage>>\n\nTitle: <<problem_reports.title>>\n\nMessage: <<problem_reports.content>>','email')
88
('members', 'PROBLEM_REPORT','OPAC problem report','OPAC problem report','Username: <<problem_reports.username>>\n\nProblem page: <<problem_reports.problempage>>\n\nTitle: <<problem_reports.title>>\n\nMessage: <<problem_reports.content>>','email'),
89
90
('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')
89
;
91
;
90
92
91
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
93
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 651-656 Circulation: Link Here
651
                  no: "Don't revert"
651
                  no: "Don't revert"
652
            - waiting status of a hold if the allocated item is marked as Lost.
652
            - waiting status of a hold if the allocated item is marked as Lost.
653
        -
653
        -
654
            - pref: SendLostHoldNotices
655
              choices:
656
                  yes: Send
657
                  no: "Don't send"
658
            - a notice to a borrower if their reserved and waiting item is marked as Lost.
659
        -
654
            - In the staff interface, split the holds queue into separate tables by
660
            - In the staff interface, split the holds queue into separate tables by
655
            - pref: HoldsSplitQueue
661
            - pref: HoldsSplitQueue
656
              choices:
662
              choices:
(-)a/t/db_dependent/Reserves.t (-3 / +20 lines)
Lines 1192-1204 subtest 'AllowHoldOnPatronPossession test' => sub { Link Here
1192
1192
1193
subtest 'Waiting item is marked as lost' => sub {
1193
subtest 'Waiting item is marked as lost' => sub {
1194
1194
1195
    plan tests => 15;
1195
    plan tests => 17;
1196
1196
1197
    # Set up data
1197
    # Set up data
1198
    my $biblio = $builder->build_sample_biblio();
1198
    my $biblio = $builder->build_sample_biblio();
1199
    my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber });
1199
    my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber });
1200
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
1200
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
1201
1201
    t::lib::Mocks::mock_preference( 'SendLostHoldNotices', 0 );
1202
    $dbh->do(q|DELETE FROM message_queue|);
1202
    ## TEST 1: BIBLIO-LEVEL HOLD
1203
    ## TEST 1: BIBLIO-LEVEL HOLD
1203
1204
1204
    # place biblio-level hold
1205
    # place biblio-level hold
Lines 1209-1214 subtest 'Waiting item is marked as lost' => sub { Link Here
1209
    });
1210
    });
1210
    my $hold = Koha::Holds->find( $reserve_id );
1211
    my $hold = Koha::Holds->find( $reserve_id );
1211
1212
1213
    $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 %]") });
1214
1212
    is( $hold->item_level_hold, 0, 'Biblio-level hold placed' );
1215
    is( $hold->item_level_hold, 0, 'Biblio-level hold placed' );
1213
1216
1214
    # set hold as waiting and assign item
1217
    # set hold as waiting and assign item
Lines 1276-1282 subtest 'Waiting item is marked as lost' => sub { Link Here
1276
    $hold->cancel;
1279
    $hold->cancel;
1277
    $item->itemlost( 0 );
1280
    $item->itemlost( 0 );
1278
1281
1282
    my $message_count = $dbh->selectall_arrayref(q{
1283
        SELECT COUNT(*)
1284
        FROM message_queue
1285
        WHERE letter_code = 'LOST_WAITING_HOLD'
1286
    });
1287
    is( $message_count->[0]->[0], 0, 'No notices enqueued because SendLostHoldNotices disabled' );
1288
1279
    # TEST 3: ITEM-LEVEL HOLD, CANCEL
1289
    # TEST 3: ITEM-LEVEL HOLD, CANCEL
1290
    t::lib::Mocks::mock_preference( 'SendLostHoldNotices', 1 );
1280
1291
1281
    # place item-level hold
1292
    # place item-level hold
1282
    $reserve_id = AddReserve({
1293
    $reserve_id = AddReserve({
Lines 1310-1315 subtest 'Waiting item is marked as lost' => sub { Link Here
1310
    C4::Circulation::LostItem( $item->itemnumber, 'test', 0, { cancel_reserve => 1 });
1321
    C4::Circulation::LostItem( $item->itemnumber, 'test', 0, { cancel_reserve => 1 });
1311
    $hold = Koha::Holds->find( $reserve_id );
1322
    $hold = Koha::Holds->find( $reserve_id );
1312
    is( Koha::Holds->find( $reserve_id ), undef, 'Hold has been cancelled with RevertLostBibLevelHolds enabled' );
1323
    is( Koha::Holds->find( $reserve_id ), undef, 'Hold has been cancelled with RevertLostBibLevelHolds enabled' );
1324
1325
    $message_count = $dbh->selectall_arrayref(q{
1326
        SELECT COUNT(*)
1327
        FROM message_queue
1328
        WHERE letter_code = 'LOST_WAITING_HOLD'
1329
    });
1330
    is( $message_count->[0]->[0], 2, 'LOST_WAITING_HOLD notice enqueued with each call to LostItem' );
1313
};
1331
};
1314
1332
1315
sub count_hold_print_messages {
1333
sub count_hold_print_messages {
1316
- 

Return to bug 20844