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

(-)a/C4/Circulation.pm (-15 / +35 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 1827-1842 sub AddReturn { Link Here
1827
        }
1828
        }
1828
    }
1829
    }
1829
1830
1830
    if ( $item->{'location'} eq 'PROC' ) {
1831
    my $item = GetItem($itemnumber) or die "GetItem($itemnumber) failed";
1831
        if ( C4::Context->preference("InProcessingToShelvingCart") ) {
1832
            $item->{'location'} = 'CART';
1833
        }
1834
        else {
1835
            $item->{location} = $item->{permanent_location};
1836
        }
1837
1838
        ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'}, { log_action => 0 } );
1839
    }
1840
1832
1841
        # full item data, but no borrowernumber or checkout info (no issue)
1833
        # full item data, but no borrowernumber or checkout info (no issue)
1842
    my $hbr = GetBranchItemRule($item->{'homebranch'}, $item->{'itype'})->{'returnbranch'} || "homebranch";
1834
    my $hbr = GetBranchItemRule($item->{'homebranch'}, $item->{'itype'})->{'returnbranch'} || "homebranch";
Lines 1847-1852 sub AddReturn { Link Here
1847
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1839
    my $borrowernumber = $patron ? $patron->borrowernumber : undef;    # we don't know if we had a borrower or not
1848
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1840
    my $patron_unblessed = $patron ? $patron->unblessed : {};
1849
1841
1842
    my $yaml_loc = C4::Context->preference('UpdateItemLocationOnCheckin');
1843
    if ($yaml_loc) {
1844
        $yaml_loc = "$yaml_loc\n\n";  # YAML is strict on ending \n. Surplus does not hurt
1845
        my $rules;
1846
        eval { $rules = YAML::Load($yaml_loc); };
1847
        if ($@) {
1848
            warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
1849
        }
1850
        else {
1851
            if (defined $rules->{_ALL_}) {
1852
                if ($rules->{_ALL_} eq '_PERM_') { $rules->{_ALL_} = $item->{permanent_location}; }
1853
                if ($rules->{_ALL_} eq '_BLANK_') { $rules->{_ALL_} = ''; }
1854
                if ( $item->{location} ne $rules->{_ALL_}) {
1855
                    $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{_ALL_} };
1856
                    ModItem( { location => $rules->{_ALL_} }, undef, $itemnumber );
1857
                }
1858
            }
1859
            else {
1860
                foreach my $key ( keys %$rules ) {
1861
                    if ( $rules->{$key} eq '_PERM_' ) { $rules->{$key} = $item->{permanent_location}; }
1862
                    if ( $rules->{$key} eq '_BLANK_') { $rules->{$key} = '' ;}
1863
                    if ( ($item->{location} eq $key && $item->{location} ne $rules->{$key}) || ($key eq '_BLANK_' && $item->{location} eq '' && $rules->{$key} ne '') ) {
1864
                        $messages->{'ItemLocationUpdated'} = { from => $item->{location}, to => $rules->{$key} };
1865
                        ModItem( { location => $rules->{$key} }, undef, $itemnumber );
1866
                        last;
1867
                    }
1868
                }
1869
            }
1870
        }
1871
    }
1872
1850
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1873
    my $yaml = C4::Context->preference('UpdateNotForLoanStatusOnCheckin');
1851
    if ($yaml) {
1874
    if ($yaml) {
1852
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
1875
        $yaml = "$yaml\n\n";  # YAML is anal on ending \n. Surplus does not hurt
Lines 1949-1963 sub AddReturn { Link Here
1949
            );
1972
            );
1950
            $sth->execute( $item->{'itemnumber'} );
1973
            $sth->execute( $item->{'itemnumber'} );
1951
            # if we have a reservation with valid transfer, we can set it's status to 'W'
1974
            # if we have a reservation with valid transfer, we can set it's status to 'W'
1952
            ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") );
1953
            C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W');
1975
            C4::Reserves::ModReserveStatus($item->{'itemnumber'}, 'W');
1954
        } else {
1976
        } else {
1955
            $messages->{'WrongTransfer'}     = $tobranch;
1977
            $messages->{'WrongTransfer'}     = $tobranch;
1956
            $messages->{'WrongTransferItem'} = $item->{'itemnumber'};
1978
            $messages->{'WrongTransferItem'} = $item->{'itemnumber'};
1957
        }
1979
        }
1958
        $validTransfert = 1;
1980
        $validTransfert = 1;
1959
    } else {
1960
        ShelfToCart( $item->{'itemnumber'} ) if ( C4::Context->preference("ReturnToShelvingCart") );
1961
    }
1981
    }
1962
1982
1963
    # fix up the accounts.....
1983
    # 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 626-634 sub ModItemTransfer { Link Here
626
    my ( $itemnumber, $frombranch, $tobranch ) = @_;
604
    my ( $itemnumber, $frombranch, $tobranch ) = @_;
627
605
628
    my $dbh = C4::Context->dbh;
606
    my $dbh = C4::Context->dbh;
