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

(-)a/C4/Circulation.pm (-15 / +35 lines)
Lines 1383-1392 sub AddIssue { Link Here
1383
                }
1383
                }
1384
              );
1384
              );
1385
1385
1386
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1386
            if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) {
1387
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1387
            ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1388
                CartToShelf( $item->{'itemnumber'} );
1388
                CartToShelf( $item->{'itemnumber'} );
1389
            }
1389
            }
1390
1390
            $item->{'issues'}++;
1391
            $item->{'issues'}++;
1391
            if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
1392
            if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
1392
                UpdateTotalIssues( $item->{'biblionumber'}, 1 );
1393
                UpdateTotalIssues( $item->{'biblionumber'}, 1 );
Lines 1849-1864 sub AddReturn { Link Here
1849
        }
1850
        }
1850
    }
1851
    }
1851
1852
1852
    if ( $item->{'location'} eq 'PROC' ) {
1853
    my $item = GetItem($itemnumber) or die "GetItem($itemnumber) failed";
1853
        if ( C4::Context->preference("InProcessingToShelvingCart") ) {
1854
            $item->{'location'} = 'CART';
1855
        }
1856
        else {
1857
            $item->{location} = $item->{permanent_location};
1858
        }
1859
1860
        ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
1861
    }
1862
1854
1863
        # full item data, but no borrowernumber or checkout info (no issue)
1855
        # full item data, but no borrowernumber or checkout info (no issue)
1864
    my $hbr = GetBranchItemRule($item->{'homebranch'}, $item->{'itype'})->{'returnbranch'} || "homebranch";
1856
    my $hbr = GetBranchItemRule($item->{'homebranch'}, $item->{'itype'})->{'returnbranch'} || "homebranch";
Lines 1869-1874 sub AddReturn { Link Here
1869
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1861
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1870
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1862
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1871
1863
1864
    my $yaml_loc = C4::Context->preference('UpdateItemLocationOnCheckin');
1865
    if ($yaml_loc) {
1866
        $yaml_loc = "$yaml_loc\n\n";  # YAML is strict on ending \n. Surplus does not hurt
1867
        my $rules;
1868
        eval { $rules = YAML::Load($yaml_loc); };
1869
        if ($@) {
1870
            warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
1871
        }
1872
        else {
1873
            if (defined $rules->{_ALL_}) {
1874
                if ($rules->{_ALL_} eq '_PERM_') { $rules->{_ALL_} = $item->{permanent_location}; }
1875
                if ($rules->{_ALL_} eq '_BLANK_') { $rules->{_ALL_} = ''; }
1876
                if ( $item->{location} ne $rules->{_ALL_}) {
1877
                    $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{_ALL_} };
1878
                    ModItem( { location => $rules->{_ALL_} }, undef, $itemnumber );
1879
                }
1880
            }
1881
            else {
1882
                foreach my $key ( keys %$rules ) {
1883
                    if ( $rules->{$key} eq '_PERM_' ) { $rules->{$key} = $item->{permanent_location}; }
1884
                    if ( $rules->{$key} eq '_BLANK_') { $rules->{$key} = '' ;}
1885
                    if ( ($item->{location} eq $key && $item->{location} ne $rules->{$key}) || ($key eq '_BLANK_' && $item->{location} eq '' && $rules->{$key} ne '') ) {
1886
                        $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{$key} };
1887
                        ModItem( { location => $rules->{$key} }, undef, $itemnumber );
1888
                        last;
1889
                    }
1890
                }
1891
            }
1892
        }
1893
    }
1894
1872
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1895
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1873
    if ($yaml) {
1896
    if ($yaml) {
1874
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
1897
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
Lines 1981-1995 sub AddReturn { Link Here
1981
            );
2004
            );
1982
            $sth->execute( $item->{'itemnumber'} );
2005
            $sth->execute( $item->{'itemnumber'} );
1983
            # if we have a reservation with valid transfer, we can set it's status to 'W'
2006
            # if we have a reservation with valid transfer, we can set it's status to 'W'
1984
            ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") );
1985
            C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W');
2007
            C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W');
1986
        } else {
2008
        } else {
1987
            $messages->{'WrongTransfer'}     = $tobranch;
2009
            $messages->{'WrongTransfer'}     = $tobranch;
1988
            $messages->{'WrongTransferItem'} = $item->{'itemnumber'};
2010
            $messages->{'WrongTransferItem'} = $item->{'itemnumber'};
1989
        }
2011
        }
1990
        $validTransfert = 1;
