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

(-)a/C4/Circulation.pm (-16 / +34 lines)
Lines 1366-1375 sub AddIssue { Link Here
1366
                }
1366
                }
1367
              );
1367
              );
1368
1368
1369
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1369
            if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) {
1370
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1370
            ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1371
                CartToShelf( $item->{'itemnumber'} );
1371
                CartToShelf( $item->{'itemnumber'} );
1372
            }
1372
            }
1373
1373
            $item->{'issues'}++;
1374
            $item->{'issues'}++;
1374
            if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
1375
            if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
1375
                UpdateTotalIssues( $item->{'biblionumber'}, 1 );
1376
                UpdateTotalIssues( $item->{'biblionumber'}, 1 );
Lines 1828-1844 sub AddReturn { Link Here
1828
        }
1829
        }
1829
    }
1830
    }
1830
1831
1831
    if ( $item->{'location'} eq 'PROC' ) {
1832
        if ( C4::Context->preference("InProcessingToShelvingCart") ) {
1833
            $item->{'location'} = 'CART';
1834
        }
1835
        else {
1836
            $item->{location} = $item->{permanent_location};
1837
        }
1838
1839
        ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'}, { log_action => 0 } );
1840
    }
1841
1842
        # full item data, but no borrowernumber or checkout info (no issue)
1832
        # full item data, but no borrowernumber or checkout info (no issue)
1843
    my $hbr = GetBranchItemRule($item->{'homebranch'}, $item->{'itype'})->{'returnbranch'} || "homebranch";
1833
    my $hbr = GetBranchItemRule($item->{'homebranch'}, $item->{'itype'})->{'returnbranch'} || "homebranch";
1844
        # get the proper branch to which to return the item
1834
        # get the proper branch to which to return the item
Lines 1848-1853 sub AddReturn { Link Here
1848
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1838
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1849
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1839
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1850
1840
1841
    my $yaml_loc = C4::Context->preference('UpdateItemLocationOnCheckin');
1842
    if ($yaml_loc) {
1843
        $yaml_loc = "$yaml_loc\n\n";  # YAML is strict on ending \n. Surplus does not hurt
1844
        my $rules;
1845
        eval { $rules = YAML::Load($yaml_loc); };
1846
        if ($@) {
1847
            warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
1848
        }
1849
        else {
1850
            if (defined $rules->{_ALL_}) {
1851
                if ($rules->{_ALL_} eq '_PERM_') { $rules->{_ALL_} = $item->{permanent_location}; }
1852
                if ($rules->{_ALL_} eq '_BLANK_') { $rules->{_ALL_} = ''; }
1853
                if ( $item->{location} ne $rules->{_ALL_}) {
1854
                    $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{_ALL_} };
1855
                    ModItem( { location => $rules->{_ALL_} }, undef, $itemnumber );
1856
                }
1857
            }
1858
            else {
1859
                foreach my $key ( keys %$rules ) {
1860
                    if ( $rules->{$key} eq '_PERM_' ) { $rules->{$key} = $item->{permanent_location}; }
1861
                    if ( $rules->{$key} eq '_BLANK_') { $rules->{$key} = '' ;}
1862
                    if ( ($item->{location} eq $key && $item->{location} ne $rules->{$key}) || ($key eq '_BLANK_' && $item->{location} eq '' && $rules->{$key} ne '') ) {
1863
                        $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{$key} };
1864
                        ModItem( { location => $rules->{$key} }, undef, $itemnumber );
1865
                        last;
1866
                    }
1867
                }
1868
            }
1869
        }
1870
    }
1871
1851
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1872
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1852
    if ($yaml) {
1873
    if ($yaml) {
1853
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
1874
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
Lines 1952-1966 sub AddReturn { Link Here
1952
            );
1973
            );
1953
            $sth->execute( $item->{'itemnumber'} );
1974
            $sth->execute( $item->{'itemnumber'} );
1954
            # if we have a reservation with valid transfer, we can set it's status to 'W'
1975
            # if we have a reservation with valid transfer, we can set it's status to 'W'
1955
            ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") );
1956
            C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W');
1976
            C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W');
1957
        } else {
1977
        } else {
1958
            $messages->{'WrongTransfer'}     = $tobranch;
1978
            $messages->{'WrongTransfer'}     = $tobranch;
1959
            $messages->{'WrongTransferItem'} = $item->{'itemnumber'};
1979
            $messages->{'WrongTransferItem'} = $item->{'itemnumber'};
1960
        }
1980
        }
1961
        $validTransfert = 1;
1981
        $validTransfert = 1;
1962
    } else {
1963
        ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") );
1964
    }
1982
    }
1965
1983
1966
    # fix up the accounts.....
1984
    # fix up the accounts.....
(-)a/C4/Items.pm (-23 / +2 lines)
Lines 80-86 BEGIN { Link Here
80
    GetLatestAcquisitions
80
    GetLatestAcquisitions
81
81
82
        CartToShelf
82
        CartToShelf
83
        ShelfToCart
84
83
85
	GetAnalyticsCount
84
	GetAnalyticsCount
86
85
Lines 195-221 sub CartToShelf { Link Here
195
    }
194
    }
196
}
195
}
197
196
198
=head2 ShelfToCart
199
200
  ShelfToCart($itemnumber);
