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 1281-1287 sub ModReserveStatus { Link Here
1281
    my $sth_set = $dbh->prepare($query);
1281
    my $sth_set = $dbh->prepare($query);
1282
    $sth_set->execute( $newstatus, $itemnumber );
1282
    $sth_set->execute( $newstatus, $itemnumber );
1283
1283
1284
    if ( C4::Context->preference("ReturnToShelvingCart") && $newstatus ) {
1284
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) && $newstatus ) {
1285
      CartToShelf( $itemnumber );
1285
      CartToShelf( $itemnumber );
1286
    }
1286
    }
1287
}
1287
}
Lines 1349-1355 sub ModReserveAffect { Link Here
1349
    $sth->execute( $itemnumber, $borrowernumber,$biblionumber);
1349
    $sth->execute( $itemnumber, $borrowernumber,$biblionumber);
1350
    _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber ) if ( !$transferToDo && !$already_on_shelf );
1350
    _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber ) if ( !$transferToDo && !$already_on_shelf );
1351
    _FixPriority( { biblionumber => $biblionumber } );
1351
    _FixPriority( { biblionumber => $biblionumber } );
1352
    if ( C4::Context->preference("ReturnToShelvingCart") ) {
1352
    if ( ( $item->{'location'} eq 'CART' && $item->{'permanent_location'} ne 'CART'  ) ) {
1353
      CartToShelf( $itemnumber );
1353
      CartToShelf( $itemnumber );
1354
    }
1354
    }
1355
1355
(-)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 187-193 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
187
('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'),
187
('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'),
188
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
188
('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'),
189
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
189
('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'),
190
('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'),
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'),
190
('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
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'),
191
('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'),
193
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
192
('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'),
Lines 424-430 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
424
('RestrictionBlockRenewing','0',NULL,'If patron is restricted, should renewal be allowed or blocked','YesNo'),
423
('RestrictionBlockRenewing','0',NULL,'If patron is restricted, should renewal be allowed or blocked','YesNo'),
425
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
424
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
426
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
425
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
427
('ReturnToShelvingCart','0','','If set, when any item is \'checked in\', it\'s location code will be changed to CART.','YesNo'),
428
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
426
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
429
('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'),
427
('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'),
430
('RoutingListAddReserves','1','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
428
('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 (-13 / +29 lines)
Lines 58-76 $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") ) {
61
     my $yaml_loc = C4::Context->preference('UpdateItemLocationOnCheckin');
62
    my $item = GetItem($itemnumber);
62
     if ($yaml_loc) {
63
    if ( $item->{'location'} eq 'PROC' ) {
63
         $yaml_loc = "$yaml_loc\n\n";  # YAML is strict on ending \n. Surplus does not hurt
64
        $item->{'location'} = 'CART';
64
         my $rules;
65
        ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
65
         eval { $rules = YAML::Load($yaml_loc); };
66
    }
66
         if ($@) {
67
}
67
             warn "Unable to parse UpdateItemLocationOnCheckin syspref : $@";
68
68
         }
69
if ( C4::Context->preference("ReturnToShelvingCart") ) {
69
         else {
70
    my $item = GetItem($itemnumber);
70
            my $item = GetItem($itemnumber);
71
    $item->{'location'} = 'CART';
71
             if (defined $rules->{_ALL_}) {
72
    ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
72
                 if ($rules->{_ALL_} eq '_PERM_') { $rules->{_ALL_} = $item->{permanent_location}; }
73
}
73
                 if ($rules->{_ALL_} eq '_BLANK_') { $rules->{_ALL_} = ''; }
74
                 if ( $item->{location} ne $rules->{_ALL_}) {
75
                     ModItem( { location => $rules->{_ALL_} }, undef, $itemnumber );
76
                 }
77
             }
78
             else {
79
                 foreach my $key ( keys %$rules ) {
80
                     if ( $rules->{$key} eq '_PERM_' ) { $rules->{$key} = $item->{permanent_location}; }
81
                     if ( $rules->{$key} eq '_BLANK_') { $rules->{$key} = '' ;}
82
                     if ( ($item->{location} eq $key && $item->{location} ne $rules->{$key}) || ($key eq '_BLANK_' && $item->{location} eq '' && $rules->{$key} ne '') ) {
83
                         ModItem( { location => $rules->{$key} }, undef, $itemnumber );
84
                         last;
85
                     }
86
                 }
87
             }
88
         }
89
     }
74
90
75
( $data->{returned} ) = AddReturn( $barcode, $branchcode, $exempt_fine );
91
( $data->{returned} ) = AddReturn( $barcode, $branchcode, $exempt_fine );
76
92
(-)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