Bugzilla – Attachment 17965 Details for
Bug 10204
Patron image no longer appears in the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10204 - Patron image no longer appears in the OPAC
Bug-10204---Patron-image-no-longer-appears-in-the-.patch (text/plain), 6.18 KB, created by
Owen Leonard
on 2013-05-06 16:44:14 UTC
(
hide
)
Description:
Bug 10204 - Patron image no longer appears in the OPAC
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-05-06 16:44:14 UTC
Size:
6.18 KB
patch
obsolete
>From 5bb5a00cc5099976bac50b051b525d2cb6d2f66b Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 6 May 2013 12:29:01 -0400 >Subject: [PATCH] Bug 10204 - Patron image no longer appears in the OPAC >Content-Type: text/plain; charset="utf-8" > >With the addition of opac-memberentry.pl to the OPAC we lost a way to >display the image associated with a patron's account. This patch adds >display of the patron image to opac-memberentry.pl now that >opac-userdetails.pl and opac-userupdate.pl are deprecated. > >To test: > >1. Log into the OPAC as a patron who has an image associated with their > account. View the "my personal details" tab and confirm that the > patron image appears with and without OPACPatronDetails enabled. > >2. Log into the OPAC as a patron who has no image associated with their > account. View the "my personal details" tab and confirm that the > layout looks correct. > >3. Turn off OPACpatronimages and confirm that the "my personal details" > page looks correct. >--- > .../opac-tmpl/prog/en/modules/opac-memberentry.tt | 37 +++++++++++++------- > opac/opac-memberentry.pl | 13 ++++++- > 2 files changed, 36 insertions(+), 14 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt >index 95149b3..8eda352 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt >@@ -34,12 +34,13 @@ > > <div id="yui-main"> > <div class="yui-b"> >- <div class="yui-g"> >- [% IF action == 'edit' %] >- <div id="update-account" class="container"> >- [% ELSE %] >- <div id="add-account" class="container"> >- [% END %] >+ <form method="post" action="/cgi-bin/koha/opac-memberentry.pl" id="memberentry-form"> >+ [% IF action == 'edit' %] >+ <div id="update-account" class="container"> >+ [% ELSE %] >+ <div id="add-account" class="container"> >+ [% END %] >+ <div class="yui-g"> > [% IF action == 'edit' %] > <h3><a href="/cgi-bin/koha/opac-user.pl">[% borrower.firstname %] [% borrower.surname %]'s account</a> ⇢ Personal details</h3> > [% ELSE %] >@@ -60,8 +61,6 @@ > <div class="dialog alert">You typed in the wrong characters in the box before submitting. Please try again.</div> > [% END %] > >- <form method="post" action="/cgi-bin/koha/opac-memberentry.pl" id="memberentry-form"> >- > [% UNLESS > hidden.defined('branchcode') > %] >@@ -93,12 +92,16 @@ > </ol> > </fieldset> > [% END %] >- >+ </div> > [% UNLESS > hidden.defined('title') && hidden.defined('surname') && hidden.defined('firstname') && > hidden.defined('dateofbirth') && hidden.defined('initials') && hidden.defined('othernames') && > hidden.defined('sex') > %] >+ <div class="yui-g"> >+ [% IF ( display_patron_image ) %] >+ <div class="yui-u first"> >+ [% END %] > <fieldset class="rows" id="memberentry_identity"> > <legend id="identity_legend">Identity</legend> > >@@ -228,8 +231,18 @@ > [% END %] > </ol> > </fieldset> >+ [% IF ( display_patron_image ) %] >+ </div> >+ <div class="yui-u"> >+ <p class="patronimage"> >+ <img src="/cgi-bin/koha/opac-patron-image.pl" alt="" /> >+ </p> >+ </div> >+ [% END %] >+ </div> > [% END %] > >+ <div class="yui-g"> > [% UNLESS > hidden.defined('streetnumber') && hidden.defined('address') && hidden.defined('address2') && > hidden.defined('city') && hidden.defined('state') && hidden.defined('zipcode') && >@@ -741,11 +754,9 @@ > <input type="submit" value="Submit" /> > </fieldset> > [% END %] >- >- </form> >- >+ </div> > </div><!--/div id="update-account" --> >- </div> >+ </form> > </div> > </div> > >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index 7f8230d..112d405 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -195,8 +195,19 @@ elsif ( $action eq 'update' ) { > } > } > elsif ( $action eq 'edit' ) { #Display logged in borrower's data >+ my $borrower = GetMember( borrowernumber => $borrowernumber ); > $template->param( >- borrower => GetMember( borrowernumber => $borrowernumber ), ); >+ borrower => $borrower, ); >+ >+ if (C4::Context->preference('OPACpatronimages')) { >+ my ($image, $dberror) = GetPatronImage($borrower->{cardnumber}); >+ if ($image) { >+ $template->param( >+ display_patron_image => 1 >+ ); >+ } >+ } >+ > } > > my $captcha = random_string("CCCCC"); >-- >1.7.9.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 10204
:
17965
|
17980
|
18006