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

(-)a/C4/Circulation.pm (-16 / +33 lines)
Lines 1424-1431 sub AddIssue { Link Here
1424
                )->store;
1424
                )->store;
1425
            }
1425
            }
1426
1426
1427
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1427
            if ( $item_object->location eq 'CART' && $item_object->permanent_location ne 'CART'  ) {
1428
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1428
            ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1429
                CartToShelf( $item_object->itemnumber );
1429
                CartToShelf( $item_object->itemnumber );
1430
            }
1430
            }
1431
1431
Lines 1872-1888 sub AddReturn { Link Here
1872
    }
1872
    }
1873
1873
1874
    my $item_unblessed = $item->unblessed;
1874
    my $item_unblessed = $item->unblessed;
1875
    if ( $item->location eq 'PROC' ) {
1876
        if ( C4::Context->preference("InProcessingToShelvingCart") ) {
1877
            $item_unblessed->{location} = 'CART';
1878
        }
1879
        else {
1880
            $item_unblessed->{location} = $item->permanent_location;
1881
        }
1882
1883
        ModItem( $item_unblessed, $item->biblionumber, $item->itemnumber, { log_action => 0 } );
1884
    }
1885
1886
        # full item data, but no borrowernumber or checkout info (no issue)
1875
        # full item data, but no borrowernumber or checkout info (no issue)
1887
    my $hbr = GetBranchItemRule($item->homebranch, $itemtype)->{'returnbranch'} || "homebranch";
1876
    my $hbr = GetBranchItemRule($item->homebranch, $itemtype)->{'returnbranch'} || "homebranch";
1888
        # get the proper branch to which to return the item
1877
        # get the proper branch to which to return the item
Lines 1892-1897 sub AddReturn { Link Here
1892
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1881
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1893
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1882
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1894
1883
1884
    my $yaml_loc = C4::Context->preference('UpdateItemLocationOnCheckin');
1885
    if ($yaml_loc) {
1886
        $yaml_loc = "$yaml_loc\n\n";  # YAML is strict on ending \n. Surplus does not hurt
1887
        my $rules;
1888
        eval { $rules = YAML::Load($yaml_loc); };
1889
        if ($@) {
1890
            warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
1891
        }
1892
        else {
1893
            if (defined $rules->{_ALL_}) {
1894
                if ($rules->{_ALL_} eq '_PERM_') { $rules->{_ALL_} = $item->{permanent_location}; }
1895
                if ($rules->{_ALL_} eq '_BLANK_') { $rules->{_ALL_} = ''; }
1896
                if ( $item->{location} ne $rules->{_ALL_}) {
1897
                    $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{_ALL_} };
1898
                    ModItem( { location => $rules->{_ALL_} }, undef, $itemnumber );
1899
                }
1900
            }
1901
            else {
1902
                foreach my $key ( keys %$rules ) {
1903
                    if ( $rules->{$key} eq '_PERM_' ) { $rules->{$key} = $item->{permanent_location}; }
1904
                    if ( $rules->{$key} eq '_BLANK_') { $rules->{$key} = '' ;}
1905
                    if ( ($item->{location} eq $key && $item->{location} ne $rules->{$key}) || ($key eq '_BLANK_' && $item->{location} eq '' && $rules->{$key} ne '') ) {
1906
                        $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{$key} };
1907
                        ModItem( { location => $rules->{$key} }, undef, $itemnumber );
1908
                        last;
1909
                    }
1910
                }
1911
            }
1912
        }
1913
    }
1914
1895
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1915
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1896
    if ($yaml) {
1916
    if ($yaml) {
1897
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
1917
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
Lines 1983-1997 sub AddReturn { Link Here
1983
            );
2003
            );
1984
            $sth->execute( $item->itemnumber );
2004
            $sth->execute( $item->itemnumber );
1985
            # if we have a reservation with valid transfer, we can set it's status to 'W'
2005
            # if we have a reservation with valid transfer, we can set it's status to 'W'
1986
            ShelfToCart( $item->itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") );
1987
            C4::Reserves::ModReserveStatus($item->itemnumber, 'W');
2006
            C4::Reserves::ModReserveStatus($item->itemnumber, 'W');
1988
        } else {
2007
        } else {
1989
            $messages->{'WrongTransfer'}     = $tobranch;
2008
            $messages->{'WrongTransfer'}     = $tobranch;
1990
            $messages->{'WrongTransferItem'} = $item->itemnumber;
2009
            $messages->{'WrongTransferItem'} = $item->itemnumber;
1991
        }
2010
        }
