View | Details | Raw Unified | Return to bug 3516
Collapse All | Expand All

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 96-101 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
96
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserjs','','Define custom javascript for inclusion in OPAC','70|10','Textarea');
96
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserjs','','Define custom javascript for inclusion in OPAC','70|10','Textarea');
97
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserlogin',1,'Enable or disable display of user login features',NULL,'YesNo');
97
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacuserlogin',1,'Enable or disable display of user login features',NULL,'YesNo');
98
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('patronimages',0,'Enable patron images for the Staff Client',NULL,'YesNo');
98
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('patronimages',0,'Enable patron images for the Staff Client',NULL,'YesNo');
99
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACpatronimages',0,'Enable patron images in the OPAC',NULL,'YesNo');
99
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('printcirculationslips',1,'If ON, enable printing circulation receipts','','YesNo');
100
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('printcirculationslips',1,'If ON, enable printing circulation receipts','','YesNo');
100
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RecordLocalUseOnReturn',0,'If ON, statistically record returns of unissued items as local use, instead of return',NULL,'YesNo');
101
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RecordLocalUseOnReturn',0,'If ON, statistically record returns of unissued items as local use, instead of return',NULL,'YesNo');
101
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RequestOnOpac',1,'If ON, globally enables patron holds on OPAC',NULL,'YesNo');
102
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RequestOnOpac',1,'If ON, globally enables patron holds on OPAC',NULL,'YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 4712-4717 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
4712
    SetVersion($DBversion);
4712
    SetVersion($DBversion);
4713
}
4713
}
4714
4714
4715
$DBversion = "3.07.00.XXX";
4716
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
4717
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACpatronimages',0,'Enable patron images in the OPAC',NULL,'YesNo');");
4718
    print "Upgrade to $DBversion done (Bug 3516: Add the option to show patron images in the OPAC.)\n";
4719
    SetVersion($DBversion);
4720
}
4721
4715
=head1 FUNCTIONS
4722
=head1 FUNCTIONS
4716
4723
4717
=head2 DropAllForeignKeys($table)
4724
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 235-240 OPAC: Link Here
235
                  no: "Don't allow"
235
                  no: "Don't allow"
236
            - patrons to notify the library of changes to their contact information from the OPAC.
236
            - patrons to notify the library of changes to their contact information from the OPAC.
237
        -
237
        -
238
            - pref: OPACpatronimages
239
              choices:
240
                  yes: Show
241
                  no: "Don't show"
242
            - patron images on the patron information page in the OPAC.
243
        -
238
            - pref: OPACFinesTab
244
            - pref: OPACFinesTab
239
              choices:
245
              choices:
240
                  yes: Allow
246
                  yes: Allow
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt (-1 / +7 lines)
Lines 14-25 Link Here
14
14
15
<div id="userupdatecontainer" class="container">
15
<div id="userupdatecontainer" class="container">
16
[% FOREACH BORROWER_INF IN BORROWER_INFO %]
16
[% FOREACH BORROWER_INF IN BORROWER_INFO %]
17
<h3><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' ifirstname = BORROWER_INF.firstname surname = BORROWER_INF.surname othernames = BORROWER_INF.othernames cardnumber = BORROWER_INF.cardnumber %]'s account</a> <img src="[% themelang %]../../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> Your Personal Details</h3>
17
<h3><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' firstname = BORROWER_INF.firstname surname = BORROWER_INF.surname othernames = BORROWER_INF.othernames cardnumber = BORROWER_INF.cardnumber %]'s account</a> <img src="[% themelang %]../../images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> Your Personal Details</h3>
18
18
19
[% IF ( OPACPatronDetails ) %]
19
[% IF ( OPACPatronDetails ) %]
20
<form action="/cgi-bin/koha/opac-userupdate.pl" method="get">
20
<form action="/cgi-bin/koha/opac-userupdate.pl" method="get">
21
<div class="yui-u first">
21
<div class="yui-u first">
22
<input type="hidden" name="modify" value="yes" />
22
<input type="hidden" name="modify" value="yes" />
23
[% IF ( display_patron_image ) %]<p style="border:1px solid #EEE;padding:1em;">
24
    <img src="/cgi-bin/koha/opac-patron-image.pl" alt="" />
