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

(-)a/C4/Auth.pm (-4 / +7 lines)
Lines 462-467 sub get_template_and_user { Link Here
462
            SyndeticsSeries              => C4::Context->preference("SyndeticsSeries"),
462
            SyndeticsSeries              => C4::Context->preference("SyndeticsSeries"),
463
            SyndeticsCoverImageSize      => C4::Context->preference("SyndeticsCoverImageSize"),
463
            SyndeticsCoverImageSize      => C4::Context->preference("SyndeticsCoverImageSize"),
464
            OPACLocalCoverImages         => C4::Context->preference("OPACLocalCoverImages"),
464
            OPACLocalCoverImages         => C4::Context->preference("OPACLocalCoverImages"),
465
            PatronSelfRegistration       => C4::Context->preference("PatronSelfRegistration"),
466
            PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"),
465
        );
467
        );
466
468
467
        $template->param(OpacPublic => '1') if ($user || C4::Context->preference("OpacPublic"));
469
        $template->param(OpacPublic => '1') if ($user || C4::Context->preference("OpacPublic"));
Lines 967-976 sub checkauth { Link Here
967
        OpacAuthorities      => C4::Context->preference("OpacAuthorities"),
969
        OpacAuthorities      => C4::Context->preference("OpacAuthorities"),
968
        OpacBrowser          => C4::Context->preference("OpacBrowser"),
970
        OpacBrowser          => C4::Context->preference("OpacBrowser"),
969
        opacheader           => C4::Context->preference("opacheader"),
971
        opacheader           => C4::Context->preference("opacheader"),
970
        TagsEnabled                  => C4::Context->preference("TagsEnabled"),
972
        TagsEnabled          => C4::Context->preference("TagsEnabled"),
971
        OPACUserCSS           => C4::Context->preference("OPACUserCSS"),
973
        OPACUserCSS           => C4::Context->preference("OPACUserCSS"),
972
        intranetcolorstylesheet =>
974
        intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
973
								C4::Context->preference("intranetcolorstylesheet"),
974
        intranetstylesheet => C4::Context->preference("intranetstylesheet"),
975
        intranetstylesheet => C4::Context->preference("intranetstylesheet"),
975
        intranetbookbag    => C4::Context->preference("intranetbookbag"),
976
        intranetbookbag    => C4::Context->preference("intranetbookbag"),
976
        IntranetNav        => C4::Context->preference("IntranetNav"),
977
        IntranetNav        => C4::Context->preference("IntranetNav"),
Lines 978-984 sub checkauth { Link Here
978
        intranetuserjs     => C4::Context->preference("intranetuserjs"),
979
        intranetuserjs     => C4::Context->preference("intranetuserjs"),
979
        IndependantBranches=> C4::Context->preference("IndependantBranches"),
980
        IndependantBranches=> C4::Context->preference("IndependantBranches"),
980
        AutoLocation       => C4::Context->preference("AutoLocation"),
981
        AutoLocation       => C4::Context->preference("AutoLocation"),
981
		wrongip            => $info{'wrongip'},
982
        wrongip            => $info{'wrongip'},
983
        PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"),
984
        PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"),
982
    );
985
    );
983
986
984
    $template->param( OpacPublic => C4::Context->preference("OpacPublic"));
987
    $template->param( OpacPublic => C4::Context->preference("OpacPublic"));
(-)a/C4/Installer/PerlDependencies.pm (+5 lines)
Lines 629-634 our $PERL_DEPS = { Link Here
629
        'required' => '0',
629
        'required' => '0',
630
        'min_ver'  => '1.09',
630
        'min_ver'  => '1.09',
631
      },
631
      },
632
    'String::Random' => {
633
        'usage'    => 'OpacSelfRegistration',
634
        'required' => '0',
635
        'min_ver'  => '1.4',
636
    },
632
};
637
};
633
638
634
1;
639
1;
(-)a/C4/Letters.pm (-13 / +17 lines)
Lines 540-545 sub GetProcessedLetter { Link Here
540
       }
540
       }
541
    }
541
    }
542
542
543
    my $OPACBaseURL = C4::Context->preference('OPACBaseURL');
544
    $letter->{content} =~ s/<<OPACBaseURL>>/$OPACBaseURL/go;