1992
        $validTransfert = 1;
2011
        $validTransfert = 1;
1993
    } else {
1994
        ShelfToCart( $item->itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") );
1995
    }
2012
    }
1996
2013
1997
    # fix up the accounts.....
2014
    # fix up the accounts.....
(-)a/C4/Items.pm (-21 / +2 lines)
Lines 47-53 BEGIN { Link Here
47
        DelItemCheck
47
        DelItemCheck
48
        MoveItemFromBiblio
48
        MoveItemFromBiblio
49
        CartToShelf
49
        CartToShelf
50
        ShelfToCart
51
        GetAnalyticsCount
50
        GetAnalyticsCount
52
        SearchItemsByField
51
        SearchItemsByField
53
        SearchItems
52
        SearchItems
Lines 141-165 sub CartToShelf { Link Here
141
    }
140
    }
142
}
141
}
143
142
144
=head2 ShelfToCart
145
146
  ShelfToCart($itemnumber);
147
148
Set the current shelving location of the item
149
to shelving cart ('CART').
150
151
=cut
152
153
sub ShelfToCart {
154
    my ( $itemnumber ) = @_;
155
156
    unless ( $itemnumber ) {
157
        croak "FAILED ShelfToCart() - no itemnumber supplied";
158
    }
159
160
    ModItem({ location => 'CART'}, undef, $itemnumber);
161
}
162
163
=head2 AddItemFromMarc
143
=head2 AddItemFromMarc
164
144
165
  my ($biblionumber, $biblioitemnumber, $itemnumber) 
145
  my ($biblionumber, $biblioitemnumber, $itemnumber) 
Lines 566-574 sub ModItemTransfer { Link Here
566
    my ( $itemnumber, $frombranch, $tobranch ) = @_;
546
    my ( $itemnumber, $frombranch, $tobranch ) = @_;
567
547
568
    my $dbh = C4::Context->dbh;
548
    my $dbh = C4::Context->dbh;
549
    my $item = GetItem( $itemnumber );
569
550
570
    # Remove the 'shelving cart' location status if it is being used.
551
    # Remove the 'shelving cart' location status if it is being used.
571
    CartToShelf( $itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") );
552
    CartToShelf( $itemnumber ) if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART' );
572
553
573
    $dbh->do("UPDATE branchtransfers SET datearrived = NOW(), comments = ? WHERE itemnumber = ? AND datearrived IS NULL", undef, "Canceled, new transfer from $frombranch to $tobranch created", $itemnumber);
554
    $dbh->do("UPDATE branchtransfers SET datearrived = NOW(), comments = ? WHERE itemnumber = ? AND datearrived IS NULL", undef, "Canceled, new transfer from $frombranch to $tobranch created", $itemnumber);
574
555
(-)a/C4/Reserves.pm (-4 / +5 lines)
Lines 1030-1036 sub ModReserveStatus { Link Here
1030
    my $sth_set = $dbh->prepare($query);
1030
    my $sth_set = $dbh->prepare($query);
1031
    $sth_set->execute( $newstatus, $itemnumber );
1031
    $sth_set->execute( $newstatus, $itemnumber );
1032
1032
1033
    if ( C4::Context->preference("ReturnToShelvingCart") && $newstatus ) {
1033
    my $item = GetItem($itemnumber);
1034
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) && $newstatus ) {
1034
      CartToShelf( $itemnumber );
1035
      CartToShelf( $itemnumber );
1035
    }
1036
    }
1036
}
1037
}
Lines 1082-1090 sub ModReserveAffect { Link Here
1082
      if ( !$transferToDo && !$already_on_shelf );
1083
      if ( !$transferToDo && !$already_on_shelf );
1083
1084
1084
    _FixPriority( { biblionumber => $biblionumber } );
1085
    _FixPriority( { biblionumber => $biblionumber } );
1085
1086
    my $item = GetItem($itemnumber);
1086
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1087
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) ) {
1087
        CartToShelf($itemnumber);
1088
      CartToShelf( $itemnumber );
1088
    }
