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

(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt (-2 / +2 lines)
Lines 166-173 Link Here
166
        [% IF ( message ) %]
166
        [% IF ( message ) %]
167
            [% IF ( GNA ) %]
167
            [% IF ( GNA ) %]
168
              <div id="gna" class="dialog alert">
168
              <div id="gna" class="dialog alert">
169
                <p><strong>Sorry</strong>, you cannot place holds because the library doesn't have up-to-date <a href="/cgi-bin/koha/opac-userupdate.pl">contact information</a> on file.</p>
169
                <p><strong>Sorry</strong>, you cannot place holds because the library doesn't have up-to-date <a href="/cgi-bin/koha/opac-memberentry.pl">contact information</a> on file.</p>
170
              <p>Please contact your librarian, or use the <a href="/cgi-bin/koha/opac-userupdate.pl">online update form</a> to submit current information (<em>Please note:</em> there may be a delay in restoring your account if you submit online)</p>
170
              <p>Please contact your librarian, or use the <a href="/cgi-bin/koha/opac-memberentry.pl">online update form</a> to submit current information (<em>Please note:</em> there may be a delay in restoring your account if you submit online)</p>
171
              </div>
171
              </div>
172
            [% END %]
172
            [% END %]
173
            [% IF ( lost ) %]
173
            [% IF ( lost ) %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt (-1 / +1 lines)
Lines 105-111 $.tablesorter.addParser({ Link Here
105
                <span id="userdebarred"><li><strong>Please note:</strong> Your account has been frozen[% IF ( BORROWER_INF.userdebarreddate ) %] until <span id="userdebarred_date">[% BORROWER_INF.userdebarreddate | $KohaDates %]</span>[% END %][% IF ( BORROWER_INF.debarredcomment ) %] with the comment <span id="userdebarred_comment">"[% BORROWER_INF.debarredcomment %]"</span>[% END %]. Usually the reason for freezing an account is old overdues or damage fees. If <a href="/cgi-bin/koha/opac-user.pl">your account page</a> shows your account to be clear, please contact the library.</li></span>
105
                <span id="userdebarred"><li><strong>Please note:</strong> Your account has been frozen[% IF ( BORROWER_INF.userdebarreddate ) %] until <span id="userdebarred_date">[% BORROWER_INF.userdebarreddate | $KohaDates %]</span>[% END %][% IF ( BORROWER_INF.debarredcomment ) %] with the comment <span id="userdebarred_comment">"[% BORROWER_INF.debarredcomment %]"</span>[% END %]. Usually the reason for freezing an account is old overdues or damage fees. If <a href="/cgi-bin/koha/opac-user.pl">your account page</a> shows your account to be clear, please contact the library.</li></span>
106
            [% END %]
106
            [% END %]
107
            [% IF ( BORROWER_INF.gonenoaddress ) %]
107
            [% IF ( BORROWER_INF.gonenoaddress ) %]
108
                <span id="gonenoaddress"><li><strong>Please note:</strong> According to our records, we don't have up-to-date [% UNLESS ( BORROWER_INF.OPACPatronDetails ) %]<a href="/cgi-bin/koha/opac-userupdate.pl">contact information</a>[% ELSE %]contact information[% END %] on file.  Please contact the library[% IF ( BORROWER_INF.OPACPatronDetails ) %] or use the <a href="/cgi-bin/koha/opac-userupdate.pl">online update form</a> to submit current information (<em>Please note:</em> there may be a delay in restoring your account if you submit online)[% END %].</li></span>
108
                <span id="gonenoaddress"><li><strong>Please note:</strong> According to our records, we don't have up-to-date [% UNLESS ( BORROWER_INF.OPACPatronDetails ) %]<a href="/cgi-bin/koha/opac-memberentry.pl">contact information</a>[% ELSE %]contact information[% END %] on file.  Please contact the library[% IF ( BORROWER_INF.OPACPatronDetails ) %] or use the <a href="/cgi-bin/koha/opac-memberentry.pl">online update form</a> to submit current information (<em>Please note:</em> there may be a delay in restoring your account if you submit online)[% END %].</li></span>
109
            [% END %]
109
            [% END %]
110
            [% IF ( BORROWER_INF.lost ) %]
110
            [% IF ( BORROWER_INF.lost ) %]
111
                <span id="lost"><li><strong>Please note: </strong> Your library card has been marked as lost or stolen. If this is an error, please contact the library.</li></span>
111
                <span id="lost"><li><strong>Please note: </strong> Your library card has been marked as lost or stolen. If this is an error, please contact the library.</li></span>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userdetails.tt (-87 lines)
Lines 1-87 Link Here
1
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo;  Your personal details
2
[% INCLUDE 'doc-head-close.inc' %]
3
</head>
4
<body>
5
<div id="doc3" class="yui-t1">
6
   <div id="bd">
7
[% INCLUDE 'masthead.inc' %]
8
9
	<div id="yui-main">
10
	<div class="yui-b"><div class="yui-g">
11
12
<h3><a href="/cgi-bin/koha/opac-user.pl">[% firstname %] [% surname %]'s account</a> &#8674; Personal details</h3>
13
14
<table>
15
<tr><th scope="row">Name:</th><td> [% firstname %] [% surname %]</td></tr>
16
<tr><th scope="row">
17
Card number:</th><td>[% cardnumber %]</td></tr>
18
</table>
19
20
<table>
21
<caption>Contact details</caption>
22
<tr><th scope="row">Mailing address:</th><td>[% address %], [% city %]</td></tr>
23
24
<tr><th scope="row">Permanent address:</th><td> [% B_address %], [% B_address2 %], [% B_city %]</td></tr>
25
26
<tr><th scope="row">Primary phone:</th><td>[% IF ( phone ) %][% phone %][% ELSE %]&nbsp;[% END %]</td></tr>
27
28
<tr><th scope="row">Secondary phone:</th><td>[% IF ( mobile ) %][% mobile %][% ELSE %]&nbsp;[% END %]</td></tr>
29
30
<tr><th scope="row">Fax:</th><td>[% IF ( fax ) %][% fax %][% ELSE %]&nbsp;[% END %]</td></tr>
31
32
<tr><th scope="row">Email:</th><td>[% IF ( email ) %]<a href="mailto:[% email %]">[% email %]</a>[% ELSE %]&nbsp;[% END %]</td></tr>
33
34
</table>
35
36
<table>
37
<caption>Membership details</caption>
38
<tr><th scope="row">Membership number:</th><td> [% borrowernumber %]</td></tr>
39
40
<tr><th scope="row">Membership category:</th><td>  [% categorycode %]</td></tr>
41
42
<!-- <td>Fee:</th><td>  /year, Paid</td> -->
43
44
<tr><th scope="row">Joined:</th><td>[% dateenrolled %]</td></tr>
45
46
<tr><th scope="row">Expires:</th><td>[% dateexpiry %]</td></tr>
47
48
[% IF ( joiningbranch ) %]<tr><th>Joining library:</th><td>[% joiningbranch %]</td></tr>[% ELSE %]&nbsp;[% END %]</table>
49
50
<table>
51
<caption>Identity details</caption>
52
<tr><th scope="row">DoB:</th><td> [% IF ( dateofbirth ) %][% dateofbirth %][% ELSE %]&nbsp;[% END %]</td></tr>
53
54
<tr><th scope="row">Gender:</th><td>[% IF ( sex ) %][% sex %][% ELSE %]&nbsp;[% END %]</td></tr></table>
55
56
[% IF ( contactname ) %]
57
<table>
58
<caption>Alternate contact details</caption>
59
<tr><th scope="row">Alternate contact:</th><td> [% IF ( contactname ) %][% contactname %][% ELSE %]&nbsp;[% END %]</td></tr>
60
61
<tr><th scope="row">Phone:</th><td> [% IF ( B_phone ) %][% B_phone %][% ELSE %]&nbsp;[% END %]</td></tr>
62
63
<tr><th scope="row">Relationship:</th><td> [% IF ( relationship ) %][% relationship %][% ELSE %]&nbsp;[% END %]  </td></tr>
64
65
<tr><th scope="row">Notes:</th><td> [% IF ( contactnote ) %][% contactnote %][% ELSE %]&nbsp;[% END %] </td></tr>
66
67
<tr><th scope="row">Guarantor:</th><td> [% IF ( guarantorid ) %][% guarantorid %][% ELSE %]&nbsp;[% END %] </td></tr></table>
68
69
[% ELSE %]
70
<h4>No alternate contact on file.</h4>
71
[% END %]
72
73
<form action="/cgi-bin/koha/opac-userupdate.pl" method="post">
74
<input type="submit" name="Modify" value="Modify Your Record" />
75
</form>
76
77
</div>
78
</div>
79
</div>
80
<div class="yui-b">
81
<div id="leftmenus" class="container">
82
[% INCLUDE 'navigation.inc' %]
83
[% INCLUDE 'usermenu.inc' %]
84
</div>
85
</div>
86
</div>
87
[% INCLUDE 'opac-bottom.inc' %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tt (-195 lines)
Lines 1-195 Link Here
1
[% USE KohaDates %]
2
3
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %][% ELSE %]Koha online[% END %] catalog &rsaquo;  Your personal details
4
[% INCLUDE 'doc-head-close.inc' %]
5
</head>
6
<body id="opac-userupdate">
7
<div id="doc3" class="yui-t1">
8
   <div id="bd">
9
[% INCLUDE 'masthead.inc' %]
10
11
	<div id="yui-main">
12
	<div class="yui-b"><div class="yui-g" id="userupdate">
13
14
<div id="userupdatecontainer" class="container">
15
[% FOREACH BORROWER_INF IN BORROWER_INFO %]
16
<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> &#8674; Your personal details</h3>
17
18
[% IF ( OPACPatronDetails ) %]
19
<form action="/cgi-bin/koha/opac-userupdate.pl" method="get">
20
<div class="yui-u first">
21
<input type="hidden" name="modify" value="yes" />
22
[% IF ( display_patron_image ) %]<p class="patronimage edit">
23
    <img src="/cgi-bin/koha/opac-patron-image.pl" alt="" />
24
</p>[% END %]
25
<fieldset class="brief"><legend>Name</legend><ol>
26
<li><label for="firstname">First name:</label> <input id="firstname" type="text" value="[% BORROWER_INF.firstname %]"  name="firstname" /></li>
27
<li><label for="othernames">Other name:</label> <input id="othernames" type="text" value="[% BORROWER_INF.othernames %]"  name="othernames" /></li>
28
<li><label for="surname">Last name:</label> <input id="surname" type="text" value="[% BORROWER_INF.surname %]"  name="surname" /></li>
29
</ol>
30
</fieldset>
31
32
<fieldset class="brief"><legend>Contact information</legend>
33
<ol>
34
<li><label for="address">Address:</label>
35
	<input id="streetnumber" size ="7" type="text" value="[% BORROWER_INF.streetnumber %]"  name="streetnumber" /> 
36
	<input type="text" name="address" value="[% BORROWER_INF.address %]" id="address" />
37
	<input type="text" name="address2" value="[% BORROWER_INF.address2 %]" id="address2" /></li>
38
<li><label for="city">City:</label> <input id="city" type="text" value="[% BORROWER_INF.city %]"  name="city" /></li>
39
<li><label for="state">State:</label> <input id="state" type="text" value="[% BORROWER_INF.state %]"  name="state" /></li>
40
<li><label for="zipcode">Zip code: </label><input type="text" id="zipcode" value="[% BORROWER_INF.zipcode %]" name="zipcode" /></li>
41
<li><label for="country">Country: </label><input type="text" id="country" value="[% BORROWER_INF.country %]" name="country" /></li>
42
<li><label for="phone">Primary phone:</label> <input id="phone" type="text" value="[% BORROWER_INF.phone %]"  name="phone" /></li>
43
<li><label for="mobile">Secondary phone:</label> <input id="mobile" type="text" value="[% BORROWER_INF.mobile %]"  name="mobile" /></li>
44
<li><label for="phonepro">Other phone:</label> <input id="phonepro"  type="text" value="[% BORROWER_INF.phonepro %]"  name="phonepro" /></li>
45
<li><label for="fax">Fax:</label> <input id="fax" type="text" value="[% BORROWER_INF.fax %]"  name="fax" /></li>
46
<li><label for="emailaddress">Primary email:</label> <input id="emailaddress" type="text" value="[% BORROWER_INF.email %]"  name="emailaddress" /></li>
47
<li><label for="emailpro">Secondary email:</label> <input id="emailpro" type="text" value="[% BORROWER_INF.emailpro %]"  name="emailpro" /></li>
48
</ol>
49
</fieldset>
50
51
</div>
52
<div class="yui-u">
53
<fieldset class="brief">
54
<legend>Alternate contact information</legend>
55
<ol>
56
<li>
57
    <label for="B_streetaddress">Alternate address:</label>
58
    <input id="B_streetnumber" size ="7" type="text" value="[% BORROWER_INF.B_streetnumber %]"  name="B_streetnumber" /> 
59
    <input id="B_address" type="text" value="[% BORROWER_INF.B_address %]"  name="B_address" /> 
60
    <input id="B_address2" type="text" value="[% BORROWER_INF.B_address2 %]"  name="B_address2" />
61
</li>
62
63
<li><label for="B_city">City:</label> <input id="B_city" type="text" value="[% BORROWER_INF.B_city %]"  name="B_city" /></li>
64
<li><label for="B_state">State:</label> <input id="B_state" type="text" value="[% BORROWER_INF.B_state %]"  name="B_state" /></li>
65
<li><label for="B_zipcode">Zip code:</label> <input type="text" id="B_zipcode" value="[% BORROWER_INF.B_zipcode %]" name="B_zipcode" /></li>
66
<li><label for="B_country">Country:</label> <input type="text" id="B_country" value="[% BORROWER_INF.B_country %]" name="B_country" /></li>
67
<li><label for="B_phone">Phone:</label> <input type="text" id="B_phone" value="[% BORROWER_INF.B_phone %]" name="B_phone" /></li>
68
<li><label for="B_email">Email:</label> <input type="text" id="B_email" value="[% BORROWER_INF.B_email %]" name="B_email" /></li>
69
</ol>
70
</fieldset>
71
<fieldset class="brief">
72
<ol>
73
<li><label for="dob">Date of birth: </label> <input id="dob" type="text" size="10" value="[% BORROWER_INF.dateofbirth | $KohaDates %]" name="dateofbirth" /></li>
74
<li><label for="sex">Gender: </label> <select name="sex" id="sex"><option></option>
75
[% IF ( BORROWER_INF.sex == 'F' ) %]<option value="F" selected="selected">Female</option>[% ELSE %]<option value="F">Female</option>[% END %]
76
[% IF ( BORROWER_INF.sex == 'M' ) %]<option value="M" selected="selected">Male</option>[% ELSE %]<option value="M">Male</option>[% END %]
77
</select></li>
78
</ol></fieldset>
79
<fieldset class="brief">
80
<legend>Library use:</legend>
81
<ol>
82
	<li><label for="cardnumber">Card number:</label><input type="text" id="cardnumber" disabled="disabled" readonly="readonly" value="[% BORROWER_INF.cardnumber %]" /></li>
83
    <li><label for="branchname">Home library:</label><input type="text" id="branchname" disabled="disabled" readonly="readonly" value="[% BORROWER_INF.branchname %]" /></li>
84
    <li><label for="borrowernumber">Patron number:</label><input type="text" id="borrowernumber" disabled="disabled" readonly="readonly" value="[% BORROWER_INF.borrowernumber %]" /></li>
85
    <li><label for="categorycode">Patron category:</label><input type="text" id="categorycode" disabled="disabled" readonly="readonly" value="[% BORROWER_INF.description %] ([% BORROWER_INF.categorycode %])" /></li>
86
	<li><label for="dateenrolled">Joined: </label><input type="text" id="dateenrolled" disabled="disabled" readonly="readonly" value="[% BORROWER_INF.dateenrolled | $KohaDates %]" /></li>
87
	<li><label for="dateexpiry">Expires: </label><input type="text" id="dateexpiry" disabled="disabled" readonly="readonly" value="[% BORROWER_INF.dateexpiry | $KohaDates %]" /></li>
88
   [% IF ( BORROWER_INF.ExtendedPatronAttributes ) %]
89
    [% FOREACH patron_attribute IN BORROWER_INF.patron_attributes %]
90
        <li><label>[% patron_attribute.description %]</label>
91
        [% IF ( patron_attribute.value_description ) %]
92
            [% patron_attribute.value_description %]"
93
        [% ELSE %]
94
            [% patron_attribute.value |html_line_break %]
95
        [% END %]
96
        </li>
97
    [% END %]
98
   [% END %]
99
</ol>
100
</fieldset>
101
<fieldset class="action">
102
<p>Please make any necessary changes to your record.  Submitting the form will notify a library staff member, who will make the changes permanent.</p>
103
<input type="submit" value="Submit Changes" /> <a class="cancel" href="/cgi-bin/koha/opac-user.pl">Cancel</a></fieldset>
104
</div>
105
106
</form>
107
[% ELSE %]
108
<p style="clear:left;padding:1em 0">To make changes to your record please contact the library.</p>
109
<div class="yui-u first">
110
[% IF ( display_patron_image ) %]<p class="patronimage">
111
    <img src="/cgi-bin/koha/opac-patron-image.pl" alt="" />
112
</p>[% END %]
113
<fieldset class="rows">
114
<legend>Contact information</legend>
115
<ol>
116
<li><span class="label">Name:</span> [% BORROWER_INF.firstname %] [% BORROWER_INF.surname %]</li>
117
<li><span class="label">Other name:</span> [% BORROWER_INF.othernames %]</li>
118
<li><span class="label">Address:</span> [% BORROWER_INF.streetnumber %] [% BORROWER_INF.address %]</li>
119
<li><span class="label">&nbsp;</span>[% BORROWER_INF.address2 %]</li>
120
<li><span class="label">City:</span>  [% BORROWER_INF.city %]</li>
121
<li><span class="label">State:</span>  [% BORROWER_INF.state %]</li>
122
<li><span class="label">Zip code:</span>  [% BORROWER_INF.zipcode %]</li>
123
<li><span class="label">Country:</span>  [% BORROWER_INF.country %]</li>
124
<li><span class="label">Primary phone:</span>  [% BORROWER_INF.phone %]</li>
125
<li><span class="label">Secondary phone:</span>  [% BORROWER_INF.mobile %]</li>
126
<li><span class="label">Other phone:</span>  [% BORROWER_INF.phonepro %]</li>
127
<li><span class="label">Fax:</span>  [% BORROWER_INF.fax %]</li>
128
<li><span class="label">Primary email:</span>  [% BORROWER_INF.email %]</li>
129
<li><span class="label">Secondary email:</span>  [% BORROWER_INF.emailpro %]</li>
130
</ol>
131
</fieldset>
132
133
<fieldset class="rows">
134
<legend>Personal information</legend>
135
<ol>
136
<li><span class="label">Date of birth:</span> [% BORROWER_INF.dateofbirth | $KohaDates %]</li>
137
<li><span class="label">Gender:</span>
138
[% IF ( sex == 'F' ) %]Female[% END %]
139
[% IF ( sex == 'M' ) %]Male[% END %]
140
</li>
141
</ol>
142
</fieldset>
143
</div>
144
145
<div class="yui-u">
146
<fieldset class="rows">
147
<legend>Alternate contact information</legend>
148
<ol>
149
<li><span class="label">Alternate address:</span> [% BORROWER_INF.B_streetnumber %] [% BORROWER_INF.B_address %] </li>
150
<li><span class="label">&nbsp;</span>[% BORROWER_INF.B_address2 %]</li>
151
<li><span class="label">City:</span> [% BORROWER_INF.B_city %]</li>
152
<li><span class="label">State:</span> [% BORROWER_INF.B_state %]</li>
153
<li><span class="label">Zip code:</span> [% BORROWER_INF.B_zipcode %]</li>
154
<li><span class="label">Country:</span> [% BORROWER_INF.B_country %]</li>
155
<li><span class="label">Phone:</span> [% BORROWER_INF.B_phone %]</li>
156
<li><span class="label">Email:</span> [% BORROWER_INF.B_email %]</li>
157
</ol>
158
</fieldset>
159
160
<fieldset class="rows">
161
<legend>Library use:</legend>
162
<ol>
163
<li><span class="label">Card number:</span> [% BORROWER_INF.cardnumber %]</li>
164
<li><span class="label">Home library:</span> [% BORROWER_INF.branchname %]</li>
165
<li><span class="label">Patron number:</span> [% BORROWER_INF.borrowernumber %]</li>
166
<li><span class="label">Patron category:</span> [% BORROWER_INF.description %] ([% BORROWER_INF.categorycode %])</li>
167
<li><span class="label">Joined:</span> [% BORROWER_INF.dateenrolled | $KohaDates %]</li>
168
<li><span class="label">Expires:</span> [% BORROWER_INF.dateexpiry | $KohaDates %]</li>
169
   [% IF ( BORROWER_INF.ExtendedPatronAttributes ) %]
170
    [% FOREACH patron_attribute IN BORROWER_INF.patron_attributes %]
171
        <li><span class="label">[% patron_attribute.description %]</span>
172
        [% IF ( patron_attribute.value_description ) %]
173
            [% patron_attribute.value_description %]
174
        [% ELSE %]
175
            [% patron_attribute.value %]
176
        [% END %]
177
        </li>
178
    [% END %]
179
   [% END %]
180
</ol>
181
</fieldset>
182
</div>
183
[% END %]
184
[% END %]
185
</div>
186
</div>
187
</div>
188
</div>
189
<div class="yui-b">
190
<div id="leftmenus" class="container">
191
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
192
</div>
193
</div>
194
</div>
195
[% INCLUDE 'opac-bottom.inc' %]
(-)a/opac/opac-patron-image.pl (-14 / +11 lines)
Lines 21-47 Link Here
21
use strict;
21
use strict;
22
use warnings;
22
use warnings;
23
use C4::Members;
23
use C4::Members;
24
use C4::Auth;
24
use CGI;
25
my $query = new CGI;
25
use CGI::Cookie;  # need to check cookies before having CGI parse the POST request
26
use C4::Auth qw(:DEFAULT check_cookie_auth);
26
27
27
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
28
my $query = new CGI;
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
29
38
unless (C4::Context->preference('OPACpatronimages')) {
30
unless (C4::Context->preference('OPACpatronimages')) {
39
    print $query->header(status => '403 Forbidden - displaying patron images in the OPAC not enabled');
31
    print $query->header(status => '403 Forbidden - displaying patron images in the OPAC not enabled');
40
    exit;
32
    exit;
41
}
33
}
42
34
43
my ($borrower)=GetMember('borrowernumber' => $borrowernumber);
35
my $needed_flags;
44
my $cardnumber = $borrower->{'cardnumber'};
36
my %cookies = fetch CGI::Cookie;
37
my $sessid = $cookies{'CGISESSID'}->value;
38
my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags);
39
my $borrowernumber = C4::Context->userenv->{'number'};
40
my $cardnumber = C4::Context->userenv->{'cardnumber'};
41
45
my ($imagedata, $dberror) = GetPatronImage($cardnumber);
42
my ($imagedata, $dberror) = GetPatronImage($cardnumber);
46
43
47
if ($dberror) {
44
if ($dberror) {
(-)a/opac/opac-userdetails.pl (-56 lines)
Lines 1-56 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2000-2002 Katipo Communications
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use strict;
21
use warnings;
22
23
use CGI;
24
25
use C4::Auth;
26
use C4::Koha;
27
use C4::Circulation;
28
29
use C4::Output;
30
use C4::Dates qw/format_date/;
31
use C4::Members;
32
33
my $query = new CGI;
34
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
35
    {
36
        template_name   => "opac-userdetails.tmpl",
37
        query           => $query,
38
        type            => "opac",
39
        authnotrequired => 0,
40
        flagsrequired   => { borrow => 1 },
41
        debug           => 1,
42
    }
43
);
44
45
# get borrower information ....
46
my ( $borr ) = GetMemberDetails( $borrowernumber );
47
48
$borr->{'dateenrolled'} = format_date( $borr->{'dateenrolled'} );
49
$borr->{'dateexpiry'}       = format_date( $borr->{'dateexpiry'} );
50
$borr->{'dateofbirth'}  = format_date( $borr->{'dateofbirth'} );
51
$borr->{'ethnicity'}    = fixEthnicity( $borr->{'ethnicity'} );
52
53
$template->param($borr);
54
55
output_html_with_http_headers $query, $cookie, $template->output;
56
(-)a/opac/opac-userupdate.pl (-189 lines)
Lines 1-188 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2000-2002 Katipo Communications
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use strict;
21
use warnings;
22
23
use CGI;
24
use Mail::Sendmail;
25
use Encode;
26
27
use C4::Auth;    # checkauth, getborrowernumber.
28
use C4::Context;
29
use C4::Koha;
30
use C4::Circulation;
31
use C4::Output;
32
use C4::Dates qw/format_date/;
33
use C4::Members;
34
use C4::Members::Attributes;
35
use C4::Branch;
36
37
my $query = new CGI;
38
39
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
40
    {
41
        template_name   => "opac-userupdate.tmpl",
42
        query           => $query,
43
        type            => "opac",
44
        authnotrequired => 0,
45
        flagsrequired   => { borrow => 1 },
46
        debug           => 1,
47
    }
48
);
49
50
# get borrower information ....
51
my ( $borr ) = GetMemberDetails( $borrowernumber );
52
my ( $patronemail ) = GetFirstValidEmailAddress($borrowernumber);
53
my $lib = GetBranchDetail($borr->{'branchcode'});
54
55
# handle the new information....
56
# collect the form values and send an email.
57
my @fields = (
58
    'surname','firstname','othernames','streetnumber','address','address2','city','state','zipcode','country','phone','mobile','fax','phonepro', 'emailaddress','emailpro','B_streetnumber','B_address','B_address2','B_city','B_state','B_zipcode','B_country','B_phone','B_email','dateofbirth','sex'
59
);
60
my $update;
61
my $updateemailaddress = $lib->{'branchemail'};
62
$updateemailaddress = C4::Context->preference('KohaAdminEmailAddress') unless( $updateemailaddress =~ /\w+@\w+/);
63
if ( !$updateemailaddress || $updateemailaddress eq '' ) {
64
    warn
65
"KohaAdminEmailAddress system preference not set.  Couldn't send patron update information for $borr->{'firstname'} $borr->{'surname'} (#$borrowernumber)\n";
66
    my ($template) = get_template_and_user(
67
        {
68
            template_name   => "kohaerror.tmpl",
69
            query           => $query,
70
            type            => "opac",
71
            authnotrequired => 1,
72
            flagsrequired   => { borrow => 1 },
73
            debug           => 1,
74
        }
75
    );
76
77
    $template->param(
78
        noadminemail => 1,
79
    );
80
81
    output_html_with_http_headers $query, $cookie, $template->output;
82
    exit;
83
}
84
85
if ( !$patronemail || $patronemail eq '' ) {
86
	$patronemail = $updateemailaddress;
87
};
88
89
if ( $query->param('modify') ) {
90
91
    # get all the fields:
92
    my $message = <<"EOF";
93
Patron $borr->{'cardnumber'} has requested to change her/his personal details.
94
Please check these new details and make the changes to these fields:
95
96
EOF
97
98
    my $streetnumber = $borr->{'streetnumber'} || '';
99
    my $address = $borr->{'address'} || '';
100
    my $address2 = $borr->{'address2'} || '';
101
    my $B_streetnumber = $borr->{'B_streetnumber'} || '';
102
    my $B_address = $borr->{'B_address'} || '';
103
    my $B_address2 = $borr->{'B_address2'} || '';
104
105
    foreach my $field (@fields) {
106
        my $newfield = decode('utf-8',$query->param($field)) || '';
107
        my $borrowerfield = '';
108
        if($borr->{$field}) {
109
            $borrowerfield = $borr->{$field};
110
        }
111
        
112
        if($field eq "dateofbirth") {
113
           $borrowerfield  = format_date( $borr->{'dateofbirth'} ) || '';
114
        }
115
116
        if($borrowerfield ne $newfield) {
117
            $message .= $field . " : $borrowerfield  -->  $newfield\n";
118
        }
119
    }
120
121
    $message .= "\nEdit this patron's record: http://".C4::Context->preference('staffClientBaseURL ')."/cgi-bin/koha/members/memberentry.pl?op=modify&borrowernumber=".$borr->{'borrowernumber'}."&categorycode=".$borr->{'categorycode'} if C4::Context->preference('staffClientBaseURL ');
122
123
    $message .= "\n\nThanks,\nKoha\n\n";
124
    my %mail = (
125
        To      => $updateemailaddress,
126
        From    => $patronemail,
127
        Subject => "User Request for update of Record.",
128
        Message => encode('utf-8', $message), # Mail::Sendmail doesn't like wide characters
129
        'Content-Type' => 'text/plain; charset="utf-8"',
130
    );
131
132
    if ( sendmail %mail ) {
133
134
        # do something if it works....
135
        print $query->redirect('/cgi-bin/koha/opac-user.pl?patronupdate=sent');
136
        exit;
137
    }
138
    else {
139
140
        # do something if it doesnt work....
141
        warn "Error sending mail: $Mail::Sendmail::error \n";
142
    }
143
}
144
145
$borr->{'ethnicity'}    = fixEthnicity( $borr->{'ethnicity'} );
146
$borr->{'branchname'}   = GetBranchName($borr->{'branchcode'});
147
148
if (C4::Context->preference('ExtendedPatronAttributes')) {
149
    my $attributes = C4::Members::Attributes::GetBorrowerAttributes($borrowernumber, 'opac');
150
    if (scalar(@$attributes) > 0) {
151
        $borr->{ExtendedPatronAttributes} = 1;
152
        $borr->{patron_attributes} = $attributes;
153
    }
154
}
155
156
my $checkin_prefs  = C4::Members::Messaging::GetMessagingPreferences({
157
    borrowernumber => $borrowernumber,
158
    message_name   => 'Item Checkout'
159
});
160
for ( keys %{ $checkin_prefs->{transports} }) {
161
    $borr->{"items_returned_$_"} = 1;
162
}
163
my $checkout_prefs = C4::Members::Messaging::GetMessagingPreferences({
164
    borrowernumber => $borrowernumber,
165
    message_name   => 'Item Check-in'
166
});
167
for ( keys %{ $checkout_prefs->{transports} }) {
168
    $borr->{"items_borrowed_$_"} = 1;
169
}
170
171
if (C4::Context->preference('OPACpatronimages')) {
172
    my ($image, $dberror) = GetPatronImage($borr->{'cardnumber'});
173
    if ($image) {
174
        $template->param(
175
            display_patron_image => 1
176
        );
177
    }
178
}
179
180
my @bordat;
181
$bordat[0] = $borr;
182
183
$template->param( 
184
    BORROWER_INFO => \@bordat,
185
    userupdateview => 1,
186
);
187
188
output_html_with_http_headers $query, $cookie, $template->output;
189
- 

Return to bug 10201