[Koha-patches] [PATCH 1/2] [SIGNED-OFF] Bug 6050 Make calls to GetItemsInfo consistent
Frédéric Demians
f.demians at tamil.fr
Fri May 13 18:12:51 CEST 2011
From: Colin Campbell <colin.campbell at ptfs-europe.com>
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 <f.demians at tamil.fr>
---
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 44272e2..9342564 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<intra> or anything else. If it is not set to
-C<intra>, then the search will exclude lost, very overdue, and
-withdrawn items.
+Returns information about items with the given biblionumber.
C<GetItemsInfo> 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<biblio>, C<biblioitems>, C<items>, and C<itemtypes> tables in the
Koha database. Other keys include:
@@ -1157,7 +1153,7 @@ If this is set, it is set to C<One Order>.
=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 ed6e5a4..8fc15e4 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 107a737..66f73fa 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 03271b4..8738737 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 41d346f..fe92fe5 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 b50947d..e141da7 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 b357a56..6345da1 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 0042c42..df1b4c5 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 6a376c4..b1c34de 100755
--- a/opac/opac-sendshelf.pl
+++ b/opac/opac-sendshelf.pl
@@ -86,7 +86,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 67f384c..42a1d20 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 5d57c13..64849b5 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, at 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 d902398..16ada89 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;
--
1.7.4
More information about the Koha-patches
mailing list