1089
    }
1089
1090
1090
    return;
1091
    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 533-538 foreach my $code ( keys %$messages ) { Link Here
533
    elsif ( $code eq 'ForeverDebarred' ) {
533
    elsif ( $code eq 'ForeverDebarred' ) {
534
        $err{foreverdebarred}        = $messages->{'ForeverDebarred'};
534
        $err{foreverdebarred}        = $messages->{'ForeverDebarred'};
535
    }
535
    }
536
    elsif ( $code eq 'ItemLocationUpdated' ) {
537
        $err{ItemLocationUpdated} = $messages->{ItemLocationUpdated};
538
    }
536
    elsif ( $code eq 'NotForLoanStatusUpdated' ) {
539
    elsif ( $code eq 'NotForLoanStatusUpdated' ) {
537
        $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated};
540
        $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated};
538
    }
541
    }
(-)a/installer/data/mysql/atomicupdate/bug_14576_add_UpdateItemLocationOnCheckin.perl (+20 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
        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');
5
    });
6
    $dbh->do(q{
7
        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%';
8
    });
9
    $dbh->do(q{
10
        DELETE FROM systempreferences WHERE variable='InProcessingToShelvingCart';
11
    });
12
    $dbh->do(q{
13
        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%';
14
    });
15
    $dbh->do(q{
16
        DELETE FROM systempreferences WHERE variable='ReturnToShelvingCart';
17
    });
18
    SetVersion( $DBversion );
19
    print "Upgrade to $DBversion done (Bug 14576: Add UpdateItemLocationOnCheckin syspref)\n";
20
}
(-)a/installer/data/mysql/sysprefs.sql (-2 / +1 lines)
Lines 233-239 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
233
('RecordedBooksLibraryID','','','Library ID for RecordedBooks integration','Integer'),
233
('RecordedBooksLibraryID','','','Library ID for RecordedBooks integration','Integer'),
234
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
234
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
235
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
235
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
236
('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'),
237
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
236
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
238
('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'),
237
('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'),
239
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
238
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
Lines 502-508 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
502
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
501
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
503
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
502
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
504
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
503
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
505
('ReturnToShelvingCart','0','','If set, when any item is \'checked in\', it\'s location code will be changed to CART.','YesNo'),
506
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
504
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
507
('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'),
505
('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'),
508
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
506
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
Lines 604-609 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
604
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
602
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
605
('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'),
603
('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'),
606
('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'),
604
('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'),
605
('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'),
607
('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'),
606
('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'),
608
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
607
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
609
('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'),
608
('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 202-207 Link Here
202
        var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
202
        var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
203
        var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
203
        var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
204
        var MSG_LOADING = _( "Loading..." );
204
        var MSG_LOADING = _( "Loading..." );
205
        var MSG_ALL_VALUE_WARN = _("Note: _ALL_ value will override all other values");
206
        var MSG_UPD_LOC_FORMAT_WARN = _("The following values are not formatted correctly:");
205
    </script>
207
    </script>
206
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
208
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
207
    [% Asset.js("js/ajax.js") | $raw %]
209
    [% Asset.js("js/ajax.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-14 / +15 lines)
Lines 216-235 Circulation: Link Here
216
                  no: "Don't allow"
216
                  no: "Don't allow"
217
            - staff to manually override and check out items to patrons who have more than noissuescharge in fines.
217
            - staff to manually override and check out items to patrons who have more than noissuescharge in fines.
218
        -
218
        -
219
            - pref: InProcessingToShelvingCart
220
              choices:
221
                  yes: Move
222
                  no: "Don't move"
223
            - items that have the location PROC to the location CART when they are checked in.
224
            - "<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."
225
        -
226
            - pref: ReturnToShelvingCart
227
              choices:
228
                  yes: Move
229
                  no: "Don't move"
230
            - all items to the location CART when they are checked in.
231
            - "<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."
232
        -
233
            - pref: AutomaticItemReturn
219
            - pref: AutomaticItemReturn
234
              choices:
220
              choices:
235
                  yes: Do
221
                  yes: Do
Lines 532-537 Circulation: Link Here
532
            - calculate and update overdue charges when an item is returned.
518
            - calculate and update overdue charges when an item is returned.
533
            - "<br /><strong>NOTE: If you are doing hourly loans then you should have this on.</strong>"
519
            - "<br /><strong>NOTE: If you are doing hourly loans then you should have this on.</strong>"
534
        -
520
        -
521
            - pref: UpdateItemLocationOnCheckin
522
              type: textarea
523
              class: code
524
            - This is is a list of value pairs, the first value is followed immediately by colon space then the second value i.e.:<br/>
525
            - "PROC: FIC"
526
            - <br/> When an item is checked in, if the location value on the left matches the items location value
527
            - "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."
528
            - <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.
529
            - <br/>Items in the CART location will be returned to their permanent location on checkout
530
            - <br/>You can use the special term _BLANK_ on either side of a pair to update/remove items with no location assigned
531
            - <br>You can use the special term _ALL_ on the left side to affect all items
532
            - and the special term _PERM_ on the right side to return items to their permanent location
533
            - <br>**Use of an _ALL_ rule will override/ignore any other values**
534
            - <br>Each pair of values should be on a separate line.
535
        -
535
            - pref: UpdateNotForLoanStatusOnCheckin
536
            - pref: UpdateNotForLoanStatusOnCheckin
536
              type: textarea
537
              type: textarea
537
              class: code
538
              class: code
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +29 lines)
Lines 536-541 Link Here
536
                    [% END %]
536
                    [% END %]
537
                </p>
537
                </p>
538
            [% END %]
538
            [% END %]
539
            [% IF ( errmsgloo.ItemLocationUpdated ) %]
540
                 <p class="problem">
541
                     Item shelving location updated.
542
                    <br />Old value:
543
                    [% IF errmsgloo.ItemLocationUpdated.from %]
544
                        [% IF errmsgloo.ItemLocationUpdated.from == '' %]
545
                            empty
546
                        [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) == '' %]
547
                            [% errmsgloo.ItemLocationUpdated.from | html %] (No description available)
548
                        [% ELSE %]
549
                            [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) | html %]
