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

(-)a/C4/Circulation.pm (-15 / +35 lines)
Lines 1379-1388 sub AddIssue { Link Here
1379
                }
1379
                }
1380
              );
1380
              );
1381
1381
1382
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1382
            if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) {
1383
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1383
            ## Item was moved to cart via UpdateItemLocationOnCheckin, anything issued should be taken off the cart.
1384
                CartToShelf( $item->{'itemnumber'} );
1384
                CartToShelf( $item->{'itemnumber'} );
1385
            }
1385
            }
1386
1386
            $item->{'issues'}++;
1387
            $item->{'issues'}++;
1387
            if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
1388
            if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
1388
                UpdateTotalIssues( $item->{'biblionumber'}, 1 );
1389
                UpdateTotalIssues( $item->{'biblionumber'}, 1 );
Lines 1844-1859 sub AddReturn { Link Here
1844
        }
1845
        }
1845
    }
1846
    }
1846
1847
1847
    if ( $item->{'location'} eq 'PROC' ) {
1848
    my $item = GetItem($itemnumber) or die "GetItem($itemnumber) failed";
1848
        if ( C4::Context->preference("InProcessingToShelvingCart") ) {
1849
            $item->{'location'} = 'CART';
1850
        }
1851
        else {
1852
            $item->{location} = $item->{permanent_location};
1853
        }
1854
1855
        ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
1856
    }
1857
1849
1858
        # full item data, but no borrowernumber or checkout info (no issue)
1850
        # full item data, but no borrowernumber or checkout info (no issue)
1859
    my $hbr = GetBranchItemRule($item->{'homebranch'}, $item->{'itype'})->{'returnbranch'} || "homebranch";
1851
    my $hbr = GetBranchItemRule($item->{'homebranch'}, $item->{'itype'})->{'returnbranch'} || "homebranch";
Lines 1864-1869 sub AddReturn { Link Here
1864
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1856
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1865
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1857
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1866
1858
1859
    my $yaml_loc = C4::Context->preference('UpdateItemLocationOnCheckin');
1860
    if ($yaml_loc) {
1861
        $yaml_loc = "$yaml_loc\n\n";  # YAML is strict on ending \n. Surplus does not hurt
1862
        my $rules;
1863
        eval { $rules = YAML::Load($yaml_loc); };
1864
        if ($@) {
1865
            warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
1866
        }
1867
        else {
1868
            if (defined $rules->{_ALL_}) {
1869
                if ($rules->{_ALL_} eq '_PERM_') { $rules->{_ALL_} = $item->{permanent_location}; }
1870
                if ($rules->{_ALL_} eq '_BLANK_') { $rules->{_ALL_} = ''; }
1871
                if ( $item->{location} ne $rules->{_ALL_}) {
1872
                    $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{_ALL_} };
1873
                    ModItem( { location => $rules->{_ALL_} }, undef, $itemnumber );
1874
                }
1875
            }
1876
            else {
1877
                foreach my $key ( keys %$rules ) {
1878
                    if ( $rules->{$key} eq '_PERM_' ) { $rules->{$key} = $item->{permanent_location}; }
1879
                    if ( $rules->{$key} eq '_BLANK_') { $rules->{$key} = '' ;}
1880
                    if ( ($item->{location} eq $key && $item->{location} ne $rules->{$key}) || ($key eq '_BLANK_' && $item->{location} eq '' && $rules->{$key} ne '') ) {
1881
                        $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{$key} };
1882
                        ModItem( { location => $rules->{$key} }, undef, $itemnumber );
1883
                        last;
1884
                    }
1885
                }
1886
            }
1887
        }
1888
    }
