Bugzilla – Attachment 54289 Details for
Bug 16741
Remove dead code "sub itemissues" from C4/Circulation.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16741 - Remove dead code "sub itemissues" from C4/Circulation.pm
Bug-16741---Remove-dead-code-sub-itemissues-from-C.patch (text/plain), 4.28 KB, created by
Jonathan Druart
on 2016-08-11 09:41:04 UTC
(
hide
)
Description:
Bug 16741 - Remove dead code "sub itemissues" from C4/Circulation.pm
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-08-11 09:41:04 UTC
Size:
4.28 KB
patch
obsolete
>From 19e529ebf0ac99e0e55708bfc6f7aa7f57d8fca9 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Wed, 10 Aug 2016 10:12:55 +0200 >Subject: [PATCH] Bug 16741 - Remove dead code "sub itemissues" from > C4/Circulation.pm > >To verify: >- git grep itemissues >Result: Appears in C4/Circulation.pm only > >To test: >- apply patch >- git grep itemissues >Expected result: No occurences >- prove t/db_dependent/Circulation.t >Expected result: Pass OK > >Signed-off-by: Claire Gravely <c.gravely@arts.ac.uk> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > C4/Circulation.pm | 108 ------------------------------------------------------ > 1 file changed, 108 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 9b95bbf..1304d11 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -551,114 +551,6 @@ sub TooMany { > return; > } > >-=head2 itemissues >- >- @issues = &itemissues($biblioitemnumber, $biblio); >- >-Looks up information about who has borrowed the bookZ<>(s) with the >-given biblioitemnumber. >- >-C<$biblio> is ignored. >- >-C<&itemissues> returns an array of references-to-hash. The keys >-include the fields from the C<items> table in the Koha database. >-Additional keys include: >- >-=over 4 >- >-=item C<date_due> >- >-If the item is currently on loan, this gives the due date. >- >-If the item is not on loan, then this is either "Available" or >-"Cancelled", if the item has been withdrawn. >- >-=item C<card> >- >-If the item is currently on loan, this gives the card number of the >-patron who currently has the item. >- >-=item C<timestamp0>, C<timestamp1>, C<timestamp2> >- >-These give the timestamp for the last three times the item was >-borrowed. >- >-=item C<card0>, C<card1>, C<card2> >- >-The card number of the last three patrons who borrowed this item. >- >-=item C<borrower0>, C<borrower1>, C<borrower2> >- >-The borrower number of the last three patrons who borrowed this item. >- >-=back >- >-=cut >- >-#' >-sub itemissues { >- my ( $bibitem, $biblio ) = @_; >- my $dbh = C4::Context->dbh; >- my $sth = >- $dbh->prepare("Select * from items where items.biblioitemnumber = ?") >- || die $dbh->errstr; >- my $i = 0; >- my @results; >- >- $sth->execute($bibitem) || die $sth->errstr; >- >- while ( my $data = $sth->fetchrow_hashref ) { >- >- # Find out who currently has this item. >- # FIXME - Wouldn't it be better to do this as a left join of >- # some sort? Currently, this code assumes that if >- # fetchrow_hashref() fails, then the book is on the shelf. >- # fetchrow_hashref() can fail for any number of reasons (e.g., >- # database server crash), not just because no items match the >- # search criteria. >- my $sth2 = $dbh->prepare( >- "SELECT * FROM issues >- LEFT JOIN borrowers ON issues.borrowernumber = borrowers.borrowernumber >- WHERE itemnumber = ? >- " >- ); >- >- $sth2->execute( $data->{'itemnumber'} ); >- if ( my $data2 = $sth2->fetchrow_hashref ) { >- $data->{'date_due'} = $data2->{'date_due'}; >- $data->{'card'} = $data2->{'cardnumber'}; >- $data->{'borrower'} = $data2->{'borrowernumber'}; >- } >- else { >- $data->{'date_due'} = ($data->{'withdrawn'} eq '1') ? 'Cancelled' : 'Available'; >- } >- >- >- # Find the last 3 people who borrowed this item. >- $sth2 = $dbh->prepare( >- "SELECT * FROM old_issues >- LEFT JOIN borrowers ON issues.borrowernumber = borrowers.borrowernumber >- WHERE itemnumber = ? >- ORDER BY returndate DESC,timestamp DESC" >- ); >- >- $sth2->execute( $data->{'itemnumber'} ); >- for ( my $i2 = 0 ; $i2 < 2 ; $i2++ ) >- { # FIXME : error if there is less than 3 pple borrowing this item >- if ( my $data2 = $sth2->fetchrow_hashref ) { >- $data->{"timestamp$i2"} = $data2->{'timestamp'}; >- $data->{"card$i2"} = $data2->{'cardnumber'}; >- $data->{"borrower$i2"} = $data2->{'borrowernumber'}; >- } # if >- } # for >- >- $results[$i] = $data; >- $i++; >- } >- >- return (@results); >-} >- > =head2 CanBookBeIssued > > ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $borrower, >-- >2.8.1
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 16741
:
54259
|
54284
| 54289