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

(-)a/C4/Circulation.pm (-16 / +34 lines)
Lines 1367-1376 sub AddIssue { Link Here
1367
                }
1367
                }
1368
              );
1368
              );
1369
1369
1370
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1370
            if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) {
1371
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1371
            ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1372
                CartToShelf( $item->{'itemnumber'} );
1372
                CartToShelf( $item->{'itemnumber'} );
1373
            }
1373
            }
1374
1374
            $item->{'issues'}++;
1375
            $item->{'issues'}++;
1375
            if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
1376
            if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
1376
                UpdateTotalIssues( $item->{'biblionumber'}, 1 );
1377
                UpdateTotalIssues( $item->{'biblionumber'}, 1 );
Lines 1829-1845 sub AddReturn { Link Here
1829
        }
1830
        }
1830
    }
1831
    }
1831
1832
1832
    if ( $item->{'location'} eq 'PROC' ) {
1833
        if ( C4::Context->preference("InProcessingToShelvingCart") ) {
1834
            $item->{'location'} = 'CART';
1835
        }
1836
        else {
1837
            $item->{location} = $item->{permanent_location};
1838
        }
1839
1840
        ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'}, { log_action => 0 } );
1841
    }
1842
1843
        # full item data, but no borrowernumber or checkout info (no issue)
1833
        # full item data, but no borrowernumber or checkout info (no issue)
1844
    my $hbr = GetBranchItemRule($item->{'homebranch'}, $item->{'itype'})->{'returnbranch'} || "homebranch";
1834
    my $hbr = GetBranchItemRule($item->{'homebranch'}, $item->{'itype'})->{'returnbranch'} || "homebranch";
1845
        # get the proper branch to which to return the item
1835
        # get the proper branch to which to return the item
Lines 1849-1854 sub AddReturn { Link Here
1849
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1839
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1850
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1840
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1851
1841
1842
    my $yaml_loc = C4::Context->preference('UpdateItemLocationOnCheckin');
1843
    if ($yaml_loc) {
1844
        $yaml_loc = "$yaml_loc\n\n";  # YAML is strict on ending \n. Surplus does not hurt
1845
        my $rules;
1846
        eval { $rules = YAML::Load($yaml_loc); };
1847
        if ($@) {
1848
            warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
1849
        }
1850
        else {
1851
            if (defined $rules->{_ALL_}) {
1852
                if ($rules->{_ALL_} eq '_PERM_') { $rules->{_ALL_} = $item->{permanent_location}; }
1853
                if ($rules->{_ALL_} eq '_BLANK_') { $rules->{_ALL_} = ''; }
1854
                if ( $item->{location} ne $rules->{_ALL_}) {
1855
                    $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{_ALL_} };
1856
                    ModItem( { location => $rules->{_ALL_} }, undef, $itemnumber );
1857
                }
1858
            }
1859
            else {
1860
                foreach my $key ( keys %$rules ) {
1861
                    if ( $rules->{$key} eq '_PERM_' ) { $rules->{$key} = $item->{permanent_location}; }
1862
                    if ( $rules->{$key} eq '_BLANK_') { $rules->{$key} = '' ;}
1863
                    if ( ($item->{location} eq $key && $item->{location} ne $rules->{$key}) || ($key eq '_BLANK_' && $item->{location} eq '' && $rules->{$key} ne '') ) {
1864
                        $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{$key} };
1865
                        ModItem( { location => $rules->{$key} }, undef, $itemnumber );
1866
                        last;
1867
                    }
1868
                }
1869
            }
1870
        }
1871
    }
1872
1852
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1873
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1853
    if ($yaml) {
1874
    if ($yaml) {
1854
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
1875
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
Lines 1953-1967 sub AddReturn { Link Here
1953
            );
1974
            );
1954
            $sth->execute( $item->{'itemnumber'} );
1975
            $sth->execute( $item->{'itemnumber'} );
1955
            # if we have a reservation with valid transfer, we can set it's status to 'W'
1976
            # if we have a reservation with valid transfer, we can set it's status to 'W'
1956
            ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") );
1957
            C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W');
1977
            C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W');
1958
        } else {
1978
        } else {
1959
            $messages->{'WrongTransfer'}     = $tobranch;
1979
            $messages->{'WrongTransfer'}     = $tobranch;
1960
            $messages->{'WrongTransferItem'} = $item->{'itemnumber'};
1980
            $messages->{'WrongTransferItem'} = $item->{'itemnumber'};
1961
        }
1981
        }
1962
        $validTransfert = 1;
1982
        $validTransfert = 1;
1963
    } else {
1964
        ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") );
1965
    }