2012
        $validTransfert = 1;
1991
    } else {
1992
        ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") );
1993
    }
2013
    }
1994
2014
1995
    # fix up the accounts.....
2015
    # fix up the accounts.....
(-)a/C4/Items.pm (-23 / +2 lines)
Lines 84-90 BEGIN { Link Here
84
    GetLatestAcquisitions
84
    GetLatestAcquisitions
85
85
86
        CartToShelf
86
        CartToShelf
87
        ShelfToCart
88
87
89
	GetAnalyticsCount
88
	GetAnalyticsCount
90
89
Lines 199-225 sub CartToShelf { Link Here
199
    }
198
    }
200
}
199
}
201
200
202
=head2 ShelfToCart
203
204
  ShelfToCart($itemnumber);
205
206
Set the current shelving location of the item
207
to shelving cart ('CART').
208
209
=cut
210
211
sub ShelfToCart {
212
    my ( $itemnumber ) = @_;
213
214
    unless ( $itemnumber ) {
215
        croak "FAILED ShelfToCart() - no itemnumber supplied";
216
    }
217
218
    my $item = GetItem($itemnumber);
219
    $item->{'location'} = 'CART';
220
    ModItem($item, undef, $itemnumber);
221
}
222
223
=head2 AddItemFromMarc
201
=head2 AddItemFromMarc
224
202
225
  my ($biblionumber, $biblioitemnumber, $itemnumber) 
203
  my ($biblionumber, $biblioitemnumber, $itemnumber) 
Lines 618-626 sub ModItemTransfer { Link Here
618
    my ( $itemnumber, $frombranch, $tobranch ) = @_;
596
    my ( $itemnumber, $frombranch, $tobranch ) = @_;
619
597
620
    my $dbh = C4::Context->dbh;
598
    my $dbh = C4::Context->dbh;
599
    my $item = GetItem( $itemnumber );
621
600
622
    # Remove the 'shelving cart' location status if it is being used.
601
    # Remove the 'shelving cart' location status if it is being used.
623
    CartToShelf( $itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") );
602
    CartToShelf( $itemnumber ) if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART' );
624
603
625
    #new entry in branchtransfers....
604
    #new entry in branchtransfers....
626
    my $sth = $dbh->prepare(
605
    my $sth = $dbh->prepare(
(-)a/C4/Reserves.pm (-4 / +5 lines)
Lines 960-966 sub ModReserveStatus { Link Here
960
    my $sth_set = $dbh->prepare($query);
960
    my $sth_set = $dbh->prepare($query);
961
    $sth_set->execute( $newstatus, $itemnumber );
961
    $sth_set->execute( $newstatus, $itemnumber );
962
962
963
    if ( C4::Context->preference("ReturnToShelvingCart") && $newstatus ) {
963
    my $item = GetItem($itemnumber);
964
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) && $newstatus ) {
964
      CartToShelf( $itemnumber );
965
      CartToShelf( $itemnumber );
965
    }
966
    }
966
}
967
}
Lines 1012-1020 sub ModReserveAffect { Link Here
1012
      if ( !$transferToDo && !$already_on_shelf );
1013
      if ( !$transferToDo && !$already_on_shelf );
1013
1014
1014
    _FixPriority( { biblionumber => $biblionumber } );
1015
    _FixPriority( { biblionumber => $biblionumber } );
1015
1016
    my $item = GetItem($itemnumber);
1016
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1017
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) ) {
1017
        CartToShelf($itemnumber);
1018
      CartToShelf( $itemnumber );
1018
    }
1019
    }
1019
1020
1020
    return;
1021
    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 548-553 foreach my $code ( keys %$messages ) { Link Here
548
    elsif ( $code eq 'ForeverDebarred' ) {
548
    elsif ( $code eq 'ForeverDebarred' ) {
549
        $err{foreverdebarred}        = $messages->{'ForeverDebarred'};
549
        $err{foreverdebarred}        = $messages->{'ForeverDebarred'};
550
    }
550
    }
551
    elsif ( $code eq 'ItemLocationUpdated' ) {
552
        $err{ItemLocationUpdated} = $messages->{ItemLocationUpdated};
553
    }
551
    elsif ( $code eq 'NotForLoanStatusUpdated' ) {
554
    elsif ( $code eq 'NotForLoanStatusUpdated' ) {
552
        $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated};
555
        $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated};
553
    }
556
    }
