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

(-)a/C4/Circulation.pm (-16 / +33 lines)
Lines 1428-1435 sub AddIssue { Link Here
1428
                )->store;
1428
                )->store;
1429
            }
1429
            }
1430
1430
1431
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1431
            if ( $item_object->location eq 'CART' && $item_object->permanent_location ne 'CART'  ) {
1432
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1432
            ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1433
                CartToShelf( $item_object->itemnumber );
1433
                CartToShelf( $item_object->itemnumber );
1434
            }
1434
            }
1435
1435
Lines 1876-1892 sub AddReturn { Link Here
1876
    }
1876
    }
1877
1877
1878
    my $item_unblessed = $item->unblessed;
1878
    my $item_unblessed = $item->unblessed;
1879
    if ( $item->location eq 'PROC' ) {
1880
        if ( C4::Context->preference("InProcessingToShelvingCart") ) {
1881
            $item_unblessed->{location} = 'CART';
1882
        }
1883
        else {
1884
            $item_unblessed->{location} = $item->permanent_location;
1885
        }
1886
1887
        ModItem( $item_unblessed, $item->biblionumber, $item->itemnumber, { log_action => 0 } );
1888
    }
1889
1890
        # full item data, but no borrowernumber or checkout info (no issue)
1879
        # full item data, but no borrowernumber or checkout info (no issue)
1891
    my $hbr = GetBranchItemRule($item->homebranch, $itemtype)->{'returnbranch'} || "homebranch";
1880
    my $hbr = GetBranchItemRule($item->homebranch, $itemtype)->{'returnbranch'} || "homebranch";
1892
        # get the proper branch to which to return the item
1881
        # get the proper branch to which to return the item
Lines 1896-1901 sub AddReturn { Link Here
1896
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1885
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1897
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1886
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1898
1887
1888
    my $yaml_loc = C4::Context->preference('UpdateItemLocationOnCheckin');
1889
    if ($yaml_loc) {
1890
        $yaml_loc = "$yaml_loc\n\n";  # YAML is strict on ending \n. Surplus does not hurt
1891
        my $rules;
1892
        eval { $rules = YAML::Load($yaml_loc); };
1893
        if ($@) {
1894
            warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
1895
        }
1896
        else {
1897
            if (defined $rules->{_ALL_}) {
1898
                if ($rules->{_ALL_} eq '_PERM_') { $rules->{_ALL_} = $item->{permanent_location}; }
1899
                if ($rules->{_ALL_} eq '_BLANK_') { $rules->{_ALL_} = ''; }
1900
                if ( $item->{location} ne $rules->{_ALL_}) {
1901
                    $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{_ALL_} };
1902
                    ModItem( { location => $rules->{_ALL_} }, undef, $itemnumber );
1903
                }
1904
            }
1905
            else {
1906
                foreach my $key ( keys %$rules ) {
1907
                    if ( $rules->{$key} eq '_PERM_' ) { $rules->{$key} = $item->{permanent_location}; }
1908
                    if ( $rules->{$key} eq '_BLANK_') { $rules->{$key} = '' ;}
1909
                    if ( ($item->{location} eq $key && $item->{location} ne $rules->{$key}) || ($key eq '_BLANK_' && $item->{location} eq '' && $rules->{$key} ne '') ) {
1910
                        $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{$key} };
1911
                        ModItem( { location => $rules->{$key} }, undef, $itemnumber );
1912
                        last;
1913
                    }
1914
                }
1915
            }
1916
        }
1917
    }
1918
1899
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1919
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1900
    if ($yaml) {
1920
    if ($yaml) {
1901
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
1921
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
Lines 1987-2001 sub AddReturn { Link Here
1987
            );
2007
            );
1988
            $sth->execute( $item->itemnumber );
2008
            $sth->execute( $item->itemnumber );
1989
            # if we have a reservation with valid transfer, we can set it's status to 'W'
2009
            # if we have a reservation with valid transfer, we can set it's status to 'W'
1990
            ShelfToCart( $item->itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") );
1991
            C4::Reserves::ModReserveStatus($item->itemnumber, 'W');
2010
            C4::Reserves::ModReserveStatus($item->itemnumber, 'W');
1992
        } else {
2011
        } else {
1993
            $messages->{'WrongTransfer'}     = $tobranch;
2012
            $messages->{'WrongTransfer'}     = $tobranch;
1994
            $messages->{'WrongTransferItem'} = $item->itemnumber;
2013
            $messages->{'WrongTransferItem'} = $item->itemnumber;
1995
        }
2014
        }
1996
        $validTransfert = 1;
