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

(-)a/C4/Auth.pm (-4 / +5 lines)
Lines 457-462 sub get_template_and_user { Link Here
457
            SyndeticsSeries              => C4::Context->preference("SyndeticsSeries"),
457
            SyndeticsSeries              => C4::Context->preference("SyndeticsSeries"),
458
            SyndeticsCoverImageSize      => C4::Context->preference("SyndeticsCoverImageSize"),
458
            SyndeticsCoverImageSize      => C4::Context->preference("SyndeticsCoverImageSize"),
459
            OPACLocalCoverImages         => C4::Context->preference("OPACLocalCoverImages"),
459
            OPACLocalCoverImages         => C4::Context->preference("OPACLocalCoverImages"),
460
            PatronSelfRegistration       => C4::Context->preference("PatronSelfRegistration"),
460
        );
461
        );
461
462
462
        $template->param(OpacPublic => '1') if ($user || C4::Context->preference("OpacPublic"));
463
        $template->param(OpacPublic => '1') if ($user || C4::Context->preference("OpacPublic"));
Lines 957-973 sub checkauth { Link Here
957
        OpacAuthorities      => C4::Context->preference("OpacAuthorities"),
958
        OpacAuthorities      => C4::Context->preference("OpacAuthorities"),
958
        OpacBrowser          => C4::Context->preference("OpacBrowser"),
959
        OpacBrowser          => C4::Context->preference("OpacBrowser"),
959
        opacheader           => C4::Context->preference("opacheader"),
960
        opacheader           => C4::Context->preference("opacheader"),
960
        TagsEnabled                  => C4::Context->preference("TagsEnabled"),
961
        TagsEnabled          => C4::Context->preference("TagsEnabled"),
961
        OPACUserCSS           => C4::Context->preference("OPACUserCSS"),
962
        OPACUserCSS           => C4::Context->preference("OPACUserCSS"),
962
        intranetcolorstylesheet =>
963
        intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
963
								C4::Context->preference("intranetcolorstylesheet"),
964
        intranetstylesheet => C4::Context->preference("intranetstylesheet"),
964
        intranetstylesheet => C4::Context->preference("intranetstylesheet"),
965
        intranetbookbag    => C4::Context->preference("intranetbookbag"),
965
        intranetbookbag    => C4::Context->preference("intranetbookbag"),
966
        IntranetNav        => C4::Context->preference("IntranetNav"),
966
        IntranetNav        => C4::Context->preference("IntranetNav"),
967
        intranetuserjs     => C4::Context->preference("intranetuserjs"),
967
        intranetuserjs     => C4::Context->preference("intranetuserjs"),
968
        IndependantBranches=> C4::Context->preference("IndependantBranches"),
968
        IndependantBranches=> C4::Context->preference("IndependantBranches"),
969
        AutoLocation       => C4::Context->preference("AutoLocation"),
969
        AutoLocation       => C4::Context->preference("AutoLocation"),
970
		wrongip            => $info{'wrongip'},
970
        wrongip            => $info{'wrongip'},
971
	PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"),	
971
    );
972
    );
972
973
973
    $template->param( OpacPublic => C4::Context->preference("OpacPublic"));
974
    $template->param( OpacPublic => C4::Context->preference("OpacPublic"));
(-)a/C4/Installer/PerlDependencies.pm (-1 / +5 lines)
Lines 583-589 our $PERL_DEPS = { Link Here
583
        'usage'    => 'Core',
583
        'usage'    => 'Core',
584
        'required' => '0',
584
        'required' => '0',
585
        'min_ver'  => '0.14',
585
        'min_ver'  => '0.14',
586
587
    },
586
    },
588
    'Test::YAML::Valid' => {
587
    'Test::YAML::Valid' => {
589
        'usage'    => 'Core',
588
        'usage'    => 'Core',
Lines 600-605 our $PERL_DEPS = { Link Here
600
        'required' => '1',
599
        'required' => '1',
601
        'min_ver'  => '1.23',
600
        'min_ver'  => '1.23',
602
    },
601
    },
602
    'String::Random' => {
603
        'usage'    => 'OpacSelfRegistration',
604
        'required' => '0',
605
        'min_ver'  => '1.4',
606
    },
603
};
607
};
604
608
605
1;
609
1;
(-)a/C4/Letters.pm (-13 / +17 lines)
Lines 456-461 sub GetPreparedLetter { Link Here
456
       }
456
       }
457
    }
457
    }
458
458
459
    my $OPACBaseURL = C4::Context->preference('OPACBaseURL');
460
    $letter->{content} =~ s/<<OPACBaseURL>>/$OPACBaseURL/go;
