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

(-)a/C4/Circulation.pm (+15 lines)
Lines 3936-3941 sub LostItem{ Link Here
3936
            $hold = C4::Reserves::RevertWaitingStatus({ itemnumber => $itemnumber });
3936
            $hold = C4::Reserves::RevertWaitingStatus({ itemnumber => $itemnumber });
3937
        }
3937
        }
3938
    }
3938
    }
3939
3940
    # SendLostHoldNotices
3941
    my $item = Koha::Items->find( $itemnumber );
3942
    if ( C4::Context->preference('SendLostHoldNotices') && defined $hold && $item->itemlost ){
3943
        my $letter = C4::Letters::GetPreparedLetter(
3944
            module => 'reserves',
3945
            letter_code => 'LOST_WAITING_HOLD',
3946
            branchcode => $hold->branchcode,
3947
            tables => {
3948
                borrowers => $hold->borrowernumber,
3949
                branches => $hold->branchcode,
3950
            },
3951
        );
3952
        C4::Message->enqueue($letter, $hold->borrower->unblessed, 'email');
3953
    }
3939
}
3954
}
3940
3955
3941
sub GetOfflineOperations {
3956
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 1478-1480 tables: Link Here
1478
            - "Barcode: [% item.barcode %] <br />"
1478
            - "Barcode: [% item.barcode %] <br />"
1479
            - "</p>"
1479
            - "</p>"
1480
            - "[% END %]"
1480
            - "[% END %]"
1481
1482
        - module: reserves
1483
          code: LOST_WAITING_HOLD
1484
          branchcode: ""
1485
          name: "Waiting hold marked lost"
1486
          is_html: 0
1487
          title: "Your waiting hold has been marked lost"
1488
          message_transport_type: email
1489
          lang: default
1490
          content:
1491
            - "Dear [% borrower.firstname %] [% borrowers.surname %],"
1492
            - ""
1493
            - "Your hold awaiting pickup is no longer available. The item is lost."
1494
            - ""
1495
            - "Please contact the library for more information."
1496
            - ""
1497
            - "Thank you,"
1498
            - ""
1499
            - "[% branch.branchname %]"
(-)a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql (-1 / +3 lines)
Lines 36-42 Checked in items for [% borrower.title %] [% borrower.firstname %] [% borrower.i Link Here
36
[% item.biblio.title %] <br />
36
[% item.biblio.title %] <br />
37
Barcode: [% item.barcode %] <br />
37
Barcode: [% item.barcode %] <br />
38
</p>
38
</p>
39
[% END %]", 'print');
39
[% END %]", 'print'),
40
('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')
41
;
40
42
41
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
43
INSERT INTO `letter` (module, code, name, title, content, is_html, message_transport_type)
42
VALUES ('suggestions','NEW_SUGGESTION','Nouvelle suggestion','Nouvelle suggestion','<h3>Suggestion en attente</h3>
44
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 665-670 Circulation: Link Here
665
                  no: "Don't revert"
665
                  no: "Don't revert"
666
            - waiting status of a hold if the allocated item is marked as Lost.
666
            - waiting status of a hold if the allocated item is marked as Lost.
667
        -
667
        -
668
            - pref: SendLostHoldNotices
669
              choices:
670
                  yes: Send
671
                  no: "Don't send"
672
            - a notice to a borrower if their reserved and waiting item is marked as Lost.
673
        -
668
            - In the staff interface, split the holds queue into separate tables by
674
            - In the staff interface, split the holds queue into separate tables by
669
            - pref: HoldsSplitQueue
675
            - pref: HoldsSplitQueue
670
              choices:
676
              choices:
(-)a/t/db_dependent/Reserves.t (-3 / +20 lines)
Lines 1220-1232 subtest 'MergeHolds' => sub { Link Here
1220
1220
1221
subtest 'Waiting item is marked as lost' => sub {
1221
subtest 'Waiting item is marked as lost' => sub {
1222
1222
1223
    plan tests => 15;
1223
    plan tests => 17;
1224
1224
1225
    # Set up data
1225
    # Set up data
1226
    my $biblio = $builder->build_sample_biblio();
1226
    my $biblio = $builder->build_sample_biblio();
1227
    my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber });
1227
    my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber });
1228
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
1228
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
1229
1229
    t::lib::Mocks::mock_preference( 'SendLostHoldNotices', 0 );
1230
    $dbh->do(q|DELETE FROM message_queue|);
1230
    ## TEST 1: BIBLIO-LEVEL HOLD
1231
    ## TEST 1: BIBLIO-LEVEL HOLD
1231
1232
1232
    # place biblio-level hold
1233
    # place biblio-level hold
Lines 1237-1242 subtest 'Waiting item is marked as lost' => sub { Link Here
1237
    });
1238
    });
1238
    my $hold = Koha::Holds->find( $reserve_id );
1239
    my $hold = Koha::Holds->find( $reserve_id );
1239
1240
1241
    $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 %]") });
1242
1240
    is( $hold->item_level_hold, 0, 'Biblio-level hold placed' );
1243
    is( $hold->item_level_hold, 0, 'Biblio-level hold placed' );
1241
1244
1242
    # set hold as waiting and assign item
1245
    # set hold as waiting and assign item
Lines 1304-1310 subtest 'Waiting item is marked as lost' => sub { Link Here
1304
    $hold->cancel;
1307
    $hold->cancel;
1305
    $item->itemlost( 0 );
1308
    $item->itemlost( 0 );
1306
1309
1310
    my $message_count = $dbh->selectall_arrayref(q{
1311
        SELECT COUNT(*)
1312
        FROM message_queue
1313
        WHERE letter_code = 'LOST_WAITING_HOLD'
1314
    });
1315
    is( $message_count->[0]->[0], 0, 'No notices enqueued because SendLostHoldNotices disabled' );
1316
1307
    # TEST 3: ITEM-LEVEL HOLD, CANCEL
1317
    # TEST 3: ITEM-LEVEL HOLD, CANCEL
1318
    t::lib::Mocks::mock_preference( 'SendLostHoldNotices', 1 );
1308
1319
1309
    # place item-level hold
1320
    # place item-level hold
1310
    $reserve_id = AddReserve({
1321
    $reserve_id = AddReserve({
Lines 1338-1343 subtest 'Waiting item is marked as lost' => sub { Link Here
1338
    C4::Circulation::LostItem( $item->itemnumber, 'test', 0, { cancel_reserve => 1 });
1349
    C4::Circulation::LostItem( $item->itemnumber, 'test', 0, { cancel_reserve => 1 });
1339
    $hold = Koha::Holds->find( $reserve_id );
1350
    $hold = Koha::Holds->find( $reserve_id );
1340
    is( Koha::Holds->find( $reserve_id ), undef, 'Hold has been cancelled with RevertLostBibLevelHolds enabled' );
1351
    is( Koha::Holds->find( $reserve_id ), undef, 'Hold has been cancelled with RevertLostBibLevelHolds enabled' );
1352
1353
    $message_count = $dbh->selectall_arrayref(q{
1354
        SELECT COUNT(*)
1355
        FROM message_queue
1356
        WHERE letter_code = 'LOST_WAITING_HOLD'
1357
    });
1358
    is( $message_count->[0]->[0], 2, 'LOST_WAITING_HOLD notice enqueued with each call to LostItem' );
1341
};
1359
};
1342
1360
1343
sub count_hold_print_messages {
1361
sub count_hold_print_messages {
1344
- 

Return to bug 20844