1889
1867
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1890
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1868
    if ($yaml) {
1891
    if ($yaml) {
1869
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
1892
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
Lines 1972-1986 sub AddReturn { Link Here
1972
            );
1995
            );
1973
            $sth->execute( $item->{'itemnumber'} );
1996
            $sth->execute( $item->{'itemnumber'} );
1974
            # if we have a reservation with valid transfer, we can set it's status to 'W'
1997
            # if we have a reservation with valid transfer, we can set it's status to 'W'
1975
            ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") );
1976
            C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W');
1998
            C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W');
1977
        } else {
1999
        } else {
1978
            $messages->{'WrongTransfer'}     = $tobranch;
2000
            $messages->{'WrongTransfer'}     = $tobranch;
1979
            $messages->{'WrongTransferItem'} = $item->{'itemnumber'};
2001
            $messages->{'WrongTransferItem'} = $item->{'itemnumber'};
1980
        }
2002
        }
1981
        $validTransfert = 1;
2003
        $validTransfert = 1;
1982
    } else {
1983
        ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") );
1984
    }
2004
    }
1985
2005
1986
    # fix up the accounts.....
2006
    # 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 619-627 sub ModItemTransfer { Link Here
619
    my ( $itemnumber, $frombranch, $tobranch ) = @_;
597
    my ( $itemnumber, $frombranch, $tobranch ) = @_;
620
598
621
    my $dbh = C4::Context->dbh;
599
    my $dbh = C4::Context->dbh;
600
    my $item = GetItem( $itemnumber );
622
601
623
    # Remove the 'shelving cart' location status if it is being used.
602
    # Remove the 'shelving cart' location status if it is being used.
624
    CartToShelf( $itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") );
603
    CartToShelf( $itemnumber ) if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART' );
625
604
626
    #new entry in branchtransfers....
605
    #new entry in branchtransfers....
627
    my $sth = $dbh->prepare(
606
    my $sth = $dbh->prepare(
(-)a/C4/Reserves.pm (-4 / +5 lines)
Lines 1001-1007 sub ModReserveStatus { Link Here
1001
    my $sth_set = $dbh->prepare($query);
1001
    my $sth_set = $dbh->prepare($query);
1002
    $sth_set->execute( $newstatus, $itemnumber );
1002
    $sth_set->execute( $newstatus, $itemnumber );
1003
1003
1004
    if ( C4::Context->preference("ReturnToShelvingCart") && $newstatus ) {
1004
    my $item = GetItem($itemnumber);
1005
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) && $newstatus ) {
1005
      CartToShelf( $itemnumber );
1006
      CartToShelf( $itemnumber );
1006
    }
1007
    }
1007
}
1008
}
Lines 1053-1061 sub ModReserveAffect { Link Here
1053
      if ( !$transferToDo && !$already_on_shelf );
1054
      if ( !$transferToDo && !$already_on_shelf );
1054
1055
1055
    _FixPriority( { biblionumber => $biblionumber } );
1056
    _FixPriority( { biblionumber => $biblionumber } );
1056
1057
    my $item = GetItem($itemnumber);
1057
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1058
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) ) {
1058
        CartToShelf($itemnumber);
1059
      CartToShelf( $itemnumber );
1059
    }
1060
    }
1060
1061
1061
    return;
1062
    return;