550
                        [% END %]
551
                    [% ELSE %]
552
                        "Blank"
553
                    [% END %]
554
                    <br />New value:
555
                    [% IF errmsgloo.ItemLocationUpdated.to %]
556
                        [% IF errmsgloo.ItemLocationUpdated.to == '' %]
557
                            empty
558
                        [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) == '' %]
559
                            [% errmsgloo.ItemLocationUpdated.to | html %] (Not an authorized value)
560
                        [% ELSE %]
561
                            [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) | html %]
562
                        [% END %]
563
                    [% ELSE %]
564
                        "Blank"
565
                    [% END %]
566
                 </p>
567
            [% END %]
539
            [% IF ( errmsgloo.badbarcode ) %]
568
            [% IF ( errmsgloo.badbarcode ) %]
540
                <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
569
                <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
541
            [% END %]
570
            [% END %]
Lines 554-560 Link Here
554
                [% ELSE %]
583
                [% ELSE %]
555
                    <p class="problem">Item was lost, now found.</p>
584
                    <p class="problem">Item was lost, now found.</p>
556
                [% END %]
585
                [% END %]
557
558
                [% IF LostItemFeeRefunded and not Koha.Preference('BlockReturnOfLostItems') %]
586
                [% IF LostItemFeeRefunded and not Koha.Preference('BlockReturnOfLostItems') %]
559
                    <p class="problem">A refund has been applied to the borrowing patron's account.</p>
587
                    <p class="problem">A refund has been applied to the borrowing patron's account.</p>
560
                [% ELSIF Koha.Preference('BlockReturnOfLostItems') %]
588
                [% 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 (-13 lines)
Lines 63-80 $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 = Koha::Items->find($itemnumber);
68
    if ( $item->location eq 'PROC' ) {
69
        ModItem( { location => 'CART' }, $item->biblionumber, $item->itemnumber );
70
    }
71
}
72
73
if ( C4::Context->preference("ReturnToShelvingCart") ) {
74
    my $item = Koha::Items->find($itemnumber);
75
    ModItem( { location => 'CART' }, $item->biblionumber, $item->itemnumber );
76
}
77
78
my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber });
66
my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber });
79
$data->{patronnote} = $checkout ? $checkout->note : q||;
67
$data->{patronnote} = $checkout ? $checkout->note : q||;
80
68
81
- 

Return to bug 14576