(-)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 211-217 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
211
('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'),
211
('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'),
212
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
212
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
213
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
213
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
214
('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'),
215
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
214
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
216
('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'),
215
('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'),
217
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
216
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
Lines 467-473 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
467
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
466
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
468
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
467
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
469
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
468
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
470
('ReturnToShelvingCart','0','','If set, when any item is \'checked in\', it\'s location code will be changed to CART.','YesNo'),
471
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
469
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
472
('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'),
470
('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'),
473
('RoutingListAddReserves','1','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
471
('RoutingListAddReserves','1','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
Lines 559-564 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
559
('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'),
557
('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'),
560
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
558
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
561
('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'),
559
('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'),
560
('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'),
562
('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'),
561
('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'),
563
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
562
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
564
('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'),
563
('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 186-191 Link Here
186
        var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
186
        var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
187
        var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
187
        var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
188
        var MSG_LOADING = _( "Loading..." );
188
        var MSG_LOADING = _( "Loading..." );
189
        var MSG_ALL_VALUE_WARN = _("Note: _ALL_ value will override all other values");
190
        var MSG_UPD_LOC_FORMAT_WARN = _("The following values are not formatted correctly:");
189
    </script>
191
    </script>
190
    <script src="[% interface %]/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
192
    <script src="[% interface %]/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
191
    <script src="[% interface %]/[% theme %]/js/ajax.js" type="text/javascript"></script>
193
    <script src="[% interface %]/[% theme %]/js/ajax.js" type="text/javascript"></script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-12 / +15 lines)
Lines 201-218 Circulation: Link Here
201
                  no: "Don't allow"
201
                  no: "Don't allow"
202
            - staff to manually override and check out items to patrons who have more than noissuescharge in fines.
202
            - staff to manually override and check out items to patrons who have more than noissuescharge in fines.
203
        -
203
        -
204
            - pref: InProcessingToShelvingCart
205
              choices:
206
                  yes: Move
207
                  no: "Don't move"
208
            - items that have the location PROC to the location CART when they are checked in.
209
        -
210
            - pref: ReturnToShelvingCart
211
              choices:
212
                  yes: Move
213
                  no: "Don't move"
214
            - all items to the location CART when they are checked in.
215
        -
216
            - pref: AutomaticItemReturn
204
            - pref: AutomaticItemReturn
217
              choices:
205
              choices:
218
                  yes: Do
206
                  yes: Do
Lines 486-491 Circulation: Link Here
486
            - calculate and update overdue charges when an item is returned.
474
            - calculate and update overdue charges when an item is returned.
487
            - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
475
            - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
488
        -
476
        -
477
            - pref: UpdateItemLocationOnCheckin
478
              type: textarea
479
              class: code
480
            - This is is a list of value pairs, the first value is followed immediately by colon space then the second value i.e.:<br/>
481
            - "PROC: FIC"
482
            - <br/> When an item is checked in, if the location value on the left matches the items location value
483
            - "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."
484
            - <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.
485
            - <br/>Items in the CART location will be returned to their permanent location on checkout
486
            - <br/>You can use the special term _BLANK_ on either side of a pair to update/remove items with no location assigned
487
            - <br>You can use the special term _ALL_ on the left side to affect all items
488
            - and the special term _PERM_ on the right side to return items to their permanent location
489
            - <br>**Use of an _ALL_ rule will override/ignore any other values**
490
            - <br>Each pair of values should be on a separate line.
491
        -
489
            - pref: UpdateNotForLoanStatusOnCheckin
492
            - pref: UpdateNotForLoanStatusOnCheckin
490
              type: textarea
493
              type: textarea
491
              class: code
494
              class: code
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-13 / +76 lines)
Lines 468-486 Link Here
468
            [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
468
            [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
469
                <p class="problem">
469
                <p class="problem">
470
                    Not for loan status updated.
470
                    Not for loan status updated.
471
                    <br />Old value:
471
                <br />Old value:
472
                    [% IF errmsgloo.NotForLoanStatusUpdated.from %]
472
                 [% IF errmsgloo.NotForLoanStatusUpdated.from %]
473
                        [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) %].
473
                     [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) %].
474
                    [% ELSE %]
474
                 [% ELSE %]
475
                        Available for loan.
475
                     Available for loan.
476
                    [% END %]
476
                 [% END %]
477
                    <br />New value:
477
                     <br />New value:
478
                    [% IF errmsgloo.NotForLoanStatusUpdated.to %]
478
                 [% IF errmsgloo.NotForLoanStatusUpdated.to %]
479
                        [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) %].
479
                     [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) %].