607
    my $item = GetItem( $itemnumber );
629
608
630
    # Remove the 'shelving cart' location status if it is being used.
609
    # Remove the 'shelving cart' location status if it is being used.
631
    CartToShelf( $itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") );
610
    CartToShelf( $itemnumber ) if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART' );
632
611
633
    $dbh->do("UPDATE branchtransfers SET datearrived = NOW(), comments = ? WHERE itemnumber = ? AND datearrived IS NULL", undef, "Canceled, new transfer from $frombranch to $tobranch created", $itemnumber);
612
    $dbh->do("UPDATE branchtransfers SET datearrived = NOW(), comments = ? WHERE itemnumber = ? AND datearrived IS NULL", undef, "Canceled, new transfer from $frombranch to $tobranch created", $itemnumber);
634
613
(-)a/C4/Reserves.pm (-4 / +5 lines)
Lines 971-977 sub ModReserveStatus { Link Here
971
    my $sth_set = $dbh->prepare($query);
971
    my $sth_set = $dbh->prepare($query);
972
    $sth_set->execute( $newstatus, $itemnumber );
972
    $sth_set->execute( $newstatus, $itemnumber );
973
973
974
    if ( C4::Context->preference("ReturnToShelvingCart") && $newstatus ) {
974
    my $item = GetItem($itemnumber);
975
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) && $newstatus ) {
975
      CartToShelf( $itemnumber );
976
      CartToShelf( $itemnumber );
976
    }
977
    }
977
}
978
}
Lines 1023-1031 sub ModReserveAffect { Link Here
1023
      if ( !$transferToDo && !$already_on_shelf );
1024
      if ( !$transferToDo && !$already_on_shelf );
1024
1025
1025
    _FixPriority( { biblionumber => $biblionumber } );
1026
    _FixPriority( { biblionumber => $biblionumber } );
1026
1027
    my $item = GetItem($itemnumber);
1027
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1028
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) ) {
1028
        CartToShelf($itemnumber);
1029
      CartToShelf( $itemnumber );
1029
    }
1030
    }
1030
1031
1031
    return;
1032
    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 501-506 foreach my $code ( keys %$messages ) { Link Here
501
    elsif ( $code eq 'ForeverDebarred' ) {
501
    elsif ( $code eq 'ForeverDebarred' ) {
502
        $err{foreverdebarred}        = $messages->{'ForeverDebarred'};
502
        $err{foreverdebarred}        = $messages->{'ForeverDebarred'};
503
    }
503
    }
504
    elsif ( $code eq 'ItemLocationUpdated' ) {
505
        $err{ItemLocationUpdated} = $messages->{ItemLocationUpdated};
506
    }
504
    elsif ( $code eq 'NotForLoanStatusUpdated' ) {
507
    elsif ( $code eq 'NotForLoanStatusUpdated' ) {
505
        $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated};
508
        $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated};
506
    }
509
    }
(-)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 214-220 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
214
('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'),
214
('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'),
215
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
215
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
216
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
216
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
217
('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'),
218
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
217
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
219
('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'),
218
('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'),
220
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
219
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
Lines 475-481 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
475
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
474
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
476
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
475
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
477
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
476
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
478
('ReturnToShelvingCart','0','','If set, when any item is \'checked in\', it\'s location code will be changed to CART.','YesNo'),
479
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
477
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
480
('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'),
478
('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'),
481
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
479
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
Lines 574-579 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
574
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
572
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),
575
('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'),
573
('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'),
576
('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'),
574
('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'),
575
('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'),
577
('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'),
576
('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'),
578
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
577
('UpdateTotalIssuesOnCirc','0',NULL,'Whether to update the totalissues field in the biblio on each circ.','YesNo'),
579
('UploadPurgeTemporaryFilesDays','',NULL,'If not empty, number of days used when automatically deleting temporary uploads','integer'),
578
('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 189-194 Link Here
189
        var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
189
        var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
190
        var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
190
        var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
191
        var MSG_LOADING = _( "Loading..." );
191
        var MSG_LOADING = _( "Loading..." );
192
        var MSG_ALL_VALUE_WARN = _("Note: _ALL_ value will override all other values");
193
        var MSG_UPD_LOC_FORMAT_WARN = _("The following values are not formatted correctly:");
192
    </script>
194
    </script>
193
    <script src="[% interface %]/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
195
    <script src="[% interface %]/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
194
    <script src="[% interface %]/[% theme %]/js/ajax.js" type="text/javascript"></script>
196
    <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 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 497-502 Circulation: Link Here
497
            - calculate and update overdue charges when an item is returned.
485
            - calculate and update overdue charges when an item is returned.
498
            - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
486
            - <br /><b>NOTE If you are doing hourly loans then you should have this on.</b>
499
        -
487
        -
488
            - pref: UpdateItemLocationOnCheckin
489
              type: textarea
490
              class: code
491
            - This is is a list of value pairs, the first value is followed immediately by colon space then the second value i.e.:<br/>
492
            - "PROC: FIC"
493
            - <br/> When an item is checked in, if the location value on the left matches the items location value
494
            - "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."
495
            - <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.
496
            - <br/>Items in the CART location will be returned to their permanent location on checkout
497
            - <br/>You can use the special term _BLANK_ on either side of a pair to update/remove items with no location assigned
498
            - <br>You can use the special term _ALL_ on the left side to affect all items
499
            - and the special term _PERM_ on the right side to return items to their permanent location
500
            - <br>**Use of an _ALL_ rule will override/ignore any other values**
501
            - <br>Each pair of values should be on a separate line.
502
        -
500
            - pref: UpdateNotForLoanStatusOnCheckin
503
            - pref: UpdateNotForLoanStatusOnCheckin
501
              type: textarea
504
              type: textarea
502
              class: code
505
              class: code
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-13 / +76 lines)
Lines 466-484 Link Here
466
            [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
466
            [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
467
                <p class="problem">
467
                <p class="problem">
468
                    Not for loan status updated.
468
                    Not for loan status updated.
469
                    <br />Old value:
469
                <br />Old value:
470
                    [% IF errmsgloo.NotForLoanStatusUpdated.from %]
470
                 [% IF errmsgloo.NotForLoanStatusUpdated.from %]
471
                        [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) %].
471
                     [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) %].
