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

(-)a/C4/Circulation.pm (-4 lines)
Lines 1460-1469 sub AddIssue { Link Here
1460
            UpdateTotalIssues($item->{'biblionumber'}, 1);
1460
            UpdateTotalIssues($item->{'biblionumber'}, 1);
1461
        }
1461
        }
1462
1462
1463
            if ( C4::Context->preference('ReturnToShelvingCart') ) {
1464
                # ReturnToShelvingCart is on, anything issued should be taken off the cart.
1465
                CartToShelf( $item->{'itemnumber'} );
1466
            }
1467
            $item->{'issues'}++;
1463
            $item->{'issues'}++;
1468
            if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
1464
            if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) {
1469
                UpdateTotalIssues( $item->{'biblionumber'}, 1 );
1465
                UpdateTotalIssues( $item->{'biblionumber'}, 1 );
(-)a/C4/Items.pm (-1 / +1 lines)
Lines 631-637 sub ModItemTransfer { Link Here
631
    my $dbh = C4::Context->dbh;
631
    my $dbh = C4::Context->dbh;
632
632
633
    # Remove the 'shelving cart' location status if it is being used.
633
    # Remove the 'shelving cart' location status if it is being used.
634
    CartToShelf( $itemnumber ) if ( C4::Context->preference("ReturnToShelvingCart") );
634
    CartToShelf( $itemnumber ) if ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART' );
635
635
636
    #new entry in branchtransfers....
636
    #new entry in branchtransfers....
637
    my $sth = $dbh->prepare(
637
    my $sth = $dbh->prepare(
(-)a/C4/Reserves.pm (-2 / +2 lines)
Lines 1294-1300 sub ModReserveStatus { Link Here
1294
    my $sth_set = $dbh->prepare($query);
1294
    my $sth_set = $dbh->prepare($query);
1295
    $sth_set->execute( $newstatus, $itemnumber );
1295
    $sth_set->execute( $newstatus, $itemnumber );
1296
1296
1297
    if ( C4::Context->preference("ReturnToShelvingCart") && $newstatus ) {
1297
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) && $newstatus ) {
1298
      CartToShelf( $itemnumber );
1298
      CartToShelf( $itemnumber );
1299
    }
1299
    }
1300
}
1300
}
Lines 1362-1368 sub ModReserveAffect { Link Here
1362
    $sth->execute( $itemnumber, $borrowernumber,$biblionumber);
1362
    $sth->execute( $itemnumber, $borrowernumber,$biblionumber);
1363
    _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber ) if ( !$transferToDo && !$already_on_shelf );
1363
    _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber ) if ( !$transferToDo && !$already_on_shelf );
1364
    _FixPriority( { biblionumber => $biblionumber } );
1364
    _FixPriority( { biblionumber => $biblionumber } );
1365
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1365
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) ) {
1366
      CartToShelf( $itemnumber );
1366
      CartToShelf( $itemnumber );
1367
    }
1367
    }