545
543
    if ($want_librarian) {
546
    if ($want_librarian) {
544
        # parsing librarian name
547
        # parsing librarian name
545
        my $userenv = C4::Context->userenv;
548
        my $userenv = C4::Context->userenv;
Lines 638-655 sub _parseletter_sth { Link Here
638
    # check cache first
641
    # check cache first
639
    (defined $handles{$table}) and return $handles{$table};
642
    (defined $handles{$table}) and return $handles{$table};
640
    my $query = 
643
    my $query = 
641
    ($table eq 'biblio'       ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                 :
644
    ($table eq 'biblio'       ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
642
    ($table eq 'biblioitems'  ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                 :
645
    ($table eq 'biblioitems'  ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
643
    ($table eq 'items'        ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                 :
646
    ($table eq 'items'        ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
644
    ($table eq 'issues'       ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                 :
647
    ($table eq 'issues'       ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
645
    ($table eq 'old_issues'   ) ? "SELECT * FROM $table WHERE     itemnumber = ? ORDER BY timestamp DESC LIMIT 1" :
648
    ($table eq 'old_issues'   ) ? "SELECT * FROM $table WHERE     itemnumber = ? ORDER BY timestamp DESC LIMIT 1"  :
646
    ($table eq 'reserves'     ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?"            :
649
    ($table eq 'reserves'     ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?"             :
647
    ($table eq 'borrowers'    ) ? "SELECT * FROM $table WHERE borrowernumber = ?"                                 :
650
    ($table eq 'borrowers'    ) ? "SELECT * FROM $table WHERE borrowernumber = ?"                                  :
648
    ($table eq 'branches'     ) ? "SELECT * FROM $table WHERE     branchcode = ?"                                 :
651
    ($table eq 'branches'     ) ? "SELECT * FROM $table WHERE     branchcode = ?"                                  :
649
    ($table eq 'suggestions'  ) ? "SELECT * FROM $table WHERE   suggestionid = ?"                                 :
652
    ($table eq 'suggestions'  ) ? "SELECT * FROM $table WHERE   suggestionid = ?"                                  :
650
    ($table eq 'aqbooksellers') ? "SELECT * FROM $table WHERE             id = ?"                                 :
653
    ($table eq 'aqbooksellers') ? "SELECT * FROM $table WHERE             id = ?"                                  :
651
    ($table eq 'aqorders'     ) ? "SELECT * FROM $table WHERE    ordernumber = ?"                                 :
654
    ($table eq 'aqorders'     ) ? "SELECT * FROM $table WHERE    ordernumber = ?"                                  :
652
    ($table eq 'opac_news'    ) ? "SELECT * FROM $table WHERE          idnew = ?"                                 :
655
    ($table eq 'opac_news'    ) ? "SELECT * FROM $table WHERE          idnew = ?"                                  :
656
    ($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE borrowernumber = ? OR verification_token =?":
653
    undef ;
657
    undef ;
654
    unless ($query) {
658
    unless ($query) {
655
        warn "ERROR: No _parseletter_sth query for table '$table'";
659
        warn "ERROR: No _parseletter_sth query for table '$table'";
Lines 756-762 sub EnqueueLetter { Link Here
756
    my $params = shift or return;
760
    my $params = shift or return;
757
761
758
    return unless exists $params->{'letter'};
762
    return unless exists $params->{'letter'};
759
    return unless exists $params->{'borrowernumber'};
763
#   return unless exists $params->{'borrowernumber'};
760
    return unless exists $params->{'message_transport_type'};
764
    return unless exists $params->{'message_transport_type'};
761
765
762
    my $content = $params->{letter}->{content};
766
    my $content = $params->{letter}->{content};
(-)a/C4/Log.pm (+1 lines)
Lines 73-78 sub logaction { Link Here
73
    # the scalar '0'.
73
    # the scalar '0'.
74
    my $userenv = C4::Context->userenv();
74
    my $userenv = C4::Context->userenv();
75
    my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : 0;
75
    my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : 0;
76
    $usernumber ||= 0;
76
77
77
    my $dbh = C4::Context->dbh;
78
    my $dbh = C4::Context->dbh;
78
    my $sth=$dbh->prepare("Insert into action_logs (timestamp,user,module,action,object,info) values (now(),?,?,?,?,?)");
79
    my $sth=$dbh->prepare("Insert into action_logs (timestamp,user,module,action,object,info) values (now(),?,?,?,?,?)");
(-)a/C4/Members.pm (-5 / +37 lines)
Lines 25-30 use strict; Link Here
25
use C4::Context;
25
use C4::Context;
26
use C4::Dates qw(format_date_in_iso format_date);
26
use C4::Dates qw(format_date_in_iso format_date);
27
use Digest::MD5 qw(md5_base64);
27
use Digest::MD5 qw(md5_base64);
28
use String::Random qw( random_string );
28
use Date::Calc qw/Today Add_Delta_YM check_date Date_to_Days/;
29
use Date::Calc qw/Today Add_Delta_YM check_date Date_to_Days/;
29
use C4::Log; # logaction
30
use C4::Log; # logaction
30
use C4::Overdues;
31
use C4::Overdues;
Lines 118-123 BEGIN { Link Here
118
    #Insert data
119
    #Insert data
119
    push @EXPORT, qw(
120
    push @EXPORT, qw(
120
        &AddMember
121
        &AddMember
122
        &AddMember_Opac
121
        &add_member_orgs
123
        &add_member_orgs
122
        &MoveMemberToDeleted
124
        &MoveMemberToDeleted
123
        &ExtendMemberSubscriptionTo
125
        &ExtendMemberSubscriptionTo
Lines 751-761 Returns as undef upon any db error without further processing Link Here
751
sub AddMember {
753
sub AddMember {
752
    my (%data) = @_;
754
    my (%data) = @_;
753
    my $dbh = C4::Context->dbh;
755
    my $dbh = C4::Context->dbh;
754
	# generate a proper login if none provided
756
755
	$data{'userid'} = Generate_Userid($data{'borrowernumber'}, $data{'firstname'}, $data{'surname'}) if $data{'userid'} eq '';
757
    # generate a proper login if none provided
756
	# create a disabled account if no password provided
758
    $data{'userid'} = Generate_Userid($data{'borrowernumber'}, $data{'firstname'}, $data{'surname'}) if $data{'userid'} eq '';
757
	$data{'password'} = ($data{'password'})? md5_base64($data{'password'}) : '!';
759
758
	$data{'borrowernumber'}=InsertInTable("borrowers",\%data);	
760
    # add expiration date if it isn't already there
761
    unless ( $data{'dateexpiry'} ) {
762
        $data{'dateexpiry'} = GetExpiryDate( $data{'categorycode'}, C4::Dates->new()->output("iso") );
763
    }
764
765
    # add enrollment date if it isn't already there
766
    unless ( $data{'dateenrolled'} ) {
767
        $data{'dateenrolled'} = C4::Dates->new()->output("iso");
768
    }
769
770
    # create a disabled account if no password provided
771
    $data{'password'} = ($data{'password'})? md5_base64($data{'password'}) : '!';
772
    $data{'borrowernumber'}=InsertInTable("borrowers",\%data);
773
774
759
    # mysql_insertid is probably bad.  not necessarily accurate and mysql-specific at best.
775
    # mysql_insertid is probably bad.  not necessarily accurate and mysql-specific at best.
760
    logaction("MEMBERS", "CREATE", $data{'borrowernumber'}, "") if C4::Context->preference("BorrowersLog");
776
    logaction("MEMBERS", "CREATE", $data{'borrowernumber'}, "") if C4::Context->preference("BorrowersLog");
761
    
777
    
Lines 2379-2384 sub GetBorrowersWithEmail { Link Here
2379
    return @result;
2395
    return @result;
2380
}
2396
}
2381
2397
2398
sub AddMember_Opac {
2399
    my ( %borrower ) = @_;
2400
2401
    $borrower{'categorycode'} = C4::Context->preference('PatronSelfRegistrationDefaultCategory');
2402
2403
    my $sr = new String::Random;
2404
    $sr->{'A'} = [ 'A'..'Z', 'a'..'z' ];
2405
    my $password = $sr->randpattern("AAAAAAAAAA");
2406
    $borrower{'password'} = $password;
2407
2408
    $borrower{'cardnumber'} = fixup_cardnumber();
2409
2410
    my $borrowernumber = AddMember(%borrower);
2411
2412
    return ( $borrowernumber, $password );
2413
}
2382
2414
2383
END { }    # module clean-up code here (global destructor)
2415
END { }    # module clean-up code here (global destructor)
2384
2416
(-)a/Koha/Borrower/Modifications.pm (+369 lines)
Line 0 Link Here
1
package Koha::Borrower::Modifications;
2
3
# Copyright 2012 ByWater Solutions
4
# This file is part of Koha.
5
#
6
# Koha is free software; you can redistribute it and/or modify it under the
7
# terms of the GNU General Public License as published by the Free Software
8
# Foundation; either version 2 of the License, or (at your option) any later
9
# version.
10
#
11
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
12
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License along
16
# with Koha; if not, write to the Free Software Foundation, Inc.,
17
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19
=head1 NAME
20
21
C4::Borrowers::Modifications
22
23
=cut
24
25
use Modern::Perl;
26
27
use C4::Context;
28
use C4::Debug;
29
use C4::SQLHelper qw(InsertInTable UpdateInTable);
30
31
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
32
33
BEGIN {
34
35
    # set the version for version checking
36
    $VERSION = 0.01;
37
    require Exporter;
38
    @ISA    = qw(Exporter);
39
    @EXPORT = qw(
40
41
    );
42
43
    my $debug = C4::Context->preference("DebugLevel");
44
}
45
46
sub new {
47
    my ( $class, %args ) = @_;
48
    my $self = bless( {}, $class );
49
50
    $self->{'verification_token'} = $args{'verification_token'};
51
    $self->{'borrowernumber'}     = $args{'borrowernumber'};
52
53
    return $self;
54
}
55
56
=head AddModifications
57
58
Koha::Borrower::Modifications->AddModifications( %data );
59
60
Adds or updates modifications for a borrower.
61
62
Requires either the key borrowernumber, or verification_token
63
to be part of the passed in hash.
64
65
=cut
66
67
sub AddModifications {
68
    my ( $self, %data ) = @_;
69
70
    if ( $self->{'borrowernumber'} ) {
71
        delete $data{'borrowernumber'};
72
73
        if ( keys %data ) {
74
            $data{'borrowernumber'} = $self->{'borrowernumber'};
75
            my $dbh = C4::Context->dbh;
76
77
            my $query = "
78
                SELECT COUNT(*) AS count
79
                FROM borrower_modifications
80
                WHERE borrowernumber = ?
81
            ";
82
83
            my $sth = $dbh->prepare($query);
84
            $sth->execute( $self->{'borrowernumber'} );
85
            my $result = $sth->fetchrow_hashref();
86
87
            if ( $result->{'count'} ) {
88
                $data{'verification_token'} = q{};
89
                return UpdateInTable( "borrower_modifications", \%data );
90
            }
91
            else {
92
                return InsertInTable( "borrower_modifications", \%data );
93
            }
94
        }
95
96
    }
97
    elsif ( $self->{'verification_token'} ) {
98
        delete $data{'borrowernumber'};
99
        $data{'verification_token'} = $self->{'verification_token'};
100
101
        return InsertInTable( "borrower_modifications", \%data );
102
    }
103
    else {
104
        return;
105
    }
106
}
107
108
=head Verify
109
110
$verified = Koha::Borrower::Modifications->Verify( $verification_token );
111
112
Returns true if the passed in token is valid.
113
114
=cut
115
116
sub Verify {
117
    my ( $self, $verification_token ) = @_;
118
119
    if ( ref($self) ) {
120
        $verification_token =
121
          ($verification_token)
122
          ? $verification_token
123
          : $self->{'verification_token'};
124
    }
125
126
    my $dbh   = C4::Context->dbh;
127
    my $query = "
128
        SELECT COUNT(*) AS count
129
        FROM borrower_modifications
130
        WHERE verification_token = ?
131
    ";
132
    my $sth = $dbh->prepare($query);
133
    $sth->execute($verification_token);
134
    my $result = $sth->fetchrow_hashref();
135
136
    return $result->{'count'};
137
}
138
139
=head GetPendingModificationsCount
140
141
$count = Koha::Borrower::Modifications->GetPendingModificationsCount();
142
143
Returns the number of pending modifications for existing borrowers.
144
=cut
145
146
sub GetPendingModificationsCount {
147
    my ( $self, $branchcode ) = @_;
148
149
    my $dbh   = C4::Context->dbh;
150
    my $query = "
151
        SELECT COUNT(*) AS count
152
        FROM borrower_modifications, borrowers
153
        WHERE borrower_modifications.borrowernumber > 0
154
        AND borrower_modifications.borrowernumber = borrowers.borrowernumber
155
    ";
156
157
    my @params;
158
    if ($branchcode) {
159
        $query .= " AND borrowers.branchcode = ? ";
160
        push( @params, $branchcode );
161
    }
162
163
    my $sth = $dbh->prepare($query);
164
    $sth->execute(@params);
165
    my $result = $sth->fetchrow_hashref();
166
167
    return $result->{'count'};
168
}
169
170
=head GetPendingModifications
171
172
$arrayref = Koha::Borrower::Modifications->GetPendingModifications();
173
174
Returns an arrayref of hashrefs for all pending modifications for existing borrowers.
175
176
=cut
177
178
sub GetPendingModifications {
179
    my ( $self, $branchcode ) = @_;
180
181
    my $dbh   = C4::Context->dbh;
182
    my $query = "
183
        SELECT borrower_modifications.*
184
        FROM borrower_modifications, borrowers
185
        WHERE borrower_modifications.borrowernumber > 0
186
        AND borrower_modifications.borrowernumber = borrowers.borrowernumber
187
    ";
188
189
    my @params;
190
    if ($branchcode) {
191
        $query .= " AND borrowers.branchcode = ? ";
192
        push( @params, $branchcode );
193
    }
194
195
    my $sth = $dbh->prepare($query);
196
    $sth->execute(@params);
197
198
    my @m;
199
    while ( my $row = $sth->fetchrow_hashref() ) {
200
        foreach my $key ( keys %$row ) {
201
            delete $row->{$key} unless defined $row->{$key};
202
        }
203
204
        push( @m, $row );
205
    }
206
207
    return \@m;
208
}
209
210
=head ApproveModifications
211
212
Koha::Borrower::Modifications->ApproveModifications( $borrowernumber );
213
214
Commits the pending modifications to the borrower record and removes
215
them from the modifications table.
216
217
=cut
218
219
sub ApproveModifications {
220
    my ( $self, $borrowernumber ) = @_;
221
222
    if ( ref($self) ) {
223
        $borrowernumber =
224
          ($borrowernumber) ? $borrowernumber : $self->{'borrowernumber'};
225
    }
226
227
    return unless $borrowernumber;
228
229
    my $data = $self->GetModifications( borrowernumber => $borrowernumber );
230
231
    if ( UpdateInTable( "borrowers", $data ) ) {
232
        $self->DelModifications( borrowernumber => $borrowernumber );
233
    }
234
}
235
236
=head DenyModifications
237
238
Koha::Borrower::Modifications->DenyModifications( $borrowernumber );
239
240
Removes the modifications from the table for the given borrower,
241
without commiting the changes to the borrower record.
242
243
=cut
244
245
sub DenyModifications {
246
    my ( $self, $borrowernumber ) = @_;
247
248
    if ( ref($self) ) {
249
        $borrowernumber =
250
          ($borrowernumber) ? $borrowernumber : $self->{'borrowernumber'};
251
    }
252
253
    return unless $borrowernumber;
254
255
    return $self->DelModifications( borrowernumber => $borrowernumber );
256
}
257
258
=head DelModifications
259
260
Koha::Borrower::Modifications->DelModifications(
261
  [ borrowernumber => $borrowernumber ],
262
  [ verification_token => $verification_token ]
263
);
264
265
Deletes the modifications for the given borrowernumber or verification token.
266
267
=cut
268
269
sub DelModifications {
270
    my ( $self, %params ) = @_;
271
272
    my ( $field, $value );
273
274
    if ( $params{'borrowernumber'} ) {
275
        $field = 'borrowernumber';
276
        $value = $params{'borrowernumber'};
277
    }
278
    elsif ( $params{'verification_token'} ) {
279
        $field = 'verification_token';
280
        $value = $params{'verification_token'};
281
    }
282
283
    if ( ref($self) && !$value ) {
284
        if ( $self->{'borrowernumber'} ) {
285
            $field = 'borrowernumber';
286
            $value = $self->{'borrowernumber'};
287
        }
288
        elsif ( $self->{'verification_token'} ) {
289
            $field = 'verification_token';
290
            $value = $self->{'verification_token'};
291
        }
292
    }
293
294
    return unless $value;
295
296
    my $dbh = C4::Context->dbh;
297
298
    $field = $dbh->quote_identifier($field);
299
300
    my $query = "
301
        DELETE
302
        FROM borrower_modifications
303
        WHERE $field = ?
304
    ";
305
306
    my $sth = $dbh->prepare($query);
307
    return $sth->execute($value);
308
}
309
310
=head GetModifications
311
312
$hashref = Koha::Borrower::Modifications->GetModifications(
313
  [ borrowernumber => $borrowernumber ],
314
  [ verification_token => $verification_token ]
315
);
316
317
Gets the modifications for the given borrowernumber or verification token.
318
319
=cut
320
321
sub GetModifications {
322
    my ( $self, %params ) = @_;
323
324
    my ( $field, $value );
325
326
    if ( $params{'borrowernumber'} ) {
327
        $field = 'borrowernumber';
328
        $value = $params{'borrowernumber'};
329
    }
330
    elsif ( $params{'verification_token'} ) {
331
        $field = 'verification_token';
332
        $value = $params{'verification_token'};
333
    }
334
335
    if ( ref($self) && !$value ) {
336
        if ( $self->{'borrowernumber'} ) {
337
            $field = 'borrowernumber';
338
            $value = $self->{'borrowernumber'};
339
        }
340
        elsif ( $self->{'verification_token'} ) {
341
            $field = 'verification_token';
342
            $value = $self->{'verification_token'};
343
        }
344
    }
345
346
    return unless $value;
347
348
    my $dbh = C4::Context->dbh;
349
350
    $field = $dbh->quote_identifier($field);
351
352
    my $query = "
353
        SELECT *
354
        FROM borrower_modifications
355
        WHERE $field = ?
356
    ";
357
358
    my $sth = $dbh->prepare($query);
359
    $sth->execute($value);
360
    my $data = $sth->fetchrow_hashref();
361
362
    foreach my $key ( keys %$data ) {
363
        delete $data->{$key} unless ( defined( $data->{$key} ) );
364
    }
365
366
    return $data;
367
}
368
369
1;
(-)a/installer/data/mysql/en/mandatory/sample_notices.sql (+12 lines)
Lines 105-107 Date due: <<issues.date_due>><br /> Link Here
105
   <li><<items.barcode>></li>
105
   <li><<items.barcode>></li>
106
   <li><<items.itemcallnumber>></li>
106
   <li><<items.itemcallnumber>></li>
107
</ul>', 1);
107
</ul>', 1);
108
109
110
INSERT INTO `letter` (`module`,`code`,`branchcode`,`name`,`is_html`,`title`,`content`)
111
VALUES (
112
'members',  'OPAC_REG_VERIFY',  '',  'Opac Self-Registration Verification Email',  '1',  'Verify Your Account',  'Hello!
113
114
Your library account has been created. Please verify your email address by clicking this link to complete the signup process:
115
116
http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
117
118
If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.'
119
);
(-)a/installer/data/mysql/kohastructure.sql (+78 lines)
Lines 2977-2982 CREATE TABLE borrower_attribute_types_branches( -- association table between bor Link Here
2977
    FOREIGN KEY (b_branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
2977
    FOREIGN KEY (b_branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
2978
) ENGINE=INNODB DEFAULT CHARSET=utf8;
2978
) ENGINE=INNODB DEFAULT CHARSET=utf8;
2979
2979
2980
--
2981
-- Table structure for table `borrower_modifications`
2982
--
2983
2984
CREATE TABLE IF NOT EXISTS `borrower_modifications` (
2985
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
2986
  `verification_token` varchar(255) NOT NULL DEFAULT '',
2987
  `borrowernumber` int(11) NOT NULL DEFAULT '0',
2988
  `cardnumber` varchar(16) DEFAULT NULL,
2989
  `surname` mediumtext,
2990
  `firstname` text,
2991
  `title` mediumtext,
2992
  `othernames` mediumtext,
2993
  `initials` text,
2994
  `streetnumber` varchar(10) DEFAULT NULL,
2995
  `streettype` varchar(50) DEFAULT NULL,
2996
  `address` mediumtext,
2997
  `address2` text,
2998
  `city` mediumtext,
2999
  `state` text,
3000
  `zipcode` varchar(25) DEFAULT NULL,
3001
  `country` text,
3002
  `email` mediumtext,
3003
  `phone` text,
3004
  `mobile` varchar(50) DEFAULT NULL,
3005
  `fax` mediumtext,
3006
  `emailpro` text,
3007
  `phonepro` text,
3008
  `B_streetnumber` varchar(10) DEFAULT NULL,
3009
  `B_streettype` varchar(50) DEFAULT NULL,
3010
  `B_address` varchar(100) DEFAULT NULL,
3011
  `B_address2` text,
3012
  `B_city` mediumtext,
3013
  `B_state` text,
3014
  `B_zipcode` varchar(25) DEFAULT NULL,
3015
  `B_country` text,
3016
  `B_email` text,
3017
  `B_phone` mediumtext,
3018
  `dateofbirth` date DEFAULT NULL,
3019
  `branchcode` varchar(10) DEFAULT NULL,
3020
  `categorycode` varchar(10) DEFAULT NULL,
3021
  `dateenrolled` date DEFAULT NULL,
3022
  `dateexpiry` date DEFAULT NULL,
3023
  `gonenoaddress` tinyint(1) DEFAULT NULL,
3024
  `lost` tinyint(1) DEFAULT NULL,
3025
  `debarred` date DEFAULT NULL,
3026
  `debarredcomment` varchar(255) DEFAULT NULL,
3027
  `contactname` mediumtext,
3028
  `contactfirstname` text,
3029
  `contacttitle` text,
3030
  `guarantorid` int(11) DEFAULT NULL,
3031
  `borrowernotes` mediumtext,
3032
  `relationship` varchar(100) DEFAULT NULL,
3033
  `ethnicity` varchar(50) DEFAULT NULL,
3034
  `ethnotes` varchar(255) DEFAULT NULL,
3035
  `sex` varchar(1) DEFAULT NULL,
3036
  `password` varchar(30) DEFAULT NULL,
3037
  `flags` int(11) DEFAULT NULL,
3038
  `userid` varchar(75) DEFAULT NULL,
3039
  `opacnote` mediumtext,
3040
  `contactnote` varchar(255) DEFAULT NULL,
3041
  `sort1` varchar(80) DEFAULT NULL,
3042
  `sort2` varchar(80) DEFAULT NULL,
3043
  `altcontactfirstname` varchar(255) DEFAULT NULL,
3044
  `altcontactsurname` varchar(255) DEFAULT NULL,
3045
  `altcontactaddress1` varchar(255) DEFAULT NULL,
3046
  `altcontactaddress2` varchar(255) DEFAULT NULL,
3047
  `altcontactaddress3` varchar(255) DEFAULT NULL,
3048
  `altcontactstate` text,
3049
  `altcontactzipcode` varchar(50) DEFAULT NULL,
3050
  `altcontactcountry` text,
3051
  `altcontactphone` varchar(50) DEFAULT NULL,
3052
  `smsalertnumber` varchar(50) DEFAULT NULL,
3053
  `privacy` int(11) DEFAULT NULL,
3054
  PRIMARY KEY (`verification_token`,`borrowernumber`),
3055
  KEY `verification_token` (`verification_token`),
3056
  KEY `borrowernumber` (`borrowernumber`)
3057
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2980
3058
2981
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3059
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
2982
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3060
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
(-)a/installer/data/mysql/sysprefs.sql (+7 lines)
Lines 388-390 INSERT INTO systempreferences (variable, value, options, explanation, type) VALU Link Here
388
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
388
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
389
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free');
389
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free');
390
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo');
390
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo');
391
INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES
392
('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'),
393
('PatronSelfRegistrationVerifyByEmail', '0', NULL, 'If enabled, any patron attempting to register themselves via the OPAC will be required to verify themselves via email to activate his or her account.', 'YesNo'),
394
('PatronSelfRegistrationDefaultCategory', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'),
395
('PatronSelfRegistrationExpireTemporaryAccountsDelay', '0', NULL, 'If PatronSelfRegistrationDefaultCategory is enabled, this system preference controls how long a patron can have a temporary status before the account is deleted automatically. It is an integer value representing a number of days to wait before deleting a temporary patron account. Setting it to 0 disables the deleting of temporary accounts.', 'Integer'),
396
('PatronSelfRegistrationBorrowerMandatoryField',  'surname|firstname', NULL ,  'Choose the mandatory fields for a patron''s account, when registering via the OPAC.',  'free'),
397
('PatronSelfRegistrationBorrowerUnwantedField',  '', NULL ,  'Name the fields you don''t want to display when registering a new patron via the OPAC.',  'free');
(-)a/installer/data/mysql/updatedatabase.pl (+104 lines)
Lines 5714-5719 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
5714
          ) ENGINE=InnoDB DEFAULT CHARSET=utf8");
5714
          ) ENGINE=InnoDB DEFAULT CHARSET=utf8");
5715
5715
5716
    print "Upgrade to $DBversion done (creating `transport_cost` table; adding UseTransportCostMatrix systempref, in circulation)\n";
5716
    print "Upgrade to $DBversion done (creating `transport_cost` table; adding UseTransportCostMatrix systempref, in circulation)\n";
5717
    SetVersion($DBversion);
5718
}
5719
5720
$DBversion = '3.09.00.XXX';
5721
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5722
    $dbh->do("
5723
        CREATE TABLE IF NOT EXISTS `borrower_modifications` (
5724
          `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
5725
          `verification_token` varchar(255) NOT NULL DEFAULT '',
5726
          `borrowernumber` int(11) NOT NULL DEFAULT '0',
5727
          `cardnumber` varchar(16) DEFAULT NULL,
5728
          `surname` mediumtext,
5729
          `firstname` text,
5730
          `title` mediumtext,
5731
          `othernames` mediumtext,
5732
          `initials` text,
5733
          `streetnumber` varchar(10) DEFAULT NULL,
5734
          `streettype` varchar(50) DEFAULT NULL,
5735
          `address` mediumtext,
5736
          `address2` text,
5737
          `city` mediumtext,
5738
          `state` text,
5739
          `zipcode` varchar(25) DEFAULT NULL,
5740
          `country` text,
5741
          `email` mediumtext,
5742
          `phone` text,
5743
          `mobile` varchar(50) DEFAULT NULL,
5744
          `fax` mediumtext,
5745
          `emailpro` text,
5746
          `phonepro` text,
5747
          `B_streetnumber` varchar(10) DEFAULT NULL,
5748
          `B_streettype` varchar(50) DEFAULT NULL,
5749
          `B_address` varchar(100) DEFAULT NULL,
5750
          `B_address2` text,
5751
          `B_city` mediumtext,
5752
          `B_state` text,
5753
          `B_zipcode` varchar(25) DEFAULT NULL,
5754
          `B_country` text,
5755
          `B_email` text,
5756
          `B_phone` mediumtext,
5757
          `dateofbirth` date DEFAULT NULL,
5758
          `branchcode` varchar(10) DEFAULT NULL,
5759
          `categorycode` varchar(10) DEFAULT NULL,
5760
          `dateenrolled` date DEFAULT NULL,
5761
          `dateexpiry` date DEFAULT NULL,
5762
          `gonenoaddress` tinyint(1) DEFAULT NULL,
5763
          `lost` tinyint(1) DEFAULT NULL,
5764
          `debarred` date DEFAULT NULL,
5765
          `debarredcomment` varchar(255) DEFAULT NULL,
5766
          `contactname` mediumtext,
5767
          `contactfirstname` text,
5768
          `contacttitle` text,
5769
          `guarantorid` int(11) DEFAULT NULL,
5770
          `borrowernotes` mediumtext,
5771
          `relationship` varchar(100) DEFAULT NULL,
5772
          `ethnicity` varchar(50) DEFAULT NULL,
5773
          `ethnotes` varchar(255) DEFAULT NULL,
5774
          `sex` varchar(1) DEFAULT NULL,
5775
          `password` varchar(30) DEFAULT NULL,
5776
          `flags` int(11) DEFAULT NULL,
5777
          `userid` varchar(75) DEFAULT NULL,
5778
          `opacnote` mediumtext,
5779
          `contactnote` varchar(255) DEFAULT NULL,
5780
          `sort1` varchar(80) DEFAULT NULL,
5781
          `sort2` varchar(80) DEFAULT NULL,
5782
          `altcontactfirstname` varchar(255) DEFAULT NULL,
5783
          `altcontactsurname` varchar(255) DEFAULT NULL,
5784
          `altcontactaddress1` varchar(255) DEFAULT NULL,
5785
          `altcontactaddress2` varchar(255) DEFAULT NULL,
5786
          `altcontactaddress3` varchar(255) DEFAULT NULL,
5787
          `altcontactstate` text,
5788
          `altcontactzipcode` varchar(50) DEFAULT NULL,
5789
          `altcontactcountry` text,
5790
          `altcontactphone` varchar(50) DEFAULT NULL,
5791
          `smsalertnumber` varchar(50) DEFAULT NULL,
5792
          `privacy` int(11) DEFAULT NULL,
5793
          PRIMARY KEY (`verification_token`,`borrowernumber`),
5794
          KEY `verification_token` (`verification_token`),
5795
          KEY `borrowernumber` (`borrowernumber`)
5796
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
5797
");
5798
5799
    $dbh->do("
5800
        INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES
5801
        ('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'),
5802
        ('PatronSelfRegistrationVerifyByEmail', '0', NULL, 'If enabled, any patron attempting to register themselves via the OPAC will be required to verify themselves via email to activate his or her account.', 'YesNo'),
5803
        ('PatronSelfRegistrationDefaultCategory', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'),
5804
        ('PatronSelfRegistrationExpireTemporaryAccountsDelay', '0', NULL, 'If PatronSelfRegistrationDefaultCategory is enabled, this system preference controls how long a patron can have a temporary status before the account is deleted automatically. It is an integer value representing a number of days to wait before deleting a temporary patron account. Setting it to 0 disables the deleting of temporary accounts.', 'Integer'),
5805
        ('PatronSelfRegistrationBorrowerMandatoryField',  'surname|firstname', NULL ,  'Choose the mandatory fields for a patron''s account, when registering via the OPAC.',  'free'),
5806
        ('PatronSelfRegistrationBorrowerUnwantedField',  '', NULL ,  'Name the fields you don''t want to display when registering a new patron via the OPAC.',  'free');
5807
    ");
5808
5809
    $dbh->do("
5810
    INSERT INTO  letter ( `module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content` )
5811
    VALUES ( 'members', 'OPAC_REG_VERIFY', '', 'Opac Self-Registration Verification Email', '1', 'Verify Your Account', 'Hello!
5812
5813
    Your library account has been created. Please verify your email address by clicking this link to complete the signup process:
5814
5815
    http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
5816
5817
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.'
5818
    )");
5819
5820
    print "Upgrade to $DBversion done (Add Patron Self Registration)\n";
5717
    SetVersion ($DBversion);
5821
    SetVersion ($DBversion);
5718
}
5822
}
5719
5823
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+34 lines)
Lines 527-529 OPAC: Link Here
527
                  yes: Use
527
                  yes: Use
528
                  no: "Don't use"
528
                  no: "Don't use"
529
            - "the item collection code when finding items for the shelf browser."      
529
            - "the item collection code when finding items for the shelf browser."      
530
531
    Self Registration:
532
        -
533
            - pref: PatronSelfRegistration
534
              choices:
535
                  yes: Allow
536
                  no: "Don't allow"
537
            - "library patrons to register an account via the OPAC."
538
        -
539
            - pref: PatronSelfRegistrationVerifyByEmail
540
              choices:
541
                  yes: Require
542
                  no: "Don't require"
543
            - "that a self-registering patron verify his or herself via email."
544
        -
545
            - "Use the patron category code"
546
            - pref: PatronSelfRegistrationDefaultCategory
547
              class: short
548
            - "as the default patron category for patrons registered via the OPAC."
549
        -
550
            - "Delete patrons registered via the OPAC, but not yet verified after"
551
            - pref: PatronSelfRegistrationExpireTemporaryAccountsDelay
552
              class: integer
553
            - "days."
554
        -
555
            - "The following <a href='http://schema.koha-community.org/tables/borrowers.html' target='blank'>database columns</a> must be filled in on the patron entry screen:"
556
            - pref: PatronSelfRegistrationBorrowerMandatoryField
557
              class: multi
558
            - (separate columns with |)
559
        -
560
            - "The following <a href='http://schema.koha-community.org/tables/borrowers.html' target='blank'>database columns</a> will not appear on the patron entry screen:"
561
            - pref: PatronSelfRegistrationBorrowerUnwantedField
562
              class: multi
563
            - (separate columns with |)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt (-1 / +11 lines)
Lines 107-112 Link Here
107
<div class="yui-g">
107
<div class="yui-g">
108
            [% IF ( ( CAN_user_tools_moderate_comments  && pendingcomments ) 
108
            [% IF ( ( CAN_user_tools_moderate_comments  && pendingcomments ) 
109
                    || ( CAN_user_tools_moderate_tags && pendingtags )
109
                    || ( CAN_user_tools_moderate_tags && pendingtags )
110
                    || ( CAN_user_borrowers && pending_borrower_modifications )
110
                    || ( CAN_user_acquisition && pendingsuggestions ) ) %]
111
                    || ( CAN_user_acquisition && pendingsuggestions ) ) %]
111
                <div id="area-pending">
112
                <div id="area-pending">
112
                    [% IF ( CAN_user_acquisition && pendingsuggestions ) %]
113
                    [% IF ( CAN_user_acquisition && pendingsuggestions ) %]
Lines 130-138 Link Here
130
                        <span class="pending-number-link">[% pendingtags %]</span>
131
                        <span class="pending-number-link">[% pendingtags %]</span>
131
                    </div>
132
                    </div>
132
                    [% END %]
133
                    [% END %]
134
135
136
                    [% IF ( CAN_user_borrowers && pending_borrower_modifications ) %]
137
                    <div class="pending-info">
138
                        <a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>:
139
                        <span class="pending-number-link">[% pending_borrower_modifications %]</span>
140
                    </div>
141
                    [% END %]
142
133
                </div>
143
                </div>
134
            [% END %]
135
144
145
            [% END %]
136
146
137
</div>
147
</div>
138
            [% IF ( IntranetmainUserblock ) %]
148
            [% IF ( IntranetmainUserblock ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt (+140 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Patrons [% IF ( searching ) %]&rsaquo; Search results[% END %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="pat_member" class="pat">
6
[% INCLUDE 'header.inc' %]
7
[% INCLUDE 'patron-search.inc' %]
8
9
[%
10
    SET field_display_names = {
11
        surname         => "Surname"
12
        firstname       => "First name"
13
        title           => "Title"
14
        othernames      => "Other names"
15
        initials        => "Initials"
16
        streetnumber    => "Street number"
17
        streettype      => "Street type"
18
        address         => "Address"
19
        address2        => "Address 2"
20
        city            => "City"
21
        state           => "State"
22
        zipcode         => "Zip code"
23
        country         => "Country"
24
        email           => "Email"
25
        phone           => "Primary Phone"
26
        mobile          => "Primary Mobile Phone"
27
        fax             => "Fax"
28
        emailpro        => "Secondary email"
29
        phonepro        => "Secondary phone"
30
        B_streetnumber  => "Alternate address - street number"
31
        B_streettype    => "Alternate address - street type"
32
        B_address       => "Alternate address"
33
        B_address2      => "Alternate address 2"
34
        B_city          => "Alternate address - city"
35
        B_state         => "Alternate address - state"
36
        B_zipcode       => "Alternate address - zip code"
37
        B_email         => "Alternate address - email"
38
        B_phone         => "Alertnate address - phone"
39
        dateofbirth     => "Date of birth"
40
        contactname     => "Contact - last name"
41
        contactfirstname=> "Contact - first name"
42
        contacttitle    => "Contact - title"
43
        relationship    => "Contact - relationship"
44
        ethnicity       => "Ethnicity"
45
        ethnotes        => "Ethnicity notes"
46
        sex             => "Sex"
47
        altcontactfirstname => "Alternate contact - first name"
48
        altcontactsurname   => "Alternate contact - surname"
49
        altcontactaddress1  => "Alternate contact - address"
50
        altcontactaddress2  => "Alternate contact - address 2"
51
        altcontactaddress3  => "Alternate contact - city"
52
        altcontactstate     => "Alternate contact - state"
53
        altcontactzipcode   => "Alternate contact - zip code"
54
        altcontactcounty    => "Alternate contact - county"
55
        altcontactphone     => "Alternate contact - phone"
56
        smsalertnumber      => "SMS alert number"
57
    }
58
%]
59
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; Patrons &rsaquo; Modifications</div>
60
61
<div id="doc2" class="yui-t7">
62
63
   <div id="bd">
64
        <div id="yui-main">
65
            <div class="yui-b">
66
                <div class="yui-g">
67
                    [% IF PendingModifications %]
68
                        <form method="post" action="members-update-do.pl">
69
70
                            <table>
71
                                <thead>
72
                                    <tr>
73
                                        <th colspan="3">Action</th>
74
                                        <th rowspan="2">Patron</th>
75
                                        <th rowspan="2">Changes</th>
76
                                    </tr>
77
78
                                    <tr>
79
                                        <th>Approve</th>
80
                                        <th>Deny</th>
81
                                        <th>Ignore</th>
82
                                    </tr>
83
                                </thead>
84
85
                                <tbody>
86
                                    [% FOREACH pm IN PendingModifications %]
87
                                        [% SET borrowernumber = pm.borrowernumber %]
88
                                        <tr>
89
                                            <td>
90
                                                <input type="radio" name="modify_[% pm.borrowernumber %]" value="approve" />
91
                                            </td>
92
                                            <td>
93
                                                <input type="radio" name="modify_[% pm.borrowernumber %]" value="deny" />
94
                                            </td>
95
                                            <td>
96
                                                <input type="radio" name="modify_[% pm.borrowernumber %]" value="ignore" checked="checked"/>
97
                                            </td>
98
99
                                            <td>
100
                                                [% borrowers.$borrowernumber.firstname %] [% borrowers.$borrowernumber.surname %]
101
                                            </td>
102
103
                                            <td>
104
                                                <table>
105
                                                    <tr>
106
                                                        <th>Field</th>
107
                                                        <th>From</th>
108
                                                        <th>To</th>
109
                                                    </tr>
110
111
112
                                                    [% FOREACH key IN pm.keys %]
113
                                                        [% IF field_display_names.$key %]
114
                                                            [% IF ( ( pm.$key OR borrowers.$borrowernumber.$key ) && ( pm.$key != borrowers.$borrowernumber.$key ) ) %]
115
                                                                <tr>
116
                                                                    <td>[% field_display_names.$key %]</td>
117
                                                                    <td>[% borrowers.$borrowernumber.$key %]</td>
118
                                                                    <td>[% pm.$key %]</td>
119
                                                                </tr>
120
                                                            [% END %]
121
                                                        [% END %]
122
                                                    [% END %]
123
                                                </table>
124
                                            </td>
125
                                        </tr>
126
                                    [% END %]
127
                                </tbody>
128
                            </table>
129
130
                            <p><input type="submit" /></p>
131
132
                        </form>
133
                    [% ELSE %]
134
                        <p>There are no pending patron modifications.</p>
135
                    [% END %]
136
                </div>
137
            </div>
138
        </div>
139
    </div>
140
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc (-2 / +2 lines)
Lines 1-7 Link Here
1
[% IF ( opaccredits ) %]
1
[% IF ( opaccredits ) %]
2
	<div class="ft">
2
	<div class="ft">
3
        [% opaccredits %]
3
            [% opaccredits %]
4
    </div>
4
        </div>
5
[% END %]
5
[% END %]
6
</div>
6
</div>
7
7
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc (-1 / +1 lines)
Lines 5-11 Link Here
5
  [% IF ( OPACFinesTab ) %]
5
  [% IF ( OPACFinesTab ) %]
6
  [% IF ( accountview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-account.pl">my fines</a></li>
6
  [% IF ( accountview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-account.pl">my fines</a></li>
7
  [% END %]
7
  [% END %]
8
  [% IF ( userupdateview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-userupdate.pl">my personal details</a></li>
8
  [% IF ( userupdateview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-memberentry.pl">my personal details</a></li>
9
  [% IF ( TagsEnabled ) %]
9
  [% IF ( TagsEnabled ) %]
10
    [% IF ( tagsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-tags.pl?mine=1">my tags</a></li>
10
    [% IF ( tagsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-tags.pl?mine=1">my tags</a></li>
11
  [% END %]
11
  [% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt (-2 / +4 lines)
Lines 84-91 please choose against which one you would like to authenticate: </p> Link Here
84
</ol></fieldset>
84
</ol></fieldset>
85
85
86
<input type="submit" value="Log In" class="submit" />
86
<input type="submit" value="Log In" class="submit" />
87
<div id="nologininstructions">  <h5>Don't have a password yet?</h5><p> If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.</p>
87
<div id="nologininstructions">
88
<h5>Don't have a library card?</h5><p> If you don't have a library card, stop by your local library to sign up.  </p></div>
88
    <h5>Don't have a password yet?</h5><p> If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.</p>
89
    <h5>Don't have a library card?</h5><p> If you don't have a library card, stop by your local library to sign up[% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %] or  <a href="/cgi-bin/koha/opac-memberentry.pl">register here</a>[% END %].</p>
90
</div>
89
</form>
91
</form>
90
92
91
93
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt (+2 lines)
Lines 56-61 Link Here
56
		<li><label for="password">Password:</label><input type="password" id="password" size="10" name="password" /></li>
56
		<li><label for="password">Password:</label><input type="password" id="password" size="10" name="password" /></li>
57
		</ol>	 <fieldset class="action">
57
		</ol>	 <fieldset class="action">
58
	 <input type="submit" value="Log In" class="submit" />
58
	 <input type="submit" value="Log In" class="submit" />
59
        [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]<div>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></div>[% END %]
60
59
	 </fieldset></fieldset>
61
	 </fieldset></fieldset>
60
	</form>
62
	</form>
61
	</div>
63
	</div>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry-update-submitted.tt (+29 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="opac-main">
6
[% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
7
   <div id="bd">
8
[% INCLUDE 'masthead.inc' %]
9
10
<div id="yui-main">
11
    <div class="yui-b">
12
        <div id="loggedin" class="yui-ge">
13
            <div class="yui-u first">
14
15
                <p>Your updates have been submitted. A librarian will now review you updates before applying them.</p>
16
17
            </div>
18
        </div>
19
    </div>
20
</div>
21
22
[% IF ( OpacNav ) %]<div class="yui-b">
23
    <div id="opacnav" class="container">
24
        [% INCLUDE 'navigation.inc' %]
25
    </div>
26
[% END %]
27
28
</div>
29
[% INCLUDE 'opac-bottom.inc' %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt (+736 lines)
Line 0 Link Here
1
[% USE KohaDates %]
2
[% SET userupdateview = 1 %]
3
4
    [% INCLUDE 'doc-head-open.inc' %]
5
        [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your fines and charges
6
    [% INCLUDE 'doc-head-close.inc' %]
7
8
    <script type="text/javascript">
9
        $(document).ready(function() {
10
            [% IF action == 'edit' && !OPACPatronDetails %]
11
                $("#memberentry-form :input").attr('readonly', true);
12
                $("#borrower_branchcode").attr('disabled',true);
13
                $("#borrower_title").attr('disabled',true);
14
                $('#memberentry-form :radio').attr('disabled',true);
15
                $('span.required').remove();
16
                $('label.required').removeClass('required');
17
            [% ELSE %]
18
                $( "#borrower_dateofbirth" ).datepicker({ yearRange: "c-120:c" });
19
            [% END %]
20
        });
21
    </script>
22
</head>
23
24
<body id="opac-account">
25
    <div id="doc3" class="yui-t1">
26
        <div id="bd">
27
            [% INCLUDE 'masthead.inc' %]
28
29
            <div id="yui-main">
30
                <div class="yui-b">
31
                    <div class="yui-g">
32
                        <div id="useraccount" class="container">
33
                            [% UNLESS OPACPatronDetails %]
34
                                <div>To make changes to your record please contact the library.</div>
35
                            [% END %]
36
37
                            [% IF empty_mandatory_fields %]
38
                                <div class="dialog alert">You have not filled out all required fields. Please fill in all missing fields and resubmit.</div>
39
                            [% END %]
40
41
                            [% IF failed_captcha %]
42
                                <div class="dialog alert">You typed in the wrong characters in the box before submitting. Please try again.</div>
43
                            [% END %]
44
45
                            <form method="post" id="memberentry-form">
46
47
                                [% UNLESS
48
                                    hidden.defined('branchcode')
49
                                %]
50
51
                                <fieldset class="rows" id="memberentry_library">
52
53
                                    <legend id="library_legend">Library</legend>
54
                                        <ol>
55
                                            [% UNLESS hidden.defined('branchcode') %]
56
                                                <li>
57
                                                    [% IF mandatory.defined('branchcode') %]
58
                                                        <label for="borrower_branchcode" class="required">
59
                                                    [% ELSE %]
60
                                                        <label for="borrower_branchcode">
61
                                                    [% END %]
62
                                                    Home Library:</label>
63
64
                                                    <select id="borrower_branchcode" name="borrower_branchcode">
65
                                                        [% FOREACH b IN branches %]
66
                                                            [% IF b.value == borrower.branchcode %]
67
                                                                <option value="[% b.value %]" selected="selected">[% b.branchname %]</option>
68
                                                            [% ELSE %]
69
                                                                <option value="[% b.value %]">[% b.branchname %]</option>
70
                                                            [% END %]
71
                                                        [% END %]
72
                                                    </select>
73
                                                </li>
74
                                            [% END %]
75
                                        </ol>
76
                                    </fieldset>
77
                                [% END %]
78
79
                                [% UNLESS
80
                                    hidden.defined('title') && hidden.defined('surname') && hidden.defined('firstname') &&
81
                                    hidden.defined('dateofbirth') && hidden.defined('initials') && hidden.defined('othernames') &&
82
                                    hidden.defined('sex')
83
                                %]
84
                                    <fieldset class="rows" id="memberentry_identity">
85
                                        <legend id="identity_legend">Identity</legend>
86
87
                                        <ol>
88
                                            [% UNLESS hidden.defined('title') %]
89
                                                <li>
90
                                                    [% IF mandatory.defined('title') %]
91
                                                        <label for="borrower_title" class="required">
92
                                                    [% ELSE %]
93
                                                        <label for="borrower_title">
94
                                                    [% END %]
95
                                                    Salutation:</label>
96
97
                                                    <select id="borrower_title" name="borrower_title">
98
                                                        <option value="">&nbsp;</option>
99
                                                        [% FOREACH mt IN member_titles %]
100
                                                            [% IF mt == borrower.title %]
101
                                                                <option value="[% mt %]" selected="selected">[% mt %]</option>
102
                                                            [% ELSE %]
103
                                                                <option value="[% mt %]">[% mt %]</option>
104
                                                            [% END %]
105
                                                        [% END %]
106
                                                    </select>
107
                                                </li>
108
                                            [% END %]
109
110
                                            [% UNLESS hidden.defined('surname') %]
111
                                                <li>
112
                                                    [% IF mandatory.defined('surname') %]
113
                                                        <label for="borrower_surname" class="required">
114
                                                    [% ELSE %]
115
                                                        <label for="borrower_surname">
116
                                                    [% END %]
117
                                                    Surname:</label>
118
119
                                                    <input type="text" id="borrower_surname" name="borrower_surname" value="[% borrower.surname %]" />
120
                                                    [% IF mandatory.defined('surname') %]<span class="required">Required</span>[% END %]
121
                                                </li>
122
                                            [% END %]
123
124
                                            [% UNLESS hidden.defined('firstname') %]
125
                                                <li>
126
                                                    [% IF mandatory.defined('firstname') %]
127
                                                        <label for="borrower_firstname" class="required">
128
                                                    [% ELSE %]
129
                                                        <label for="borrower_firstname">
130
                                                    [% END %]
131
                                                    First name:</label>
132
133
                                                    <input type="text" id="borrower_firstname" name="borrower_firstname" value="[% borrower.firstname %]" />
134
                                                    [% IF mandatory.defined('firstname') %]<span class="required">Required</span>[% END %]
135
                                                </li>
136
                                            [% END %]
137
138
                                            [% UNLESS hidden.defined('dateofbirth') %]
139
                                                <li>
140
                                                    [% IF mandatory.defined('dateofbirth') %]
141
                                                        <label for="borrower_dateofbirth" class="required">
142
                                                    [% ELSE %]
143
                                                        <label for="borrower_dateofbirth">
144
                                                    [% END %]
145
                                                    Date of birth:</label>
146
147
                                                    <input type="text" id="borrower_dateofbirth" name="borrower_dateofbirth" value="[% borrower.dateofbirth | $KohaDates %]" size="10" />
148
149
                                                    [% UNLESS action == 'edit' && !OPACPatronDetails %]
150
                                                        <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('borrower_dateofbirth').value='';return false;">Clear date</a><p></p>
151
                                                    [% END %]
152
153
                                                    [% IF mandatory.defined('dateofbirth') %]<span class="required">Required</span>[% END %]
154
                                                </li>
155
                                            [% END %]
156
157
                                            [% UNLESS hidden.defined('initials') %]
158
                                                <li>
159
                                                    [% IF mandatory.defined('initials') %]
160
                                                        <label for="borrower_initials" class="required">
161
                                                    [% ELSE %]
162
                                                        <label for="borrower_initials">
163
                                                    [% END %]
164
                                                    Initials:</label>
165
166
                                                    <input type="text" id="borrower_initials" name="borrower_initials" value="[% borrower.initials %]" />
167
                                                    [% IF mandatory.defined('initials') %]<span class="required">Required</span>[% END %]
168
                                                </li>
169
                                            [% END %]
170
171
                                            [% UNLESS hidden.defined('othernames') %]
172
                                                <li>
173
                                                    [% IF mandatory.defined('othernames') %]
174
                                                        <label for="borrower_othernames" class="required">
175
                                                    [% ELSE %]
176
                                                        <label for="borrower_othernames">
177
                                                    [% END %]
178
                                                    Other names:</label>
179
180
                                                    <input type="text" id="borrower_othernames" name="borrower_othernames" value="[% borrower.othernames %]" />
181
                                                    [% IF mandatory.defined('othernames') %]<span class="required">Required</span>[% END %]
182
                                                </li>
183
                                            [% END %]
184
185
                                            [% UNLESS hidden.defined('sex') %]
186
                                                <li class="radio">
187
                                                    <label for="sex-female">Female:</label>
188
                                                    [% IF borrower.sex == 'F' %]
189
                                                        <input type="radio" name="borrower_sex" id="sex-female" value="F" checked="checked" />
190
                                                    [% ELSE %]
191
                                                        <input type="radio" name="borrower_sex" id="sex-female" value="F" />
192
                                                    [% END %]
193
194
                                                    <label for="sex-male">Male:</label>
195
                                                    [% IF borrower.sex == 'M' %]
196
                                                        <input type="radio" name="borrower_sex" id="sex-male" value="M" checked="checked" />
197
                                                    [% ELSE %]
198
                                                        <input type="radio" name="borrower_sex" id="sex-male" value="M" />
199
                                                    [% END %]
200
201
                                                    <label for="sex-none">N/A:</label>
202
                                                    [% IF borrower.sex == '' %]
203
                                                        <input type="radio" name="borrower_sex" id="sex-none" value="" checked="checked" />
204
                                                    [% ELSE %]
205
                                                        <input type="radio" name="borrower_sex" id="sex-none" value="" />
206
                                                    [% END %]
207
208
                                                    [% IF mandatory.defined('sex') %]<span class="required">Required</span>[% END %]
209
                                                </li>
210
                                            [% END %]
211
                                        </ol>
212
                                    </fieldset>
213
                                [% END %]
214
215
                                [% UNLESS
216
                                    hidden.defined('streetnumber') && hidden.defined('address') && hidden.defined('address2') &&
217
                                    hidden.defined('city') && hidden.defined('state') && hidden.defined('zipcode') &&
218
                                    hidden.defined('country')
219
                                %]
220
                                    <fieldset class="rows" id="memberentry_mainaddress">
221
                                        <legend id="mainaddress_legend">Main address</legend>
222
223
                                        <ol>
224
                                            [% UNLESS hidden.defined('streetnumber') %]
225
                                                <li>
226
                                                    [% IF mandatory.defined('streetnumber') %]
227
                                                        <label for="borrower_streetnumber" class="required">
228
                                                    [% ELSE %]
229
                                                        <label for="borrower_streetnumber">
230
                                                    [% END %]
231
                                                    Street number:</label>
232
233
                                                    <input type="text" id="borrower_streetnumber" name="borrower_streetnumber" value="[% borrower.streetnumber %]" />
234
                                                    [% IF mandatory.defined('streetnumber') %]<span class="required">Required</span>[% END %]
235
                                                </li>
236
                                            [% END %]
237
238
                                            [% UNLESS hidden.defined('address') %]
239
                                                <li>
240
                                                    [% IF mandatory.defined('address') %]
241
                                                        <label for="borrower_address" class="required">
242
                                                    [% ELSE %]
243
                                                        <label for="borrower_address">
244
                                                    [% END %]
245
                                                    Address:</label>
246
247
                                                    <input type="text" id="borrower_address" name="borrower_address" value="[% borrower.address %]" />
248
                                                    [% IF mandatory.defined('address') %]<span class="required">Required</span>[% END %]
249
                                                </li>
250
                                            [% END %]
251
252
                                            [% UNLESS hidden.defined('address2') %]
253
                                                <li>
254
                                                    [% IF mandatory.defined('address2') %]
255
                                                        <label for="borrower_address2" class="required">
256
                                                    [% ELSE %]
257
                                                        <label for="borrower_address2">
258
                                                    [% END %]
259
                                                    Address 2:</label>
260
261
                                                    <input type="text" id="borrower_address2" name="borrower_address2" value="[% borrower.address2 %]" />
262
                                                    [% IF mandatory.defined('address2') %]<span class="required">Required</span>[% END %]
263
                                                </li>
264
                                            [% END %]
265
266
                                            [% UNLESS hidden.defined('city') %]
267
                                                <li>
268
                                                    [% IF mandatory.defined('city') %]
269
                                                        <label for="borrower_city" class="required">
270
                                                    [% ELSE %]
271
                                                        <label for="borrower_city">
272
                                                    [% END %]
273
                                                    City:</label>
274
275
                                                    <input type="text" id="borrower_city" name="borrower_city" value="[% borrower.city %]" />
276
                                                    [% IF mandatory.defined('city') %]<span class="required">Required</span>[% END %]
277
                                                </li>
278
                                            [% END %]
279
280
                                            [% UNLESS hidden.defined('state') %]
281
                                                <li>
282
                                                    [% IF mandatory.defined('state') %]
283
                                                        <label for="borrower_state" class="required">
284
                                                    [% ELSE %]
285
                                                        <label for="borrower_state">
286
                                                    [% END %]
287
                                                    State:</label>
288
289
                                                    <input type="text" id="borrower_state" name="borrower_state" value="[% borrower.state %]" />
290
                                                    [% IF mandatory.defined('state') %]<span class="required">Required</span>[% END %]
291
                                                </li>
292
                                            [% END %]
293
294
                                            [% UNLESS hidden.defined('zipcode') %]
295
                                                <li>
296
                                                    [% IF mandatory.defined('zipcode') %]
297
                                                        <label for="borrower_zipcode" class="required">
298
                                                    [% ELSE %]
299
                                                        <label for="borrower_zipcode">
300
                                                    [% END %]
301
                                                    Zip/Postal code:</label>
302
303
                                                    <input type="text" id="borrower_zipcode" name="borrower_zipcode" value="[% borrower.zipcode %]" />
304
                                                    [% IF mandatory.defined('zipcode') %]<span class="required">Required</span>[% END %]
305
                                                </li>
306
                                            [% END %]
307
308
                                            [% UNLESS hidden.defined('country') %]
309
                                                <li>
310
                                                    [% IF mandatory.defined('country') %]
311
                                                        <label for="borrower_country" class="required">
312
                                                    [% ELSE %]
313
                                                        <label for="borrower_country">
314
                                                    [% END %]
315
                                                    Country:</label>
316
317
                                                    <input type="text" id="borrower_country" name="borrower_country" value="[% borrower.country %]" />
318
                                                    [% IF mandatory.defined('country') %]<span class="required">Required</span>[% END %]
319
                                                </li>
320
                                            [% END %]
321
322
                                        </ol>
323
                                    </fieldset>
324
                                [% END %]
325
326
                                [% UNLESS
327
                                    hidden.defined('phone') && hidden.defined('phonepro') && hidden.defined('mobile') &&
328
                                    hidden.defined('email') && hidden.defined('emailpro') && hidden.defined('fax')
329
                                %]
330
                                    <fieldset class="rows" id="memberentry_contact">
331
                                        <legend id="contact_legend">Contact information</legend>
332
333
                                        <ol>
334
                                            [% UNLESS hidden.defined('phone') %]
335
                                                <li>
336
                                                    [% IF mandatory.defined('phone') %]
337
                                                        <label for="borrower_phone" class="required">
338
                                                    [% ELSE %]
339
                                                        <label for="borrower_phone">
340
                                                    [% END %]
341
                                                    Primary phone:</label>
342
343
                                                    <input type="text" id="borrower_phone" name="borrower_phone" value="[% borrower.phone %]" />
344
                                                    [% IF mandatory.defined('phone') %]<span class="required">Required</span>[% END %]
345
                                                </li>
346
                                            [% END %]
347
348
                                            [% UNLESS hidden.defined('phonepro') %]
349
                                                <li>
350
                                                    [% IF mandatory.defined('phonepro') %]
351
                                                        <label for="borrower_phonepro" class="required">
352
                                                    [% ELSE %]
353
                                                        <label for="borrower_phonepro">
354
                                                    [% END %]
355
                                                    Secondary phone:</label>
356
357
                                                    <input type="text" id="borrower_phonepro" name="borrower_phonepro" value="[% borrower.phonepro %]" />
358
                                                    [% IF mandatory.defined('phonepro') %]<span class="required">Required</span>[% END %]
359
                                                </li>
360
                                            [% END %]
361
362
                                            [% UNLESS hidden.defined('mobile') %]
363
                                                <li>
364
                                                    [% IF mandatory.defined('mobile') %]
365
                                                        <label for="borrower_mobile" class="required">
366
                                                    [% ELSE %]
367
                                                        <label for="borrower_mobile">
368
                                                    [% END %]
369
                                                    Mobile phone:</label>
370
371
                                                    <input type="text" id="borrower_mobile" name="borrower_mobile" value="[% borrower.mobile %]" />
372
                                                    [% IF mandatory.defined('mobile') %]<span class="required">Required</span>[% END %]
373
                                                </li>
374
                                            [% END %]
375
376
                                            [% UNLESS hidden.defined('email') %]
377
                                                <li>
378
                                                    [% IF mandatory.defined('email') %]
379
                                                        <label for="borrower_email" class="required">
380
                                                    [% ELSE %]
381
                                                        <label for="borrower_email">
382
                                                    [% END %]
383
                                                    Primary email:</label>
384
385
                                                    <input type="text" id="borrower_email" name="borrower_email" value="[% borrower.email %]" />
386
                                                    [% IF mandatory.defined('email') %]<span class="required">Required</span>[% END %]
387
                                                </li>
388
                                            [% END %]
389
390
                                            [% UNLESS hidden.defined('emailpro') %]
391
                                                <li>
392
                                                    [% IF mandatory.defined('emailpro') %]
393
                                                        <label for="borrower_emailpro" class="required">
394
                                                    [% ELSE %]
395
                                                        <label for="borrower_emailpro">
396
                                                    [% END %]
397
                                                    Secondary email:</label>
398
399
                                                    <input type="text" id="borrower_emailpro" name="borrower_emailpro" value="[% borrower.emailpro %]" />
400
                                                    [% IF mandatory.defined('emailpro') %]<span class="required">Required</span>[% END %]
401
                                                </li>
402
                                            [% END %]
403
404
                                            [% UNLESS hidden.defined('fax') %]
405
                                                <li>
406
                                                    [% IF mandatory.defined('fax') %]
407
                                                        <label for="borrower_fax" class="required">
408
                                                    [% ELSE %]
409
                                                        <label for="borrower_fax">
410
                                                    [% END %]
411
                                                    Fax:</label>
412
413
                                                    <input type="text" id="borrower_fax" name="borrower_fax" value="[% borrower.fax %]" />
414
                                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
415
                                                </li>
416
                                            [% END %]
417
                                        </ol>
418
                                    </fieldset>
419
                                [% END %]
420
421
                                [% UNLESS
422
                                    hidden.defined('B_address') && hidden.defined('B_address2') && hidden.defined('B_city') &&
423
                                    hidden.defined('B_state') && hidden.defined('B_zipcode') && hidden.defined('B_county') &&
424
                                    hidden.defined('B_phone') && hidden.defined('B_email') && hidden.defined('contactnote')
425
                                %]
426
                                    <fieldset class="rows" id="memberentry_alternateaddress">
427
                                        <legend id="alternateaddress_legend">Alternate address</legend>
428
429
                                        <ol>
430
                                            [% UNLESS hidden.defined('B_address') %]
431
                                                <li>
432
                                                    [% IF mandatory.defined('B_address') %]
433
                                                        <label for="borrower_B_address" class="required">
434
                                                    [% ELSE %]
435
                                                        <label for="borrower_B_address">
436
                                                    [% END %]
437
                                                    Address:</label>
438
439
                                                    <input type="text" id="borrower_B_address" name="borrower_B_address" value="[% borrower.B_address %]" />
440
                                                    [% IF mandatory.defined('B_address') %]<span class="required">Required</span>[% END %]
441
                                                </li>
442
                                            [% END %]
443
444
                                            [% UNLESS hidden.defined('B_address2') %]
445
                                                <li>
446
                                                    [% IF mandatory.defined('B_address2') %]
447
                                                        <label for="borrower_B_address2" class="required">
448
                                                    [% ELSE %]
449
                                                        <label for="borrower_B_address2">
450
                                                    [% END %]
451
                                                    Address 2:</label>
452
453
                                                    <input type="text" id="borrower_B_address2" name="borrower_B_address2" value="[% borrower.B_address2 %]" />
454
                                                    [% IF mandatory.defined('B_address2') %]<span class="required">Required</span>[% END %]
455
                                                </li>
456
                                            [% END %]
457
458
                                            [% UNLESS hidden.defined('B_city') %]
459
                                                <li>
460
                                                    [% IF mandatory.defined('B_city') %]
461
                                                        <label for="borrower_B_city" class="required">
462
                                                    [% ELSE %]
463
                                                        <label for="borrower_B_city">
464
                                                    [% END %]
465
                                                    City:</label>
466
467
                                                    <input type="text" id="borrower_B_city" name="borrower_B_city" value="[% borrower.B_city %]" />
468
                                                    [% IF mandatory.defined('B_city') %]<span class="required">Required</span>[% END %]
469
                                                </li>
470
                                            [% END %]
471
472
                                            [% UNLESS hidden.defined('B_state') %]
473
                                                <li>
474
                                                    [% IF mandatory.defined('B_state') %]
475
                                                        <label for="borrower_B_state" class="required">
476
                                                    [% ELSE %]
477
                                                        <label for="borrower_B_state">
478
                                                    [% END %]
479
                                                    State:</label>
480
481
                                                    <input type="text" id="borrower_B_state" name="borrower_B_state" value="[% borrower.B_state %]" />
482
                                                    [% IF mandatory.defined('B_state') %]<span class="required">Required</span>[% END %]
483
                                                </li>
484
                                            [% END %]
485
486
                                            [% UNLESS hidden.defined('B_zipcode') %]
487
                                                <li>
488
                                                    [% IF mandatory.defined('B_zipcode') %]
489
                                                        <label for="borrower_B_zipcode" class="required">
490
                                                    [% ELSE %]
491
                                                        <label for="borrower_B_zipcode">
492
                                                    [% END %]
493
                                                    Zip/Postal code:</label>
494
495
                                                    <input type="text" id="borrower_B_zipcode" name="borrower_B_zipcode" value="[% borrower.B_zipcode %]" />
496
                                                    [% IF mandatory.defined('B_zipcode') %]<span class="required">Required</span>[% END %]
497
                                                </li>
498
                                            [% END %]
499
500
                                            [% UNLESS hidden.defined('B_country') %]
501
                                                <li>
502
                                                    [% IF mandatory.defined('B_country') %]
503
                                                        <label for="borrower_B_country" class="required">
504
                                                    [% ELSE %]
505
                                                        <label for="borrower_B_country">
506
                                                    [% END %]
507
                                                    Country:</label>
508
509
                                                    <input type="text" id="borrower_B_country" name="borrower_B_country" value="[% borrower.B_country %]" />
510
                                                    [% IF mandatory.defined('B_country') %]<span class="required">Required</span>[% END %]
511
                                                </li>
512
                                            [% END %]
513
514
                                            [% UNLESS hidden.defined('B_phone') %]
515
                                                <li>
516
                                                    [% IF mandatory.defined('B_phone') %]
517
                                                        <label for="borrower_B_phone" class="required">
518
                                                    [% ELSE %]
519
                                                        <label for="borrower_B_phone">
520
                                                    [% END %]
521
                                                    Phone:</label>
522
523
                                                    <input type="text" id="borrower_B_phone" name="borrower_B_phone" value="[% borrower.B_phone %]" />
524
                                                    [% IF mandatory.defined('B_phone') %]<span class="required">Required</span>[% END %]
525
                                                </li>
526
                                            [% END %]
527
528
                                            [% UNLESS hidden.defined('B_email') %]
529
                                                <li>
530
                                                    [% IF mandatory.defined('B_email') %]
531
                                                        <label for="borrower_B_email" class="required">
532
                                                    [% ELSE %]
533
                                                        <label for="borrower_B_email">
534
                                                    [% END %]
535
                                                    Email:</label>
536
537
                                                    <input type="text" id="borrower_B_email" name="borrower_B_email" value="[% borrower.B_email %]" />
538
                                                    [% IF mandatory.defined('B_email') %]<span class="required">Required</span>[% END %]
539
                                                </li>
540
                                            [% END %]
541
542
                                            [% UNLESS hidden.defined('contactnote') %]
543
                                                <li>
544
                                                    [% IF mandatory.defined('contactnote') %]
545
                                                        <label for="borrower_contactnote" class="required">
546
                                                    [% ELSE %]
547
                                                        <label for="borrower_contactnote">
548
                                                    [% END %]
549
                                                    Contact Note:</label>
550
551
                                                    <textarea id="borrower_contactnote" name="borrower_contactnote" cols="40" rows="2">[% borrower.contactnote %]</textarea>
552
                                                    [% IF mandatory.defined('contactnote') %]<span class="required">Required</span>[% END %]
553
                                                </li>
554
                                            [% END %]
555
556
                                        </ol>
557
                                    </fieldset>
558
                                [% END %]
559
560
                                [% UNLESS
561
                                    hidden.defined('altcontactsurname') && hidden.defined('altcontactfirstname') && hidden.defined('altcontactaddress1') &&
562
                                    hidden.defined('altcontactaddress2') && hidden.defined('altcontactaddress3') && hidden.defined('altcontactstate') &&
563
                                    hidden.defined('altcontactzipcode') && hidden.defined('altcontactcountry') && hidden.defined('altcontactphone')
564
                                %]
565
                                    <fieldset class="rows" id="memberentry_alternatecontact">
566
                                        <legend id="alternatecontact_legend">Alternate contact</legend>
567
568
                                        <ol>
569
                                            [% UNLESS hidden.defined('altcontactsurname') %]
570
                                                <li>
571
                                                    [% IF mandatory.defined('altcontactsurname') %]
572
                                                        <label for="borrower_altcontactsurname" class="required">
573
                                                    [% ELSE %]
574
                                                        <label for="borrower_altcontactsurname">
575
                                                    [% END %]
576
                                                    Surname:</label>
577
578
                                                    <input type="text" id="borrower_altcontactsurname" name="borrower_altcontactsurname" value="[% borrower.altcontactsurname %]" />
579
                                                    [% IF mandatory.defined('altcontactsurname') %]<span class="required">Required</span>[% END %]
580
                                                </li>
581
                                            [% END %]
582
583
                                            [% UNLESS hidden.defined('altcontactfirstname') %]
584
                                                <li>
585
                                                    [% IF mandatory.defined('altcontactfirstname') %]
586
                                                        <label for="borrower_altcontactfirstname" class="required">
587
                                                    [% ELSE %]
588
                                                        <label for="borrower_altcontactfirstname">
589
                                                    [% END %]
590
                                                    First name:</label>
591
592
                                                    <input type="text" id="borrower_altcontactfirstname" name="borrower_altcontactfirstname" value="[% borrower.altcontactfirstname %]" />
593
                                                    [% IF mandatory.defined('altcontactfirstname') %]<span class="required">Required</span>[% END %]
594
                                                </li>
595
                                            [% END %]
596
597
                                            [% UNLESS hidden.defined('altcontactaddress1') %]
598
                                                <li>
599
                                                    [% IF mandatory.defined('altcontactaddress1') %]
600
                                                        <label for="borrower_altcontactaddress1" class="required">
601
                                                    [% ELSE %]
602
                                                        <label for="borrower_altcontactaddress1">
603
                                                    [% END %]
604
                                                    Address:</label>
605
606
                                                    <input type="text" id="borrower_altcontactaddress1" name="borrower_altcontactaddress1" value="[% borrower.altcontactaddress1 %]" />
607
                                                    [% IF mandatory.defined('altcontactaddress1') %]<span class="required">Required</span>[% END %]
608
                                                </li>
609
                                            [% END %]
610
611
                                            [% UNLESS hidden.defined('altcontactaddress2') %]
612
                                                <li>
613
                                                    [% IF mandatory.defined('altcontactaddress2') %]
614
                                                        <label for="borrower_altcontactaddress2" class="required">
615
                                                    [% ELSE %]
616
                                                        <label for="borrower_altcontactaddress2">
617
                                                    [% END %]
618
                                                    Address 2:</label>
619
620
                                                    <input type="text" id="borrower_altcontactaddress2" name="borrower_altcontactaddress2" value="[% borrower.altcontactaddress2 %]" />
621
                                                    [% IF mandatory.defined('altcontactaddress2') %]<span class="required">Required</span>[% END %]
622
                                                </li>
623
                                            [% END %]
624
625
                                            [% UNLESS hidden.defined('altcontactaddress3') %]
626
                                                <li>
627
                                                    [% IF mandatory.defined('altcontactaddress3') %]
628
                                                        <label for="borrower_altcontactaddress3" class="required">
629
                                                    [% ELSE %]
630
                                                        <label for="borrower_altcontactaddress3">
631
                                                    [% END %]
632
                                                    City:</label>
633
634
                                                    <input type="text" id="borrower_altcontactaddress3" name="borrower_altcontactaddress3" value="[% borrower.altcontactaddress3 %]" />
635
                                                    [% IF mandatory.defined('altcontactaddress3') %]<span class="required">Required</span>[% END %]
636
                                                </li>
637
                                            [% END %]
638
639
                                            [% UNLESS hidden.defined('altcontactstate') %]
640
                                                <li>
641
                                                    [% IF mandatory.defined('altcontactstate') %]
642
                                                        <label for="borrower_altcontactstate" class="required">
643
                                                    [% ELSE %]
644
                                                        <label for="borrower_altcontactstate">
645
                                                    [% END %]
646
                                                    State:</label>
647
648
                                                    <input type="text" id="borrower_altcontactstate" name="borrower_altcontactstate" value="[% borrower.altcontactstate %]" />
649
                                                    [% IF mandatory.defined('altcontactstate') %]<span class="required">Required</span>[% END %]
650
                                                </li>
651
                                            [% END %]
652
653
                                            [% UNLESS hidden.defined('altcontactzipcode') %]
654
                                                <li>
655
                                                    [% IF mandatory.defined('altcontactzipcode') %]
656
                                                        <label for="borrower_altcontactzipcode" class="required">
657
                                                    [% ELSE %]
658
                                                        <label for="borrower_altcontactzipcode">
659
                                                    [% END %]
660
                                                    Zip/Postal code:</label>
661
662
                                                    <input type="text" id="borrower_altcontactzipcode" name="borrower_altcontactzipcode" value="[% borrower.altcontactzipcode %]" />
663
                                                    [% IF mandatory.defined('altcontactzipcode') %]<span class="required">Required</span>[% END %]
664
                                                </li>
665
                                            [% END %]
666
667
                                            [% UNLESS hidden.defined('altcontactcountry') %]
668
                                                <li>
669
                                                    [% IF mandatory.defined('altcontactcountry') %]
670
                                                        <label for="borrower_altcontactcountry" class="required">
671
                                                    [% ELSE %]
672
                                                        <label for="borrower_altcontactcountry">
673
                                                    [% END %]
674
                                                    Country:</label>
675
676
                                                    <input type="text" id="borrower_altcontactcountry" name="borrower_altcontactcountry" value="[% borrower.altcontactcountry %]" />
677
                                                    [% IF mandatory.defined('altcontactcountry') %]<span class="required">Required</span>[% END %]
678
                                                </li>
679
                                            [% END %]
680
681
                                            [% UNLESS hidden.defined('altcontactphone') %]
682
                                                <li>
683
                                                    [% IF mandatory.defined('altcontactphone') %]
684
                                                        <label for="borrower_altcontactphone" class="required">
685
                                                    [% ELSE %]
686
                                                        <label for="borrower_altcontactphone">
687
                                                    [% END %]
688
                                                    Phone:</label>
689
690
                                                    <input type="text" id="borrower_altcontactphone" name="borrower_altcontactphone" value="[% borrower.altcontactphone %]" />
691
                                                    [% IF mandatory.defined('altcontactphone') %]<span class="required">Required</span>[% END %]
692
                                                </li>
693
                                            [% END %]
694
                                        </ol>
695
                                    </fieldset>
696
                                [% END %]
697
698
                                [% UNLESS action == 'edit' %]
699
                                    <fieldset class="rows" id="memberentry_captcha">
700
                                        <ol>
701
                                            <li>
702
                                                <label for="borrower_altcontactphone" class="required">Verification</label>
703
704
                                                <input type="text" name="captcha" id="captcha" />
705
                                                <input type="hidden" name="captcha_digest" value="[% captcha_digest %]" />
706
707
                                                <span class="required">Please type this following characters into the preceding box: <strong>[% captcha %]</strong></span>
708
                                            </li>
709
                                        </ol>
710
                                    </fieldset>
711
                                [% END %]
712
713
                                [% IF action == 'edit' %]
714
                                    [% IF OPACPatronDetails %]
715
                                        <input type="hidden" name="action" value="update" />
716
                                        <input type="submit" value="Submit Update Request" />
717
                                    [% END %]
718
                                [% ELSE %]
719
                                    <input type="hidden" name="action" value="create" />
720
                                    <input type="submit" value="Submit" />
721
                                [% END %]
722
723
                            </form>
724
725
                        </div><!--/div id="useraccount" -->
726
                    </div>
727
                </div>
728
            </div>
729
730
            <div class="yui-b">
731
                <div id="leftmenus" class="container">
732
                    [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
733
                </div>
734
            </div>
735
        </div>
736
[% INCLUDE 'opac-bottom.inc' %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-confirmation.tt (+70 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="opac-main">
6
[% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
7
   <div id="bd">
8
[% INCLUDE 'masthead.inc' %]
9
10
<div id="yui-main">
11
    <div class="yui-b">
12
        <div id="loggedin" class="yui-ge">
13
            <div class="yui-u first">
14
                <h1>Registration Complete!</h1>
15
16
                <p>You have successfully registered your new account. To log in, use the following credentials:</p>
17
18
                <p>
19
                    Username: [% borrower.userid %]
20
                    <br/>
21
                    Password: [% password_cleartext %]
22
                </p>
23
24
                <p>For your convenience, the login box on this page has been pre-filled with this data. Please log in[% IF OpacPasswordChange %] and change your password[% END %].</p>
25
26
                <div id="PatronSelfRegistrationAdditionalInstructions">[% PatronSelfRegistrationAdditionalInstructions %]</div>
27
            </div>
28
29
            [% IF ( opacuserlogin || OpacNavRight ) %]
30
                <div class="yui-u">
31
                    [% IF ( opacuserlogin ) %]
32
                        [% UNLESS ( loggedinusername ) %]
33
                            [% UNLESS ( casAuthentication ) %]
34
                                <div id="login" class="container clearfix">
35
                                    <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="auth">
36
                                        <input type="hidden" name="koha_login_context" value="opac" />
37
38
                                        <fieldset class="brief">
39
                                            <legend>Log in to your account:</legend>
40
41
                                            <ol>
42
                                                <li><label for="userid">Login:</label><input type="text" id="userid" size="10" name="userid" value="[% borrower.userid %]" /></li>
43
                                                <li><label for="password">Password:</label><input type="password" id="password" size="10" name="password" value="[% password_cleartext %]" /></li>
44
                                            </ol>
45
46
                                            <fieldset class="action">
47
                                                <input type="submit" value="Log In" class="submit" />
48
                                            </fieldset>
49
                                        </fieldset>
50
                                    </form>
51
                                </div>
52
                            [% END %]
53
                        [% END %]
54
                    [% END %]
55
56
                    [% IF ( OpacNavRight ) %]<div id="opacrightsidebar" class="container">[% OpacNavRight %]</div>[% END %]
57
                </div>
58
            [% END %]
59
        </div>
60
    </div>
61
</div>
62
63
[% IF ( OpacNav ) %]<div class="yui-b">
64
    <div id="opacnav" class="container">
65
        [% INCLUDE 'navigation.inc' %]
66
    </div>
67
[% END %]
68
69
</div>
70
[% INCLUDE 'opac-bottom.inc' %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-email-sent.tt (+31 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="opac-main">
6
[% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
7
   <div id="bd">
8
[% INCLUDE 'masthead.inc' %]
9
10
<div id="yui-main">
11
    <div class="yui-b">
12
        <div id="loggedin" class="yui-ge">
13
            <div class="yui-u first">
14
                <h1>Please Confirm Registration</h1>
15
16
                <p>A confirmation email has been sent to the email address <strong>[% email %]</strong>.</p>
17
18
                <p>Your account will not be activated until you follow the link provided in the confirmation email.</p>
19
            </div>
20
        </div>
21
    </div>
22
</div>
23
24
[% IF ( OpacNav ) %]<div class="yui-b">
25
    <div id="opacnav" class="container">
26
        [% INCLUDE 'navigation.inc' %]
27
    </div>
28
[% END %]
29
30
</div>
31
[% INCLUDE 'opac-bottom.inc' %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-invalid.tt (+30 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="opac-main">
6
[% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
7
   <div id="bd">
8
[% INCLUDE 'masthead.inc' %]
9
10
<div id="yui-main">
11
    <div class="yui-b">
12
        <div id="loggedin" class="yui-ge">
13
            <div class="yui-u first">
14
                <h1>Registration invalid!</h1>
15
16
                <p>There were problems processing your registration. Please contact your library for help.</p>
17
18
            </div>
19
        </div>
20
    </div>
21
</div>
22
23
[% IF ( OpacNav ) %]<div class="yui-b">
24
    <div id="opacnav" class="container">
25
        [% INCLUDE 'navigation.inc' %]
26
    </div>
27
[% END %]
28
29
</div>
30
[% INCLUDE 'opac-bottom.inc' %]
(-)a/mainpage.pl (-11 / +20 lines)
Lines 28-44 use C4::NewsChannels; Link Here
28
use C4::Review qw/numberofreviews/;
28
use C4::Review qw/numberofreviews/;
29
use C4::Suggestions qw/CountSuggestion/;
29
use C4::Suggestions qw/CountSuggestion/;
30
use C4::Tags qw/get_count_by_tag_status/;
30
use C4::Tags qw/get_count_by_tag_status/;
31
my $query     = new CGI;
31
use Koha::Borrower::Modifications;
32
32
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
my $query = new CGI;
34
35
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
34
    {
36
    {
35
        template_name   => "intranet-main.tmpl",
37
        template_name   => "intranet-main.tmpl",
36
        query           => $query,
38
        query           => $query,
37
        type            => "intranet",
39
        type            => "intranet",
38
        authnotrequired => 0,
40
        authnotrequired => 0,
39
        flagsrequired   => {
41
        flagsrequired   => { catalogue => 1, },
40
            catalogue => 1,
41
        },
42
    }
42
    }
43
);
43
);
44
44
Lines 50-63 $template->param( Link Here
50
    koha_news_count => $koha_news_count
50
    koha_news_count => $koha_news_count
51
);
51
);
52
52
53
my $pendingcomments = numberofreviews(0);
53
my $branch =
54
my $pendingtags = get_count_by_tag_status(0);
54
  C4::Context->preference("IndependantBranches")
55
my $pendingsuggestions       = CountSuggestion("ASKED");
55
  && !$flags->{'superlibrarian'}
56
  ? C4::Context->userenv()->{'branch'}
57
  : undef;
58
59
my $pendingcomments    = numberofreviews(0);
60
my $pendingtags        = get_count_by_tag_status(0);
61
my $pendingsuggestions = CountSuggestion("ASKED");
62
my $pending_borrower_modifications =
63
  Koha::Borrower::Modifications->GetPendingModificationsCount( $branch );
56
64
57
$template->param(
65
$template->param(
58
    pendingcomments    => $pendingcomments,
66
    pendingcomments                => $pendingcomments,
59
    pendingtags        => $pendingtags,
67
    pendingtags                    => $pendingtags,
60
    pendingsuggestions => $pendingsuggestions
68
    pendingsuggestions             => $pendingsuggestions,
69
    pending_borrower_modifications => $pending_borrower_modifications,
61
);
70
);
62
71
63
#
72
#
(-)a/members/members-update-do.pl (+64 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Parts Copyright Biblibre 2010
4
# This file is part of Koha.
5
#
6
# Koha is free software; you can redistribute it and/or modify it under the
7
# terms of the GNU General Public License as published by the Free Software
8
# Foundation; either version 2 of the License, or (at your option) any later
9
# version.
10
#
11
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
12
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License along
16
# with Koha; if not, write to the Free Software Foundation, Inc.,
17
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19
use strict;
20
use warnings;
21
22
use CGI;
23
use C4::Auth;
24
use C4::Output;
25
use C4::Context;
26
use C4::Members;
27
use C4::Branch;
28
use C4::Category;
29
use Koha::Borrower::Modifications;
30
31
my $query = new CGI;
32
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
34
    {
35
        template_name   => "about.tmpl",
36
        query           => $query,
37
        type            => "intranet",
38
        authnotrequired => 0,
39
        flagsrequired   => { borrowers => 1 },
40
        debug           => 1,
41
    }
42
);
43
44
my @params = $query->param;
45
46
foreach my $param (@params) {
47
    if ( $param =~ "^modify_" ) {
48
        my (undef, $borrowernumber) = split( /_/, $param );
49
50
        my $action = $query->param($param);
51
52
        if ( $action eq 'approve' ) {
53
            Koha::Borrower::Modifications->ApproveModifications( $borrowernumber );
54
        }
55
        elsif ( $action eq 'deny' ) {
56
            Koha::Borrower::Modifications->DenyModifications( $borrowernumber );
57
        }
58
        elsif ( $action eq 'ignore' ) {
59
60
        }
61
    }
62
}
63
64
print $query->redirect("/cgi-bin/koha/members/members-update.pl");
(-)a/members/members-update.pl (+65 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Parts Copyright Biblibre 2010
4
# This file is part of Koha.
5
#
6
# Koha is free software; you can redistribute it and/or modify it under the
7
# terms of the GNU General Public License as published by the Free Software
8
# Foundation; either version 2 of the License, or (at your option) any later
9
# version.
10
#
11
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
12
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License along
16
# with Koha; if not, write to the Free Software Foundation, Inc.,
17
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19
use strict;
20
use warnings;
21
22
use CGI;
23
use C4::Auth;
24
use C4::Output;
25
use C4::Context;
26
use C4::Members;
27
use C4::Branch;
28
use C4::Category;
29
use Koha::Borrower::Modifications;
30
31
my $query = new CGI;
32
33
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
34
    {
35
        template_name   => "members/members-update.tmpl",
36
        query           => $query,
37
        type            => "intranet",
38
        authnotrequired => 0,
39
        flagsrequired   => { borrowers => 1 },
40
        debug           => 1,
41
    }
42
);
43
44
my $branch =
45
  C4::Context->preference("IndependantBranches")
46
  && !$flags->{'superlibrarian'}
47
  ? C4::Context->userenv()->{'branch'}
48
  : undef;
49
50
my $pending_modifications =
51
  Koha::Borrower::Modifications->GetPendingModifications($branch);
52
53
my $borrowers;
54
foreach my $pm (@$pending_modifications) {
55
    $borrowers->{ $pm->{'borrowernumber'} } =
56
      GetMember( borrowernumber => $pm->{'borrowernumber'} );
57
58
}
59
60
$template->param(
61
    PendingModifications => $pending_modifications,
62
    borrowers            => $borrowers,
63
);
64
65
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/misc/cronjobs/delete_expired_opac_registrations.pl (+80 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2009-2010 Kyle Hall
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 Modern::Perl;
21
use Getopt::Long;
22
23
BEGIN {
24
25
    # find Koha's Perl modules
26
    # test carefully before changing this
27
    use FindBin;
28
    eval { require "$FindBin::Bin/../kohalib.pl" };
29
}
30
31
use C4::Context;
32
use C4::Members qw/ DelMember /;
33
34
my $help;
35
my $confirm;
36
37
GetOptions(
38
    'h|help'    => \$help,
39
    'c|confirm' => \$confirm,
40
);
41
my $usage = << 'ENDUSAGE';
42
43
This script remove confirmed OPAC based patron registrations
44
that have not been changed from the patron category specified
45
in the system preference PatronSelfRegistrationDefaultCategory
46
within the required time period.
47
48
This script has the following parameters :
49
    -h --help:    This message
50
51
    -c --confirm: Without this flag set, this script will do nothing.
52
ENDUSAGE
53
54
if ( $help || !$confirm ) {
55
    print $usage;
56
    exit;
57
}
58
59
## Delete accounts that haven't been upgraded from the 'temporary' category code'
60
my $delay =
61
  C4::Context->preference('PatronSelfRegistrationExpireTemporaryAccountsDelay');
62
my $category_code =
63
  C4::Context->preference('PatronSelfRegistrationDefaultCategory');
64
65
my $query = "
66
    SELECT borrowernumber
67
    FROM borrowers
68
    WHERE
69
        categorycode = ?
70
      AND
71
        DATEDIFF( DATE( NOW() ), DATE(dateenrolled) ) = ? )
72
";
73
74
my $dbh = C4::Context->dbh;
75
my $sth = $dbh->prepare($query);
76
$sth->execute( $category_code, $delay );
77
78
while ( my ($borrowernumber) = $sth->fetchrow_array() ) {
79
    DelMember($borrowernumber);
80
}
(-)a/misc/cronjobs/delete_unverified_opac_registrations.pl (+70 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2009-2010 Kyle Hall
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 Modern::Perl;
21
use Getopt::Long;
22
23
BEGIN {
24
25
    # find Koha's Perl modules
26
    # test carefully before changing this
27
    use FindBin;
28
    eval { require "$FindBin::Bin/../kohalib.pl" };
29
}
30
31
use C4::Context;
32
use C4::Members qw/ DelMember /;
33
34
my $help;
35
my $confirm;
36
my $hours = 24;
37
38
GetOptions(
39
    'h|help'    => \$help,
40
    'c|confirm' => \$confirm,
41
    't|time=i'  => \$hours,
42
);
43
my $usage = << 'ENDUSAGE';
44
45
This script removes unconfirmed OPAC based patron registrations
46
that have not been confirmed within the required time period.
47
48
This script has the following parameters :
49
    -h --help:    This message
50
51
    -t --time:    The length in hours to wait before removing an unconfirmed registration.
52
                  Defaults to 24 hours if not set.
53
54
    -c --confirm: Without this flag set, this script will do nothing.
55
ENDUSAGE
56
57
if ( $help || !$confirm ) {
58
    print $usage;
59
    exit;
60
}
61
62
my $dbh = C4::Context->dbh;
63
64
$dbh->do( "
65
         DELETE FROM borrower_modifications
66
         WHERE
67
             borrowernumber = 0
68
           AND
69
             TIME_TO_SEC( TIMEDIFF( NOW(), timestamp )) / 3600 > ?
70
", undef, $hours );
(-)a/opac/opac-memberentry.pl (+303 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 2 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use CGI;
21
use Digest::MD5 qw( md5_base64 md5_hex );
22
use String::Random qw( random_string );
23
24
use C4::Auth;
25
use C4::Output;
26
use C4::Members;
27
use Koha::Borrower::Modifications;
28
use C4::Branch qw(GetBranchesLoop);
29
30
my $cgi = new CGI;
31
my $dbh = C4::Context->dbh;
32
33
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
34
    {
35
        template_name   => "opac-memberentry.tmpl",
36
        type            => "opac",
37
        query           => $cgi,
38
        authnotrequired => 1,
39
    }
40
);
41
42
unless ( C4::Context->preference('PatronSelfRegistration') || $borrowernumber )
43
{
44
    print $cgi->redirect("/cgi-bin/koha/opac-main.pl");
45
    exit;
46
}
47
48
my $action = $cgi->param('action') || q{};
49
if ( $action eq q{} ) {
50
    if ($borrowernumber) {
51
        $action = 'edit';
52
    }
53
    else {
54
        $action = 'new';
55
    }
56
}
57
58
$template->param(
59
    action            => $action,
60
    hidden            => GetHiddenFields(),
61
    mandatory         => GetMandatoryFields($action),
62
    member_titles     => GetTitles(),
63
    branches          => GetBranchesLoop(),
64
    OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),
65
);
66
67
if ( $action eq 'create' ) {
68
69
    my %borrower = ParseCgiForBorrower($cgi);
70
71
    %borrower = DelEmptyFields(%borrower);
72
73
    my @empty_mandatory_fields = CheckMandatoryFields( \%borrower, $action );
74
75
    if (@empty_mandatory_fields) {
76
        $template->param(
77
            empty_mandatory_fields => \@empty_mandatory_fields,
78
            borrower               => \%borrower
79
        );
80
    }
81
    elsif (
82
        md5_base64( $cgi->param('captcha') ) ne $cgi->param('captcha_digest') )
83
    {
84
        $template->param(
85
            failed_captcha => 1,
86
            borrower       => \%borrower
87
        );
88
    }
89
    else {
90
        if (
91
            C4::Context->boolean_preference(
92
                'PatronSelfRegistrationVerifyByEmail')
93
          )
94
        {
95
            ( $template, $borrowernumber, $cookie ) = get_template_and_user(
96
                {
97
                    template_name   => "opac-registration-email-sent.tmpl",
98
                    type            => "opac",
99
                    query           => $cgi,
100
                    authnotrequired => 1,
101
                }
102
            );
103
            $template->param( 'email' => $borrower{'email'} );
104
105
            my $verification_token = md5_hex( \%borrower );
106
            $borrower{'password'} = random_string("..........");
107
108
            Koha::Borrower::Modifications->new(
109
                verification_token => $verification_token )
110
              ->AddModifications(%borrower);
111
112
            #Send verification email
113
            my $letter = C4::Letters::GetPreparedLetter(
114
                module      => 'members',
115
                letter_code => 'OPAC_REG_VERIFY',
116
                tables      => {
117
                    borrower_modifications =>
118
                      [ $verification_token, $verification_token ],
119
                },
120
            );
121
122
            C4::Letters::EnqueueLetter(
123
                {
124
                    letter                 => $letter,
125
                    message_transport_type => 'email',
126
                    to_address             => $borrower{'email'},
127
                    from_address =>
128
                      C4::Context->preference('KohaAdminEmailAddress'),
129
                }
130
            );
131
        }
132
        else {
133
            ( $template, $borrowernumber, $cookie ) = get_template_and_user(
134
                {
135
                    template_name   => "opac-registration-confirmation.tmpl",
136
                    type            => "opac",
137
                    query           => $cgi,
138
                    authnotrequired => 1,
139
                }
140
            );
141
142
            $template->param( OpacPasswordChange =>
143
                  C4::Context->preference('OpacPasswordChange') );
144
145
            my ( $borrowernumber, $password ) = AddMember_Opac(%borrower);
146
147
            $template->param( password_cleartext => $password );
148
            $template->param(
149
                borrower => GetMember( borrowernumber => $borrowernumber ) );
150
            $template->param(
151
                PatronSelfRegistrationAdditionalInstructions =>
152
                  C4::Context->preference(
153
                    'PatronSelfRegistrationAdditionalInstructions')
154
            );
155
        }
156
    }
157
}
158
elsif ( $action eq 'update' ) {
159
160
    my %borrower = ParseCgiForBorrower($cgi);
161
162
    my %borrower_changes = DelEmptyFields(%borrower);
163
    my @empty_mandatory_fields =
164
      CheckMandatoryFields( \%borrower_changes, $action );
165
166
    if (@empty_mandatory_fields) {
167
        $template->param(
168
            empty_mandatory_fields => \@empty_mandatory_fields,
169
            borrower               => \%borrower
170
        );
171
172
        $template->param( action => 'edit' );
173
    }
174
    else {
175
        ( $template, $borrowernumber, $cookie ) = get_template_and_user(
176
            {
177
                template_name   => "opac-memberentry-update-submitted.tmpl",
178
                type            => "opac",
179
                query           => $cgi,
180
                authnotrequired => 1,
181
            }
182
        );
183
184
        my %borrower_changes = DelUnchangedFields( $borrowernumber, %borrower );
185
186
        my $m =
187
          Koha::Borrower::Modifications->new(
188
            borrowernumber => $borrowernumber );
189
190
        $m->DelModifications;
191
        $m->AddModifications(%borrower_changes);
192
    }
193
}
194
elsif ( $action eq 'edit' ) {    #Display logged in borrower's data
195
    $template->param(
196
        borrower => GetMember( borrowernumber => $borrowernumber ), );
197
}
198
199
my $captcha = random_string("CCCCC");
200
201
$template->param(
202
    captcha        => $captcha,
203
    captcha_digest => md5_base64($captcha)
204
);
205
206
output_html_with_http_headers $cgi, $cookie, $template->output;
207
208
sub GetHiddenFields {
209
    my %hidden_fields;
210
211
    my $BorrowerUnwantedField =
212
      C4::Context->preference("PatronSelfRegistrationBorrowerUnwantedField");
213
214
    my @fields = split( /\|/, $BorrowerUnwantedField );
215
    foreach (@fields) {
216
        next unless m/\w/o;
217
        $hidden_fields{$_} = 1;
218
    }
219
220
    return \%hidden_fields;
221
}
222
223
sub GetMandatoryFields {
224
    my ($action) = @_;
225
226
    my %mandatory_fields;
227
228
    my $BorrowerMandatoryField =
229
      C4::Context->preference("PatronSelfRegistrationBorrowerMandatoryField");
230
231
    my @fields = split( /\|/, $BorrowerMandatoryField );
232
233
    foreach (@fields) {
234
        $mandatory_fields{$_} = 1;
235
    }
236
237
    if ( $action eq 'create' || $action eq 'new' ) {
238
        $mandatory_fields{'email'} = 1
239
          if C4::Context->boolean_preference(
240
            'PatronSelfRegistrationVerifyByEmail');
241
    }
242
243
    return \%mandatory_fields;
244
}
245
246
sub CheckMandatoryFields {
247
    my ( $borrower, $action ) = @_;
248
249
    my @empty_mandatory_fields;
250
251
    my $mandatory_fields = GetMandatoryFields($action);
252
    delete $mandatory_fields->{'cardnumber'};
253
254
    foreach my $key ( keys %$mandatory_fields ) {
255
        push( @empty_mandatory_fields, $key )
256
          unless ( defined( $borrower->{$key} ) && $borrower->{$key} );
257
    }
258
259
    return @empty_mandatory_fields;
260
}
261
262
sub ParseCgiForBorrower {
263
    my ($cgi) = @_;
264
265
    my %borrower;
266
267
    foreach ( $cgi->param ) {
268
        if ( $_ =~ '^borrower_' ) {
269
            my ($key) = substr( $_, 9 );
270
            $borrower{$key} = $cgi->param($_);
271
        }
272
    }
273
274
    $borrower{'dateofbirth'} =
275
      C4::Dates->new( $borrower{'dateofbirth'} )->output("iso")
276
      if ( defined( $borrower{'dateofbirth'} ) );
277
278
    return %borrower;
279
}
280
281
sub DelUnchangedFields {
282
    my ( $borrowernumber, %new_data ) = @_;
283
284
    my $current_data = GetMember( borrowernumber => $borrowernumber );
285
286
    foreach my $key ( keys %new_data ) {
287
        if ( $current_data->{$key} eq $new_data{$key} ) {
288
            delete $new_data{$key};
289
        }
290
    }
291
292
    return %new_data;
293
}
294
295
sub DelEmptyFields {
296
    my (%borrower) = @_;
297
298
    foreach my $key ( keys %borrower ) {
299
        delete $borrower{$key} unless $borrower{$key};
300
    }
301
302
    return %borrower;
303
}
(-)a/opac/opac-registration-verify.pl (+82 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 2 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along
15
# with Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18
use Modern::Perl;
19
20
use CGI;
21
22
use C4::Auth;
23
use C4::Output;
24
use C4::Members;
25
use Koha::Borrower::Modifications;
26
27
my $cgi = new CGI;
28
my $dbh = C4::Context->dbh;
29
30
unless ( C4::Context->preference('PatronSelfRegistration') ) {
31
    print $cgi->redirect("/cgi-bin/koha/opac-main.pl");
32
    exit;
33
}
34
35
my $token = $cgi->param('token');
36
my $m = Koha::Borrower::Modifications->new( verification_token => $token );
37
38
my ( $template, $borrowernumber, $cookie );
39
if ( $m->Verify() ) {
40
    ( $template, $borrowernumber, $cookie ) = get_template_and_user(
41
        {
42
            template_name   => "opac-registration-confirmation.tmpl",
43
            type            => "opac",
44
            query           => $cgi,
45
            authnotrequired => 1,
46
        }
47
    );
48
49
    $template->param(
50
        OpacPasswordChange => C4::Context->preference('OpacPasswordChange') );
51
52
    my $borrower = $m->GetModifications();
53
54
    my $password;
55
    ( $borrowernumber, $password ) = AddMember_Opac(%$borrower);
56
57
    if ($borrowernumber) {
58
        $m->DelModifications();
59
60
        $template->param( password_cleartext => $password );
61
        $template->param(
62
            borrower => GetMember( borrowernumber => $borrowernumber ) );
63
        $template->param(
64
            PatronSelfRegistrationAdditionalInstructions =>
65
              C4::Context->preference(
66
                'PatronSelfRegistrationAdditionalInstructions')
67
        );
68
    }
69
70
}
71
else {
72
    ( $template, $borrowernumber, $cookie ) = get_template_and_user(
73
        {
74
            template_name   => "opac-registration-invalid.tmpl",
75
            type            => "opac",
76
            query           => $cgi,
77
            authnotrequired => 1,
78
        }
79
    );
80
}
81
82
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/opac/opac-user.pl (-2 / +1 lines)
Lines 368-374 $template->param( Link Here
368
$template->param( DHTMLcalendar_dateformat  => C4::Dates->DHTMLcalendar() );
368
$template->param( DHTMLcalendar_dateformat  => C4::Dates->DHTMLcalendar() );
369
$template->param(
369
$template->param(
370
    SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'),
370
    SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'),
371
    AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds') ,
371
    AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
372
);
372
);
373
373
374
output_html_with_http_headers $query, $cookie, $template->output;
374
output_html_with_http_headers $query, $cookie, $template->output;
375
- 

Return to bug 7067