1983
    }
1966
1984
1967
    # fix up the accounts.....
1985
    # fix up the accounts.....
(-)a/C4/Items.pm (-23 / +2 lines)
Lines 48-54 BEGIN { Link Here
48
        DelItemCheck
48
        DelItemCheck
49
        MoveItemFromBiblio
49
        MoveItemFromBiblio
50
        CartToShelf
50
        CartToShelf
51
        ShelfToCart
52
        GetAnalyticsCount
51
        GetAnalyticsCount
53
        SearchItemsByField
52
        SearchItemsByField
54
        SearchItems
53
        SearchItems
Lines 184-210 sub CartToShelf { Link Here
184
    }
183
    }
185
}
184
}
186
185
187
=head2 ShelfToCart
188
189
  ShelfToCart($itemnumber);
190
191
Set the current shelving location of the item
192
to shelving cart ('CART').
193
194
=cut
195
196
sub ShelfToCart {
197
    my ( $itemnumber ) = @_;
198
199
    unless ( $itemnumber ) {
200
        croak "FAILED ShelfToCart() - no itemnumber supplied";
201
    }
202
203
    my $item = GetItem($itemnumber);
204
    $item->{'location'} = 'CART';
205
    ModItem($item, undef, $itemnumber);
206
}
207
208
=head2 AddItemFromMarc
186
=head2 AddItemFromMarc
209
187
210
  my ($biblionumber, $biblioitemnumber, $itemnumber) 
188
  my ($biblionumber, $biblioitemnumber, $itemnumber) 
Lines 612-620 sub ModItemTransfer { Link Here
612
    my ( $itemnumber, $frombranch, $tobranch ) = @_;
590
    my ( $itemnumber, $frombranch, $tobranch ) = @_;
613
591
614
    my $dbh = C4::Context->dbh;
592
    my $dbh = C4::Context->dbh;
593
    my $item = GetItem( $itemnumber );
615
594
616
    # Remove the 'shelving cart' location status if it is being used.
595
    # Remove the 'shelving cart' location status if it is being used.
617
    CartToShelf( $itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") );
596
    CartToShelf( $itemnumber ) if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART' );
618
597
619
    $dbh->do("UPDATE branchtransfers SET datearrived = NOW(), comments = ? WHERE itemnumber = ? AND datearrived IS NULL", undef, "Canceled, new transfer from $frombranch to $tobranch created", $itemnumber);
598
    $dbh->do("UPDATE branchtransfers SET datearrived = NOW(), comments = ? WHERE itemnumber = ? AND datearrived IS NULL", undef, "Canceled, new transfer from $frombranch to $tobranch created", $itemnumber);
620
599
(-)a/C4/Reserves.pm (-4 / +5 lines)
Lines 1018-1024 sub ModReserveStatus { Link Here
1018
    my $sth_set = $dbh->prepare($query);
1018
    my $sth_set = $dbh->prepare($query);
1019
    $sth_set->execute( $newstatus, $itemnumber );
1019
    $sth_set->execute( $newstatus, $itemnumber );
1020
1020
1021
    if ( C4::Context->preference("ReturnToShelvingCart") && $newstatus ) {
1021
    my $item = GetItem($itemnumber);
1022
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) && $newstatus ) {
1022
      CartToShelf( $itemnumber );
1023
      CartToShelf( $itemnumber );
1023
    }
1024
    }
1024
}
1025
}
Lines 1070-1078 sub ModReserveAffect { Link Here
1070
      if ( !$transferToDo && !$already_on_shelf );
1071
      if ( !$transferToDo && !$already_on_shelf );
1071
1072
1072
    _FixPriority( { biblionumber => $biblionumber } );
1073
    _FixPriority( { biblionumber => $biblionumber } );
1073
1074
    my $item = GetItem($itemnumber);
1074
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1075
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) ) {
1075
        CartToShelf($itemnumber);
1076
      CartToShelf( $itemnumber );
1076
    }
1077
    }
1077
1078
1078
    return;
1079
    return;