2015
        $validTransfert = 1;
1997
    } else {
1998
        ShelfToCart( $item->itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") );
1999
    }
2016
    }
2000
2017
2001
    # fix up the accounts.....
2018
    # 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 1029-1035 sub ModReserveStatus { Link Here
1029
    my $sth_set = $dbh->prepare($query);
1029
    my $sth_set = $dbh->prepare($query);
1030
    $sth_set->execute( $newstatus, $itemnumber );
1030
    $sth_set->execute( $newstatus, $itemnumber );
1031
1031
1032
    if ( C4::Context->preference("ReturnToShelvingCart") && $newstatus ) {
1032
    my $item = GetItem($itemnumber);
1033
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) && $newstatus ) {
1033
      CartToShelf( $itemnumber );
1034
      CartToShelf( $itemnumber );
1034
    }
1035
    }
1035
}
1036
}
Lines 1081-1089 sub ModReserveAffect { Link Here
1081
      if ( !$transferToDo && !$already_on_shelf );
1082
      if ( !$transferToDo && !$already_on_shelf );
1082
1083
1083
    _FixPriority( { biblionumber => $biblionumber } );
1084
    _FixPriority( { biblionumber => $biblionumber } );
1084
1085
    my $item = GetItem($itemnumber);
1085
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1086
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) ) {
1086
        CartToShelf($itemnumber);
1087
      CartToShelf( $itemnumber );
1087
    }
1088
    }
1088
1089
1089
    return;
1090
    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 234-240 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
234
('RecordedBooksLibraryID','','','Library ID for RecordedBooks integration','Integer'),
234
('RecordedBooksLibraryID','','','Library ID for RecordedBooks integration','Integer'),
235
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
235
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
236
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
236
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
237
('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'),
238
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
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'),
239
('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'),
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'),
240
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
239
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
Lines 510-516 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
510
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
509
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
511
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
510
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
512
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
511
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
513
('ReturnToShelvingCart','0','','If set, when any item is \'checked in\', it\'s location code will be changed to CART.','YesNo'),
514
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
512
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
515
('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'),
513
('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'),
516
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
514
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
Lines 613-618 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
613
('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'),
611
('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'),
614
('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'),
612
('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'),
615
('UnsubscribeReflectionDelay','',NULL,'Delay for locking unsubscribers', 'Integer'),
613
('UnsubscribeReflectionDelay','',NULL,'Delay for locking unsubscribers', 'Integer'),
614
('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'),
616
('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'),
615
('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'),
617
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
616
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
618
('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'),
617
('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 209-214 Link Here
209
        var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
209
        var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
210
        var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
210
        var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
211
        var MSG_LOADING = _( "Loading..." );
211
        var MSG_LOADING = _( "Loading..." );
212
        var MSG_ALL_VALUE_WARN = _("Note: _ALL_ value will override all other values");
213
        var MSG_UPD_LOC_FORMAT_WARN = _("The following values are not formatted correctly:");
212
    </script>
214
    </script>
213
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
215
    [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
214
    [% Asset.js("js/ajax.js") | $raw %]
216
    [% Asset.js("js/ajax.js") | $raw %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-14 / +15 lines)
Lines 222-241 Circulation: Link Here
222
                  no: "Don't allow"
222
                  no: "Don't allow"
223
            - staff to manually override and check out items to patrons who have more than noissuescharge in fines.
223
            - staff to manually override and check out items to patrons who have more than noissuescharge in fines.
224
        -
224
        -
225
            - pref: InProcessingToShelvingCart
226
              choices:
227
                  yes: Move
228
                  no: "Don't move"
229
            - items that have the location PROC to the location CART when they are checked in.
230
            - "<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."
231
        -
232
            - pref: ReturnToShelvingCart
233
              choices:
234
                  yes: Move
235
                  no: "Don't move"
236
            - all items to the location CART when they are checked in.
237
            - "<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."
238
        -
239
            - pref: AutomaticItemReturn
225
            - pref: AutomaticItemReturn
240
              choices:
226
              choices:
241
                  yes: Do
227
                  yes: Do
Lines 538-543 Circulation: Link Here
538
            - calculate and update overdue charges when an item is returned.
524
            - calculate and update overdue charges when an item is returned.
539
            - "<br /><strong>NOTE: If you are doing hourly loans then you should have this on.</strong>"
525
            - "<br /><strong>NOTE: If you are doing hourly loans then you should have this on.</strong>"
540
        -
526
        -
527
            - pref: UpdateItemLocationOnCheckin
528
              type: textarea
529
              class: code
530
            - This is is a list of value pairs, the first value is followed immediately by colon space then the second value i.e.:<br/>
531
            - "PROC: FIC"
532
            - <br/> When an item is checked in, if the location value on the left matches the items location value
533
            - "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."
534
            - <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.
535
            - <br/>Items in the CART location will be returned to their permanent location on checkout
536
            - <br/>You can use the special term _BLANK_ on either side of a pair to update/remove items with no location assigned
537
            - <br>You can use the special term _ALL_ on the left side to affect all items
538
            - and the special term _PERM_ on the right side to return items to their permanent location
539
            - <br>**Use of an _ALL_ rule will override/ignore any other values**
540
            - <br>Each pair of values should be on a separate line.
541
        -
541
            - pref: UpdateNotForLoanStatusOnCheckin
542
            - pref: UpdateNotForLoanStatusOnCheckin
542
              type: textarea
543
              type: textarea
543
              class: code
544
              class: code
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-1 / +29 lines)
Lines 577-582 Link Here
577
                    [% END %]
577
                    [% END %]
578
                </p>
578
                </p>
579
            [% END %]
579
            [% END %]
580
            [% IF ( errmsgloo.ItemLocationUpdated ) %]
581
                 <p class="problem">
582
                     Item shelving location updated.
583
                    <br />Old value:
584
                    [% IF errmsgloo.ItemLocationUpdated.from %]
585
                        [% IF errmsgloo.ItemLocationUpdated.from == '' %]
586
                            empty
587
                        [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) == '' %]