461
459
    if ($want_librarian) {
462
    if ($want_librarian) {
460
        # parsing librarian name
463
        # parsing librarian name
461
        my $userenv = C4::Context->userenv;
464
        my $userenv = C4::Context->userenv;
Lines 554-571 sub _parseletter_sth { Link Here
554
    # check cache first
557
    # check cache first
555
    (defined $handles{$table}) and return $handles{$table};
558
    (defined $handles{$table}) and return $handles{$table};
556
    my $query = 
559
    my $query = 
557
    ($table eq 'biblio'       ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                 :
560
    ($table eq 'biblio'       ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
558
    ($table eq 'biblioitems'  ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                 :
561
    ($table eq 'biblioitems'  ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
559
    ($table eq 'items'        ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                 :
562
    ($table eq 'items'        ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
560
    ($table eq 'issues'       ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                 :
563
    ($table eq 'issues'       ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
561
    ($table eq 'old_issues'   ) ? "SELECT * FROM $table WHERE     itemnumber = ? ORDER BY timestamp DESC LIMIT 1" :
564
    ($table eq 'old_issues'   ) ? "SELECT * FROM $table WHERE     itemnumber = ? ORDER BY timestamp DESC LIMIT 1"  :
562
    ($table eq 'reserves'     ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?"            :
565
    ($table eq 'reserves'     ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?"             :
563
    ($table eq 'borrowers'    ) ? "SELECT * FROM $table WHERE borrowernumber = ?"                                 :
566
    ($table eq 'borrowers'    ) ? "SELECT * FROM $table WHERE borrowernumber = ?"                                  :
564
    ($table eq 'branches'     ) ? "SELECT * FROM $table WHERE     branchcode = ?"                                 :
567
    ($table eq 'branches'     ) ? "SELECT * FROM $table WHERE     branchcode = ?"                                  :
565
    ($table eq 'suggestions'  ) ? "SELECT * FROM $table WHERE   suggestionid = ?"                                 :
568
    ($table eq 'suggestions'  ) ? "SELECT * FROM $table WHERE   suggestionid = ?"                                  :
566
    ($table eq 'aqbooksellers') ? "SELECT * FROM $table WHERE             id = ?"                                 :
569
    ($table eq 'aqbooksellers') ? "SELECT * FROM $table WHERE             id = ?"                                  :
567
    ($table eq 'aqorders'     ) ? "SELECT * FROM $table WHERE    ordernumber = ?"                                 :
570
    ($table eq 'aqorders'     ) ? "SELECT * FROM $table WHERE    ordernumber = ?"                                  :
568
    ($table eq 'opac_news'    ) ? "SELECT * FROM $table WHERE          idnew = ?"                                 :
571
    ($table eq 'opac_news'    ) ? "SELECT * FROM $table WHERE          idnew = ?"                                  :
572
    ($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE borrowernumber = ? OR verification_token =?":
569
    undef ;
573
    undef ;
570
    unless ($query) {
574
    unless ($query) {
571
        warn "ERROR: No _parseletter_sth query for table '$table'";
575
        warn "ERROR: No _parseletter_sth query for table '$table'";
Lines 672-678 sub EnqueueLetter { Link Here
672
    my $params = shift or return;
676
    my $params = shift or return;
673
677
674
    return unless exists $params->{'letter'};
678
    return unless exists $params->{'letter'};
675
    return unless exists $params->{'borrowernumber'};
679
#   return unless exists $params->{'borrowernumber'};
676
    return unless exists $params->{'message_transport_type'};
680
    return unless exists $params->{'message_transport_type'};
677
681
678
    my $content = $params->{letter}->{content};
682
    my $content = $params->{letter}->{content};
(-)a/C4/Members.pm (-5 / +36 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
    # create a disabled account if no password provided
761
    $data{'password'} = ($data{'password'})? md5_base64($data{'password'}) : '!';
762
    $data{'borrowernumber'}=InsertInTable("borrowers",\%data);	
763
764
    # add expiration date if it isn't already there
765
    unless ( $data{'dateexpiry'} ) {
766
        $data{'dateexpiry'} = GetExpiryDate( $data{'categorycode'}, C4::Dates->new()->output("iso") );
767
    }
768
     
769
    # add enrollment date if it isn't already there
770
    unless ( $data{'dateenrolled'} ) {
771
        $data{'dateenrolled'} = C4::Dates->new()->output("iso");
772
    }                                                                                           
773
759
    # mysql_insertid is probably bad.  not necessarily accurate and mysql-specific at best.
774
    # mysql_insertid is probably bad.  not necessarily accurate and mysql-specific at best.
760
    logaction("MEMBERS", "CREATE", $data{'borrowernumber'}, "") if C4::Context->preference("BorrowersLog");
775
    logaction("MEMBERS", "CREATE", $data{'borrowernumber'}, "") if C4::Context->preference("BorrowersLog");
761
    
776
    
Lines 2365-2370 sub GetBorrowersWithEmail { Link Here
2365
    return @result;
2380
    return @result;
2366
}
2381
}
2367
2382
2383
sub AddMember_Opac {
2384
    my ( %borrower ) = @_;
2385
2386
    $borrower{'categorycode'} = C4::Context->preference('PatronSelfRegistrationUseTemporaryStatus');
2387
    
2388
    my $sr = new String::Random;
2389
    $sr->{'A'} = [ 'A'..'Z', 'a'..'z' ];
2390
    my $password = $sr->randpattern("AAAAAAAAAA");
2391
    $borrower{'password'} = $password;
2392
2393
    $borrower{'cardnumber'} = fixup_cardnumber();
2394
2395
    my $borrowernumber = AddMember(%borrower);
2396
2397
    return ( $borrowernumber, $password );
2398
}
2368
2399
2369
END { }    # module clean-up code here (global destructor)
2400
END { }    # module clean-up code here (global destructor)
2370
2401
(-)a/Koha/Borrower/Modifications.pm (+340 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
        $data{'borrowernumber'} = $self->{'borrowernumber'};
72
        my $dbh   = C4::Context->dbh;
73
        my $query = "
74
            SELECT COUNT(*) AS count
75
            FROM borrower_modifications
76
            WHERE borrowernumber = ?
77
        ";
78
        my $sth = $dbh->prepare($query);
79
        $sth->execute( $self->{'borrowernumber'} );
80
        my $result = $sth->fetchrow_hashref();
81
82
        if ( $result->{'count'} ) {
83
            $data{'verification_token'} = q{};
84
            return UpdateInTable( "borrower_modifications", \%data );
85
        }
86
        else {
87
            return InsertInTable( "borrower_modifications", \%data );
88
        }
89
90
    }
91
    elsif ( $self->{'verification_token'} ) {
92
        delete $data{'borrowernumber'};
93
        $data{'verification_token'} = $self->{'verification_token'};
94
95
        return InsertInTable( "borrower_modifications", \%data );
96
    }
97
    else {
98
        return;
99
    }
100
}
101
102
=head Verify
103
104
$verified = Koha::Borrower::Modifications->Verify( $verification_token );
105
106
Returns true if the passed in token is valid.
107
108
=cut
109
110
sub Verify {
111
    my ( $self, $verification_token ) = @_;
112
113
    if ( ref($self) ) {
114
        $verification_token =
115
          ($verification_token)
116
          ? $verification_token
117
          : $self->{'verification_token'};
118
    }
119
120
    my $dbh   = C4::Context->dbh;
121
    my $query = "
122
        SELECT COUNT(*) AS count
123
        FROM borrower_modifications
124
        WHERE verification_token = ?
125
    ";
126
    my $sth = $dbh->prepare($query);
127
    $sth->execute($verification_token);
128
    my $result = $sth->fetchrow_hashref();
129
130
    return $result->{'count'};
131
}
132
133
=head GetPendingModificationsCount
134
135
$count = Koha::Borrower::Modifications->GetPendingModificationsCount();
136
137
Returns the number of pending modifications for existing borrowers.
138
=cut
139
140
sub GetPendingModificationsCount {
141
    my ($self) = @_;
142
143
    my $dbh   = C4::Context->dbh;
144
    my $query = "
145
        SELECT COUNT(*) AS count
146
        FROM borrower_modifications
147
        WHERE borrowernumber > 0
148
    ";
149
150
    my $sth = $dbh->prepare($query);
151
    $sth->execute();
152
    my $result = $sth->fetchrow_hashref();
153
154
    return $result->{'count'};
155
}
156
157
=head GetPendingModifications
158
159
$arrayref = Koha::Borrower::Modifications->GetPendingModifications();
160
161
Returns an arrayref of hashrefs for all pending modifications for existing borrowers.
162
163
=cut
164
165
sub GetPendingModifications {
166
    my ($self) = @_;
167
168
    my $dbh   = C4::Context->dbh;
169
    my $query = "
170
        SELECT *
171
        FROM borrower_modifications
172
        WHERE borrowernumber > 0
173
    ";
174
175
    my $sth = $dbh->prepare($query);
176
    $sth->execute();
177
178
    return $sth->fetchall_arrayref( {} );
179
}
180
181
=head ApproveModifications
182
183
Koha::Borrower::Modifications->ApproveModifications( $borrowernumber );
184
185
Commits the pending modifications to the borrower record and removes
186
them from the modifications table.
187
188
=cut
189
190
sub ApproveModifications {
191
    my ( $self, $borrowernumber ) = @_;
192
193
    if ( ref($self) ) {
194
        $borrowernumber =
195
          ($borrowernumber) ? $borrowernumber : $self->{'borrowernumber'};
196
    }
197
198
    return unless $borrowernumber;
199
200
    my $data = $self->GetModifications( borrowernumber => $borrowernumber );
201
202
    if ( UpdateInTable( "borrowers", $data ) ) {
203
        $self->DelModifications( borrowernumber => $borrowernumber );
204
    }
205
}
206
207
=head DenyModifications
208
209
Koha::Borrower::Modifications->DenyModifications( $borrowernumber );
210
211
Removes the modifications from the table for the given borrower,
212
without commiting the changes to the borrower record.
213
214
=cut
215
216
sub DenyModifications {
217
    my ( $self, $borrowernumber ) = @_;
218
219
    if ( ref($self) ) {
220
        $borrowernumber =
221
          ($borrowernumber) ? $borrowernumber : $self->{'borrowernumber'};
222
    }
223
224
    return unless $borrowernumber;
225
226
    return $self->DelModifications( borrowernumber => $borrowernumber );
227
}
228
229
=head DelModifications
230
231
Koha::Borrower::Modifications->DelModifications( 
232
  [ borrowernumber => $borrowernumber ], 
233
  [ verification_token => $verification_token ] 
234
);
235
236
Deletes the modifications for the given borrowernumber or verification token.
237
238
=cut
239
240
sub DelModifications {
241
    my ( $self, %params ) = @_;
242
243
    my ( $field, $value );
244
245
    if ( $params{'borrowernumber'} ) {
246
        $field = 'borrowernumber';
247
        $value = $params{'borrowernumber'};
248
    }
249
    elsif ( $params{'verification_token'} ) {
250
        $field = 'verification_token';
251
        $value = $params{'verification_token'};
252
    }
253
254
    if ( ref($self) && !$value ) {
255
        if ( $self->{'borrowernumber'} ) {
256
            $field = 'borrowernumber';
257
            $value = $self->{'borrowernumber'};
258
        }
259
        elsif ( $self->{'verification_token'} ) {
260
            $field = 'verification_token';
261
            $value = $self->{ 'verification_token' };
262
        }
263
    }
264
265
    return unless $value;
266
267
    my $dbh = C4::Context->dbh;
268
269
    $field = $dbh->quote_identifier($field);
270
271
    my $query = "
272
        DELETE
273
        FROM borrower_modifications
274
        WHERE $field = ?
275
    ";
276
277
    my $sth = $dbh->prepare($query);
278
    return $sth->execute($value);
279
}
280
281
=head GetModifications
282
283
$hashref = Koha::Borrower::Modifications->GetModifications( 
284
  [ borrowernumber => $borrowernumber ], 
285
  [ verification_token => $verification_token ] 
286
);
287
288
Gets the modifications for the given borrowernumber or verification token.
289
290
=cut
291
292
sub GetModifications {
293
    my ( $self, %params ) = @_;
294
295
    my ( $field, $value );
296
297
    if ( $params{'borrowernumber'} ) {
298
        $field = 'borrowernumber';
299
        $value = $params{'borrowernumber'};
300
    }
301
    elsif ( $params{'verification_token'} ) {
302
        $field = 'verification_token';
303
        $value = $params{'verification_token'};
304
    }
305
306
    if ( ref($self) && !$value ) {
307
        if ( $self->{'borrowernumber'} ) {
308
            $field = 'borrowernumber';
309
            $value = $self->{'borrowernumber'};
310
        }
311
        elsif ( $self->{'verification_token'} ) {
312
            $field = 'verification_token';
313
            $value = $self->{ 'verification_token' };
314
        }
315
    }
316
317
    return unless $value;
318
319
    my $dbh = C4::Context->dbh;
320
321
    $field = $dbh->quote_identifier($field);
322
323
    my $query = "
324
        SELECT *
325
        FROM borrower_modifications
326
        WHERE $field = ?
327
    ";
328
329
    my $sth = $dbh->prepare($query);
330
    $sth->execute($value);
331
    my $data = $sth->fetchrow_hashref();
332
333
    foreach my $key ( keys %$data ) {
334
        delete $data->{$key} unless ( defined( $data->{$key} ) );
335
    }
336
337
    return $data;
338
}
339
340
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 (+79 lines)
Lines 2867-2872 CREATE TABLE `quotes` ( Link Here
2867
  PRIMARY KEY (`id`)
2867
  PRIMARY KEY (`id`)
2868
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2868
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2869
2869
2870
--
2871
-- Table structure for table `borrower_modifications`
2872
--
2873
2874
CREATE TABLE IF NOT EXISTS `borrower_modifications` (
2875
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
2876
  `verification_token` varchar(255) NOT NULL DEFAULT '',
2877
  `borrowernumber` int(11) NOT NULL DEFAULT '0',
2878
  `cardnumber` varchar(16) DEFAULT NULL,
2879
  `surname` mediumtext,
2880
  `firstname` text,
2881
  `title` mediumtext,
2882
  `othernames` mediumtext,
2883
  `initials` text,
2884
  `streetnumber` varchar(10) DEFAULT NULL,
2885
  `streettype` varchar(50) DEFAULT NULL,
2886
  `address` mediumtext,
2887
  `address2` text,
2888
  `city` mediumtext,
2889
  `state` text,
2890
  `zipcode` varchar(25) DEFAULT NULL,
2891
  `country` text,
2892
  `email` mediumtext,
2893
  `phone` text,
2894
  `mobile` varchar(50) DEFAULT NULL,
2895
  `fax` mediumtext,
2896
  `emailpro` text,
2897
  `phonepro` text,
2898
  `B_streetnumber` varchar(10) DEFAULT NULL,
2899
  `B_streettype` varchar(50) DEFAULT NULL,
2900
  `B_address` varchar(100) DEFAULT NULL,
2901
  `B_address2` text,
2902
  `B_city` mediumtext,
2903
  `B_state` text,
2904
  `B_zipcode` varchar(25) DEFAULT NULL,
2905
  `B_country` text,
2906
  `B_email` text,
2907
  `B_phone` mediumtext,
2908
  `dateofbirth` date DEFAULT NULL,
2909
  `branchcode` varchar(10) DEFAULT NULL,
2910
  `categorycode` varchar(10) DEFAULT NULL,
2911
  `dateenrolled` date DEFAULT NULL,
2912
  `dateexpiry` date DEFAULT NULL,
2913
  `gonenoaddress` tinyint(1) DEFAULT NULL,
2914
  `lost` tinyint(1) DEFAULT NULL,
2915
  `debarred` date DEFAULT NULL,
2916
  `debarredcomment` varchar(255) DEFAULT NULL,
2917
  `contactname` mediumtext,
2918
  `contactfirstname` text,
2919
  `contacttitle` text,
2920
  `guarantorid` int(11) DEFAULT NULL,
2921
  `borrowernotes` mediumtext,
2922
  `relationship` varchar(100) DEFAULT NULL,
2923
  `ethnicity` varchar(50) DEFAULT NULL,
2924
  `ethnotes` varchar(255) DEFAULT NULL,
2925
  `sex` varchar(1) DEFAULT NULL,
2926
  `password` varchar(30) DEFAULT NULL,
2927
  `flags` int(11) DEFAULT NULL,
2928
  `userid` varchar(75) DEFAULT NULL,
2929
  `opacnote` mediumtext,
2930
  `contactnote` varchar(255) DEFAULT NULL,
2931
  `sort1` varchar(80) DEFAULT NULL,
2932
  `sort2` varchar(80) DEFAULT NULL,
2933
  `altcontactfirstname` varchar(255) DEFAULT NULL,
2934
  `altcontactsurname` varchar(255) DEFAULT NULL,
2935
  `altcontactaddress1` varchar(255) DEFAULT NULL,
2936
  `altcontactaddress2` varchar(255) DEFAULT NULL,
2937
  `altcontactaddress3` varchar(255) DEFAULT NULL,
2938
  `altcontactstate` text,
2939
  `altcontactzipcode` varchar(50) DEFAULT NULL,
2940
  `altcontactcountry` text,
2941
  `altcontactphone` varchar(50) DEFAULT NULL,
2942
  `smsalertnumber` varchar(50) DEFAULT NULL,
2943
  `privacy` int(11) DEFAULT NULL,
2944
  PRIMARY KEY (`verification_token`,`borrowernumber`),
2945
  KEY `verification_token` (`verification_token`),
2946
  KEY `borrowernumber` (`borrowernumber`)
2947
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2948
2870
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
2949
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
2871
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
2950
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
2872
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
2951
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/sysprefs.sql (+7 lines)
Lines 369-371 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
369
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSuppressionByIPRange','','Restrict the suppression to IP adresses outside of the IP range','','free');
369
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSuppressionByIPRange','','Restrict the suppression to IP adresses outside of the IP range','','free');
370
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('PrefillItem','0','When a new item is added, should it be prefilled with last created item values?','','YesNo');
370
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('PrefillItem','0','When a new item is added, should it be prefilled with last created item values?','','YesNo');
371
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SubfieldsToUseWhenPrefill','','Define a list of subfields to use when prefilling items (separated by space)','','Free');
371
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SubfieldsToUseWhenPrefill','','Define a list of subfields to use when prefilling items (separated by space)','','Free');
372
INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES
373
('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'),
374
('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'),
375
('PatronSelfRegistrationUseTemporaryStatus', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'),
376
('PatronSelfRegistrationExpireTemporaryAccountsDelay', '0', NULL, 'If PatronSelfRegistrationUseTemporaryStatus 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'),
377
('PatronSelfRegistrationBorrowerMandatoryField',  'surname|firstname', NULL ,  'Choose the mandatory fields for a patron''s account, when registering via the OPAC.',  'free'),
378
('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 5684-5689 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5684
    SetVersion($DBversion);
5684
    SetVersion($DBversion);
5685
}
5685
}
5686
5686
5687
$DBversion = '3.09.00.XXX';
5688
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5689
    $dbh->do("
5690
        CREATE TABLE IF NOT EXISTS `borrower_modifications` (
5691
          `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
5692
          `verification_token` varchar(255) NOT NULL DEFAULT '',
5693
          `borrowernumber` int(11) NOT NULL DEFAULT '0',
5694
          `cardnumber` varchar(16) DEFAULT NULL,
5695
          `surname` mediumtext,
5696
          `firstname` text,
5697
          `title` mediumtext,
5698
          `othernames` mediumtext,
5699
          `initials` text,
5700
          `streetnumber` varchar(10) DEFAULT NULL,
5701
          `streettype` varchar(50) DEFAULT NULL,
5702
          `address` mediumtext,
5703
          `address2` text,
5704
          `city` mediumtext,
5705
          `state` text,
5706
          `zipcode` varchar(25) DEFAULT NULL,
5707
          `country` text,
5708
          `email` mediumtext,
5709
          `phone` text,
5710
          `mobile` varchar(50) DEFAULT NULL,
5711
          `fax` mediumtext,
5712
          `emailpro` text,
5713
          `phonepro` text,
5714
          `B_streetnumber` varchar(10) DEFAULT NULL,
5715
          `B_streettype` varchar(50) DEFAULT NULL,
5716
          `B_address` varchar(100) DEFAULT NULL,
5717
          `B_address2` text,
5718
          `B_city` mediumtext,
5719
          `B_state` text,
5720
          `B_zipcode` varchar(25) DEFAULT NULL,
5721
          `B_country` text,
5722
          `B_email` text,
5723
          `B_phone` mediumtext,
5724
          `dateofbirth` date DEFAULT NULL,
5725
          `branchcode` varchar(10) DEFAULT NULL,
5726
          `categorycode` varchar(10) DEFAULT NULL,
5727
          `dateenrolled` date DEFAULT NULL,
5728
          `dateexpiry` date DEFAULT NULL,
5729
          `gonenoaddress` tinyint(1) DEFAULT NULL,
5730
          `lost` tinyint(1) DEFAULT NULL,
5731
          `debarred` date DEFAULT NULL,
5732
          `debarredcomment` varchar(255) DEFAULT NULL,
5733
          `contactname` mediumtext,
5734
          `contactfirstname` text,
5735
          `contacttitle` text,
5736
          `guarantorid` int(11) DEFAULT NULL,
5737
          `borrowernotes` mediumtext,
5738
          `relationship` varchar(100) DEFAULT NULL,
5739
          `ethnicity` varchar(50) DEFAULT NULL,
5740
          `ethnotes` varchar(255) DEFAULT NULL,
5741
          `sex` varchar(1) DEFAULT NULL,
5742
          `password` varchar(30) DEFAULT NULL,
5743
          `flags` int(11) DEFAULT NULL,
5744
          `userid` varchar(75) DEFAULT NULL,
5745
          `opacnote` mediumtext,
5746
          `contactnote` varchar(255) DEFAULT NULL,
5747
          `sort1` varchar(80) DEFAULT NULL,
5748
          `sort2` varchar(80) DEFAULT NULL,
5749
          `altcontactfirstname` varchar(255) DEFAULT NULL,
5750
          `altcontactsurname` varchar(255) DEFAULT NULL,
5751
          `altcontactaddress1` varchar(255) DEFAULT NULL,
5752
          `altcontactaddress2` varchar(255) DEFAULT NULL,
5753
          `altcontactaddress3` varchar(255) DEFAULT NULL,
5754
          `altcontactstate` text,
5755
          `altcontactzipcode` varchar(50) DEFAULT NULL,
5756
          `altcontactcountry` text,
5757
          `altcontactphone` varchar(50) DEFAULT NULL,
5758
          `smsalertnumber` varchar(50) DEFAULT NULL,
5759
          `privacy` int(11) DEFAULT NULL,
5760
          PRIMARY KEY (`verification_token`,`borrowernumber`),
5761
          KEY `verification_token` (`verification_token`),
5762
          KEY `borrowernumber` (`borrowernumber`)
5763
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
5764
");
5765
5766
    $dbh->do("
5767
        INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES
5768
        ('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'),
5769
        ('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'),
5770
        ('PatronSelfRegistrationUseTemporaryStatus', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'),
5771
        ('PatronSelfRegistrationExpireTemporaryAccountsDelay', '0', NULL, 'If PatronSelfRegistrationUseTemporaryStatus 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'),
5772
        ('PatronSelfRegistrationBorrowerMandatoryField',  'surname|firstname', NULL ,  'Choose the mandatory fields for a patron''s account, when registering via the OPAC.',  'free'),
5773
        ('PatronSelfRegistrationBorrowerUnwantedField',  '', NULL ,  'Name the fields you don''t want to display when registering a new patron via the OPAC.',  'free');
5774
    ");
5775
5776
    $dbh->do("
5777
    INSERT INTO  letter ( `module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content` )
5778
    VALUES ( 'members', 'OPAC_REG_VERIFY', '', 'Opac Self-Registration Verification Email', '1', 'Verify Your Account', 'Hello!
5779
5780
    Your library account has been created. Please verify your email address by clicking this link to complete the signup process:
5781
5782
    http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
5783
5784
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.'
5785
    )");
5786
5787
    print "Upgrade to $DBversion done (Add Patron Self Registration)\n";
5788
    SetVersion ($DBversion);
5789
}
5790
5687
=head1 FUNCTIONS
5791
=head1 FUNCTIONS
5688
5792
5689
=head2 TableExists($table)
5793
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+34 lines)
Lines 499-501 OPAC: Link Here
499
                  yes: Use
499
                  yes: Use
500
                  no: "Don't use"
500
                  no: "Don't use"
501
            - "the item collection code when finding items for the shelf browser."      
501
            - "the item collection code when finding items for the shelf browser."      
502
503
    Self Registration:
504
        -
505
            - pref: PatronSelfRegistration
506
              choices:
507
                  yes: Allow
508
                  no: "Don't allow"
509
            - "library patrons to register an account via the OPAC."
510
        -
511
            - pref: PatronSelfRegistrationVerifyByEmail
512
              choices:
513
                  yes: Require
514
                  no: "Don't require"
515
            - "that a self-registering patron verify his or herself via email."
516
        -
517
            - "Use the patron category code"
518
            - pref: PatronSelfRegistrationUseTemporaryStatus
519
              class: short
520
            - "as the default patron category for patrons registered via the OPAC."
521
        -
522
            - "Delete patrons registered via the OPAC, but not yet verified after"
523
            - pref: PatronSelfRegistrationExpireTemporaryAccountsDelay
524
              class: integer
525
            - "days."
526
        -
527
            - "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:"
528
            - pref: PatronSelfRegistrationBorrowerMandatoryField
529
              class: multi
530
            - (separate columns with |)
531
        -
532
            - "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:"
533
            - pref: PatronSelfRegistrationBorrowerUnwantedField
534
              class: multi
535
            - (separate columns with |)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt (-1 / +10 lines)
Lines 123-131 Link Here
123
                        <span class="pending-number-link">[% pendingtags %]</span>
123
                        <span class="pending-number-link">[% pendingtags %]</span>
124
                    </div>
124
                    </div>
125
                    [% END %]
125
                    [% END %]
126
127
128
                    [% IF ( CAN_user_borrowers && pending_borrower_modifications )%]
129
                    <div class="pending-info">
130
                        <a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>:
131
                        <span class="pending-number-link">[% pending_borrower_modifications %]</span>
132
                    </div>
133
                    [% END %]
134
126
                </div>
135
                </div>
127
            [% END %]
128
136
137
            [% END %]
129
138
130
</div>
139
</div>
131
            [% IF ( IntranetmainUserblock ) %]
140
            [% IF ( IntranetmainUserblock ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt (+137 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
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
                                                            </td>
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
                </div>
134
            </div>
135
        </div>
136
    </div>
137
[% 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 %] 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 55-60 Link Here
55
		<li><label for="password">Password:</label><input type="password" id="password" size="10" name="password" /></li>
55
		<li><label for="password">Password:</label><input type="password" id="password" size="10" name="password" /></li>
56
		</ol>	 <fieldset class="action">
56
		</ol>	 <fieldset class="action">
57
	 <input type="submit" value="Log In" class="submit" />
57
	 <input type="submit" value="Log In" class="submit" />
58
        [% IF PatronSelfRegistration %]<div>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></div>[% END %]
59
58
	 </fieldset></fieldset>
60
	 </fieldset></fieldset>
59
	</form>
61
	</form>
60
	</div>
62
	</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 (+713 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
            $( "#borrower_dateofbirth" ).datepicker();
11
        });
12
    </script>
13
</head>
14
15
<body id="opac-account">
16
    <div id="doc3" class="yui-t1">
17
        <div id="bd">
18
            [% INCLUDE 'masthead.inc' %]
19
20
            <div id="yui-main">
21
                <div class="yui-b">
22
                    <div class="yui-g">
23
                        <div id="useraccount" class="container">
24
25
                            [% IF empty_mandatory_fields %]
26
                                <div class="dialog alert">You have not filled out all required fields. Please fill in all missing fields and resubmit.</div>
27
                            [% END %]
28
29
                            [% IF failed_captcha %]
30
                                <div class="dialog alert">You typed in the wrong characters in the box before submitting. Please try again.</div>
31
                            [% END %]
32
33
                            <form method="post">
34
35
                                [% UNLESS
36
                                    hidden.defined('branchcode')
37
                                %]
38
39
                                <fieldset class="rows" id="memberentry_library">
40
41
                                    <legend id="library_legend">Library</legend>
42
                                        <ol>
43
                                            [% UNLESS hidden.defined('branchcode') %]
44
                                                <li>
45
                                                    [% IF mandatory.defined('branchcode') %]
46
                                                        <label for="borrower_branchcode" class="required">
47
                                                    [% ELSE %]
48
                                                        <label for="borrower_branchcode">
49
                                                    [% END %]
50
                                                    Home Library:</label>
51
52
                                                    <select id="borrower_branchcode" name="borrower_branchcode">
53
                                                        [% FOREACH b IN branches %]
54
                                                            [% IF b.value == borrower.branchcode %]
55
                                                                <option value="[% b.value %]" selected="selected">[% b.branchname %]</option>
56
                                                            [% ELSE %]
57
                                                                <option value="[% b.value %]">[% b.branchname %]</option>
58
                                                            [% END %]
59
                                                        [% END %]
60
                                                    </select>
61
                                                </li>
62
                                            [% END %]
63
                                        </ol>
64
                                    </fieldset>
65
                                [% END %]
66
67
                                [% UNLESS
68
                                    hidden.defined('title') && hidden.defined('surname') && hidden.defined('firstname') &&
69
                                    hidden.defined('dateofbirth') && hidden.defined('initials') && hidden.defined('othernames') &&
70
                                    hidden.defined('sex')
71
                                %]
72
                                    <fieldset class="rows" id="memberentry_identity">
73
                                        <legend id="identity_legend">Identity</legend>
74
75
                                        <ol>
76
                                            [% UNLESS hidden.defined('title') %]
77
                                                <li>
78
                                                    [% IF mandatory.defined('title') %]
79
                                                        <label for="borrower_title" class="required">
80
                                                    [% ELSE %]
81
                                                        <label for="borrower_title">
82
                                                    [% END %]
83
                                                    Salutation:</label>
84
85
                                                    <select id="borrower_title" name="borrower_title">
86
                                                        <option value="">&nbsp;</option>
87
                                                        [% FOREACH mt IN member_titles %]
88
                                                            [% IF mt == borrower.title %]
89
                                                                <option value="[% mt %]" selected="selected">[% mt %]</option>
90
                                                            [% ELSE %]
91
                                                                <option value="[% mt %]">[% mt %]</option>
92
                                                            [% END %]
93
                                                        [% END %]
94
                                                    </select>
95
                                                </li>
96
                                            [% END %]
97
98
                                            [% UNLESS hidden.defined('surname') %]
99
                                                <li>
100
                                                    [% IF mandatory.defined('surname') %]
101
                                                        <label for="borrower_surname" class="required">
102
                                                    [% ELSE %]
103
                                                        <label for="borrower_surname">
104
                                                    [% END %]
105
                                                    Surname:</label>
106
107
                                                    <input type="text" id="borrower_surname" name="borrower_surname" value="[% borrower.surname %]" />
108
                                                    [% IF mandatory.defined('surname') %]<span class="required">Required</span>[% END %]
109
                                                </li>
110
                                            [% END %]
111
112
                                            [% UNLESS hidden.defined('firstname') %]
113
                                                <li>
114
                                                    [% IF mandatory.defined('firstname') %]
115
                                                        <label for="borrower_firstname" class="required">
116
                                                    [% ELSE %]
117
                                                        <label for="borrower_firstname">
118
                                                    [% END %]
119
                                                    First name:</label>
120
121
                                                    <input type="text" id="borrower_firstname" name="borrower_firstname" value="[% borrower.firstname %]" />
122
                                                    [% IF mandatory.defined('firstname') %]<span class="required">Required</span>[% END %]
123
                                                </li>
124
                                            [% END %]
125
126
                                            [% UNLESS hidden.defined('dateofbirth') %]
127
                                                <li>
128
                                                    [% IF mandatory.defined('dateofbirth') %]
129
                                                        <label for="borrower_dateofbirth" class="required">
130
                                                    [% ELSE %]
131
                                                        <label for="borrower_dateofbirth">
132
                                                    [% END %]
133
                                                    Date of birth:</label>
134
135
                                                    <input type="text" id="borrower_dateofbirth" name="borrower_dateofbirth" value="[% borrower.dateofbirth | $KohaDates %]" readonly="readonly" size="10" />
136
137
                                                    <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('borrower_dateofbirth').value='';return false;">Clear date</a><p></p>
138
139
                                                    [% IF mandatory.defined('dateofbirth') %]<span class="required">Required</span>[% END %]
140
                                                </li>
141
                                            [% END %]
142
143
                                            [% UNLESS hidden.defined('initials') %]
144
                                                <li>
145
                                                    [% IF mandatory.defined('initials') %]
146
                                                        <label for="borrower_initials" class="required">
147
                                                    [% ELSE %]
148
                                                        <label for="borrower_initials">
149
                                                    [% END %]
150
                                                    Initials:</label>
151
152
                                                    <input type="text" id="borrower_initials" name="borrower_initials" value="[% borrower.initials %]" />
153
                                                    [% IF mandatory.defined('initials') %]<span class="required">Required</span>[% END %]
154
                                                </li>
155
                                            [% END %]
156
157
                                            [% UNLESS hidden.defined('othernames') %]
158
                                                <li>
159
                                                    [% IF mandatory.defined('othernames') %]
160
                                                        <label for="borrower_othernames" class="required">
161
                                                    [% ELSE %]
162
                                                        <label for="borrower_othernames">
163
                                                    [% END %]
164
                                                    Other names:</label>
165
166
                                                    <input type="text" id="borrower_othernames" name="borrower_othernames" value="[% borrower.othernames %]" />
167
                                                    [% IF mandatory.defined('othernames') %]<span class="required">Required</span>[% END %]
168
                                                </li>
169
                                            [% END %]
170
171
                                            [% UNLESS hidden.defined('sex') %]
172
                                                <li class="radio">
173
                                                    <label for="sex-female">Female:</label>
174
                                                    [% IF borrower.sex == 'F' %]
175
                                                        <input type="radio" name="borrower_sex" id="sex-female" value="F" checked="checked" />
176
                                                    [% ELSE %]
177
                                                        <input type="radio" name="borrower_sex" id="sex-female" value="F" />
178
                                                    [% END %]
179
180
                                                    <label for="sex-male">Male:</label>
181
                                                    [% IF borrower.sex == 'M' %]
182
                                                        <input type="radio" name="borrower_sex" id="sex-male" value="M" checked="checked" />
183
                                                    [% ELSE %]
184
                                                        <input type="radio" name="borrower_sex" id="sex-male" value="M" />
185
                                                    [% END %]
186
187
                                                    <label for="sex-none">N/A:</label>
188
                                                    [% IF borrower.sex == '' %]
189
                                                        <input type="radio" name="borrower_sex" id="sex-none" value="" checked="checked" />
190
                                                    [% ELSE %]
191
                                                        <input type="radio" name="borrower_sex" id="sex-none" value="" />
192
                                                    [% END %]
193
194
                                                    [% IF mandatory.defined('sex') %]<span class="required">Required</span>[% END %]
195
                                                </li>
196
                                            [% END %]
197
                                        </ol>
198
                                    </fieldset>
199
                                [% END %]
200
201
                                [% UNLESS
202
                                    hidden.defined('streetnumber') && hidden.defined('address') && hidden.defined('address2') &&
203
                                    hidden.defined('city') && hidden.defined('state') && hidden.defined('zipcode') &&
204
                                    hidden.defined('country')
205
                                %]
206
                                    <fieldset class="rows" id="memberentry_mainaddress">
207
                                        <legend id="mainaddress_legend">Main address</legend>
208
209
                                        <ol>
210
                                            [% UNLESS hidden.defined('streetnumber') %]
211
                                                <li>
212
                                                    [% IF mandatory.defined('streetnumber') %]
213
                                                        <label for="borrower_streetnumber" class="required">
214
                                                    [% ELSE %]
215
                                                        <label for="borrower_streetnumber">
216
                                                    [% END %]
217
                                                    Street number:</label>
218
219
                                                    <input type="text" id="borrower_streetnumber" name="borrower_streetnumber" value="[% borrower.streetnumber %]" />
220
                                                    [% IF mandatory.defined('streetnumber') %]<span class="required">Required</span>[% END %]
221
                                                </li>
222
                                            [% END %]
223
224
                                            [% UNLESS hidden.defined('address') %]
225
                                                <li>
226
                                                    [% IF mandatory.defined('address') %]
227
                                                        <label for="borrower_address" class="required">
228
                                                    [% ELSE %]
229
                                                        <label for="borrower_address">
230
                                                    [% END %]
231
                                                    Address:</label>
232
233
                                                    <input type="text" id="borrower_address" name="borrower_address" value="[% borrower.address %]" />
234
                                                    [% IF mandatory.defined('address') %]<span class="required">Required</span>[% END %]
235
                                                </li>
236
                                            [% END %]
237
238
                                            [% UNLESS hidden.defined('address2') %]
239
                                                <li>
240
                                                    [% IF mandatory.defined('address2') %]
241
                                                        <label for="borrower_address2" class="required">
242
                                                    [% ELSE %]
243
                                                        <label for="borrower_address2">
244
                                                    [% END %]
245
                                                    Address 2:</label>
246
247
                                                    <input type="text" id="borrower_address2" name="borrower_address2" value="[% borrower.address2 %]" />
248
                                                    [% IF mandatory.defined('address2') %]<span class="required">Required</span>[% END %]
249
                                                </li>
250
                                            [% END %]
251
252
                                            [% UNLESS hidden.defined('city') %]
253
                                                <li>
254
                                                    [% IF mandatory.defined('city') %]
255
                                                        <label for="borrower_city" class="required">
256
                                                    [% ELSE %]
257
                                                        <label for="borrower_city">
258
                                                    [% END %]
259
                                                    City:</label>
260
261
                                                    <input type="text" id="borrower_city" name="borrower_city" value="[% borrower.city %]" />
262
                                                    [% IF mandatory.defined('city') %]<span class="required">Required</span>[% END %]
263
                                                </li>
264
                                            [% END %]
265
266
                                            [% UNLESS hidden.defined('state') %]
267
                                                <li>
268
                                                    [% IF mandatory.defined('state') %]
269
                                                        <label for="borrower_state" class="required">
270
                                                    [% ELSE %]
271
                                                        <label for="borrower_state">
272
                                                    [% END %]
273
                                                    State:</label>
274
275
                                                    <input type="text" id="borrower_state" name="borrower_state" value="[% borrower.state %]" />
276
                                                    [% IF mandatory.defined('state') %]<span class="required">Required</span>[% END %]
277
                                                </li>
278
                                            [% END %]
279
280
                                            [% UNLESS hidden.defined('zipcode') %]
281
                                                <li>
282
                                                    [% IF mandatory.defined('zipcode') %]
283
                                                        <label for="borrower_zipcode" class="required">
284
                                                    [% ELSE %]
285
                                                        <label for="borrower_zipcode">
286
                                                    [% END %]
287
                                                    Zip/Postal code:</label>
288
289
                                                    <input type="text" id="borrower_zipcode" name="borrower_zipcode" value="[% borrower.zipcode %]" />
290
                                                    [% IF mandatory.defined('zipcode') %]<span class="required">Required</span>[% END %]
291
                                                </li>
292
                                            [% END %]
293
294
                                            [% UNLESS hidden.defined('country') %]
295
                                                <li>
296
                                                    [% IF mandatory.defined('country') %]
297
                                                        <label for="borrower_country" class="required">
298
                                                    [% ELSE %]
299
                                                        <label for="borrower_country">
300
                                                    [% END %]
301
                                                    Country:</label>
302
303
                                                    <input type="text" id="borrower_country" name="borrower_country" value="[% borrower.country %]" />
304
                                                    [% IF mandatory.defined('country') %]<span class="required">Required</span>[% END %]
305
                                                </li>
306
                                            [% END %]
307
308
                                        </ol>
309
                                    </fieldset>
310
                                [% END %]
311
312
                                [% UNLESS
313
                                    hidden.defined('phone') && hidden.defined('phonepro') && hidden.defined('mobile') &&
314
                                    hidden.defined('email') && hidden.defined('emailpro') && hidden.defined('fax')
315
                                %]
316
                                    <fieldset class="rows" id="memberentry_contact">
317
                                        <legend id="contact_legend">Contact information</legend>
318
319
                                        <ol>
320
                                            [% UNLESS hidden.defined('phone') %]
321
                                                <li>
322
                                                    [% IF mandatory.defined('phone') %]
323
                                                        <label for="borrower_phone" class="required">
324
                                                    [% ELSE %]
325
                                                        <label for="borrower_phone">
326
                                                    [% END %]
327
                                                    Primary phone:</label>
328
329
                                                    <input type="text" id="borrower_phone" name="borrower_phone" value="[% borrower.phone %]" />
330
                                                    [% IF mandatory.defined('phone') %]<span class="required">Required</span>[% END %]
331
                                                </li>
332
                                            [% END %]
333
334
                                            [% UNLESS hidden.defined('phonepro') %]
335
                                                <li>
336
                                                    [% IF mandatory.defined('phonepro') %]
337
                                                        <label for="borrower_phonepro" class="required">
338
                                                    [% ELSE %]
339
                                                        <label for="borrower_phonepro">
340
                                                    [% END %]
341
                                                    Secondary phone:</label>
342
343
                                                    <input type="text" id="borrower_phonepro" name="borrower_phonepro" value="[% borrower.phonepro %]" />
344
                                                    [% IF mandatory.defined('phonepro') %]<span class="required">Required</span>[% END %]
345
                                                </li>
346
                                            [% END %]
347
348
                                            [% UNLESS hidden.defined('mobile') %]
349
                                                <li>
350
                                                    [% IF mandatory.defined('mobile') %]
351
                                                        <label for="borrower_mobile" class="required">
352
                                                    [% ELSE %]
353
                                                        <label for="borrower_mobile">
354
                                                    [% END %]
355
                                                    Mobile phone:</label>
356
357
                                                    <input type="text" id="borrower_mobile" name="borrower_mobile" value="[% borrower.mobile %]" />
358
                                                    [% IF mandatory.defined('mobile') %]<span class="required">Required</span>[% END %]
359
                                                </li>
360
                                            [% END %]
361
362
                                            [% UNLESS hidden.defined('email') %]
363
                                                <li>
364
                                                    [% IF mandatory.defined('email') %]
365
                                                        <label for="borrower_email" class="required">
366
                                                    [% ELSE %]
367
                                                        <label for="borrower_email">
368
                                                    [% END %]
369
                                                    Primary email:</label>
370
371
                                                    <input type="text" id="borrower_email" name="borrower_email" value="[% borrower.email %]" />
372
                                                    [% IF mandatory.defined('email') %]<span class="required">Required</span>[% END %]
373
                                                </li>
374
                                            [% END %]
375
376
                                            [% UNLESS hidden.defined('emailpro') %]
377
                                                <li>
378
                                                    [% IF mandatory.defined('emailpro') %]
379
                                                        <label for="borrower_emailpro" class="required">
380
                                                    [% ELSE %]
381
                                                        <label for="borrower_emailpro">
382
                                                    [% END %]
383
                                                    Secondary email:</label>
384
385
                                                    <input type="text" id="borrower_emailpro" name="borrower_emailpro" value="[% borrower.emailpro %]" />
386
                                                    [% IF mandatory.defined('emailpro') %]<span class="required">Required</span>[% END %]
387
                                                </li>
388
                                            [% END %]
389
390
                                            [% UNLESS hidden.defined('fax') %]
391
                                                <li>
392
                                                    [% IF mandatory.defined('fax') %]
393
                                                        <label for="borrower_fax" class="required">
394
                                                    [% ELSE %]
395
                                                        <label for="borrower_fax">
396
                                                    [% END %]
397
                                                    Fax:</label>
398
399
                                                    <input type="text" id="borrower_fax" name="borrower_fax" value="[% borrower.fax %]" />
400
                                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
401
                                                </li>
402
                                            [% END %]
403
                                        </ol>
404
                                    </fieldset>
405
                                [% END %]
406
407
                                [% UNLESS
408
                                    hidden.defined('B_address') && hidden.defined('B_address2') && hidden.defined('B_city') &&
409
                                    hidden.defined('B_state') && hidden.defined('B_zipcode') && hidden.defined('B_county') &&
410
                                    hidden.defined('B_phone') && hidden.defined('B_email') && hidden.defined('contactnote')
411
                                %]
412
                                    <fieldset class="rows" id="memberentry_alternateaddress">
413
                                        <legend id="alternateaddress_legend">Alternate address</legend>
414
415
                                        <ol>
416
                                            [% UNLESS hidden.defined('B_address') %]
417
                                                <li>
418
                                                    [% IF mandatory.defined('B_address') %]
419
                                                        <label for="borrower_B_address" class="required">
420
                                                    [% ELSE %]
421
                                                        <label for="borrower_B_address">
422
                                                    [% END %]
423
                                                    Address:</label>
424
425
                                                    <input type="text" id="borrower_B_address" name="borrower_B_address" value="[% borrower.B_address %]" />
426
                                                    [% IF mandatory.defined('B_address') %]<span class="required">Required</span>[% END %]
427
                                                </li>
428
                                            [% END %]
429
430
                                            [% UNLESS hidden.defined('B_address2') %]
431
                                                <li>
432
                                                    [% IF mandatory.defined('B_address2') %]
433
                                                        <label for="borrower_B_address2" class="required">
434
                                                    [% ELSE %]
435
                                                        <label for="borrower_B_address2">
436
                                                    [% END %]
437
                                                    Address 2:</label>
438
439
                                                    <input type="text" id="borrower_B_address2" name="borrower_B_address2" value="[% borrower.B_address2 %]" />
440
                                                    [% IF mandatory.defined('B_address2') %]<span class="required">Required</span>[% END %]
441
                                                </li>
442
                                            [% END %]
443
444
                                            [% UNLESS hidden.defined('B_city') %]
445
                                                <li>
446
                                                    [% IF mandatory.defined('B_city') %]
447
                                                        <label for="borrower_B_city" class="required">
448
                                                    [% ELSE %]
449
                                                        <label for="borrower_B_city">
450
                                                    [% END %]
451
                                                    City:</label>
452
453
                                                    <input type="text" id="borrower_B_city" name="borrower_B_city" value="[% borrower.B_city %]" />
454
                                                    [% IF mandatory.defined('B_city') %]<span class="required">Required</span>[% END %]
455
                                                </li>
456
                                            [% END %]
457
458
                                            [% UNLESS hidden.defined('B_state') %]
459
                                                <li>
460
                                                    [% IF mandatory.defined('B_state') %]
461
                                                        <label for="borrower_B_state" class="required">
462
                                                    [% ELSE %]
463
                                                        <label for="borrower_B_state">
464
                                                    [% END %]
465
                                                    State:</label>
466
467
                                                    <input type="text" id="borrower_B_state" name="borrower_B_state" value="[% borrower.B_state %]" />
468
                                                    [% IF mandatory.defined('B_state') %]<span class="required">Required</span>[% END %]
469
                                                </li>
470
                                            [% END %]
471
472
                                            [% UNLESS hidden.defined('B_zipcode') %]
473
                                                <li>
474
                                                    [% IF mandatory.defined('B_zipcode') %]
475
                                                        <label for="borrower_B_zipcode" class="required">
476
                                                    [% ELSE %]
477
                                                        <label for="borrower_B_zipcode">
478
                                                    [% END %]
479
                                                    Zip/Postal code:</label>
480
481
                                                    <input type="text" id="borrower_B_zipcode" name="borrower_B_zipcode" value="[% borrower.B_zipcode %]" />
482
                                                    [% IF mandatory.defined('B_zipcode') %]<span class="required">Required</span>[% END %]
483
                                                </li>
484
                                            [% END %]
485
486
                                            [% UNLESS hidden.defined('B_country') %]
487
                                                <li>
488
                                                    [% IF mandatory.defined('B_country') %]
489
                                                        <label for="borrower_B_country" class="required">
490
                                                    [% ELSE %]
491
                                                        <label for="borrower_B_country">
492
                                                    [% END %]
493
                                                    Country:</label>
494
495
                                                    <input type="text" id="borrower_B_country" name="borrower_B_country" value="[% borrower.B_country %]" />
496
                                                    [% IF mandatory.defined('B_country') %]<span class="required">Required</span>[% END %]
497
                                                </li>
498
                                            [% END %]
499
500
                                            [% UNLESS hidden.defined('B_phone') %]
501
                                                <li>
502
                                                    [% IF mandatory.defined('B_phone') %]
503
                                                        <label for="borrower_B_phone" class="required">
504
                                                    [% ELSE %]
505
                                                        <label for="borrower_B_phone">
506
                                                    [% END %]
507
                                                    Phone:</label>
508
509
                                                    <input type="text" id="borrower_B_phone" name="borrower_B_phone" value="[% borrower.B_phone %]" />
510
                                                    [% IF mandatory.defined('B_phone') %]<span class="required">Required</span>[% END %]
511
                                                </li>
512
                                            [% END %]
513
514
                                            [% UNLESS hidden.defined('B_email') %]
515
                                                <li>
516
                                                    [% IF mandatory.defined('B_email') %]
517
                                                        <label for="borrower_B_email" class="required">
518
                                                    [% ELSE %]
519
                                                        <label for="borrower_B_email">
520
                                                    [% END %]
521
                                                    Email:</label>
522
523
                                                    <input type="text" id="borrower_B_email" name="borrower_B_email" value="[% borrower.B_email %]" />
524
                                                    [% IF mandatory.defined('B_email') %]<span class="required">Required</span>[% END %]
525
                                                </li>
526
                                            [% END %]
527
528
                                            [% UNLESS hidden.defined('contactnote') %]
529
                                                <li>
530
                                                    [% IF mandatory.defined('contactnote') %]
531
                                                        <label for="borrower_contactnote" class="required">
532
                                                    [% ELSE %]
533
                                                        <label for="borrower_contactnote">
534
                                                    [% END %]
535
                                                    Contact Note:</label>
536
537
                                                    <textarea id="borrower_contactnote" name="borrower_contactnote" cols="40" rows="2">[% borrower.contactnote %]</textarea>
538
                                                    [% IF mandatory.defined('contactnote') %]<span class="required">Required</span>[% END %]
539
                                                </li>
540
                                            [% END %]
541
542
                                        </ol>
543
                                    </fieldset>
544
                                [% END %]
545
546
                                [% UNLESS
547
                                    hidden.defined('altcontactsurname') && hidden.defined('altcontactfirstname') && hidden.defined('altcontactaddress1') &&
548
                                    hidden.defined('altcontactaddress2') && hidden.defined('altcontactaddress3') && hidden.defined('altcontactstate') &&
549
                                    hidden.defined('altcontactzipcode') && hidden.defined('altcontactcountry') && hidden.defined('altcontactphone')
550
                                %]
551
                                    <fieldset class="rows" id="memberentry_alternatecontact">
552
                                        <legend id="alternatecontact_legend">Alternate contact</legend>
553
554
                                        <ol>
555
                                            [% UNLESS hidden.defined('altcontactsurname') %]
556
                                                <li>
557
                                                    [% IF mandatory.defined('altcontactsurname') %]
558
                                                        <label for="borrower_altcontactsurname" class="required">
559
                                                    [% ELSE %]
560
                                                        <label for="borrower_altcontactsurname">
561
                                                    [% END %]
562
                                                    Surname:</label>
563
564
                                                    <input type="text" id="borrower_altcontactsurname" name="borrower_altcontactsurname" value="[% borrower.altcontactsurname %]" />
565
                                                    [% IF mandatory.defined('altcontactsurname') %]<span class="required">Required</span>[% END %]
566
                                                </li>
567
                                            [% END %]
568
569
                                            [% UNLESS hidden.defined('altcontactfirstname') %]
570
                                                <li>
571
                                                    [% IF mandatory.defined('altcontactfirstname') %]
572
                                                        <label for="borrower_altcontactfirstname" class="required">
573
                                                    [% ELSE %]
574
                                                        <label for="borrower_altcontactfirstname">
575
                                                    [% END %]
576
                                                    First name:</label>
577
578
                                                    <input type="text" id="borrower_altcontactfirstname" name="borrower_altcontactfirstname" value="[% borrower.altcontactfirstname %]" />
579
                                                    [% IF mandatory.defined('altcontactfirstname') %]<span class="required">Required</span>[% END %]
580
                                                </li>
581
                                            [% END %]
582
583
                                            [% UNLESS hidden.defined('altcontactaddress1') %]
584
                                                <li>
585
                                                    [% IF mandatory.defined('altcontactaddress1') %]
586
                                                        <label for="borrower_altcontactaddress1" class="required">
587
                                                    [% ELSE %]
588
                                                        <label for="borrower_altcontactaddress1">
589
                                                    [% END %]
590
                                                    Address:</label>
591
592
                                                    <input type="text" id="borrower_altcontactaddress1" name="borrower_altcontactaddress1" value="[% borrower.altcontactaddress1 %]" />
593
                                                    [% IF mandatory.defined('altcontactaddress1') %]<span class="required">Required</span>[% END %]
594
                                                </li>
595
                                            [% END %]
596
597
                                            [% UNLESS hidden.defined('altcontactaddress2') %]
598
                                                <li>
599
                                                    [% IF mandatory.defined('altcontactaddress2') %]
600
                                                        <label for="borrower_altcontactaddress2" class="required">
601
                                                    [% ELSE %]
602
                                                        <label for="borrower_altcontactaddress2">
603
                                                    [% END %]
604
                                                    Address 2:</label>
605
606
                                                    <input type="text" id="borrower_altcontactaddress2" name="borrower_altcontactaddress2" value="[% borrower.altcontactaddress2 %]" />
607
                                                    [% IF mandatory.defined('altcontactaddress2') %]<span class="required">Required</span>[% END %]
608
                                                </li>
609
                                            [% END %]
610
611
                                            [% UNLESS hidden.defined('altcontactaddress3') %]
612
                                                <li>
613
                                                    [% IF mandatory.defined('altcontactaddress3') %]
614
                                                        <label for="borrower_altcontactaddress3" class="required">
615
                                                    [% ELSE %]
616
                                                        <label for="borrower_altcontactaddress3">
617
                                                    [% END %]
618
                                                    City:</label>
619
620
                                                    <input type="text" id="borrower_altcontactaddress3" name="borrower_altcontactaddress3" value="[% borrower.altcontactaddress3 %]" />
621
                                                    [% IF mandatory.defined('altcontactaddress3') %]<span class="required">Required</span>[% END %]
622
                                                </li>
623
                                            [% END %]
624
625
                                            [% UNLESS hidden.defined('altcontactstate') %]
626
                                                <li>
627
                                                    [% IF mandatory.defined('altcontactstate') %]
628
                                                        <label for="borrower_altcontactstate" class="required">
629
                                                    [% ELSE %]
630
                                                        <label for="borrower_altcontactstate">
631
                                                    [% END %]
632
                                                    State:</label>
633
634
                                                    <input type="text" id="borrower_altcontactstate" name="borrower_altcontactstate" value="[% borrower.altcontactstate %]" />
635
                                                    [% IF mandatory.defined('altcontactstate') %]<span class="required">Required</span>[% END %]
636
                                                </li>
637
                                            [% END %]
638
639
                                            [% UNLESS hidden.defined('altcontactzipcode') %]
640
                                                <li>
641
                                                    [% IF mandatory.defined('altcontactzipcode') %]
642
                                                        <label for="borrower_altcontactzipcode" class="required">
643
                                                    [% ELSE %]
644
                                                        <label for="borrower_altcontactzipcode">
645
                                                    [% END %]
646
                                                    Zip/Postal code:</label>
647
648
                                                    <input type="text" id="borrower_altcontactzipcode" name="borrower_altcontactzipcode" value="[% borrower.altcontactzipcode %]" />
649
                                                    [% IF mandatory.defined('altcontactzipcode') %]<span class="required">Required</span>[% END %]
650
                                                </li>
651
                                            [% END %]
652
653
                                            [% UNLESS hidden.defined('altcontactcountry') %]
654
                                                <li>
655
                                                    [% IF mandatory.defined('altcontactcountry') %]
656
                                                        <label for="borrower_altcontactcountry" class="required">
657
                                                    [% ELSE %]
658
                                                        <label for="borrower_altcontactcountry">
659
                                                    [% END %]
660
                                                    Country:</label>
661
662
                                                    <input type="text" id="borrower_altcontactcountry" name="borrower_altcontactcountry" value="[% borrower.altcontactcountry %]" />
663
                                                    [% IF mandatory.defined('altcontactcountry') %]<span class="required">Required</span>[% END %]
664
                                                </li>
665
                                            [% END %]
666
667
                                            [% UNLESS hidden.defined('altcontactphone') %]
668
                                                <li>
669
                                                    [% IF mandatory.defined('altcontactphone') %]
670
                                                        <label for="borrower_altcontactphone" class="required">
671
                                                    [% ELSE %]
672
                                                        <label for="borrower_altcontactphone">
673
                                                    [% END %]
674
                                                    Phone:</label>
675
676
                                                    <input type="text" id="borrower_altcontactphone" name="borrower_altcontactphone" value="[% borrower.altcontactphone %]" />
677
                                                    [% IF mandatory.defined('altcontactphone') %]<span class="required">Required</span>[% END %]
678
                                                </li>
679
                                            [% END %]
680
                                        </ol>
681
                                    </fieldset>
682
                                [% END %]
683
684
                                [% UNLESS action == 'edit' %]
685
                                    <p>Please type this following characters into the box below : [% captcha %]</p>
686
                                    <p>
687
                                        <input type="text" name="captcha" id="captcha" />
688
                                        <input type="hidden" name="captcha_digest" value="[% captcha_digest %]" />
689
                                    </p>
690
                                [% END %]
691
692
                                [% IF action == 'edit' %]
693
                                    <input type="hidden" name="action" value="update" />
694
                                    <input type="submit" value="Submit Update Request" />
695
                                [% ELSE %]
696
                                    <input type="hidden" name="action" value="create" />
697
                                    <input type="submit" value="Submit" />
698
                                [% END %]
699
700
                            </form>
701
702
                        </div><!--/div id="useraccount" -->
703
                    </div>
704
                </div>
705
            </div>
706
707
            <div class="yui-b">
708
                <div id="leftmenus" class="container">
709
                    [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
710
                </div>
711
            </div>
712
        </div>
713
[% 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/mainpage.pl (-10 / +13 lines)
Lines 28-34 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
33
my $query = new CGI;
32
34
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
35
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
34
    {
36
    {
Lines 36-44 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
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 $pendingcomments    = numberofreviews(0);
54
my $pendingtags = get_count_by_tag_status(0);
54
my $pendingtags        = get_count_by_tag_status(0);
55
my $pendingsuggestions       = CountSuggestion("ASKED");
55
my $pendingsuggestions = CountSuggestion("ASKED");
56
my $pending_borrower_modifications =
57
  Koha::Borrower::Modifications->GetPendingModificationsCount();
56
58
57
$template->param(
59
$template->param(
58
    pendingcomments    => $pendingcomments,
60
    pendingcomments                => $pendingcomments,
59
    pendingtags        => $pendingtags,
61
    pendingtags                    => $pendingtags,
60
    pendingsuggestions => $pendingsuggestions
62
    pendingsuggestions             => $pendingsuggestions,
63
    pending_borrower_modifications => $pending_borrower_modifications,
61
);
64
);
62
65
63
output_html_with_http_headers $query, $cookie, $template->output;
66
output_html_with_http_headers $query, $cookie, $template->output;
(-)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/mainpage.pl");
(-)a/members/members-update.pl (+59 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   => "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 $pending_modifications =
45
  Koha::Borrower::Modifications->GetPendingModifications();
46
47
my $borrowers;
48
foreach my $pm (@$pending_modifications) {
49
    $borrowers->{ $pm->{'borrowernumber'} } =
50
      GetMember( borrowernumber => $pm->{'borrowernumber'} );
51
52
}
53
54
$template->param(
55
    PendingModifications => $pending_modifications,
56
    borrowers            => $borrowers,
57
);
58
59
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/misc/cronjobs/delete_expired_opac_registrations.pl (+54 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
22
BEGIN {
23
24
    # find Koha's Perl modules
25
    # test carefully before changing this
26
    use FindBin;
27
    eval { require "$FindBin::Bin/../kohalib.pl" };
28
}
29
30
use C4::Context;
31
use C4::Members qw/ DelMember /;
32
33
## Delete accounts that haven't been upgraded from the 'temporary' category code'
34
my $delay =
35
  C4::Context->preference('PatronSelfRegistrationExpireTemporaryAccountsDelay');
36
my $category_code =
37
  C4::Context->preference('PatronSelfRegistrationUseTemporaryStatus');
38
39
my $query = "
40
    SELECT borrowernumber
41
    FROM borrowers
42
    WHERE
43
        categorycode = ?
44
      AND
45
        DATEDIFF( DATE( NOW() ), DATE(dateenrolled) ) = ? )
46
";
47
48
my $dbh = C4::Context->dbh;
49
my $sth = $dbh->prepare($query);
50
$sth->execute( $category_code, $delay );
51
52
while ( my ($borrowernumber) = $sth->fetchrow_array() ) {
53
    DelMember($borrowernumber);
54
}
(-)a/misc/cronjobs/delete_unverified_opac_registrations.pl (+41 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
22
BEGIN {
23
24
    # find Koha's Perl modules
25
    # test carefully before changing this
26
    use FindBin;
27
    eval { require "$FindBin::Bin/../kohalib.pl" };
28
}
29
30
use C4::Context;
31
use C4::Members qw/ DelMember /;
32
33
my $dbh = C4::Context->dbh;
34
35
$dbh->do( "
36
         DELETE FROM borrower_modifications
37
         WHERE
38
             borrowernumber = 0
39
           AND
40
             TIME_TO_SEC( TIMEDIFF( NOW(), timestamp )) / 3600 > 24
41
" );
(-)a/opac/opac-memberentry.pl (+240 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
unless ( C4::Context->preference('PatronSelfRegistration') ) {
34
    print $cgi->redirect("/cgi-bin/koha/opac-main.pl");
35
    exit;
36
}
37
38
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
39
    {
40
        template_name   => "opac-memberentry.tmpl",
41
        type            => "opac",
42
        query           => $cgi,
43
        authnotrequired => 1,
44
    }
45
);
46
47
$template->param(
48
    hidden        => GetHiddenFields(),
49
    mandatory     => GetMandatoryFields(),
50
    member_titles => GetTitles(),
51
    branches      => GetBranchesLoop()
52
);
53
54
my $action = $cgi->param('action') || q{};
55
if ( $action eq 'create' ) {
56
57
    my %borrower = ParseCgiForBorrower($cgi);
58
59
    my @empty_mandatory_fields = CheckMandatoryFields( \%borrower );
60
61
    if (@empty_mandatory_fields) {
62
        $template->param(
63
            empty_mandatory_fields => \@empty_mandatory_fields,
64
            borrower               => \%borrower
65
        );
66
    }
67
    elsif (
68
        md5_base64( $cgi->param('captcha') ) ne $cgi->param('captcha_digest') )
69
    {
70
        $template->param(
71
            failed_captcha => 1,
72
            borrower       => \%borrower
73
        );
74
    }
75
    else {
76
        if (
77
            C4::Context->boolean_preference(
78
                'PatronSelfRegistrationVerifyByEmail')
79
          )
80
        {
81
            ( $template, $borrowernumber, $cookie ) = get_template_and_user(
82
                {
83
                    template_name   => "opac-registration-email-sent.tmpl",
84
                    type            => "opac",
85
                    query           => $cgi,
86
                    authnotrequired => 1,
87
                }
88
            );
89
            $template->param( 'email' => $borrower{'email'} );
90
91
            my $verification_token = md5_hex( \%borrower );
92
            $borrower{'password'} = random_string("..........");
93
94
            Koha::Borrower::Modifications->new(
95
                verification_token => $verification_token )
96
              ->AddModifications(%borrower);
97
98
            #Send verification email
99
            my $letter = C4::Letters::GetPreparedLetter(
100
                module      => 'members',
101
                letter_code => 'OPAC_REG_VERIFY',
102
                tables      => {
103
                    borrower_modifications =>
104
                      [ $verification_token, $verification_token ],
105
                },
106
            );
107
108
            C4::Letters::EnqueueLetter(
109
                {
110
                    letter                 => $letter,
111
                    message_transport_type => 'email',
112
                    to_address             => $borrower{'email'},
113
                    from_address =>
114
                      C4::Context->preference('KohaAdminEmailAddress'),
115
                }
116
            );
117
        }
118
        else {
119
            ( $template, $borrowernumber, $cookie ) = get_template_and_user(
120
                {
121
                    template_name   => "opac-registration-confirmation.tmpl",
122
                    type            => "opac",
123
                    query           => $cgi,
124
                    authnotrequired => 1,
125
                }
126
            );
127
128
            $template->param( OpacPasswordChange =>
129
                  C4::Context->preference('OpacPasswordChange') );
130
131
            my ( $borrowernumber, $password ) = AddMember_Opac(%borrower);
132
133
            $template->param( password_cleartext => $password );
134
            $template->param(
135
                borrower => GetMember( borrowernumber => $borrowernumber ) );
136
            $template->param(
137
                PatronSelfRegistrationAdditionalInstructions =>
138
                  C4::Context->preference(
139
                    'PatronSelfRegistrationAdditionalInstructions')
140
            );
141
        }
142
    }
143
}
144
elsif ( $action eq 'update' ) {
145
    ( $template, $borrowernumber, $cookie ) = get_template_and_user(
146
        {
147
            template_name   => "opac-memberentry-update-submitted.tmpl",
148
            type            => "opac",
149
            query           => $cgi,
150
            authnotrequired => 1,
151
        }
152
    );
153
154
    my %borrower = ParseCgiForBorrower($cgi);
155
156
    Koha::Borrower::Modifications->new( borrowernumber => $borrowernumber )
157
      ->AddModifications(%borrower);
158
}
159
elsif ($borrowernumber) {    #Display logged in borrower's data
160
    $action = 'edit';
161
162
    $template->param(
163
        borrower => GetMember( borrowernumber => $borrowernumber ) );
164
}
165
166
my $captcha = random_string("CCCCC");
167
168
$template->param(
169
    captcha        => $captcha,
170
    captcha_digest => md5_base64($captcha)
171
);
172
173
$template->param( action => $action );
174
175
output_html_with_http_headers $cgi, $cookie, $template->output;
176
177
sub GetHiddenFields {
178
    my %hidden_fields;
179
180
    my $BorrowerUnwantedField =
181
      C4::Context->preference("PatronSelfRegistrationBorrowerUnwantedField");
182
183
    my @fields = split( /\|/, $BorrowerUnwantedField );
184
    foreach (@fields) {
185
        next unless m/\w/o;
186
        $hidden_fields{$_} = 1;
187
    }
188
189
    return \%hidden_fields;
190
}
191
192
sub GetMandatoryFields {
193
    my %mandatory_fields;
194
195
    my $BorrowerMandatoryField =
196
      C4::Context->preference("PatronSelfRegistrationBorrowerMandatoryField");
197
198
    my @fields = split( /\|/, $BorrowerMandatoryField );
199
200
    foreach (@fields) {
201
        $mandatory_fields{$_} = 1;
202
    }
203
204
    $mandatory_fields{'email'} = 1
205
      if C4::Context->boolean_preference('PatronSelfRegistrationVerifyByEmail');
206
207
    return \%mandatory_fields;
208
}
209
210
sub CheckMandatoryFields {
211
    my ($borrower) = @_;
212
213
    my @empty_mandatory_fields;
214
215
    my $mandatory_fields = GetMandatoryFields();
216
    delete $mandatory_fields->{'cardnumber'};
217
218
    foreach my $key ( keys %$mandatory_fields ) {
219
        push( @empty_mandatory_fields, $key )
220
          unless ( defined( $borrower->{$key} ) && $borrower->{$key} );
221
    }
222
223
    return @empty_mandatory_fields;
224
}
225
226
sub ParseCgiForBorrower {
227
    my ($cgi) = @_;
228
229
    my %borrower;
230
231
    foreach ( $cgi->param ) {
232
        my ($key) = substr( $_, 9 );
233
        $borrower{$key} = $cgi->param($_)
234
          if ( $_ =~ '^borrower_' && $cgi->param($_) );
235
    }
236
237
    $borrower{'dateofbirth'} = C4::Dates->new( $borrower{'dateofbirth'} )->output("iso") if ( defined( $borrower{'dateofbirth'} ) );
238
239
    return %borrower;
240
}
(-)a/opac/opac-registration-verify.pl (+74 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 ( $template, $borrowernumber, $cookie ) = get_template_and_user(
36
    {
37
        template_name   => "opac-registration-confirmation.tmpl",
38
        type            => "opac",
39
        query           => $cgi,
40
        authnotrequired => 1,
41
    }
42
);
43
44
$template->param(
45
    OpacPasswordChange => C4::Context->preference('OpacPasswordChange') );
46
47
my $token = $cgi->param('token');
48
my $m = Koha::Borrower::Modifications->new( verification_token => $token );
49
50
if ( $m->Verify() ) {
51
    my $borrower = $m->GetModifications();
52
53
    my $password;
54
    ( $borrowernumber, $password ) = AddMember_Opac(%$borrower);
55
56
    if ($borrowernumber) {
57
        $m->DelModifications();
58
59
        $template->param( password_cleartext => $password );
60
        $template->param(
61
            borrower => GetMember( borrowernumber => $borrowernumber ) );
62
        $template->param(
63
            PatronSelfRegistrationAdditionalInstructions =>
64
              C4::Context->preference(
65
                'PatronSelfRegistrationAdditionalInstructions')
66
        );
67
    }
68
69
}
70
else {
71
72
}
73
74
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/opac/opac-user.pl (-2 / +1 lines)
Lines 367-373 $template->param( Link Here
367
$template->param( DHTMLcalendar_dateformat  => C4::Dates->DHTMLcalendar() );
367
$template->param( DHTMLcalendar_dateformat  => C4::Dates->DHTMLcalendar() );
368
$template->param(
368
$template->param(
369
    SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'),
369
    SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'),
370
    AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds') ,
370
    AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
371
);
371
);
372
372
373
output_html_with_http_headers $query, $cookie, $template->output;
373
output_html_with_http_headers $query, $cookie, $template->output;
374
- 

Return to bug 7067