Bugzilla – Attachment 20801 Details for
Bug 10636
patronimage should have borrowernumber as PK, not cardnumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10636 - patronimage should have borrowernumber as PK, not cardnumber
Bug-10636---patronimage-should-have-borrowernumber.patch (text/plain), 25.10 KB, created by
Kyle M Hall (khall)
on 2013-09-05 13:45:34 UTC
(
hide
)
Description:
Bug 10636 - patronimage should have borrowernumber as PK, not cardnumber
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-09-05 13:45:34 UTC
Size:
25.10 KB
patch
obsolete
>From a560c897709f81dd478114ecb8ea7d97039c8772 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 29 Aug 2013 12:23:39 -0400 >Subject: [PATCH] Bug 10636 - patronimage should have borrowernumber as PK, not cardnumber > >Test Plan: >1) Apply this patch >2) Run updatedatabase.pl >3) Enable patronimages >4) Verify patron images are still displaying correctly >5) Test deleting a patron image >6) Test adding a patron image from moremember.pl >7) Test adding a patron image from tools/picture-upload.pl >--- > C4/Members.pm | 26 ++++++------ > circ/circulation.pl | 2 +- > installer/data/mysql/kohastructure.sql | 6 +- > installer/data/mysql/updatedatabase.pl | 46 ++++++++++++++++++++ > .../intranet-tmpl/prog/en/includes/circ-menu.inc | 2 +- > .../intranet-tmpl/prog/en/includes/circ-menu.tt | 2 +- > members/boraccount.pl | 2 +- > members/deletemem.pl | 2 +- > members/files.pl | 2 +- > members/mancredit.pl | 2 +- > members/maninvoice.pl | 2 +- > members/member-flags.pl | 2 +- > members/member-password.pl | 2 +- > members/moremember.pl | 2 +- > members/notices.pl | 2 +- > members/patronimage.pl | 18 ++++---- > members/pay.pl | 2 +- > members/paycollect.pl | 2 +- > members/printfeercpt.pl | 2 +- > members/printinvoice.pl | 2 +- > members/readingrec.pl | 2 +- > members/routing-lists.pl | 2 +- > members/statistics.pl | 2 +- > opac/opac-memberentry.pl | 2 +- > opac/opac-patron-image.pl | 3 +- > opac/sco/sco-main.pl | 2 +- > opac/sco/sco-patron-image.pl | 4 +- > patroncards/create-pdf.pl | 2 +- > tools/picture-upload.pl | 2 +- > tools/viewlog.pl | 2 +- > 30 files changed, 98 insertions(+), 53 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index 7ac69df..1598893 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -1944,19 +1944,19 @@ sub GetTitles { > > =head2 GetPatronImage > >- my ($imagedata, $dberror) = GetPatronImage($cardnumber); >+ my ($imagedata, $dberror) = GetPatronImage($borrowernumber); > >-Returns the mimetype and binary image data of the image for the patron with the supplied cardnumber. >+Returns the mimetype and binary image data of the image for the patron with the supplied borrowernumber. > > =cut > > sub GetPatronImage { >- my ($cardnumber) = @_; >- warn "Cardnumber passed to GetPatronImage is $cardnumber" if $debug; >+ my ($borrowernumber) = @_; >+ warn "Borrowernumber passed to GetPatronImage is $borrowernumber" if $debug; > my $dbh = C4::Context->dbh; >- my $query = 'SELECT mimetype, imagefile FROM patronimage WHERE cardnumber = ?'; >+ my $query = 'SELECT mimetype, imagefile FROM patronimage WHERE borrowernumber = ?'; > my $sth = $dbh->prepare($query); >- $sth->execute($cardnumber); >+ $sth->execute($borrowernumber); > my $imagedata = $sth->fetchrow_hashref; > warn "Database error!" if $sth->errstr; > return $imagedata, $sth->errstr; >@@ -1975,7 +1975,7 @@ sub PutPatronImage { > my ($cardnumber, $mimetype, $imgfile) = @_; > warn "Parameters passed in: Cardnumber=$cardnumber, Mimetype=$mimetype, " . ($imgfile ? "Imagefile" : "No Imagefile") if $debug; > my $dbh = C4::Context->dbh; >- my $query = "INSERT INTO patronimage (cardnumber, mimetype, imagefile) VALUES (?,?,?) ON DUPLICATE KEY UPDATE imagefile = ?;"; >+ my $query = "INSERT INTO patronimage (borrowernumber, mimetype, imagefile) VALUES ( ( SELECT borrowernumber from borrowers WHERE cardnumber = ? ),?,?) ON DUPLICATE KEY UPDATE imagefile = ?;"; > my $sth = $dbh->prepare($query); > $sth->execute($cardnumber,$mimetype,$imgfile,$imgfile); > warn "Error returned inserting $cardnumber.$mimetype." if $sth->errstr; >@@ -1984,19 +1984,19 @@ sub PutPatronImage { > > =head2 RmPatronImage > >- my ($dberror) = RmPatronImage($cardnumber); >+ my ($dberror) = RmPatronImage($borrowernumber); > >-Removes the image for the patron with the supplied cardnumber. >+Removes the image for the patron with the supplied borrowernumber. > > =cut > > sub RmPatronImage { >- my ($cardnumber) = @_; >- warn "Cardnumber passed to GetPatronImage is $cardnumber" if $debug; >+ my ($borrowernumber) = @_; >+ warn "Borrowernumber passed to GetPatronImage is $borrowernumber" if $debug; > my $dbh = C4::Context->dbh; >- my $query = "DELETE FROM patronimage WHERE cardnumber = ?;"; >+ my $query = "DELETE FROM patronimage WHERE borrowernumber = ?;"; > my $sth = $dbh->prepare($query); >- $sth->execute($cardnumber); >+ $sth->execute($borrowernumber); > my $dberror = $sth->errstr; > warn "Database error!" if $sth->errstr; > return $dberror; >diff --git a/circ/circulation.pl b/circ/circulation.pl >index efd533e..cd997b3 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -765,7 +765,7 @@ if ($stickyduedate) { > $session->param( 'stickyduedate', $duedatespec ); > } > >-my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'}); >+my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > # get authorised values with type of BOR_NOTES >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 7628983..e7af046 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1660,11 +1660,11 @@ CREATE TABLE `patroncards` ( > > DROP TABLE IF EXISTS `patronimage`; > CREATE TABLE `patronimage` ( -- information related to patron images >- `cardnumber` varchar(16) NOT NULL, -- the cardnumber of the patron this image is attached to (borrowers.cardnumber) >+ `borrowernumber` int(11) NOT NULL, -- the borrowernumber of the patron this image is attached to (borrowers.borrowernumber) > `mimetype` varchar(15) NOT NULL, -- the format of the image (png, jpg, etc) > `imagefile` mediumblob NOT NULL, -- the image >- PRIMARY KEY (`cardnumber`), >- CONSTRAINT `patronimage_fk1` FOREIGN KEY (`cardnumber`) REFERENCES `borrowers` (`cardnumber`) ON DELETE CASCADE ON UPDATE CASCADE >+ PRIMARY KEY (`borrowernumber`), >+ CONSTRAINT `patronimage_fk1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > > -- Table structure for table `pending_offline_operations` >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 74aeb3e..bceda86 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7067,6 +7067,52 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.13.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(qq{ >+ DELETE FROM patronimage WHERE cardnumber NOT IN ( SELECT cardnumber FROM borrowers ) >+ }); >+ >+ $dbh->do(qq{ >+ ALTER TABLE patronimage ADD borrowernumber INT( 11 ) NULL FIRST >+ }); >+ >+ $dbh->{AutoCommit} = 0; >+ $dbh->{RaiseError} = 1; >+ >+ eval { >+ $dbh->do(qq{ >+ UPDATE patronimage LEFT JOIN borrowers USING ( cardnumber ) SET patronimage.borrowernumber = borrowers.borrowernumber >+ }); >+ $dbh->commit(); >+ }; >+ >+ if ($@) { >+ print "Upgrade to $DBversion done (Bug 10636 - patronimage should have borrowernumber as PK, not cardnumber) failed! Transaction aborted because $@\n"; >+ eval { $dbh->rollback }; >+ } >+ else { >+ $dbh->do(qq{ >+ ALTER TABLE patronimage DROP FOREIGN KEY patronimage_fk1 >+ }); >+ $dbh->do(qq{ >+ ALTER TABLE patronimage DROP PRIMARY KEY, ADD PRIMARY KEY( borrowernumber ) >+ }); >+ $dbh->do(qq{ >+ ALTER TABLE patronimage DROP cardnumber >+ }); >+ $dbh->do(qq{ >+ ALTER TABLE patronimage ADD FOREIGN KEY ( borrowernumber ) REFERENCES borrowers ( borrowernumber ) ON DELETE CASCADE ON UPDATE CASCADE >+ }); >+ >+ print "Upgrade to $DBversion done (Bug 10636 - patronimage should have borrowernumber as PK, not cardnumber)\n"; >+ SetVersion($DBversion); >+ } >+ >+ $dbh->{AutoCommit} = 1; >+ $dbh->{RaiseError} = 0; >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >index 4632467..62db1c5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -7,7 +7,7 @@ > <ul class="patronbriefinfo"> > [% IF ( patronimages ) %] > [% IF ( picture ) %] >-<li><img src="/cgi-bin/koha/members/patronimage.pl?crdnum=[% cardnumber | uri %]" id="patronimage" alt="[% firstname %] [% surname %] ([% cardnumber %])" border="0" style="max-width : 140px; margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC; width:auto !important; width:130px;" /></li> >+<li><img src="/cgi-bin/koha/members/patronimage.pl?borrowernumber=[% borrowernumber | uri %]" id="patronimage" alt="[% firstname %] [% surname %] ([% cardnumber %])" border="0" style="max-width : 140px; margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC; width:auto !important; width:130px;" /></li> > [% ELSE %] > <li id="patronbasics"><img src="[% interface %]/[% theme %]/img/patron-blank.png" alt="[% firstname %] [% surname %] ([% cardnumber %])" border="0" style="margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC;" /></li> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt >index 8d52b90..7f8cb48 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt >@@ -9,7 +9,7 @@ in the global namespace %] > <ul class="patronbriefinfo"> > [% IF ( patronimages ) %] > [% IF borrower.has_picture %] >-<li><img src="/cgi-bin/koha/members/patronimage.pl?crdnum=[% borrower.cardnumber %]" id="patronimage" alt="[% borrower.firstname %] [% borrower.surname %] ([% borrower.cardnumber %])" border="0" style="max-width : 140px; margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC; width:auto !important; width:130px;" /></li> >+<li><img src="/cgi-bin/koha/members/patronimage.pl?borrowernumber=[% borrower.borrowernumber %]" id="patronimage" alt="[% borrower.firstname %] [% borrower.surname %] ([% borrower.cardnumber %])" border="0" style="max-width : 140px; margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC; width:auto !important; width:130px;" /></li> > [% ELSE %] > <li id="patronbasics"><img src="[% interface %]/[% theme %]/img/patron-blank.png" alt="[% borrower.firstname %] [% borrower.surname %] ([% borrower.cardnumber %])" border="0" style="margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC;" /></li> > [% END %] >diff --git a/members/boraccount.pl b/members/boraccount.pl >index 48e2620..255b1ff 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -92,7 +92,7 @@ foreach my $accountline ( @{$accts}) { > > $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); > >-my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); >+my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > if (C4::Context->preference('ExtendedPatronAttributes')) { >diff --git a/members/deletemem.pl b/members/deletemem.pl >index ef6ba01..6b99cb3 100755 >--- a/members/deletemem.pl >+++ b/members/deletemem.pl >@@ -83,7 +83,7 @@ my $data=$sth->fetchrow_hashref; > if ($countissues > 0 or $flags->{'CHARGES'} or $data->{'borrowernumber'}){ > # print $input->header; > >- my ($picture, $dberror) = GetPatronImage($bor->{'cardnumber'}); >+ my ($picture, $dberror) = GetPatronImage($bor->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > $template->param(borrowernumber => $member, >diff --git a/members/files.pl b/members/files.pl >index 77d7be5..dc08751 100755 >--- a/members/files.pl >+++ b/members/files.pl >@@ -115,7 +115,7 @@ else { > ); > } > >- my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); >+ my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > $template->param( >diff --git a/members/mancredit.pl b/members/mancredit.pl >index b011d1a..a2c2258 100755 >--- a/members/mancredit.pl >+++ b/members/mancredit.pl >@@ -77,7 +77,7 @@ if ($add){ > } > > $template->param( adultborrower => 1 ) if ( $data->{category_type} eq 'A' ); >- my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); >+ my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > if (C4::Context->preference('ExtendedPatronAttributes')) { >diff --git a/members/maninvoice.pl b/members/maninvoice.pl >index 6331535..c4a9294 100755 >--- a/members/maninvoice.pl >+++ b/members/maninvoice.pl >@@ -105,7 +105,7 @@ if ($add){ > } > > $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); >- my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); >+ my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > if (C4::Context->preference('ExtendedPatronAttributes')) { >diff --git a/members/member-flags.pl b/members/member-flags.pl >index d1c165c..7b08108 100755 >--- a/members/member-flags.pl >+++ b/members/member-flags.pl >@@ -160,7 +160,7 @@ if ($input->param('newflags')) { > } > > $template->param( adultborrower => 1 ) if ( $bor->{'category_type'} eq 'A' ); >- my ($picture, $dberror) = GetPatronImage($bor->{'cardnumber'}); >+ my ($picture, $dberror) = GetPatronImage($bor->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > if (C4::Context->preference('ExtendedPatronAttributes')) { >diff --git a/members/member-password.pl b/members/member-password.pl >index bed8fc4..1199657 100755 >--- a/members/member-password.pl >+++ b/members/member-password.pl >@@ -88,7 +88,7 @@ if ( $newpassword && !scalar(@errors) ) { > } > > $template->param( adultborrower => 1 ) if ( $bor->{'category_type'} eq 'A' ); >-my ($picture, $dberror) = GetPatronImage($bor->{'cardnumber'}); >+my ($picture, $dberror) = GetPatronImage($bor->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > if (C4::Context->preference('ExtendedPatronAttributes')) { >diff --git a/members/moremember.pl b/members/moremember.pl >index 7ed96d3..e7542a2 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -356,7 +356,7 @@ if($userenv->{flags} % 2 == 1){ > # check to see if patron's image exists in the database > # basically this gives us a template var to condition the display of > # patronimage related interface on >-my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); >+my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > my $branch=C4::Context->userenv->{'branch'}; >diff --git a/members/notices.pl b/members/notices.pl >index 16935d9..aca4514 100755 >--- a/members/notices.pl >+++ b/members/notices.pl >@@ -47,7 +47,7 @@ my ($template, $loggedinuser, $cookie) > }); > > $template->param( $borrower ); >-my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'}); >+my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > # Getting the messages >diff --git a/members/patronimage.pl b/members/patronimage.pl >index e76d117..4f663d6 100755 >--- a/members/patronimage.pl >+++ b/members/patronimage.pl >@@ -31,7 +31,7 @@ $|=1; > > my $DEBUG = 0; > my $data = new CGI; >-my $cardnumber; >+my $borrowernumber; > > =head1 NAME > >@@ -39,24 +39,24 @@ patronimage.pl - Script for retrieving and formatting Koha patron images for dis > > =head1 SYNOPSIS > >-<img src="patronimage.pl?crdnum= /> >+<img src="patronimage.pl?borrowernumber= /> > > =head1 DESCRIPTION > >-This script, when called from within HTML and passed a valid patron cardnumber, will retrieve the image data associated with that cardnumber if one exists, format it in proper HTML format and pass it back to be displayed. >+This script, when called from within HTML and passed a valid patron borrowernumber, will retrieve the image data associated with that borrowernumber if one exists, format it in proper HTML format and pass it back to be displayed. > > =cut > >-if ($data->param('crdnum')) { >- $cardnumber = $data->param('crdnum'); >+if ($data->param('borrowernumber')) { >+ $borrowernumber = $data->param('borrowernumber'); > } else { >- $cardnumber = shift; >+ $borrowernumber = shift; > } > > >-warn "Cardnumber passed in: $cardnumber" if $DEBUG; >+warn "Borrowernumber passed in: $borrowernumber" if $DEBUG; > >-my ($imagedata, $dberror) = GetPatronImage($cardnumber); >+my ($imagedata, $dberror) = GetPatronImage($borrowernumber); > > if ($dberror) { > warn "Database Error!"; >@@ -70,7 +70,7 @@ if ($imagedata) { > print $data->header (-type => $imagedata->{'mimetype'}, -'Cache-Control' => 'no-store', -Content_Length => length ($imagedata->{'imagefile'})), $imagedata->{'imagefile'}; > exit; > } else { >- warn "No image exists for $cardnumber"; >+ warn "No image exists for $borrowernumber"; > exit; > } > >diff --git a/members/pay.pl b/members/pay.pl >index 4efffc3..8a8e902 100755 >--- a/members/pay.pl >+++ b/members/pay.pl >@@ -220,7 +220,7 @@ sub borrower_add_additional_fields { > } elsif ( $b_ref->{category_type} eq 'A' ) { > $b_ref->{adultborrower} = 1; > } >- my ( $picture, $dberror ) = GetPatronImage( $b_ref->{cardnumber} ); >+ my ( $picture, $dberror ) = GetPatronImage( $b_ref->{borrowernumber} ); > if ($picture) { > $b_ref->{has_picture} = 1; > } >diff --git a/members/paycollect.pl b/members/paycollect.pl >index 5edb644..96ca0fb 100755 >--- a/members/paycollect.pl >+++ b/members/paycollect.pl >@@ -169,7 +169,7 @@ sub borrower_add_additional_fields { > } elsif ( $b_ref->{category_type} eq 'A' ) { > $b_ref->{adultborrower} = 1; > } >- my ( $picture, $dberror ) = GetPatronImage( $b_ref->{cardnumber} ); >+ my ( $picture, $dberror ) = GetPatronImage( $b_ref->{borrowernumber} ); > if ($picture) { > $b_ref->{has_picture} = 1; > } >diff --git a/members/printfeercpt.pl b/members/printfeercpt.pl >index 59d5cb3..efd03c1 100755 >--- a/members/printfeercpt.pl >+++ b/members/printfeercpt.pl >@@ -113,7 +113,7 @@ for (my $i=0;$i<$numaccts;$i++){ > > $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); > >-my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); >+my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > $template->param( >diff --git a/members/printinvoice.pl b/members/printinvoice.pl >index 3e04fcc..20c23ac 100755 >--- a/members/printinvoice.pl >+++ b/members/printinvoice.pl >@@ -113,7 +113,7 @@ for (my $i=0;$i<$numaccts;$i++){ > > $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' ); > >-my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); >+my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > $template->param( >diff --git a/members/readingrec.pl b/members/readingrec.pl >index d41e3f9..0f0c3df 100755 >--- a/members/readingrec.pl >+++ b/members/readingrec.pl >@@ -103,7 +103,7 @@ if (! $limit){ > } > > >-my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); >+my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > if (C4::Context->preference('ExtendedPatronAttributes')) { >diff --git a/members/routing-lists.pl b/members/routing-lists.pl >index d70c1bc..70165f7 100755 >--- a/members/routing-lists.pl >+++ b/members/routing-lists.pl >@@ -128,7 +128,7 @@ $template->param( > RoutingSerials => C4::Context->preference('RoutingSerials'), > ); > >-my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'}); >+my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/members/statistics.pl b/members/statistics.pl >index 0667ee7..0914364 100755 >--- a/members/statistics.pl >+++ b/members/statistics.pl >@@ -91,7 +91,7 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { > ); > } > >-my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'}); >+my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > $template->param( >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index 112d405..9106fb4 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -200,7 +200,7 @@ elsif ( $action eq 'edit' ) { #Display logged in borrower's data > borrower => $borrower, ); > > if (C4::Context->preference('OPACpatronimages')) { >- my ($image, $dberror) = GetPatronImage($borrower->{cardnumber}); >+ my ($image, $dberror) = GetPatronImage($borrower->{borrowernumber}); > if ($image) { > $template->param( > display_patron_image => 1 >diff --git a/opac/opac-patron-image.pl b/opac/opac-patron-image.pl >index d1f4489..eab6abc 100755 >--- a/opac/opac-patron-image.pl >+++ b/opac/opac-patron-image.pl >@@ -37,9 +37,8 @@ my %cookies = fetch CGI::Cookie; > my $sessid = $cookies{'CGISESSID'}->value; > my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags); > my $borrowernumber = C4::Context->userenv->{'number'}; >-my $cardnumber = C4::Context->userenv->{'cardnumber'}; > >-my ($imagedata, $dberror) = GetPatronImage($cardnumber); >+my ($imagedata, $dberror) = GetPatronImage($borrowernumber); > > if ($dberror) { > print $query->header(status => '500 internal error'); >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index 0f16c8c..62884ee 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -248,7 +248,7 @@ if ($borrower->{cardnumber}) { > > ); > if (C4::Context->preference('ShowPatronImageInWebBasedSelfCheck')) { >- my ($image, $dberror) = GetPatronImage($borrower->{cardnumber}); >+ my ($image, $dberror) = GetPatronImage($borrower->{borrowernumber}); > if ($image) { > $template->param( > display_patron_image => 1, >diff --git a/opac/sco/sco-patron-image.pl b/opac/sco/sco-patron-image.pl >index b2ddcf3..de8d8d6 100755 >--- a/opac/sco/sco-patron-image.pl >+++ b/opac/sco/sco-patron-image.pl >@@ -33,9 +33,9 @@ unless (C4::Context->preference('ShowPatronImageInWebBasedSelfCheck')) { > exit; > } > >-my ($cardnumber) = C4::Service->require_params('cardnumber'); >+my ($borrowernumber) = C4::Service->require_params('borrowernumber'); > >-my ($imagedata, $dberror) = GetPatronImage($cardnumber); >+my ($imagedata, $dberror) = GetPatronImage($borrowernumber); > > if ($dberror) { > print $query->header(status => '500 internal error'); >diff --git a/patroncards/create-pdf.pl b/patroncards/create-pdf.pl >index 6a1b67a..56a32e6 100755 >--- a/patroncards/create-pdf.pl >+++ b/patroncards/create-pdf.pl >@@ -145,7 +145,7 @@ foreach my $item (@{$items}) { > next PROCESS_IMAGES; > } > elsif ($images->{$_}->{'data_source'}->[0]->{'image_source'} eq 'patronimages') { >- ($image_data, $error) = GetPatronImage($card_number); >+ ($image_data, $error) = GetPatronImage($borrower_number); > warn sprintf('No image exists for borrower number %s.', $borrower_number) if !$image_data; > next PROCESS_IMAGES if !$image_data; > } >diff --git a/tools/picture-upload.pl b/tools/picture-upload.pl >index 54b6606..b2aa18a 100755 >--- a/tools/picture-upload.pl >+++ b/tools/picture-upload.pl >@@ -146,7 +146,7 @@ if ( ($op eq 'Upload') && $uploadfile ) { # Case is important in these ope > $template->param(cardnumber => $cardnumber); > $template->param(filetype => $filetype); > } elsif ( $op eq 'Delete' ) { >- my $dberror = RmPatronImage($cardnumber); >+ my $dberror = RmPatronImage($borrowernumber); > $debug and warn "Patron image deleted for $cardnumber"; > warn "Database returned $dberror" if $dberror; > } >diff --git a/tools/viewlog.pl b/tools/viewlog.pl >index e48aaef..67ce7dd 100755 >--- a/tools/viewlog.pl >+++ b/tools/viewlog.pl >@@ -72,7 +72,7 @@ if ($src eq 'circ') { # if we were called from circulation, use the circulatio > use C4::Members; > my $borrowernumber = $object; > my $data = GetMember('borrowernumber'=>$borrowernumber); >- my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); >+ my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'}); > $template->param( picture => 1 ) if $picture; > > $template->param( menu => 1, >-- >1.7.2.5
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 10636
:
20722
|
20723
|
20724
|
20765
|
20801
|
21923
|
21931