25
</p>[% END %]
23
<fieldset class="brief"><legend>Name</legend><ol>
26
<fieldset class="brief"><legend>Name</legend><ol>
24
<li><label for="firstname">First Name:</label> <input id="firstname" type="text" value="[% BORROWER_INF.firstname %]"  name="firstname" /></li>
27
<li><label for="firstname">First Name:</label> <input id="firstname" type="text" value="[% BORROWER_INF.firstname %]"  name="firstname" /></li>
25
<li><label for="othernames">Other Name:</label> <input id="othernames" type="text" value="[% BORROWER_INF.othernames %]"  name="othernames" /></li>
28
<li><label for="othernames">Other Name:</label> <input id="othernames" type="text" value="[% BORROWER_INF.othernames %]"  name="othernames" /></li>
Lines 105-110 Link Here
105
[% ELSE %]
108
[% ELSE %]
106
<p style="clear:left;padding:1em 0">To make changes to your record please contact the library.</p>
109
<p style="clear:left;padding:1em 0">To make changes to your record please contact the library.</p>
107
<div class="yui-u first">
110
<div class="yui-u first">
111
[% IF ( display_patron_image ) %]<p style="border:1px solid #EEE;border-bottom-color:#000;padding:1em;">
112
    <img src="/cgi-bin/koha/opac-patron-image.pl" alt="" />
113
</p>[% END %]
108
<fieldset class="rows">
114
<fieldset class="rows">
109
<legend>Contact Information</legend>
115
<legend>Contact Information</legend>
110
<ol>
116
<ol>
(-)a/opac/opac-patron-image.pl (+57 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
#
3
# Copyright 2009 LibLime
4
# Parts copyright 2012 Athens County Public Libraries
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it under the
9
# terms of the GNU General Public License as published by the Free Software
10
# Foundation; either version 2 of the License, or (at your option) any later
11
# version.
12
#
13
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
14
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License along
18
# with Koha; if not, write to the Free Software Foundation, Inc.,
19
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21
use strict;
22
use warnings;
23
use C4::Members;
24
use C4::Auth;
25
my $query = new CGI;
26
27
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
28
    {
29
          template_name   => "opac-userupdate.tt",
30
          query           => $query,
31
          type            => "opac",
32
          authnotrequired => 0,
33
          flagsrequired   => { borrow => 1 },
34
          debug           => 1,
35
    }
36
);
37
38
unless (C4::Context->preference('OPACpatronimages')) {
39
    print $query->header(status => '403 Forbidden - displaying patron images in the OPAC not enabled');
40
    exit;
41
}
42
43
my ($borrower)=GetMember('borrowernumber' => $borrowernumber);
44
my $cardnumber = $borrower->{'cardnumber'};
45
my ($imagedata, $dberror) = GetPatronImage($cardnumber);
46
47
if ($dberror) {
48
    print $query->header(status => '500 internal error');
49
}
50
51
if ($imagedata) {
52
    print $query->header(-type => $imagedata->{'mimetype'},
53
                         -Content_Length => length ($imagedata->{'imagefile'})),
54
          $imagedata->{'imagefile'};
55
} else {
56
    print $query->header(status => '404 patron image not found');
57
}
(-)a/opac/opac-userupdate.pl (-1 / +9 lines)
Lines 170-175 for (@{ $checkout_prefs->{transports} }) { Link Here
170
    $borr->{"items_borrowed_$_"} = 1;
170
    $borr->{"items_borrowed_$_"} = 1;
171
}
171
}
172
172
173
if (C4::Context->preference('OPACpatronimages')) {
174
    my ($image, $dberror) = GetPatronImage($borr->{'cardnumber'});
175
    if ($image) {
176
        $template->param(
177
            display_patron_image => 1
178
        );
179
    }
180
}
181
173
my @bordat;
182
my @bordat;
174
$bordat[0] = $borr;
183
$bordat[0] = $borr;
175
184
176
- 

Return to bug 3516