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

(-)a/C4/Circulation.pm (-16 / +33 lines)
Lines 1380-1387 sub AddIssue { Link Here
1380
                )->store;
1380
                )->store;
1381
            }
1381
            }
1382
1382
1383
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1383
            if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) {
1384
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1384
            ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1385
                CartToShelf( $item->itemnumber );
1385
                CartToShelf( $item->itemnumber );
1386
            }
1386
            }
1387
1387
Lines 1842-1858 sub AddReturn { Link Here
1842
    }
1842
    }
1843
1843
1844
    my $item_unblessed = $item->unblessed;
1844
    my $item_unblessed = $item->unblessed;
1845
    if ( $item->location eq 'PROC' ) {
1846
        if ( C4::Context->preference("InProcessingToShelvingCart") ) {
1847
            $item_unblessed->{location} = 'CART';
1848
        }
1849
        else {
1850
            $item_unblessed->{location} = $item->permanent_location;
1851
        }
1852
1853
        ModItem( $item_unblessed, $item->biblionumber, $item->itemnumber, { log_action => 0 } );
1854
    }
1855
1856
        # full item data, but no borrowernumber or checkout info (no issue)
1845
        # full item data, but no borrowernumber or checkout info (no issue)
1857
    my $hbr = GetBranchItemRule($item->homebranch, $itemtype)->{'returnbranch'} || "homebranch";
1846
    my $hbr = GetBranchItemRule($item->homebranch, $itemtype)->{'returnbranch'} || "homebranch";
1858
        # get the proper branch to which to return the item
1847
        # get the proper branch to which to return the item
Lines 1862-1867 sub AddReturn { Link Here
1862
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1851
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1863
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1852
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1864
1853
1854
    my $yaml_loc = C4::Context->preference('UpdateItemLocationOnCheckin');
1855
    if ($yaml_loc) {
1856
        $yaml_loc = "$yaml_loc\n\n";  # YAML is strict on ending \n. Surplus does not hurt
1857
        my $rules;
1858
        eval { $rules = YAML::Load($yaml_loc); };
1859
        if ($@) {
1860
            warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
1861
        }
1862
        else {
1863
            if (defined $rules->{_ALL_}) {
1864
                if ($rules->{_ALL_} eq '_PERM_') { $rules->{_ALL_} = $item->{permanent_location}; }
1865
                if ($rules->{_ALL_} eq '_BLANK_') { $rules->{_ALL_} = ''; }
1866
                if ( $item->{location} ne $rules->{_ALL_}) {
1867
                    $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{_ALL_} };
1868
                    ModItem( { location => $rules->{_ALL_} }, undef, $itemnumber );
1869
                }
1870
            }
1871
            else {
1872
                foreach my $key ( keys %$rules ) {
1873
                    if ( $rules->{$key} eq '_PERM_' ) { $rules->{$key} = $item->{permanent_location}; }
1874
                    if ( $rules->{$key} eq '_BLANK_') { $rules->{$key} = '' ;}
1875
                    if ( ($item->{location} eq $key && $item->{location} ne $rules->{$key}) || ($key eq '_BLANK_' && $item->{location} eq '' && $rules->{$key} ne '') ) {
1876
                        $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{$key} };
1877
                        ModItem( { location => $rules->{$key} }, undef, $itemnumber );
1878
                        last;
1879
                    }
1880
                }
1881
            }
1882
        }
1883
    }
1884
1865
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1885
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1866
    if ($yaml) {
1886
    if ($yaml) {
1867
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
1887
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
Lines 1966-1980 sub AddReturn { Link Here
1966
            );
1986
            );
1967
            $sth->execute( $item->itemnumber );
1987
            $sth->execute( $item->itemnumber );
1968
            # if we have a reservation with valid transfer, we can set it's status to 'W'
1988
            # if we have a reservation with valid transfer, we can set it's status to 'W'
1969
            ShelfToCart( $item->itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") );
1970
            C4::Reserves::ModReserveStatus($item->itemnumber, 'W');
1989
            C4::Reserves::ModReserveStatus($item->itemnumber, 'W');
1971
        } else {
1990
        } else {
1972
            $messages->{'WrongTransfer'}     = $tobranch;
1991
            $messages->{'WrongTransfer'}     = $tobranch;
1973
            $messages->{'WrongTransferItem'} = $item->itemnumber;
1992
            $messages->{'WrongTransferItem'} = $item->itemnumber;
1974
        }
1993
        }
1975
        $validTransfert = 1;
1994
        $validTransfert = 1;
1976
    } else {
1977
        ShelfToCart( $item->itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") );
1978
    }
1995
    }
1979
1996
1980
    # fix up the accounts.....
1997
    # 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 1034-1040 sub ModReserveStatus { Link Here
1034
    my $sth_set = $dbh->prepare($query);
1034
    my $sth_set = $dbh->prepare($query);
1035
    $sth_set->execute( $newstatus, $itemnumber );
1035
    $sth_set->execute( $newstatus, $itemnumber );
1036
1036
1037
    if ( C4::Context->preference("ReturnToShelvingCart") && $newstatus ) {
1037
    my $item = GetItem($itemnumber);
1038
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) && $newstatus ) {
1038
      CartToShelf( $itemnumber );
1039
      CartToShelf( $itemnumber );
1039
    }
1040
    }
1040
}
1041
}
Lines 1086-1094 sub ModReserveAffect { Link Here
1086
      if ( !$transferToDo && !$already_on_shelf );
1087
      if ( !$transferToDo && !$already_on_shelf );
1087
1088
1088
    _FixPriority( { biblionumber => $biblionumber } );
1089
    _FixPriority( { biblionumber => $biblionumber } );
1089
1090
    my $item = GetItem($itemnumber);
1090
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1091
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) ) {
1091
        CartToShelf($itemnumber);
1092
      CartToShelf( $itemnumber );
1092
    }
1093
    }
1093
1094
1094
    return;
1095
    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.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 230-236 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
230
('RecordedBooksLibraryID','','','Library ID for RecordedBooks integration','Integer'),
230
('RecordedBooksLibraryID','','','Library ID for RecordedBooks integration','Integer'),
231
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
231
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
232
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
232
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
233
('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'),
234
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
233
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
235
('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'),
234
('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'),
236
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
235
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
Lines 499-505 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
499
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
498
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
500
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
499
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
501
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
500
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
502
('ReturnToShelvingCart','0','','If set, when any item is \'checked in\', it\'s location code will be changed to CART.','YesNo'),
503
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
501
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
504
('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'),
502
('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
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
503
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
Lines 601-606 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
601
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
599
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
602
('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'),
600
('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
('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'),
601
('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'),
602
('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'),
604
('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'),
603
('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'),
605
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
604
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
606
('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'),
605
('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