Bugzilla – Attachment 3648 Details for
Bug 6050
GetItemsInfo ignores second parameter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0001-Bug-6050-Make-calls-to-GetItemsInfo-consistent.patch (text/plain), 7.92 KB, created by
Colin Campbell
on 2011-04-04 16:47:48 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Colin Campbell
Created:
2011-04-04 16:47:48 UTC
Size:
7.92 KB
patch
obsolete
>From 97c376f6150b791027f4e136e1eae6af18d2acbc Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Mon, 4 Apr 2011 17:42:48 +0100 >Subject: [PATCH] Bug 6050 Make calls to GetItemsInfo consistent >Content-Type: text/plain; charset="utf-8" > >Do not misleadingly document or pass an unused second parameter >makes all calls use the single parameter call as the C4 >routines already did >--- > 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 939e682..8b9164e 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1127,16 +1127,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: > >@@ -1172,7 +1168,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 21fcb1f..c109f81 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -111,8 +111,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 f230834..bb1ea2e 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -84,7 +84,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; > @items = @all_items unless C4::Context->preference('hidelostitems'); > >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,@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 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6050
: 3648