(-)a/C4/UsageStats.pm (-2 lines)
Lines 144-150 sub BuildReport { Link Here
144
        AutoRemoveOverduesRestrictions
144
        AutoRemoveOverduesRestrictions
145
        CircControl
145
        CircControl
146
        HomeOrHoldingBranch
146
        HomeOrHoldingBranch
147
        InProcessingToShelvingCart
148
        IssueLostItem
147
        IssueLostItem
149
        IssuingInProcess
148
        IssuingInProcess
150
        ManInvInNoissuesCharge
149
        ManInvInNoissuesCharge
Lines 153-159 sub BuildReport { Link Here
153
        RenewalSendNotice
152
        RenewalSendNotice
154
        RentalsInNoissuesCharge
153
        RentalsInNoissuesCharge
155
        ReturnBeforeExpiry
154
        ReturnBeforeExpiry
156
        ReturnToShelvingCart
157
        TransfersMaxDaysWarning
155
        TransfersMaxDaysWarning
158
        UseBranchTransferLimits
156
        UseBranchTransferLimits
159
        useDaysMode
157
        useDaysMode
(-)a/circ/returns.pl (+3 lines)
Lines 531-536 foreach my $code ( keys %$messages ) { Link Here
531
    elsif ( $code eq 'ForeverDebarred' ) {
531
    elsif ( $code eq 'ForeverDebarred' ) {
532
        $err{foreverdebarred}        = $messages->{'ForeverDebarred'};
532
        $err{foreverdebarred}        = $messages->{'ForeverDebarred'};
533
    }
533
    }
534
    elsif ( $code eq 'ItemLocationUpdated' ) {
535
        $err{ItemLocationUpdated} = $messages->{ItemLocationUpdated};
536
    }
534
    elsif ( $code eq 'NotForLoanStatusUpdated' ) {
537
    elsif ( $code eq 'NotForLoanStatusUpdated' ) {
535
        $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated};
538
        $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated};
536
    }
539
    }
(-)a/installer/data/mysql/atomicupdate/bug_14576-add_UpdateItemLocationOnCheckin_syspref.sql (+5 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES('UpdateItemLocationOnCheckin', 'PROC: _PERM_\n', 'NULL', 'This a list of value pairs. When an item is checked in, if the location value on the left matches the items location value t will be updated to the right-hand value. E.g. ''PROC: FIC'' will cause an item that was set to ''Book Cart'' to now be in the ''Fiction'' shelving location. Note that 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.  You can also use the special term _BLANK_ on either side of a pair to update/remove items with no locaiton assigned.  You can use the special term _ALL_ on the left side to affect all items and the special term _PERM_ on the right side to return items to their permanent location', 'Free');
2
UPDATE systempreferences s1, (SELECT IF(value,'PROC: CART\n','') AS p2c FROM systempreferences WHERE variable='InProcessingToShelvingCart') s2 SET s1.value= CONCAT(s2.p2c, REPLACE(s1.value,'PROC: _PERM_\n','') ) WHERE s1.variable='UpdateItemLocationOnCheckin' AND s1.value NOT LIKE '%PROC: CART%';
3
DELETE FROM systempreferences WHERE variable='InProcessingToShelvingCart';
4
UPDATE systempreferences s1, (SELECT IF(value,'_ALL_: CART\n','') AS rtc FROM systempreferences WHERE variable='ReturnToShelvingCart') s2 SET s1.value= CONCAT(s2.rtc,s1.value) WHERE s1.variable='UpdateItemLocationOnCheckin' AND s1.value NOT LIKE '%_ALL_: CART%';
5
DELETE FROM systempreferences WHERE variable='ReturnToShelvingCart';
(-)a/installer/data/mysql/sysprefs.sql (-2 / +1 lines)
Lines 227-233 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
227
('RecordedBooksLibraryID','','','Library ID for RecordedBooks integration','Integer'),
227
('RecordedBooksLibraryID','','','Library ID for RecordedBooks integration','Integer'),
228
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
228
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
229
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
229
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
230
('InProcessingToShelvingCart','0','','If set, when any item with a location code of PROC is \'checked in\', it\'s location code will be changed to CART.','YesNo'),
231
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
230
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
232
('IntranetBiblioDefaultView','normal','normal|marc|isbd|labeled_marc','Choose the default detail view in the staff interface; choose between normal, labeled_marc, marc or isbd','Choice'),
231
('IntranetBiblioDefaultView','normal','normal|marc|isbd|labeled_marc','Choose the default detail view in the staff interface; choose between normal, labeled_marc, marc or isbd','Choice'),
233
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
232
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
Lines 492-498 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
492
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
491
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
493
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
492
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
494
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
493
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
495
('ReturnToShelvingCart','0','','If set, when any item is \'checked in\', it\'s location code will be changed to CART.','YesNo'),
496
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
494
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
497
('RisExportAdditionalFields',  '', NULL ,  'Define additional RIS tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.',  'textarea'),
495
('RisExportAdditionalFields',  '', NULL ,  'Define additional RIS tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.',  'textarea'),
498
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
496
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
Lines 594-599 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
594
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
592
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
595
('UpdateItemWhenLostFromHoldList','',NULL,'This is a list of values to update an item when it is marked as lost from the holds to pull screen','Free'),
593
('UpdateItemWhenLostFromHoldList','',NULL,'This is a list of values to update an item when it is marked as lost from the holds to pull screen','Free'),
596
('UniqueItemFields','barcode','','Space-separated list of fields that should be unique (used in acquisition module for item creation). Fields must be valid SQL column names of items table','Free'),
594
('UniqueItemFields','barcode','','Space-separated list of fields that should be unique (used in acquisition module for item creation). Fields must be valid SQL column names of items table','Free'),
595
('UpdateItemLocationOnCheckin', '', 'NULL', 'This is a list of value pairs. When an item is checked in, if the location value on the left matches the items location value it will be updated to the right-hand value. E.g. ''PROC: FIC'' will cause an item that was set to ''Book Cart'' to now be in the ''Fiction'' shelving location. Note that 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.  You can also use the special term _BLANK_ on either side of a pair to update/remove items with no locaiton assigned.  You can use the special term _ALL_ on the left side to affect all items and the special term _PERM_ on the right side to return items to their permanent location', 'Free'),
597
('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'),
596
('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'),
598
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
597
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
599
('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'),
598
('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt (+2 lines)
Lines 193-198 Link Here
193
        var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
193
        var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
194
        var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
194
        var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
195
        var MSG_LOADING = _( "Loading..." );
195
        var MSG_LOADING = _( "Loading..." );
196
        var MSG_ALL_VALUE_WARN = _("Note: _ALL_ value will override all other values");
197
        var MSG_UPD_LOC_FORMAT_WARN = _("The following values are not formatted correctly:");
196
    </script>
198
    </script>
197
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
199
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
198
    [% Asset.js("js/ajax.js") | $raw %]
200
    [% Asset.js("js/ajax.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-14 / +15 lines)
Lines 208-227 Circulation: Link Here
208
                  no: "Don't allow"
208
                  no: "Don't allow"
209
            - staff to manually override and check out items to patrons who have more than noissuescharge in fines.
209
            - staff to manually override and check out items to patrons who have more than noissuescharge in fines.
210
        -
210
        -
211
            - pref: InProcessingToShelvingCart
212
              choices:
213
                  yes: Move
214
                  no: "Don't move"
215
            - items that have the location PROC to the location CART when they are checked in.
216
            - "<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/cart_to_shelf.pl</code> cronjob. Ask your system administrator to schedule it."
217
        -
218
            - pref: ReturnToShelvingCart
219
              choices:
220
                  yes: Move
221
                  no: "Don't move"
222
            - all items to the location CART when they are checked in.
223
            - "<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/cart_to_shelf.pl</code> cronjob. Ask your system administrator to schedule it."
224
        -
225
            - pref: AutomaticItemReturn
211
            - pref: AutomaticItemReturn
226
              choices:
212
              choices:
227
                  yes: Do
213
                  yes: Do
Lines 524-529 Circulation: Link Here
524
            - calculate and update overdue charges when an item is returned.
510
            - calculate and update overdue charges when an item is returned.
525
            - "<br /><strong>NOTE: If you are doing hourly loans then you should have this on.</strong>"
511
            - "<br /><strong>NOTE: If you are doing hourly loans then you should have this on.</strong>"
526
        -
512
        -
513
            - pref: UpdateItemLocationOnCheckin
514
              type: textarea
515
              class: code
516
            - This is is a list of value pairs, the first value is followed immediately by colon space then the second value i.e.:<br/>
517
            - "PROC: FIC"
518
            - <br/> When an item is checked in, if the location value on the left matches the items location value
519
            - "it will be updated to the right-hand value.<br/> E.g. ''PROC: FIC'' will cause an item that was set to ''Book Cart'' to now be in the ''Fiction'' shelving location."
520
            - <br/>Note that 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.
521
            - <br/>Items in the CART location will be returned to their permanent location on checkout
522
            - <br/>You can use the special term _BLANK_ on either side of a pair to update/remove items with no location assigned
523
            - <br>You can use the special term _ALL_ on the left side to affect all items
524
            - and the special term _PERM_ on the right side to return items to their permanent location
525
            - <br>**Use of an _ALL_ rule will override/ignore any other values**
526
            - <br>Each pair of values should be on a separate line.
527
        -
527
            - pref: UpdateNotForLoanStatusOnCheckin
528
            - pref: UpdateNotForLoanStatusOnCheckin
528
              type: textarea
529
              type: textarea
529
              class: code
530
              class: code
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +29 lines)
Lines 532-537 Link Here
532
                    [% END %]
532
                    [% END %]
533
                </p>
533
                </p>
534
            [% END %]
534
            [% END %]
535
            [% IF ( errmsgloo.ItemLocationUpdated ) %]
536
                 <p class="problem">
537
                     Item shelving location updated.
538
                    <br />Old value:
539
                    [% IF errmsgloo.ItemLocationUpdated.from %]
540
                        [% IF errmsgloo.ItemLocationUpdated.from == '' %]
541
                            empty
542
                        [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) == '' %]
543
                            [% errmsgloo.ItemLocationUpdated.from | html %] (No description available)
544
                        [% ELSE %]
545
                            [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) | html %]
546
                        [% END %]
547
                    [% ELSE %]
548
                        "Blank"
549
                    [% END %]
550
                    <br />New value:
551
                    [% IF errmsgloo.ItemLocationUpdated.to %]
552
                        [% IF errmsgloo.ItemLocationUpdated.to == '' %]
553
                            empty
554
                        [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) == '' %]
555
                            [% errmsgloo.ItemLocationUpdated.to | html %] (Not an authorized value)
556
                        [% ELSE %]
557
                            [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) | html %]