201
202
Set the current shelving location of the item
203
to shelving cart ('CART').
204
205
=cut
206
207
sub ShelfToCart {
208
    my ( $itemnumber ) = @_;
209
210
    unless ( $itemnumber ) {
211
        croak "FAILED ShelfToCart() - no itemnumber supplied";
212
    }
213
214
    my $item = GetItem($itemnumber);
215
    $item->{'location'} = 'CART';
216
    ModItem($item, undef, $itemnumber);
217
}
218
219
=head2 AddItemFromMarc
197
=head2 AddItemFromMarc
220
198
221
  my ($biblionumber, $biblioitemnumber, $itemnumber) 
199
  my ($biblionumber, $biblioitemnumber, $itemnumber) 
Lines 622-630 sub ModItemTransfer { Link Here
622
    my ( $itemnumber, $frombranch, $tobranch ) = @_;
600
    my ( $itemnumber, $frombranch, $tobranch ) = @_;
623
601
624
    my $dbh = C4::Context->dbh;
602
    my $dbh = C4::Context->dbh;
603
    my $item = GetItem( $itemnumber );
625
604
626
    # Remove the 'shelving cart' location status if it is being used.
605
    # Remove the 'shelving cart' location status if it is being used.
627
    CartToShelf( $itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") );
606
    CartToShelf( $itemnumber ) if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART' );
628
607
629
    $dbh->do("UPDATE branchtransfers SET datearrived = NOW(), comments = ? WHERE itemnumber = ? AND datearrived IS NULL", undef, "Canceled, new transfer from $frombranch to $tobranch created", $itemnumber);
608
    $dbh->do("UPDATE branchtransfers SET datearrived = NOW(), comments = ? WHERE itemnumber = ? AND datearrived IS NULL", undef, "Canceled, new transfer from $frombranch to $tobranch created", $itemnumber);
630
609
(-)a/C4/Reserves.pm (-4 / +5 lines)
Lines 1008-1014 sub ModReserveStatus { Link Here
1008
    my $sth_set = $dbh->prepare($query);
1008
    my $sth_set = $dbh->prepare($query);
1009
    $sth_set->execute( $newstatus, $itemnumber );
1009
    $sth_set->execute( $newstatus, $itemnumber );
1010
1010
1011
    if ( C4::Context->preference("ReturnToShelvingCart") && $newstatus ) {
1011
    my $item = GetItem($itemnumber);
1012
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) && $newstatus ) {
1012
      CartToShelf( $itemnumber );
1013
      CartToShelf( $itemnumber );
1013
    }
1014
    }
1014
}
1015
}
Lines 1060-1068 sub ModReserveAffect { Link Here
1060
      if ( !$transferToDo && !$already_on_shelf );
1061
      if ( !$transferToDo && !$already_on_shelf );
1061
1062
1062
    _FixPriority( { biblionumber => $biblionumber } );
1063
    _FixPriority( { biblionumber => $biblionumber } );
1063
1064
    my $item = GetItem($itemnumber);
1064
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1065
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) ) {
1065
        CartToShelf($itemnumber);
1066
      CartToShelf( $itemnumber );
1066
    }
1067
    }
1067
1068
1068
    return;
1069
    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 223-229 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
223
('RecordedBooksLibraryID','','','Library ID for RecordedBooks integration','Integer'),
223
('RecordedBooksLibraryID','','','Library ID for RecordedBooks integration','Integer'),
224
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
224
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
225
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
225
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
226
('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'),
227
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
226
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
228
('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'),
227
('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'),
229
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
228
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
Lines 481-487 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
481
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
480
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
482
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
481
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
483
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
482
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
484
('ReturnToShelvingCart','0','','If set, when any item is \'checked in\', it\'s location code will be changed to CART.','YesNo'),
485
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
483
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
486
('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'),
484
('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'),
487
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
485
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
Lines 580-585 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
580
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
578
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
581
('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'),
579
('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'),
582
('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'),
580
('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'),
581
('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'),
583
('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'),
582
('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'),
584
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
583
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
585
('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'),
584
('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 (-12 / +15 lines)
Lines 208-225 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
        -
217
            - pref: ReturnToShelvingCart
218
              choices:
219
                  yes: Move
220
                  no: "Don't move"
221
            - all items to the location CART when they are checked in.
222
        -
223
            - pref: AutomaticItemReturn
211
            - pref: AutomaticItemReturn
224
              choices:
212
              choices:
225
                  yes: Do
213
                  yes: Do
Lines 509-514 Circulation: Link Here
509
            - calculate and update overdue charges when an item is returned.
497
            - calculate and update overdue charges when an item is returned.
510
            - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
498
            - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
511
        -
499
        -
500
            - pref: UpdateItemLocationOnCheckin
501
              type: textarea
502
              class: code
503
            - This is is a list of value pairs, the first value is followed immediately by colon space then the second value i.e.:<br/>
504
            - "PROC: FIC"
505
            - <br/> When an item is checked in, if the location value on the left matches the items location value
506
            - "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."
507
            - <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.
508
            - <br/>Items in the CART location will be returned to their permanent location on checkout
509
            - <br/>You can use the special term _BLANK_ on either side of a pair to update/remove items with no location assigned
510
            - <br>You can use the special term _ALL_ on the left side to affect all items
511
            - and the special term _PERM_ on the right side to return items to their permanent location
512
            - <br>**Use of an _ALL_ rule will override/ignore any other values**
513
            - <br>Each pair of values should be on a separate line.
514
        -
512
            - pref: UpdateNotForLoanStatusOnCheckin
515
            - pref: UpdateNotForLoanStatusOnCheckin
513
              type: textarea
516
              type: textarea
514
              class: code
517
              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