1368
1368
(-)a/C4/UsageStats.pm (-2 lines)
Lines 129-135 sub BuildReport { Link Here
129
        AutoRemoveOverduesRestrictions
129
        AutoRemoveOverduesRestrictions
130
        CircControl
130
        CircControl
131
        HomeOrHoldingBranch
131
        HomeOrHoldingBranch
132
        InProcessingToShelvingCart
133
        IssueLostItem
132
        IssueLostItem
134
        IssuingInProcess
133
        IssuingInProcess
135
        ManInvInNoissuesCharge
134
        ManInvInNoissuesCharge
Lines 138-144 sub BuildReport { Link Here
138
        RenewalSendNotice
137
        RenewalSendNotice
139
        RentalsInNoissuesCharge
138
        RentalsInNoissuesCharge
140
        ReturnBeforeExpiry
139
        ReturnBeforeExpiry
141
        ReturnToShelvingCart
142
        TransfersMaxDaysWarning
140
        TransfersMaxDaysWarning
143
        UseBranchTransferLimits
141
        UseBranchTransferLimits
144
        useDaysMode
142
        useDaysMode
(-)a/installer/data/mysql/sysprefs.sql (-2 lines)
Lines 188-194 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
188
('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'),
188
('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'),
189
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
189
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
190
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
190
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
191
('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'),
192
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
191
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
193
('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'),
192
('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'),
194
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
193
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
Lines 425-431 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
425
('RestrictionBlockRenewing','0',NULL,'If patron is restricted, should renewal be allowed or blocked','YesNo'),
424
('RestrictionBlockRenewing','0',NULL,'If patron is restricted, should renewal be allowed or blocked','YesNo'),
426
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
425
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
427
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
426
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
428
('ReturnToShelvingCart','0','','If set, when any item is \'checked in\', it\'s location code will be changed to CART.','YesNo'),
429
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
427
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
430
('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'),
428
('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'),
431
('RoutingListAddReserves','1','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
429
('RoutingListAddReserves','1','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
(-)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/svc/checkin (-14 lines)
Lines 58-77 $data->{itemnumber} = $itemnumber; Link Here
58
$data->{borrowernumber} = $borrowernumber;
58
$data->{borrowernumber} = $borrowernumber;
59
$data->{branchcode}     = $branchcode;
59
$data->{branchcode}     = $branchcode;
60
60
61
if ( C4::Context->preference("InProcessingToShelvingCart") ) {
62
    my $item = GetItem($itemnumber);
63
    if ( $item->{'location'} eq 'PROC' ) {
64
        $item->{'location'} = 'CART';
65
        ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
66
    }
67
}
68
69
if ( C4::Context->preference("ReturnToShelvingCart") ) {
70
    my $item = GetItem($itemnumber);
71
    $item->{'location'} = 'CART';
72
    ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
73
}
74
75
( $data->{returned} ) = AddReturn( $barcode, $branchcode, $exempt_fine );
61
( $data->{returned} ) = AddReturn( $barcode, $branchcode, $exempt_fine );
76
62
77
print to_json($data);
63
print to_json($data);
(-)a/t/db_dependent/Circulation/Returns.t (-58 lines)
Lines 1-58 Link Here
1
use Modern::Perl;
2
use Test::More tests => 2;
3
4
use t::lib::Mocks;
5
use C4::Biblio;
6
use C4::Circulation;
7
use C4::Items;
8
use C4::Members;
9
use Koha::Database;
10
use Koha::DateUtils;
11
12
use t::lib::TestBuilder;
13
14
use MARC::Record;
15
16
*C4::Context::userenv = \&Mock_userenv;
17
18
my $schema = Koha::Database->schema;
19
$schema->storage->txn_begin;
20
my $builder = t::lib::TestBuilder->new;
21
22
my $library = $builder->build({
23
    source => 'Branch',
24
});
25
26
my $record = MARC::Record->new();
27
my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $record, '' );
28
29
my ( undef, undef, $itemnumber ) = AddItem(
30
    {
31
        homebranch         => $library->{branchcode},
32
        holdingbranch      => $library->{branchcode},
33
        barcode            => 'i_dont_exist',
34
        location           => 'PROC',
35
        permanent_location => 'TEST'
36
    },
37
    $biblionumber
38
);
39
40
my $item;
41
42
t::lib::Mocks::mock_preference( "InProcessingToShelvingCart", 1 );
43
AddReturn( 'i_dont_exist', $library->{branchcode} );
44
$item = GetItem($itemnumber);
45
is( $item->{location}, 'CART', "InProcessingToShelvingCart functions as intended" );
46
47
$item->{location} = 'PROC';
48
ModItem( $item, undef, $itemnumber );
49
50
t::lib::Mocks::mock_preference( "InProcessingToShelvingCart", 0 );
51
AddReturn( 'i_dont_exist', $library->{branchcode} );
52
$item = GetItem($itemnumber);
53
is( $item->{location}, 'TEST', "InProcessingToShelvingCart functions as intended" );
54
55
# C4::Context->userenv
56
sub Mock_userenv {
57
    return { branch => $library->{branchcode} };
58
}
(-)a/t/db_dependent/UsageStats.t (-3 lines)
Lines 381-387 sub mocking_systempreferences_to_a_set_value { Link Here
381
        CircControl
381
        CircControl
382
        HomeOrHoldingBranch
382
        HomeOrHoldingBranch
383
        HomeOrHoldingBranchReturn
383
        HomeOrHoldingBranchReturn
384
        InProcessingToShelvingCart
385
        IssueLostItem
384
        IssueLostItem
386
        IssuingInProcess
385
        IssuingInProcess
387
        ManInvInNoissuesCharge
386
        ManInvInNoissuesCharge
Lines 390-396 sub mocking_systempreferences_to_a_set_value { Link Here
390
        RenewalSendNotice
389
        RenewalSendNotice
391
        RentalsInNoissuesCharge
390
        RentalsInNoissuesCharge
392
        ReturnBeforeExpiry
391
        ReturnBeforeExpiry
393
        ReturnToShelvingCart
394
        TransfersMaxDaysWarning
392
        TransfersMaxDaysWarning
395
        UseBranchTransferLimits
393
        UseBranchTransferLimits
396
        useDaysMode
394
        useDaysMode
397
- 

Return to bug 14576