480
                    [% ELSE %]
480
                 [% ELSE %]
481
                        Available for loan.
481
                     Available for loan.
482
                    [% END %]
482
                 [% END %]
483
                </p>
483
                     </p>
484
            [% END %]
485
            [% IF ( errmsgloo.ItemLocationUpdated ) %]
486
                 <p class="problem">
487
                     Item shelving location updated from
488
                 [% IF errmsgloo.ItemLocationUpdated.from %]
489
                     [% IF errmsgloo.ItemLocationUpdated.from == '' %]
490
                         empty
491
                     [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) == '' %]
492
                         [% errmsgloo.ItemLocationUpdated.from %] (No description available)
493
                     [% ELSE %]
494
                         [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) %]
495
                     [% END %]
496
                 [% ELSE %]
497
                     "Blank"
498
                 [% END %]
499
                 to
500
                 [% IF errmsgloo.ItemLocationUpdated.to %]
501
                     [% IF errmsgloo.ItemLocationUpdated.to == '' %]
502
                         empty
503
                     [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) == '' %]
504
                         [% errmsgloo.ItemLocationUpdated.to %] (Not an authorized value)
505
                     [% ELSE %]
506
                         [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) %]
507
                     [% END %]
508
                 [% ELSE %]
509
                     "Blank"
510
                 [% END %]
511
                 </p>
512
            [% END %]
513
            [% IF ( errmsgloo.badbarcode ) %]
514
                <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
515
            [% END %]
516
            [% IF ( errmsgloo.ispermanent ) %]
517
                <p class="problem">Please return item to: [% Branches.GetName( errmsgloo.msg ) %]</p>
518
            [% END %]
519
            [% IF ( errmsgloo.notissued ) %]
520
                <p class="problem">Not checked out.</p>
521
            [% END %]
522
            [% IF ( errmsgloo.localuse) %]
523
                <p class="problem">Local use recorded</p>
524
            [% END %]
525
            [% IF ( errmsgloo.waslost ) %]
526
                <p class="problem">Item was lost, now found.</p>
527
                [% IF ( LostItemFeeRefunded ) %]
528
                    <p class="problem">A refund has been applied to the borrowing patron's account.</p>
529
                [% ELSE %]
530
                    <p class="problem">Any lost item fees for this item will remain on the patron's account.</p>
531
                [% END %]
532
            [% END %]
533
            [% IF ( errmsgloo.withdrawn ) %]
534
                [% IF BlockReturnOfWithdrawnItems %]
535
                    <h5>Cannot check in</h5>
536
                    <p><strong>NOT CHECKED IN</strong></p>
537
                    <p class="problem">Item is withdrawn.</p>
538
                [% ELSE %]
539
                    <p class="problem">Item is withdrawn.</p>
540
                [% END %]
541
            [% END %]
542
            [% IF ( errmsgloo.debarred ) %]
543
                <p class="problem"><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% errmsgloo.debarborrowernumber %]">[% errmsgloo.debarname %]([% errmsgloo.debarcardnumber %])</a> is now debarred until [% errmsgloo.debarred | $KohaDates %].</p>
544
            [% END %]
545
            [% IF ( errmsgloo.prevdebarred ) %]
546
                <p class="problem"><b>Reminder: </b>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %].</p>
484
            [% END %]
547
            [% END %]
485
            [% IF ( errmsgloo.badbarcode ) %]
548
            [% IF ( errmsgloo.badbarcode ) %]
486
                <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
549
                <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/authorised_values.tt (-2 / +2 lines)
Lines 16-22 Link Here
16
    <li>'BOR_NOTES' is for values for custom patron notes that appear on the circulation screen and the OPAC.</li>
16
    <li>'BOR_NOTES' is for values for custom patron notes that appear on the circulation screen and the OPAC.</li>
17
    <li>'Bsort1' is for patron statistical purposes.</li>
17
    <li>'Bsort1' is for patron statistical purposes.</li>
18
    <li>'Bsort2' is used for patron statistical purposes.</li>
18
    <li>'Bsort2' is used for patron statistical purposes.</li>
19
    <li>'CART' is the shelving cart location, used by InProcessingToShelvingCart and ReturnToShelvingCart</li>
19
    <li>'CART' is the shelving cart location, used by UpdateItemLocationOnCheckin </li>
20
    <li>'CCODE' is for collection codes (appears when cataloging and working with items).</li>
20
    <li>'CCODE' is for collection codes (appears when cataloging and working with items).</li>