(-)a/C4/UsageStats.pm (-2 lines)
Lines 143-149 sub BuildReport { Link Here
143
        AutoRemoveOverduesRestrictions
143
        AutoRemoveOverduesRestrictions
144
        CircControl
144
        CircControl
145
        HomeOrHoldingBranch
145
        HomeOrHoldingBranch
146
        InProcessingToShelvingCart
147
        IssueLostItem
146
        IssueLostItem
148
        IssuingInProcess
147
        IssuingInProcess
149
        ManInvInNoissuesCharge
148
        ManInvInNoissuesCharge
Lines 152-158 sub BuildReport { Link Here
152
        RenewalSendNotice
151
        RenewalSendNotice
153
        RentalsInNoissuesCharge
152
        RentalsInNoissuesCharge
154
        ReturnBeforeExpiry
153
        ReturnBeforeExpiry
155
        ReturnToShelvingCart
156
        TransfersMaxDaysWarning
154
        TransfersMaxDaysWarning
157
        UseBranchTransferLimits
155
        UseBranchTransferLimits
158
        useDaysMode
156
        useDaysMode
(-)a/circ/returns.pl (+3 lines)
Lines 550-555 foreach my $code ( keys %$messages ) { Link Here
550
    elsif ( $code eq 'ForeverDebarred' ) {
550
    elsif ( $code eq 'ForeverDebarred' ) {
551
        $err{foreverdebarred}        = $messages->{'ForeverDebarred'};
551
        $err{foreverdebarred}        = $messages->{'ForeverDebarred'};
552
    }
552
    }
553
    elsif ( $code eq 'ItemLocationUpdated' ) {
554
        $err{ItemLocationUpdated} = $messages->{ItemLocationUpdated};
555
    }
553
    elsif ( $code eq 'NotForLoanStatusUpdated' ) {
556
    elsif ( $code eq 'NotForLoanStatusUpdated' ) {
554
        $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated};
557
        $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated};
555
    }
558
    }
(-)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 208-214 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
208
('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'),
208
('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'),
209
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
209
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
210
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
210
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
211
('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'),
212
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
211
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
213
('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'),
212
('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'),
214
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
213
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
Lines 460-466 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
460
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
459
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
461
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
460
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
462
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
461
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
463
('ReturnToShelvingCart','0','','If set, when any item is \'checked in\', it\'s location code will be changed to CART.','YesNo'),
464
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
462
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
465
('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'),
463
('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'),
466
('RoutingListAddReserves','1','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
464
('RoutingListAddReserves','1','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
Lines 550-555 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
550
('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'),
548
('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'),
551
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
549
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
552
('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'),
550
('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'),
551
('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'),
553
('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'),
552
('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'),
554
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
553
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
555
('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'),
554
('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 44-49 Link Here
44
    var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
44
    var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
45
    var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
45
    var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
46
    var MSG_LOADING = _( "Loading..." );
46
    var MSG_LOADING = _( "Loading..." );
47
    var MSG_ALL_VALUE_WARN = _("Note: _ALL_ value will override all other values");
48
    var MSG_UPD_LOC_FORMAT_WARN = _("The following values are not formatted correctly:");
47
49
48
//]]>
50
//]]>
49
</script>
51
</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 474-479 Circulation: Link Here
474
            - calculate and update overdue charges when an item is returned.
462
            - calculate and update overdue charges when an item is returned.
475
            - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
463
            - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
476
        -
464
        -
465
            - pref: UpdateItemLocationOnCheckin
466
              type: textarea
467
              class: code
468
            - This is is a list of value pairs, the first value is followed immediately by colon space then the second value i.e.:<br/>
469
            - "PROC: FIC"
470
            - <br/> When an item is checked in, if the location value on the left matches the items location value
471
            - "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."
472
            - <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.
473
            - <br/>Items in the CART location will be returned to their permanent location on checkout
474
            - <br/>You can use the special term _BLANK_ on either side of a pair to update/remove items with no location assigned
475
            - <br>You can use the special term _ALL_ on the left side to affect all items
476
            - and the special term _PERM_ on the right side to return items to their permanent location
477
            - <br>**Use of an _ALL_ rule will override/ignore any other values**
478
            - <br>Each pair of values should be on a separate line.
479
        -
477
            - pref: UpdateNotForLoanStatusOnCheckin
480
            - pref: UpdateNotForLoanStatusOnCheckin
478
              type: textarea
481
              type: textarea
479
              class: code
482
              class: code
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-13 / +76 lines)
Lines 589-607 $(document).ready(function () { Link Here
589
            [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
589
            [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
590
                <p class="problem">
590
                <p class="problem">
591
                    Not for loan status updated.
591
                    Not for loan status updated.
592
                    <br />Old value:
592
                <br />Old value:
593
                    [% IF errmsgloo.NotForLoanStatusUpdated.from %]
593
                 [% IF errmsgloo.NotForLoanStatusUpdated.from %]
594
                        [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) %].
594
                     [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) %].
595
                    [% ELSE %]
595
                 [% ELSE %]
596
                        Available for loan.
596
                     Available for loan.
597
                    [% END %]
597
                 [% END %]
598
                    <br />New value:
598
                     <br />New value:
599
                    [% IF errmsgloo.NotForLoanStatusUpdated.to %]
599
                 [% IF errmsgloo.NotForLoanStatusUpdated.to %]
600
                        [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) %].
600
                     [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) %].
601
                    [% ELSE %]
601
                 [% ELSE %]
602
                        Available for loan.
602
                     Available for loan.
603
                    [% END %]
603
                 [% END %]
604
                </p>
604
                     </p>
605
            [% END %]
606
            [% IF ( errmsgloo.ItemLocationUpdated ) %]
607
                 <p class="problem">
608
                     Item shelving location updated from
609
                 [% IF errmsgloo.ItemLocationUpdated.from %]
610
                     [% IF errmsgloo.ItemLocationUpdated.from == '' %]
611
                         empty
612
                     [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) == '' %]
613
                         [% errmsgloo.ItemLocationUpdated.from %] (No description available)
614
                     [% ELSE %]
615
                         [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) %]
616
                     [% END %]
617
                 [% ELSE %]
618
                     "Blank"
619
                 [% END %]
620
                 to
621
                 [% IF errmsgloo.ItemLocationUpdated.to %]
622
                     [% IF errmsgloo.ItemLocationUpdated.to == '' %]
623
                         empty
624
                     [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) == '' %]
