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

(-)a/C4/Circulation.pm (-1 / +1 lines)
Lines 2131-2137 sub AddReturn { Link Here
2131
            foreach my $key ( keys %$rules ) {
2131
            foreach my $key ( keys %$rules ) {
2132
                if ( $item->notforloan eq $key ) {
2132
                if ( $item->notforloan eq $key ) {
2133
                    $messages->{'NotForLoanStatusUpdated'} = { from => $item->notforloan, to => $rules->{$key} };
2133
                    $messages->{'NotForLoanStatusUpdated'} = { from => $item->notforloan, to => $rules->{$key} };
2134
                    $item->notforloan($rules->{$key})->store({ log_action => 0, skip_record_index => 1 });
2134
                    $item->notforloan($rules->{$key})->store({ log_action => 0, skip_record_index => 1 }) unless $rules->{$key} eq 'ONLYMESSAGE';
2135
                    last;
2135
                    last;
2136
                }
2136
                }
2137
            }
2137
            }
(-)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 695-701 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
695
('UnseenRenewals','0','','Allow renewals to be recorded as "unseen" by the library, and count against the patrons unseen renewals limit.','YesNo'),
695
('UnseenRenewals','0','','Allow renewals to be recorded as "unseen" by the library, and count against the patrons unseen renewals limit.','YesNo'),
696
('UnsubscribeReflectionDelay','',NULL,'Delay for locking unsubscribers', 'Integer'),
696
('UnsubscribeReflectionDelay','',NULL,'Delay for locking unsubscribers', 'Integer'),
697
('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'),
697
('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'),
698
('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'),
698
('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'),
699
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
699
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
700
('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'),
700
('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'),
701
('uppercasesurnames','0',NULL,'If ON, surnames are converted to upper case in patron entry form','YesNo'),
701
('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 632-637 Circulation: Link Here
632
              class: code
632
              class: code
633
            - 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
633
            - 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
634
            - "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."
634
            - "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."
635
            - "Can be used for showing only the not for loan message E.g. '-1: ONLYMESSAGE'."
635
            - Each pair of values should be on a separate line.
636
            - Each pair of values should be on a separate line.
636
        -
637
        -
637
            - pref: CumulativeRestrictionPeriods
638
            - pref: CumulativeRestrictionPeriods
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (+4 lines)
Lines 227-232 Link Here
227
                                    [% FOREACH errmsgloo IN errmsgloop %]
227
                                    [% FOREACH errmsgloo IN errmsgloop %]
228
                                        [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
228
                                        [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
229
                                            <p class="problem ret_nflupdate">
229
                                            <p class="problem ret_nflupdate">
230
                                            [% IF errmsgloo.NotForLoanStatusUpdated.to == 'ONLYMESSAGE' %]
231
                                                [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) %]
232
                                            [% ELSE %]
230
                                                Not for loan status updated.
233
                                                Not for loan status updated.
231
                                                <br />Old value:
234
                                                <br />Old value:
232
                                                [% IF errmsgloo.NotForLoanStatusUpdated.from %]
235
                                                [% IF errmsgloo.NotForLoanStatusUpdated.from %]
Lines 244-249 Link Here
244
                                                [% ELSE %]
247
                                                [% ELSE %]
245
                                                    Available for loan.
248
                                                    Available for loan.
246
                                                [% END %]
249
                                                [% END %]
250
                                            [% END %]
247
                                            </p>
251
                                            </p>
248
                                        [% END %]
252
                                        [% END %]
249
                                        [% IF ( errmsgloo.ItemLocationUpdated ) %]
253
                                        [% 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 => 48;
20
use Test::More tests => 49;
21
use DateTime::Duration;
21
use DateTime::Duration;
22
22
23
use t::lib::Mocks;
23
use t::lib::Mocks;
Lines 409-414 AddReturn( 'barcode_3', $branchcode_1 ); Link Here
409
$item = Koha::Items->find( $itemnumber );
409
$item = Koha::Items->find( $itemnumber );
410
ok( $item->notforloan eq 9, q{UpdateNotForLoanStatusOnCheckin does not update notforloan value from 9 with setting "1: 9"} );
410
ok( $item->notforloan eq 9, q{UpdateNotForLoanStatusOnCheckin does not update notforloan value from 9 with setting "1: 9"} );
411
411
412
t::lib::Mocks::mock_preference( 'UpdateNotForLoanStatusOnCheckin', '1: ONLYMESSAGE' );
413
$item->notforloan(1)->store;
414
AddReturn( 'barcode_3', $branchcode_1 );
415
$item = Koha::Items->find( $itemnumber );
416
ok( $item->notforloan eq 1, q{UpdateNotForLoanStatusOnCheckin does not update notforloan value from 1 with setting "1: ONLYMESSAGE"} );
417
412
my $itemnumber2 = Koha::Item->new(
418
my $itemnumber2 = Koha::Item->new(
413
    {
419
    {
414
        biblionumber   => $biblionumber,
420
        biblionumber   => $biblionumber,
415
- 

Return to bug 30407