From 2ab00242d09231245b1044357ddd2657ffcccf1b Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Fri, 13 May 2011 18:12:51 +0200 Subject: [PATCH] Bug 6050 Make calls to GetItemsInfo consistent MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Do not misleadingly document or pass an unused second parameter makes all calls use the single parameter call as the C4 routines already did Signed-off-by: Frédéric Demians Signed-off-by: Chris Cormack --- C4/Items.pm | 12 ++++-------- basket/basket.pl | 2 +- basket/sendbasket.pl | 2 +- catalogue/detail.pl | 3 +-- catalogue/detailprint.pl | 2 +- opac/opac-ISBDdetail.pl | 2 +- opac/opac-detail.pl | 2 +- opac/opac-sendbasket.pl | 2 +- opac/opac-sendshelf.pl | 2 +- reports/reservereport.pl | 2 +- serials/routing-preview.pl | 2 +- virtualshelves/sendshelf.pl | 2 +- 12 files changed, 15 insertions(+), 20 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 44272e2437..9342564d8c 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1112,16 +1112,12 @@ sub GetItemsByBiblioitemnumber { =head2 GetItemsInfo - @results = GetItemsInfo($biblionumber, $type); + @results = GetItemsInfo($biblionumber); -Returns information about books with the given biblionumber. - -C<$type> may be either C or anything else. If it is not set to -C, then the search will exclude lost, very overdue, and -withdrawn items. +Returns information about items with the given biblionumber. C returns a list of references-to-hash. Each element -contains a number of keys. Most of them are table items from the +contains a number of keys. Most of them are attributes from the C, C, C, and C tables in the Koha database. Other keys include: @@ -1157,7 +1153,7 @@ If this is set, it is set to C. =cut sub GetItemsInfo { - my ( $biblionumber, $type ) = @_; + my ( $biblionumber ) = @_; my $dbh = C4::Context->dbh; # note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance. my $query = " diff --git a/basket/basket.pl b/basket/basket.pl index ed6e5a44cf..8fc15e4b73 100755 --- a/basket/basket.pl +++ b/basket/basket.pl @@ -66,7 +66,7 @@ foreach my $biblionumber ( @bibs ) { my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); my $marcurlsarray = GetMarcUrls ($record,$marcflavour); - my @items = &GetItemsInfo( $biblionumber, 'opac' ); + my @items = GetItemsInfo( $biblionumber ); my $hasauthors = 0; if($dat->{'author'} || @$marcauthorsarray) { diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl index 107a7377da..66f73fa019 100755 --- a/basket/sendbasket.pl +++ b/basket/sendbasket.pl @@ -80,7 +80,7 @@ if ( $email_add ) { my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); - my @items = &GetItemsInfo( $biblionumber, 'opac' ); + my @items = GetItemsInfo( $biblionumber ); my $hasauthors = 0; if($dat->{'author'} || @$marcauthorsarray) { diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 03271b47d7..87387375e7 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -112,8 +112,7 @@ my $branches = GetBranches(); my $itemtypes = GetItemTypes(); my $dbh = C4::Context->dbh; -# 'intra' param included, even though it's not respected in GetItemsInfo currently -my @all_items= GetItemsInfo($biblionumber, 'intra'); +my @all_items = GetItemsInfo( $biblionumber ); my @items; for my $itm (@all_items) { push @items, $itm unless ( $itm->{itemlost} && GetHideLostItemsPreference($borrowernumber) && !$showallitems); diff --git a/catalogue/detailprint.pl b/catalogue/detailprint.pl index 41d346fb61..fe92fe5252 100755 --- a/catalogue/detailprint.pl +++ b/catalogue/detailprint.pl @@ -35,7 +35,7 @@ my $type = $query->param('type'); my $biblionumber = $query->param('biblionumber'); # change back when ive fixed request.pl -my @items = GetItemsInfo( $biblionumber, $type ); +my @items = GetItemsInfo( $biblionumber ); my $norequests = 1; foreach my $itm (@items) { $norequests = 0 unless $itm->{'notforloan'}; diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index b50947ddab..e141da7ff9 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -124,7 +124,7 @@ $template->param( my $norequests = 1; my $res = GetISBDView($biblionumber, "opac"); -my @items = &GetItemsInfo($biblionumber, 'opac'); +my @items = GetItemsInfo( $biblionumber ); my $itemtypes = GetItemTypes(); for my $itm (@items) { diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index b357a56598..6345da1c98 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -85,7 +85,7 @@ if (C4::Context->preference("OPACXSLTDetailsDisplay") ) { $template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); # change back when ive fixed request.pl -my @all_items = &GetItemsInfo( $biblionumber, 'opac' ); +my @all_items = GetItemsInfo( $biblionumber ); my @items; # Getting items to be hidden diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index 0042c4202f..df1b4c5114 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -81,7 +81,7 @@ if ( $email_add ) { my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); - my @items = &GetItemsInfo( $biblionumber, 'opac' ); + my @items = GetItemsInfo( $biblionumber ); my $hasauthors = 0; if($dat->{'author'} || @$marcauthorsarray) { diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl index e3798f8657..b571e07185 100755 --- a/opac/opac-sendshelf.pl +++ b/opac/opac-sendshelf.pl @@ -88,7 +88,7 @@ if ( $email ) { my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); - my @items = &GetItemsInfo( $biblionumber, 'opac' ); + my @items = GetItemsInfo( $biblionumber ); $dat->{MARCNOTES} = $marcnotesarray; $dat->{MARCSUBJCTS} = $marcsubjctsarray; diff --git a/reports/reservereport.pl b/reports/reservereport.pl index 67f384cc12..42a1d2019d 100755 --- a/reports/reservereport.pl +++ b/reports/reservereport.pl @@ -96,7 +96,7 @@ for ( my $i = 0 ; $i < $count ; $i++ ) { # FIXME still need to shift the text to the template so its translateable if ( $data->[$i]) { # find if its on issue - my @items = GetItemsInfo($line{'biblionumber'}, 'intra' ); + my @items = GetItemsInfo( $line{biblionumber} ); my $onissue = 0; foreach my $item (@items) { if ( $item->{'datedue'} eq 'Reserved' ) { diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl index 5d57c13bf7..64849b573a 100755 --- a/serials/routing-preview.pl +++ b/serials/routing-preview.pl @@ -65,7 +65,7 @@ if($ok){ # get biblio information.... my $biblio = $subs->{'biblionumber'}; my ($count2,@bibitems) = GetBiblioItemByBiblioNumber($biblio); - my @itemresults = GetItemsInfo($subs->{'biblionumber'}, 'intra'); + my @itemresults = GetItemsInfo( $subs->{biblionumber} ); my $branch = $itemresults[0]->{'holdingbranch'}; my $branchname = GetBranchName($branch); diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl index d902398e61..16ada89abb 100755 --- a/virtualshelves/sendshelf.pl +++ b/virtualshelves/sendshelf.pl @@ -85,7 +85,7 @@ if ( $email ) { my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); - my @items = &GetItemsInfo( $biblionumber, 'opac' ); + my @items = GetItemsInfo( $biblionumber ); $dat->{MARCNOTES} = $marcnotesarray; $dat->{MARCSUBJCTS} = $marcsubjctsarray; -- 2.39.5