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

(-)a/circ/waitingreserves.pl (-2 / +2 lines)
Lines 79-89 if ( $op eq 'cancel_reserve' and $item) { Link Here
79
    my $reserve_id = $input->param('reserve_id');
79
    my $reserve_id = $input->param('reserve_id');
80
    my $hold = Koha::Holds->find( $reserve_id );
80
    my $hold = Koha::Holds->find( $reserve_id );
81
    die "wrong reserve_id" unless $hold; # This is a bit rude, but we are not supposed to get a wrong reserve_id
81
    die "wrong reserve_id" unless $hold; # This is a bit rude, but we are not supposed to get a wrong reserve_id
82
    if ( C4::Context->preference('CanMarkHoldsAwaitingPickupAsLost') =~ m|^yes| ) {
82
    if ( C4::Context->preference('CanMarkHoldsAwaitingPickupAsLost') =~ m|^allow| ) {
83
        my $itemnumber = $hold->item->itemnumber;
83
        my $itemnumber = $hold->item->itemnumber;
84
        my $patron = $hold->borrower;
84
        my $patron = $hold->borrower;
85
        C4::Circulation::LostItem( $itemnumber, 'MARK RETURNED' ); # FIXME Do we have to mark it returned? There is no pref for that? See other occurrences of 'LostItem('
85
        C4::Circulation::LostItem( $itemnumber, 'MARK RETURNED' ); # FIXME Do we have to mark it returned? There is no pref for that? See other occurrences of 'LostItem('
86
        if ( $op eq 'mark_as_lost_and_notify' and C4::Context->preference('CanMarkHoldsAwaitingPickupAsLost') eq 'yes_and_notify' ) {
86
        if ( $op eq 'mark_as_lost_and_notify' and C4::Context->preference('CanMarkHoldsAwaitingPickupAsLost') eq 'allow_and_notify' ) {
87
            my $library = $hold->branch;
87
            my $library = $hold->branch;
88
            my $letter = C4::Letters::GetPreparedLetter(
88
            my $letter = C4::Letters::GetPreparedLetter(
89
                module => 'reserves',
89
                module => 'reserves',
(-)a/installer/data/mysql/atomicupdate/bug_19287.sql (-1 / +1 lines)
Lines 1-3 Link Here
1
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('CanMarkHoldsAwaitingPickupAsLost','no','no|yes|yes_and_notify','Add a button on the "Holds awaiting pickup" screen to mark an item as lost and notify the patron.','Choice');
1
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('CanMarkHoldsAwaitingPickupAsLost','do_not_allow','do_not_allow|allow|allow_and_notify','Add a button on the "Holds awaiting pickup" screen to mark an item as lost and notify the patron.','Choice');
2
2
3
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('reserves', 'CANCEL_HOLD_ON_LOST', '', 'Hold has been cancelled', 0, "Hold has been cancelled", "Dear [% borrower.firstname %] [% borrower.surname %],\n\nWe regret to inform you that the following item cannot longer be placed on hold, it has been marked as lost\n\nTitle: [% biblio.title %]\nAuthor: [% biblio.author %]\nCopy: [% item.copynumber %]\nLocation: [% branch.branchname %]", 'email', 'default');
3
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('reserves', 'CANCEL_HOLD_ON_LOST', '', 'Hold has been cancelled', 0, "Hold has been cancelled", "Dear [% borrower.firstname %] [% borrower.surname %],\n\nWe regret to inform you that the following item cannot longer be placed on hold, it has been marked as lost\n\nTitle: [% biblio.title %]\nAuthor: [% biblio.author %]\nCopy: [% item.copynumber %]\nLocation: [% branch.branchname %]", 'email', 'default');
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 255-261 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
255
('MARCAuthorityControlField008','|| aca||aabn           | a|a     d',NULL,'Define the contents of MARC21 authority control field 008 position 06-39','Textarea'),
255
('MARCAuthorityControlField008','|| aca||aabn           | a|a     d',NULL,'Define the contents of MARC21 authority control field 008 position 06-39','Textarea'),
256
('MarcFieldsToOrder','',NULL,'Set the mapping values for a new order line created from a MARC record in a staged file. In a YAML format.','textarea'),
256
('MarcFieldsToOrder','',NULL,'Set the mapping values for a new order line created from a MARC record in a staged file. In a YAML format.','textarea'),
257
('MarcItemFieldsToOrder','',NULL,'Set the mapping values for new item records created from a MARC record in a staged file. In a YAML format.','textarea'),
257
('MarcItemFieldsToOrder','',NULL,'Set the mapping values for new item records created from a MARC record in a staged file. In a YAML format.','textarea'),
258
('CanMarkHoldsAwaitingPickupAsLost','no','no|yes|yes_and_notify','Add a button on the "Holds awaiting pickup" screen to mark an item as lost and notify the patron.','Choice'),
258
('CanMarkHoldsAwaitingPickupAsLost','do_not_allow','do_not_allow|allow|allow_and_notify','Add a button on the "Holds awaiting pickup" screen to mark an item as lost and notify the patron.','Choice'),
259
('MARCOrgCode','OSt','','Define MARC Organization Code for MARC21 records - http://www.loc.gov/marc/organizations/orgshome.html','free'),
259
('MARCOrgCode','OSt','','Define MARC Organization Code for MARC21 records - http://www.loc.gov/marc/organizations/orgshome.html','free'),
260
('MaxFine',NULL,'','Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.','Integer'),
260
('MaxFine',NULL,'','Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.','Integer'),
261
('MaxItemsToDisplayForBatchDel','1000',NULL,'Display up to a given number of items in a single item deletionbatch.','Integer'),
261
('MaxItemsToDisplayForBatchDel','1000',NULL,'Display up to a given number of items in a single item deletionbatch.','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-3 / +3 lines)
Lines 693-701 Circulation: Link Here
693
        -
693
        -
694
            - pref: CanMarkHoldsAwaitingPickupAsLost
694
            - pref: CanMarkHoldsAwaitingPickupAsLost
695
              choices:
695
              choices:
696
                  no: "Do not allow to mark items as lost"
696
                  do_not_allow: "Do not allow to mark items as lost"
697
                  yes: "Allow to mark items as lost"
697
                  allow: "Allow to mark items as lost"
698
                  yes_and_notify: "Allow to mark items as lost and notify the patron"
698
                  allow_and_notify: "Allow to mark items as lost and notify the patron"
699
            - "from the 'Holds awaiting pickup' screen"
699
            - "from the 'Holds awaiting pickup' screen"
700
    Fines Policy:
700
    Fines Policy:
701
        -
701
        -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt (-4 / +3 lines)
Lines 191-206 Link Here
191
                                <input type="submit" value="Cancel hold" />
191
                                <input type="submit" value="Cancel hold" />
192
                                [% END %]
192
                                [% END %]
193
                            </form>
193
                            </form>
194
                            [% IF Koha.Preference('CanMarkHoldsAwaitingPickupAsLost') != 'no' %]
194
                            [% IF Koha.Preference('CanMarkHoldsAwaitingPickupAsLost') != 'do_not_allow' %]
195
                                <form name="cancelReserve" action="waitingreserves.pl" method="post">
195
                                <form name="cancelReserve" action="waitingreserves.pl" method="post">
196
                                    <input type="hidden" name="reserve_id" value="[% hold.reserve_id %]" />
196
                                    <input type="hidden" name="reserve_id" value="[% hold.reserve_id %]" />
197
                                    <input type="hidden" name="fbr" value="[% hold.holdingbranch %]" />
197
                                    <input type="hidden" name="fbr" value="[% hold.holdingbranch %]" />
198
                                    <input type="hidden" name="tbr" value="[% hold.homebranch %]" />
198
                                    <input type="hidden" name="tbr" value="[% hold.homebranch %]" />
199
                                    <input type="hidden" name="tab" value="[% tab %]">
199
                                    <input type="hidden" name="tab" value="[% tab %]">
200
                                    [% IF Koha.Preference('CanMarkHoldsAwaitingPickupAsLost') == 'yes' %]
200
                                    [% IF Koha.Preference('CanMarkHoldsAwaitingPickupAsLost') == 'allow' %]
201
                                        <input type="hidden" name="op" value="mark_as_lost" />
201
                                        <input type="hidden" name="op" value="mark_as_lost" />
202
                                        <input type="submit" value="Mark item as lost" />
202
                                        <input type="submit" value="Mark item as lost" />
203
                                    [% ELSIF Koha.Preference('CanMarkHoldsAwaitingPickupAsLost') == 'yes_and_notify' %]
203
                                    [% ELSIF Koha.Preference('CanMarkHoldsAwaitingPickupAsLost') == 'allow_and_notify' %]
204
                                        <input type="hidden" name="op" value="mark_as_lost_and_notify" />
204
                                        <input type="hidden" name="op" value="mark_as_lost_and_notify" />
205
                                        <input type="submit" value="Mark item as lost and notify the patron" />
205
                                        <input type="submit" value="Mark item as lost and notify the patron" />
206
                                    [% END %]
206
                                    [% END %]
207
- 

Return to bug 19287