472
                    [% ELSE %]
472
                 [% ELSE %]
473
                        Available for loan.
473
                     Available for loan.
474
                    [% END %]
474
                 [% END %]
475
                    <br />New value:
475
                     <br />New value:
476
                    [% IF errmsgloo.NotForLoanStatusUpdated.to %]
476
                 [% IF errmsgloo.NotForLoanStatusUpdated.to %]
477
                        [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) %].
477
                     [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) %].
478
                    [% ELSE %]
478
                 [% ELSE %]
479
                        Available for loan.
479
                     Available for loan.
480
                    [% END %]
480
                 [% END %]
481
                </p>
481
                     </p>
482
            [% END %]
483
            [% IF ( errmsgloo.ItemLocationUpdated ) %]
484
                 <p class="problem">
485
                     Item shelving location updated from
486
                 [% IF errmsgloo.ItemLocationUpdated.from %]
487
                     [% IF errmsgloo.ItemLocationUpdated.from == '' %]
488
                         empty
489
                     [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) == '' %]
490
                         [% errmsgloo.ItemLocationUpdated.from %] (No description available)
491
                     [% ELSE %]
492
                         [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) %]
493
                     [% END %]
494
                 [% ELSE %]
495
                     "Blank"
496
                 [% END %]
497
                 to
498
                 [% IF errmsgloo.ItemLocationUpdated.to %]
499
                     [% IF errmsgloo.ItemLocationUpdated.to == '' %]
500
                         empty
501
                     [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) == '' %]
502
                         [% errmsgloo.ItemLocationUpdated.to %] (Not an authorized value)
503
                     [% ELSE %]
504
                         [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) %]
505
                     [% END %]
506
                 [% ELSE %]
507
                     "Blank"
508
                 [% END %]
509
                 </p>
510
            [% END %]
511
            [% IF ( errmsgloo.badbarcode ) %]
512
                <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
513
            [% END %]
514
            [% IF ( errmsgloo.ispermanent ) %]
515
                <p class="problem">Please return item to: [% Branches.GetName( errmsgloo.msg ) %]</p>
516
            [% END %]
517
            [% IF ( errmsgloo.notissued ) %]
518
                <p class="problem">Not checked out.</p>
519
            [% END %]
520
            [% IF ( errmsgloo.localuse) %]
521
                <p class="problem">Local use recorded</p>
522
            [% END %]
523
            [% IF ( errmsgloo.waslost ) %]
524
                <p class="problem">Item was lost, now found.</p>
525
                [% IF ( LostItemFeeRefunded ) %]
526
                    <p class="problem">A refund has been applied to the borrowing patron's account.</p>
527
                [% ELSE %]
528
                    <p class="problem">Any lost item fees for this item will remain on the patron's account.</p>
529
                [% END %]
530
            [% END %]
531
            [% IF ( errmsgloo.withdrawn ) %]
532
                [% IF BlockReturnOfWithdrawnItems %]
533
                    <h5>Cannot check in</h5>
534
                    <p><strong>NOT CHECKED IN</strong></p>
535
                    <p class="problem">Item is withdrawn.</p>
536
                [% ELSE %]
537
                    <p class="problem">Item is withdrawn.</p>
538
                [% END %]
539
            [% END %]
540
            [% IF ( errmsgloo.debarred ) %]
541
                <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>
542
            [% END %]
543
            [% IF ( errmsgloo.prevdebarred ) %]
544
                <p class="problem"><b>Reminder: </b>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %].</p>
482
            [% END %]
545
            [% END %]
483
            [% IF ( errmsgloo.badbarcode ) %]
546
            [% IF ( errmsgloo.badbarcode ) %]
484
                <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
547
                <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 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 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