625
                         [% errmsgloo.ItemLocationUpdated.to %] (Not an authorized value)
626
                     [% ELSE %]
627
                         [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) %]
628
                     [% END %]
629
                 [% ELSE %]
630
                     "Blank"
631
                 [% END %]
632
                 </p>
633
            [% END %]
634
            [% IF ( errmsgloo.badbarcode ) %]
635
                <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
636
            [% END %]
637
            [% IF ( errmsgloo.ispermanent ) %]
638
                <p class="problem">Please return item to: [% Branches.GetName( errmsgloo.msg ) %]</p>
639
            [% END %]
640
            [% IF ( errmsgloo.notissued ) %]
641
                <p class="problem">Not checked out.</p>
642
            [% END %]
643
            [% IF ( errmsgloo.localuse) %]
644
                <p class="problem">Local use recorded</p>
645
            [% END %]
646
            [% IF ( errmsgloo.waslost ) %]
647
                <p class="problem">Item was lost, now found.</p>
648
                [% IF ( LostItemFeeRefunded ) %]
649
                    <p class="problem">A refund has been applied to the borrowing patron's account.</p>
650
                [% ELSE %]
651
                    <p class="problem">Any lost item fees for this item will remain on the patron's account.</p>
652
                [% END %]
653
            [% END %]
654
            [% IF ( errmsgloo.withdrawn ) %]
655
                [% IF BlockReturnOfWithdrawnItems %]
656
                    <h5>Cannot check in</h5>
657
                    <p><strong>NOT CHECKED IN</strong></p>
658
                    <p class="problem">Item is withdrawn.</p>
659
                [% ELSE %]
660
                    <p class="problem">Item is withdrawn.</p>
661
                [% END %]
662
            [% END %]
663
            [% IF ( errmsgloo.debarred ) %]
664
                <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>
665
            [% END %]
666
            [% IF ( errmsgloo.prevdebarred ) %]
667
                <p class="problem"><b>Reminder: </b>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %].</p>
605
            [% END %]
668
            [% END %]
606
            [% IF ( errmsgloo.badbarcode ) %]
669
            [% IF ( errmsgloo.badbarcode ) %]
607
                <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
670
                <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