588
                            [% errmsgloo.ItemLocationUpdated.from | html %] (No description available)
589
                        [% ELSE %]
590
                            [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) | html %]
591
                        [% END %]
592
                    [% ELSE %]
593
                        "Blank"
594
                    [% END %]
595
                    <br />New value:
596
                    [% IF errmsgloo.ItemLocationUpdated.to %]
597
                        [% IF errmsgloo.ItemLocationUpdated.to == '' %]
598
                            empty
599
                        [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) == '' %]
600
                            [% errmsgloo.ItemLocationUpdated.to | html %] (Not an authorized value)
601
                        [% ELSE %]
602
                            [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) | html %]
603
                        [% END %]
604
                    [% ELSE %]
605
                        "Blank"
606
                    [% END %]
607
                 </p>
608
            [% END %]
580
            [% IF ( errmsgloo.badbarcode ) %]
609
            [% IF ( errmsgloo.badbarcode ) %]
581
                <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
610
                <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
582
            [% END %]
611
            [% END %]
Lines 595-601 Link Here
595
                [% ELSE %]
624
                [% ELSE %]
596
                    <p class="problem">Item was lost, now found.</p>
625
                    <p class="problem">Item was lost, now found.</p>
597
                [% END %]
626
                [% END %]
598
599
                [% IF LostItemFeeRefunded and not Koha.Preference('BlockReturnOfLostItems') %]
627
                [% IF LostItemFeeRefunded and not Koha.Preference('BlockReturnOfLostItems') %]
600
                    <p class="problem">A refund has been applied to the borrowing patron's account.</p>
628
                    <p class="problem">A refund has been applied to the borrowing patron's account.</p>
601
                [% ELSIF Koha.Preference('BlockReturnOfLostItems') %]
629
                [% ELSIF Koha.Preference('BlockReturnOfLostItems') %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js (+19 lines)
Lines 162-165 $( document ).ready( function () { Link Here
162
    if ( search_jumped ) {
162
    if ( search_jumped ) {
163
        document.location.hash = "jumped";
163
        document.location.hash = "jumped";
164
    }
164
    }
165
166
    $("#pref_UpdateItemLocationOnCheckin").change(function(){
167
        var the_text = $(this).val();
168
        var alert_text = '';
169
        if ( the_text.indexOf('_ALL_:') != -1 ) alert_text = MSG_ALL_VALUE_WARN + '\n';
170
        var split_text  =the_text.split("\n");
171
        var alert_issues = '';
172
        var issue_count = 0;
173
        var reg_check = /.*:\s.*/;
174
        for (var i=0; i < split_text.length; i++){
175
            if ( !split_text[i].match(reg_check) && split_text[i].length ) {
176
                alert_issues+=split_text[i]+"\n";
177
                issue_count++;
178
            }
179
        }
180
        if (issue_count) alert_text += "\n"+ MSG_UPD_LOC_FORMAT_WARN  +"\n"+alert_issues;
181
        if ( alert_text.length )  alert(alert_text);
182
    });
183
165
} );
184
} );
(-)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