21
    <li>'DAMAGED' is for descriptions of damaged items, and appears when cataloging and working with items.</li>
21
    <li>'DAMAGED' is for descriptions of damaged items, and appears when cataloging and working with items.</li>
22
    <li>'HINGS_AS' is for General Holdings: Acquisition Status Designator, a data element that specifies the acquisition status for the unit at the time of the holdings report.</li>
22
    <li>'HINGS_AS' is for General Holdings: Acquisition Status Designator, a data element that specifies the acquisition status for the unit at the time of the holdings report.</li>
Lines 32-38 Link Here
32
</li>
32
</li>
33
    <li>'MANUAL_INV' includes values for manual invoicing.</li>
33
    <li>'MANUAL_INV' includes values for manual invoicing.</li>
34
    <li>'NOT_LOAN' is used to list reasons why a title is not for loan.</li>
34
    <li>'NOT_LOAN' is used to list reasons why a title is not for loan.</li>
35
    <li>'PROC' is for the location to be used for NewItemsDefaultLocation (change description as desired), also the location expected by InProcessingToShelvingCart.</li>
35
    <li>'PROC' is for the location to be used for NewItemsDefaultLocation (change description as desired), also a special location for UpdateItemLocationOnCheckin.</li>
36
    <li>'REPORT_GROUP' provides a way to sort and filter your reports, the default values in this category include the Koha modules (Accounts, Acquisitions, Catalog, Circulation, Patrons)</li>
36
    <li>'REPORT_GROUP' provides a way to sort and filter your reports, the default values in this category include the Koha modules (Accounts, Acquisitions, Catalog, Circulation, Patrons)</li>
37
    <li>'REPORT_SUBGROUP' can be used to further sort and filter your reports. This category is empty by default. Values here need to include the authorized value code from REPORT_GROUP in the Description (OPAC) field to link the subgroup to the appropriate group.</li>
37
    <li>'REPORT_SUBGROUP' can be used to further sort and filter your reports. This category is empty by default. Values here need to include the authorized value code from REPORT_GROUP in the Description (OPAC) field to link the subgroup to the appropriate group.</li>
38
    <li>'RESTRICTED' is used for the restricted status of an item</li>
38
    <li>'RESTRICTED' is used for the restricted status of an item</li>
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/preferences.js (+19 lines)
Lines 137-140 $( document ).ready( function () { Link Here
137
    if ( search_jumped ) {
137
    if ( search_jumped ) {
138
        document.location.hash = "jumped";
138
        document.location.hash = "jumped";
139
    }
139
    }
140
141
    $("#pref_UpdateItemLocationOnCheckin").change(function(){
142
        var the_text = $(this).val();
143
        var alert_text = '';
144
        if ( the_text.indexOf('_ALL_:') != -1 ) alert_text = MSG_ALL_VALUE_WARN + '\n';
145
        var split_text  =the_text.split("\n");
146
        var alert_issues = '';
147
        var issue_count = 0;
148
        var reg_check = /.*:\s.*/;
149
        for (var i=0; i < split_text.length; i++){
150
            if ( !split_text[i].match(reg_check) && split_text[i].length ) {
151
                alert_issues+=split_text[i]+"\n";
152
                issue_count++;
153
            }
154
        }
155
        if (issue_count) alert_text += "\n"+ MSG_UPD_LOC_FORMAT_WARN  +"\n"+alert_issues;
156
        if ( alert_text.length )  alert(alert_text);
157
    });
158
140
} );
159
} );
(-)a/svc/checkin (-15 lines)
Lines 60-79 $data->{itemnumber} = $itemnumber; Link Here
60
$data->{borrowernumber} = $borrowernumber;
60
$data->{borrowernumber} = $borrowernumber;
61
$data->{branchcode}     = $branchcode;
61
$data->{branchcode}     = $branchcode;
62
62
63
if ( C4::Context->preference("InProcessingToShelvingCart") ) {
64
    my $item = GetItem($itemnumber);
65
    if ( $item->{'location'} eq 'PROC' ) {
66
        $item->{'location'} = 'CART';
67
        ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
68
    }
69
}
70
71
if ( C4::Context->preference("ReturnToShelvingCart") ) {
72
    my $item = GetItem($itemnumber);
73
    $item->{'location'} = 'CART';
74
    ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
75
}
76
77
my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber });
63
my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber });
78
$data->{patronnote} = $checkout ? $checkout->note : q||;
64
$data->{patronnote} = $checkout ? $checkout->note : q||;
79
65
80
- 

Return to bug 14576