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

(-)a/C4/Items.pm (-1 / +24 lines)
Lines 1164-1170 If this is set, it is set to C<One Order>. Link Here
1164
=cut
1164
=cut
1165
1165
1166
sub GetItemsInfo {
1166
sub GetItemsInfo {
1167
    my ( $biblionumber ) = @_;
1167
    my ( $biblionumber, $opac ) = @_;
1168
    my $dbh   = C4::Context->dbh;
1168
    my $dbh   = C4::Context->dbh;
1169
    # note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance.
1169
    # note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance.
1170
    my $query = "
1170
    my $query = "
Lines 1269-1274 sub GetItemsInfo { Link Here
1269
            $data->{notforloanvalue} = $lib;
1269
            $data->{notforloanvalue} = $lib;
1270
        }
1270
        }
1271
1271
1272
        # get itemnotes authorised value if applicable
1273
        my $sql_itemnotes = "
1274
            SELECT authorised_value
1275
            FROM   marc_subfield_structure
1276
            WHERE  kohafield = 'items.itemnotes'
1277
            AND    frameworkcode = ?
1278
        ";
1279
        my $sth_itemnotes = $dbh->prepare( $sql_itemnotes );
1280
        $sth_itemnotes->execute( $data->{'frameworkcode'} );
1281
        
1282
        my ($authorised_valuecode) = $sth_itemnotes->fetchrow;
1283
        my $lib = $opac ? 'lib_opac' : 'lib';
1284
        if ($authorised_valuecode) {
1285
            $sth_itemnotes = $dbh->prepare(
1286
                "SELECT $lib FROM authorised_values
1287
                 WHERE  category=?
1288
                 AND authorised_value=?"
1289
            );
1290
            $sth_itemnotes->execute( $authorised_valuecode, $data->{'itemnotes'} );
1291
            my ($lib) = $sth_itemnotes->fetchrow;
1292
            $data->{'itemnotes'} = $lib;
1293
        }
1294
1272
        # get restricted status and description if applicable
1295
        # get restricted status and description if applicable
1273
        my $restrictedstatus = $dbh->prepare(
1296
        my $restrictedstatus = $dbh->prepare(
1274
            'SELECT authorised_value
1297
            'SELECT authorised_value
(-)a/opac/opac-ISBDdetail.pl (-1 / +1 lines)
Lines 127-133 $template->param( Link Here
127
127
128
my $norequests = 1;
128
my $norequests = 1;
129
my $res = GetISBDView($biblionumber, "opac");
129
my $res = GetISBDView($biblionumber, "opac");
130
my @items = GetItemsInfo( $biblionumber );
130
my @items = GetItemsInfo( $biblionumber, 1 );
131
131
132
my $itemtypes = GetItemTypes();
132
my $itemtypes = GetItemTypes();
133
for my $itm (@items) {
133
for my $itm (@items) {
(-)a/opac/opac-detail.pl (-2 / +2 lines)
Lines 372-378 $template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) ); Link Here
372
372
373
$template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); 
373
$template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); 
374
# change back when ive fixed request.pl
374
# change back when ive fixed request.pl
375
my @all_items = GetItemsInfo( $biblionumber );
375
my @all_items = GetItemsInfo( $biblionumber, 1 );
376
376
377
# adding items linked via host biblios
377
# adding items linked via host biblios
378
my $marcflavour  = C4::Context->preference("marcflavour");
378
my $marcflavour  = C4::Context->preference("marcflavour");
Lines 386-392 if ($marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC'){ Link Here
386
foreach my $hostfield ( $record->field($analyticfield)) {
386
foreach my $hostfield ( $record->field($analyticfield)) {
387
    my $hostbiblionumber = $hostfield->subfield("0");
387
    my $hostbiblionumber = $hostfield->subfield("0");
388
    my $linkeditemnumber = $hostfield->subfield("9");
388
    my $linkeditemnumber = $hostfield->subfield("9");
389
    my @hostitemInfos = GetItemsInfo($hostbiblionumber);
389
    my @hostitemInfos = GetItemsInfo( $hostbiblionumber, 1);
390
    foreach my $hostitemInfo (@hostitemInfos){
390
    foreach my $hostitemInfo (@hostitemInfos){
391
        if ($hostitemInfo->{itemnumber} eq $linkeditemnumber){
391
        if ($hostitemInfo->{itemnumber} eq $linkeditemnumber){
392
            push(@all_items, $hostitemInfo);
392
            push(@all_items, $hostitemInfo);
(-)a/opac/opac-reserve.pl (-1 / +1 lines)
Lines 123-129 foreach my $biblioNumber (@biblionumbers) { Link Here
123
    my $biblioData = GetBiblioData($biblioNumber);
123
    my $biblioData = GetBiblioData($biblioNumber);
124
    $biblioDataHash{$biblioNumber} = $biblioData;
124
    $biblioDataHash{$biblioNumber} = $biblioData;
125
125
126
    my @itemInfos = GetItemsInfo($biblioNumber);
126
    my @itemInfos = GetItemsInfo($biblioNumber,1);
127
127
128
    my $marcrecord= GetMarcBiblio($biblioNumber);
128
    my $marcrecord= GetMarcBiblio($biblioNumber);
129
129
(-)a/opac/opac-sendbasket.pl (-1 / +1 lines)
Lines 81-87 if ( $email_add ) { Link Here
81
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
81
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
82
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
82
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
83
83
84
        my @items = GetItemsInfo( $biblionumber );
84
        my @items = GetItemsInfo( $biblionumber, 1 );
85
85
86
        my $hasauthors = 0;
86
        my $hasauthors = 0;
87
        if($dat->{'author'} || @$marcauthorsarray) {
87
        if($dat->{'author'} || @$marcauthorsarray) {
(-)a/opac/opac-sendshelf.pl (-2 / +1 lines)
Lines 89-95 if ( $email ) { Link Here
89
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
89
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
90
        my $subtitle         = GetRecordValue('subtitle', $record, $fw);
90
        my $subtitle         = GetRecordValue('subtitle', $record, $fw);
91
91
92
        my @items = GetItemsInfo( $biblionumber );
92
        my @items = GetItemsInfo( $biblionumber, 1 );
93
93
94
        $dat->{MARCNOTES}      = $marcnotesarray;
94
        $dat->{MARCNOTES}      = $marcnotesarray;
95
        $dat->{MARCSUBJCTS}    = $marcsubjctsarray;
95
        $dat->{MARCSUBJCTS}    = $marcsubjctsarray;
96
- 

Return to bug 7515