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

(-)a/C4/Items.pm (-4 / +1 lines)
Lines 1298-1303 sub GetItemsInfo { Link Here
1298
           items.notforloan as itemnotforloan,
1298
           items.notforloan as itemnotforloan,
1299
           issues.borrowernumber,
1299
           issues.borrowernumber,
1300
           issues.date_due as datedue,
1300
           issues.date_due as datedue,
1301
           issues.onsite_checkout,
1301
           borrowers.cardnumber,
1302
           borrowers.cardnumber,
1302
           borrowers.surname,
1303
           borrowers.surname,
1303
           borrowers.firstname,
1304
           borrowers.firstname,
Lines 1311-1318 sub GetItemsInfo { Link Here
1311
           holding.opac_info as holding_branch_opac_info,
1312
           holding.opac_info as holding_branch_opac_info,
1312
           home.opac_info as home_branch_opac_info
1313
           home.opac_info as home_branch_opac_info
1313
    ";
1314
    ";
1314
    $query .= ", issues.onsite_checkout"
1315
        if C4::Context->preference("OnSiteCheckouts");
1316
    $query .= "
1315
    $query .= "
1317
     FROM items
1316
     FROM items
1318
     LEFT JOIN branches AS holding ON items.holdingbranch = holding.branchcode
1317
     LEFT JOIN branches AS holding ON items.holdingbranch = holding.branchcode
Lines 1325-1332 sub GetItemsInfo { Link Here
1325
     LEFT JOIN serial USING (serialid)
1324
     LEFT JOIN serial USING (serialid)
1326
     LEFT JOIN itemtypes   ON   itemtypes.itemtype         = "
1325
     LEFT JOIN itemtypes   ON   itemtypes.itemtype         = "
1327
     . (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype');
1326
     . (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype');
1328
    $query .= " LEFT JOIN issues ON issues.itemnumber = items.itemnumber"
1329
        if C4::Context->preference("OnSiteCheckouts");
1330
    $query .= " WHERE items.biblionumber = ? ORDER BY home.branchname, items.enumchron, LPAD( items.copynumber, 8, '0' ), items.dateaccessioned DESC" ;
1327
    $query .= " WHERE items.biblionumber = ? ORDER BY home.branchname, items.enumchron, LPAD( items.copynumber, 8, '0' ), items.dateaccessioned DESC" ;
1331
    my $sth = $dbh->prepare($query);
1328
    my $sth = $dbh->prepare($query);
1332
    $sth->execute($biblionumber);
1329
    $sth->execute($biblionumber);
(-)a/t/db_dependent/Items.t (-2 / +3 lines)
Lines 157-163 subtest 'GetHiddenItemnumbers tests' => sub { Link Here
157
157
158
subtest 'GetItemsInfo tests' => sub {
158
subtest 'GetItemsInfo tests' => sub {
159
159
160
    plan tests => 3;
160
    plan tests => 4;
161
161
162
    # Start transaction
162
    # Start transaction
163
    $dbh->{AutoCommit} = 0;
163
    $dbh->{AutoCommit} = 0;
Lines 186-191 subtest 'GetItemsInfo tests' => sub { Link Here
186
        'GetItemsInfo returns the correct home branch OPAC info notice' );
186
        'GetItemsInfo returns the correct home branch OPAC info notice' );
187
    is( $results[0]->{ holding_branch_opac_info }, "holdingbranch OPAC info",
187
    is( $results[0]->{ holding_branch_opac_info }, "holdingbranch OPAC info",
188
        'GetItemsInfo returns the correct holding branch OPAC info notice' );
188
        'GetItemsInfo returns the correct holding branch OPAC info notice' );
189
    is( exists( $results[0]->{ onsite_checkout } ), 1,
190
        'GetItemsInfo returns a onsite_checkout key' );
189
191
190
    $dbh->rollback;
192
    $dbh->rollback;
191
};
193
};
192
- 

Return to bug 13332