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

(-)a/C4/Items.pm (-8 / +4 lines)
Lines 1127-1142 sub GetItemsByBiblioitemnumber { Link Here
1127
1127
1128
=head2 GetItemsInfo
1128
=head2 GetItemsInfo
1129
1129
1130
  @results = GetItemsInfo($biblionumber, $type);
1130
  @results = GetItemsInfo($biblionumber);
1131
1131
1132
Returns information about books with the given biblionumber.
1132
Returns information about items with the given biblionumber.
1133
1134
C<$type> may be either C<intra> or anything else. If it is not set to
1135
C<intra>, then the search will exclude lost, very overdue, and
1136
withdrawn items.
1137
1133
1138
C<GetItemsInfo> returns a list of references-to-hash. Each element
1134
C<GetItemsInfo> returns a list of references-to-hash. Each element
1139
contains a number of keys. Most of them are table items from the
1135
contains a number of keys. Most of them are attributes from the
1140
C<biblio>, C<biblioitems>, C<items>, and C<itemtypes> tables in the
1136
C<biblio>, C<biblioitems>, C<items>, and C<itemtypes> tables in the
1141
Koha database. Other keys include:
1137
Koha database. Other keys include:
1142
1138
Lines 1172-1178 If this is set, it is set to C<One Order>. Link Here
1172
=cut
1168
=cut
1173
1169
1174
sub GetItemsInfo {
1170
sub GetItemsInfo {
1175
    my ( $biblionumber, $type ) = @_;
1171
    my ( $biblionumber ) = @_;
1176
    my $dbh   = C4::Context->dbh;
1172
    my $dbh   = C4::Context->dbh;
1177
    # note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance.
1173
    # note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance.
1178
    my $query = "
1174
    my $query = "
(-)a/basket/basket.pl (-1 / +1 lines)
Lines 66-72 foreach my $biblionumber ( @bibs ) { Link Here
66
    my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
66
    my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
67
    my $marcseriesarray  = GetMarcSeries  ($record,$marcflavour);
67
    my $marcseriesarray  = GetMarcSeries  ($record,$marcflavour);
68
    my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
68
    my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
69
    my @items            = &GetItemsInfo( $biblionumber, 'opac' );
69
    my @items            = GetItemsInfo( $biblionumber );
70
70
71
    my $hasauthors = 0;
71
    my $hasauthors = 0;
72
    if($dat->{'author'} || @$marcauthorsarray) {
72
    if($dat->{'author'} || @$marcauthorsarray) {
(-)a/basket/sendbasket.pl (-1 / +1 lines)
Lines 80-86 if ( $email_add ) { Link Here
80
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
80
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
81
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
81
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
82
82
83
        my @items = &GetItemsInfo( $biblionumber, 'opac' );
83
        my @items = GetItemsInfo( $biblionumber );
84
84
85
        my $hasauthors = 0;
85
        my $hasauthors = 0;
86
        if($dat->{'author'} || @$marcauthorsarray) {
86
        if($dat->{'author'} || @$marcauthorsarray) {
(-)a/catalogue/detail.pl (-2 / +1 lines)
Lines 111-118 my $branches = GetBranches(); Link Here
111
my $itemtypes = GetItemTypes();
111
my $itemtypes = GetItemTypes();
112
my $dbh = C4::Context->dbh;
112
my $dbh = C4::Context->dbh;
113
113
114
# 'intra' param included, even though it's not respected in GetItemsInfo currently
114
my @all_items = GetItemsInfo( $biblionumber );
115
my @all_items= GetItemsInfo($biblionumber, 'intra');
116
my @items;
115
my @items;
117
for my $itm (@all_items) {
116
for my $itm (@all_items) {
118
    push @items, $itm unless ( $itm->{itemlost} && GetHideLostItemsPreference($borrowernumber) && !$showallitems);
117
    push @items, $itm unless ( $itm->{itemlost} && GetHideLostItemsPreference($borrowernumber) && !$showallitems);
(-)a/catalogue/detailprint.pl (-1 / +1 lines)
Lines 35-41 my $type = $query->param('type'); Link Here
35
my $biblionumber = $query->param('biblionumber');
35
my $biblionumber = $query->param('biblionumber');
36
36
37
# change back when ive fixed request.pl
37
# change back when ive fixed request.pl
38
my @items = GetItemsInfo( $biblionumber, $type );
38
my @items = GetItemsInfo( $biblionumber );
39
my $norequests = 1;
39
my $norequests = 1;
40
foreach my $itm (@items) {
40
foreach my $itm (@items) {
41
    $norequests = 0 unless $itm->{'notforloan'};
41
    $norequests = 0 unless $itm->{'notforloan'};
(-)a/opac/opac-ISBDdetail.pl (-1 / +1 lines)
Lines 124-130 $template->param( Link Here
124
124
125
my $norequests = 1;
125
my $norequests = 1;
126
my $res = GetISBDView($biblionumber, "opac");
126
my $res = GetISBDView($biblionumber, "opac");
127
my @items = &GetItemsInfo($biblionumber, 'opac');
127
my @items = GetItemsInfo( $biblionumber );
128
128
129
my $itemtypes = GetItemTypes();
129
my $itemtypes = GetItemTypes();
130
for my $itm (@items) {
130
for my $itm (@items) {
(-)a/opac/opac-detail.pl (-1 / +1 lines)
Lines 84-90 if (C4::Context->preference("OPACXSLTDetailsDisplay") ) { Link Here
84
84
85
$template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); 
85
$template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); 
86
# change back when ive fixed request.pl
86
# change back when ive fixed request.pl
87
my @all_items = &GetItemsInfo( $biblionumber, 'opac' );
87
my @all_items = GetItemsInfo( $biblionumber );
88
my @items;
88
my @items;
89
@items = @all_items unless C4::Context->preference('hidelostitems');
89
@items = @all_items unless C4::Context->preference('hidelostitems');
90
90
(-)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, 'opac' );
84
        my @items = GetItemsInfo( $biblionumber );
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 (-1 / +1 lines)
Lines 86-92 if ( $email ) { Link Here
86
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
86
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
87
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
87
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
88
88
89
        my @items = &GetItemsInfo( $biblionumber, 'opac' );
89
        my @items = GetItemsInfo( $biblionumber );
90
90
91
        $dat->{MARCNOTES}      = $marcnotesarray;
91
        $dat->{MARCNOTES}      = $marcnotesarray;
92
        $dat->{MARCSUBJCTS}    = $marcsubjctsarray;
92
        $dat->{MARCSUBJCTS}    = $marcsubjctsarray;
(-)a/reports/reservereport.pl (-1 / +1 lines)
Lines 96-102 for ( my $i = 0 ; $i < $count ; $i++ ) { Link Here
96
	 # FIXME still need to shift the text to the template so its translateable
96
	 # FIXME still need to shift the text to the template so its translateable
97
	 if ( $data->[$i]) {
97
	 if ( $data->[$i]) {
98
	     # find if its on issue
98
	     # find if its on issue
99
	     my @items = GetItemsInfo($line{'biblionumber'}, 'intra' );
99
	     my @items = GetItemsInfo( $line{biblionumber} );
100
	     my $onissue = 0;
100
	     my $onissue = 0;
101
	     foreach my $item (@items) {
101
	     foreach my $item (@items) {
102
		 if ( $item->{'datedue'} eq 'Reserved' ) {
102
		 if ( $item->{'datedue'} eq 'Reserved' ) {
(-)a/serials/routing-preview.pl (-1 / +1 lines)
Lines 65-71 if($ok){ Link Here
65
    # get biblio information....
65
    # get biblio information....
66
    my $biblio = $subs->{'biblionumber'};
66
    my $biblio = $subs->{'biblionumber'};
67
	my ($count2,@bibitems) = GetBiblioItemByBiblioNumber($biblio);
67
	my ($count2,@bibitems) = GetBiblioItemByBiblioNumber($biblio);
68
	my @itemresults = GetItemsInfo($subs->{'biblionumber'}, 'intra');
68
	my @itemresults = GetItemsInfo( $subs->{biblionumber} );
69
	my $branch = $itemresults[0]->{'holdingbranch'};
69
	my $branch = $itemresults[0]->{'holdingbranch'};
70
	my $branchname = GetBranchName($branch);
70
	my $branchname = GetBranchName($branch);
71
71
(-)a/virtualshelves/sendshelf.pl (-2 / +1 lines)
Lines 85-91 if ( $email ) { Link Here
85
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
85
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
86
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
86
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
87
87
88
        my @items = &GetItemsInfo( $biblionumber, 'opac' );
88
        my @items = GetItemsInfo( $biblionumber );
89
89
90
        $dat->{MARCNOTES}      = $marcnotesarray;
90
        $dat->{MARCNOTES}      = $marcnotesarray;
91
        $dat->{MARCSUBJCTS}    = $marcsubjctsarray;
91
        $dat->{MARCSUBJCTS}    = $marcsubjctsarray;
92
- 

Return to bug 6050