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

(-)a/C4/Circulation.pm (-1 / +1 lines)
Lines 2143-2149 sub AddReturn { Link Here
2143
            foreach my $key ( keys %$rules ) {
2143
            foreach my $key ( keys %$rules ) {
2144
                if ( $item->notforloan eq $key ) {
2144
                if ( $item->notforloan eq $key ) {
2145
                    $messages->{'NotForLoanStatusUpdated'} = { from => $item->notforloan, to => $rules->{$key} };
2145
                    $messages->{'NotForLoanStatusUpdated'} = { from => $item->notforloan, to => $rules->{$key} };
2146
                    $item->notforloan($rules->{$key})->store({ log_action => 0, skip_record_index => 1, skip_holds_queue => 1 });
2146
                    $item->notforloan($rules->{$key})->store({ log_action => 0, skip_record_index => 1, skip_holds_queue => 1 }) unless $rules->{$key} eq 'ONLYMESSAGE';
2147
                    last;
2147
                    last;
2148
                }
2148
                }
2149
            }
2149
            }
(-)a/installer/data/mysql/atomicupdate/bug_30407.pl (+13 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "30407",
5
    description => "Add ability to syspref UpdateNotForLoanStatusOnCheckin to show only the notforloan values message",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        # Do you stuffs here
10
        $dbh->do(q{UPDATE IGNORE systempreferences SET explanation = "This is a list of value pairs. When an item is checked in, if the not for loan value on the left matches the items not for loan value it will be updated to the right-hand value. E.g. '-1: 0' will cause an item that was set to 'Ordered' to now be available for loan. Can be used for showing only the not for loan message E.g. '-1: ONLYMESSAGE'. Each pair of values should be on a separate line." WHERE variable = "UpdateNotForLoanStatusOnCheckin"});
11
        say $out "Update is going well so far";
12
    },
13
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 720-726 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
720
('UnseenRenewals','0','','Allow renewals to be recorded as "unseen" by the library, and count against the patrons unseen renewals limit.','YesNo'),
720
('UnseenRenewals','0','','Allow renewals to be recorded as "unseen" by the library, and count against the patrons unseen renewals limit.','YesNo'),
721
('UnsubscribeReflectionDelay','',NULL,'Delay for locking unsubscribers', 'Integer'),
721
('UnsubscribeReflectionDelay','',NULL,'Delay for locking unsubscribers', 'Integer'),
722
('UpdateItemLocationOnCheckin', '', 'NULL', 'This is a list of value pairs.\n Examples:\n\nPROC: FIC - causes an item in the Processing Center location to be updated into the Fiction location on check in.\nFIC: GEN - causes an item in the Fiction location to be updated into the General stacks location on check in.\n_BLANK_:FIC - causes an item that has no location to be updated into the Fiction location on check in.\nFIC: _BLANK_ - causes an item in location FIC to be updated to a blank location on check in.\n_ALL_:FIC - causes all items to be updated into the Fiction location on check in.\nPROC: _PERM_ - causes an item that is in the Processing Center to be updated to it''s permanent location.\n\nGeneral rule: if the location value on the left matches the item''s current location, it will be updated to match the location value on the right.\nNote: PROC and CART are special values, for these locations only can location and permanent_location differ, in all other cases an update will affect both. Items in the CART location will be returned to their permanent location on checkout.\n\nThe special term _BLANK_ may be used on either side of a value pair to update or remove the location from items with no location assigned.\nThe special term _ALL_ is used on the left side of the colon (:) to affect all items.\nThe special term _PERM_ is used on the right side of the colon (:) to return items to their permanent location.', 'Free'),
722
('UpdateItemLocationOnCheckin', '', 'NULL', 'This is a list of value pairs.\n Examples:\n\nPROC: FIC - causes an item in the Processing Center location to be updated into the Fiction location on check in.\nFIC: GEN - causes an item in the Fiction location to be updated into the General stacks location on check in.\n_BLANK_:FIC - causes an item that has no location to be updated into the Fiction location on check in.\nFIC: _BLANK_ - causes an item in location FIC to be updated to a blank location on check in.\n_ALL_:FIC - causes all items to be updated into the Fiction location on check in.\nPROC: _PERM_ - causes an item that is in the Processing Center to be updated to it''s permanent location.\n\nGeneral rule: if the location value on the left matches the item''s current location, it will be updated to match the location value on the right.\nNote: PROC and CART are special values, for these locations only can location and permanent_location differ, in all other cases an update will affect both. Items in the CART location will be returned to their permanent location on checkout.\n\nThe special term _BLANK_ may be used on either side of a value pair to update or remove the location from items with no location assigned.\nThe special term _ALL_ is used on the left side of the colon (:) to affect all items.\nThe special term _PERM_ is used on the right side of the colon (:) to return items to their permanent location.', 'Free'),
723
('UpdateNotForLoanStatusOnCheckin', '', 'NULL', 'This is a list of value pairs. When an item is checked in, if the not for loan value on the left matches the items not for loan value it will be updated to the right-hand value. E.g. ''-1: 0'' will cause an item that was set to ''Ordered'' to now be available for loan. Each pair of values should be on a separate line.', 'Free'),
723
('UpdateNotForLoanStatusOnCheckin', '', 'NULL', 'This is a list of value pairs. When an item is checked in, if the not for loan value on the left matches the items not for loan value it will be updated to the right-hand value. E.g. '-1: 0' will cause an item that was set to 'Ordered' to now be available for loan. Can be used for showing only the not for loan message E.g. '-1: ONLYMESSAGE'. Each pair of values should be on a separate line.', 'Free'),
724
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
724
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
725
('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'),
725
('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'),
726
('uppercasesurnames','0',NULL,'If ON, surnames are converted to upper case in patron entry form','YesNo'),
726
('uppercasesurnames','0',NULL,'If ON, surnames are converted to upper case in patron entry form','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+1 lines)
Lines 647-652 Circulation: Link Here
647
              class: code
647
              class: code
648
            - This is a list of value pairs. When an item is checked in, if the not for loan value on the left matches the items not for loan value
648
            - This is a list of value pairs. When an item is checked in, if the not for loan value on the left matches the items not for loan value
649
            - "it will be updated to the right-hand value. For example, '-1: 0' will cause an item that was set to 'Ordered' to now be available for loan."
649
            - "it will be updated to the right-hand value. For example, '-1: 0' will cause an item that was set to 'Ordered' to now be available for loan."
650
            - "Can be used for showing only the not for loan message E.g. '-1: ONLYMESSAGE'."
650
            - Each pair of values should be on a separate line.
651
            - Each pair of values should be on a separate line.
651
        -
652
        -
652
            - pref: CumulativeRestrictionPeriods
653
            - pref: CumulativeRestrictionPeriods
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (+4 lines)
Lines 261-266 Link Here
261
                                    [% FOREACH errmsgloo IN errmsgloop %]
261
                                    [% FOREACH errmsgloo IN errmsgloop %]
262
                                        [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
262
                                        [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
263
                                            <p class="problem ret_nflupdate">
263
                                            <p class="problem ret_nflupdate">
264
                                            [% IF errmsgloo.NotForLoanStatusUpdated.to == 'ONLYMESSAGE' %]
265
                                                [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) %]
266
                                            [% ELSE %]
264
                                                Not for loan status updated.
267
                                                Not for loan status updated.
265
                                                <br />Old value:
268
                                                <br />Old value:
266
                                                [% IF errmsgloo.NotForLoanStatusUpdated.from %]
269
                                                [% IF errmsgloo.NotForLoanStatusUpdated.from %]
Lines 278-283 Link Here
278
                                                [% ELSE %]
281
                                                [% ELSE %]
279
                                                    Available for loan.
282
                                                    Available for loan.
280
                                                [% END %]
283
                                                [% END %]
284
                                            [% END %]
281
                                            </p>
285
                                            </p>
282
                                        [% END %]
286
                                        [% END %]
283
                                        [% IF ( errmsgloo.ItemLocationUpdated ) %]
287
                                        [% IF ( errmsgloo.ItemLocationUpdated ) %]
(-)a/t/db_dependent/Circulation/issue.t (-2 / +7 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 50;
20
use Test::More tests => 51;
21
use DateTime::Duration;
21
use DateTime::Duration;
22
22
23
use t::lib::Mocks;
23
use t::lib::Mocks;
Lines 414-419 AddReturn( 'barcode_3', $branchcode_1 ); Link Here
414
$item = Koha::Items->find( $itemnumber );
414
$item = Koha::Items->find( $itemnumber );
415
ok( $item->notforloan eq 9, q{UpdateNotForLoanStatusOnCheckin does not update notforloan value from 9 with setting "1: 9"} );
415
ok( $item->notforloan eq 9, q{UpdateNotForLoanStatusOnCheckin does not update notforloan value from 9 with setting "1: 9"} );
416
416
417
t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckin', '1: ONLYMESSAGE' );
418
$item->notforloan(1)->store;
419
AddReturn( 'barcode_3', $branchcode_1 );
420
$item = Koha::Items->find( $itemnumber );
421
ok( $item->notforloan eq 1, q{UpdateNotForLoanStatusOnCheckin does not update notforloan value from 1 with setting "1: ONLYMESSAGE"} );
422
417
my $itemnumber2 = Koha::Item->new(
423
my $itemnumber2 = Koha::Item->new(
418
    {
424
    {
419
        biblionumber   => $biblionumber,
425
        biblionumber   => $biblionumber,
420
- 

Return to bug 30407