558
                        [% END %]
559
                    [% ELSE %]
560
                        "Blank"
561
                    [% END %]
562
                 </p>
563
            [% END %]
535
            [% IF ( errmsgloo.badbarcode ) %]
564
            [% IF ( errmsgloo.badbarcode ) %]
536
                <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
565
                <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
537
            [% END %]
566
            [% END %]
Lines 550-556 Link Here
550
                [% ELSE %]
579
                [% ELSE %]
551
                    <p class="problem">Item was lost, now found.</p>
580
                    <p class="problem">Item was lost, now found.</p>
552
                [% END %]
581
                [% END %]
553
554
                [% IF LostItemFeeRefunded and not Koha.Preference('BlockReturnOfLostItems') %]
582
                [% IF LostItemFeeRefunded and not Koha.Preference('BlockReturnOfLostItems') %]
555
                    <p class="problem">A refund has been applied to the borrowing patron's account.</p>
583
                    <p class="problem">A refund has been applied to the borrowing patron's account.</p>
556
                [% ELSIF Koha.Preference('BlockReturnOfLostItems') %]
584
                [% ELSIF Koha.Preference('BlockReturnOfLostItems') %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js (+19 lines)
Lines 143-146 $( document ).ready( function () { Link Here
143
    if ( search_jumped ) {
143
    if ( search_jumped ) {
144
        document.location.hash = "jumped";
144
        document.location.hash = "jumped";
145
    }
145
    }
146
147
    $("#pref_UpdateItemLocationOnCheckin").change(function(){
148
        var the_text = $(this).val();
149
        var alert_text = '';
150
        if ( the_text.indexOf('_ALL_:') != -1 ) alert_text = MSG_ALL_VALUE_WARN + '\n';
151
        var split_text  =the_text.split("\n");
152
        var alert_issues = '';
153
        var issue_count = 0;
154
        var reg_check = /.*:\s.*/;
155
        for (var i=0; i < split_text.length; i++){
156
            if ( !split_text[i].match(reg_check) && split_text[i].length ) {
157
                alert_issues+=split_text[i]+"\n";
158
                issue_count++;
159
            }
160
        }
161
        if (issue_count) alert_text += "\n"+ MSG_UPD_LOC_FORMAT_WARN  +"\n"+alert_issues;
162
        if ( alert_text.length )  alert(alert_text);
163
    });
164
146
} );
165
} );
(-)a/svc/checkin (-15 lines)
Lines 63-82 $data->{itemnumber} = $itemnumber; Link Here
63
$data->{borrowernumber} = $borrowernumber;
63
$data->{borrowernumber} = $borrowernumber;
64
$data->{branchcode}     = $branchcode;
64
$data->{branchcode}     = $branchcode;
65
65
66
if ( C4::Context->preference("InProcessingToShelvingCart") ) {
67
    my $item = GetItem($itemnumber);
68
    if ( $item->{'location'} eq 'PROC' ) {
69
        $item->{'location'} = 'CART';
70
        ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
71
    }
72
}
73
74
if ( C4::Context->preference("ReturnToShelvingCart") ) {
75
    my $item = GetItem($itemnumber);
76
    $item->{'location'} = 'CART';
77
    ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
78
}
79
80
my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber });
66
my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber });
81
$data->{patronnote} = $checkout ? $checkout->note : q||;
67
$data->{patronnote} = $checkout ? $checkout->note : q||;
82
68
83
- 

Return to bug 14576