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

(-)a/C4/Auth.pm (+1 lines)
Lines 473-478 sub get_template_and_user { Link Here
473
            SyndeticsSeries              => C4::Context->preference("SyndeticsSeries"),
473
            SyndeticsSeries              => C4::Context->preference("SyndeticsSeries"),
474
            SyndeticsCoverImageSize      => C4::Context->preference("SyndeticsCoverImageSize"),
474
            SyndeticsCoverImageSize      => C4::Context->preference("SyndeticsCoverImageSize"),
475
            OPACLocalCoverImages         => C4::Context->preference("OPACLocalCoverImages"),
475
            OPACLocalCoverImages         => C4::Context->preference("OPACLocalCoverImages"),
476
            PatronSelfRegistration       => C4::Context->preference("PatronSelfRegistration"),
476
        );
477
        );
477
478
478
        $template->param(OpacPublic => '1') if ($user || C4::Context->preference("OpacPublic"));
479
        $template->param(OpacPublic => '1') if ($user || C4::Context->preference("OpacPublic"));
(-)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 (+18 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 2365-2370 sub GetBorrowersWithEmail { Link Here
2365
    return @result;
2367
    return @result;
2366
}
2368
}
2367
2369
2370
sub AddMember_Opac {
2371
    my ( %borrower ) = @_;
2372
    
2373
    $borrower{'categorycode'} = C4::Context->preference('PatronSelfRegistrationUseTemporaryStatus');
2374
2375
    my $sr = new String::Random;
2376
    $sr->{'A'} = [ 'A'..'Z', 'a'..'z' ];
2377
    my $password = $sr->randpattern("AAAAAAAAAA");
2378
    $borrower{'password'} = $password;
2379
2380
    $borrower{'cardnumber'} = fixup_cardnumber();
2381
2382
    my $borrowernumber = AddMember(%borrower);
2383
2384
    return ( $borrowernumber, $password );
2385
}
2368
2386
2369
END { }    # module clean-up code here (global destructor)
2387
END { }    # module clean-up code here (global destructor)
2370
2388
(-)a/Koha/Borrower/Modifications.pm (+207 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 DeleteInTable);
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
sub AddModifications {
57
    my ( $self, %data ) = @_;
58
59
    if ( $self->{'borrowernumber'} ) {
60
        $data{'borrowernumber'} = $self->{'borrowernumber'};
61
        my $dbh   = C4::Context->dbh;
62
        my $query = "
63
            SELECT COUNT(*) AS count 
64
            FROM borrower_modifications 
65
            WHERE borrowernumber = ?
66
        ";
67
        my $sth = $dbh->prepare($query);
68
        $sth->execute( $self->{'borrowernumber'} );
69
        my $result = $sth->fetchrow_hashref();
70
71
        if ( $result->{'count'} ) {
72
            $data{'verification_token'} = q{};
73
            return UpdateInTable( "borrower_modifications", \%data );
74
        }
75
        else {
76
            return InsertInTable( "borrower_modifications", \%data );
77
        }
78
79
    }
80
    elsif ( $self->{'verification_token'} ) {
81
        delete $data{'borrowernumber'};
82
        $data{'verification_token'} = $self->{'verification_token'};
83
84
        return InsertInTable( "borrower_modifications", \%data );
85
    }
86
    else {
87
        return;
88
    }
89
}
90
91
sub Verify {
92
    my ( $self, $verification_token ) = @_;
93
94
    if ( ref($self) ) {
95
        $verification_token =
96
          ($verification_token)
97
          ? $verification_token
98
          : $self->{'verification_token'};
99
    }
100
101
    my $dbh   = C4::Context->dbh;
102
    my $query = "
103
        SELECT COUNT(*) AS count 
104
        FROM borrower_modifications 
105
        WHERE verification_token = ?
106
    ";
107
    my $sth = $dbh->prepare($query);
108
    $sth->execute($verification_token);
109
    my $result = $sth->fetchrow_hashref();
110
111
    return $result->{'count'};
112
}
113
114
sub GetPendingModificationsCount {
115
    my ($self) = @_;
116
117
    my $dbh   = C4::Context->dbh;
118
    my $query = "
119
        SELECT COUNT(*) AS count
120
        FROM borrower_modifications
121
        WHERE borrowernumber > 0
122
    ";
123
124
    my $sth = $dbh->prepare($query);
125
    $sth->execute();
126
    my $result = $sth->fetchrow_hashref();
127
128
    return $result->{'count'};
129
}
130
131
sub GetPendingModifications {
132
    my ($self) = @_;
133
134
    my $dbh   = C4::Context->dbh;
135
    my $query = "
136
        SELECT * 
137
        FROM borrower_modifications
138
        WHERE borrowernumber > 0
139
    ";
140
141
    my $sth = $dbh->prepare($query);
142
    $sth->execute();
143
144
    return $sth->fetchall_arrayref( {} );
145
}
146
147
sub ApproveModifications {
148
    my ( $self, $borrowernumber ) = @_;
149
    warn "ApproveModifications( $self, $borrowernumber )";
150
    if ( ref($self) ) {
151
        $borrowernumber =
152
          ($borrowernumber) ? $borrowernumber : $self->{'borrowernumber'};
153
    }
154
155
    return unless $borrowernumber;
156
157
    my $data = $self->_GetModifications($borrowernumber);
158
159
    if ( UpdateInTable( "borrowers", $data ) ) {
160
        return DeleteInTable( "borrower_modifications", $data );
161
    }
162
}
163
164
sub DenyModifications {
165
    my ( $self, $borrowernumber ) = @_;
166
    warn "DenyModifications( $self, $borrowernumber )";
167
    if ( ref($self) ) {
168
        $borrowernumber =
169
          ($borrowernumber) ? $borrowernumber : $self->{'borrowernumber'};
170
    }
171
172
    return unless $borrowernumber;
173
174
    my $data = $self->_GetModifications($borrowernumber);
175
176
    return DeleteInTable( "borrower_modifications", $data );
177
}
178
179
sub _GetModifications {
180
    my ( $self, $borrowernumber ) = @_;
181
    warn "_GetModifications( $self, $borrowernumber )";
182
    if ( ref($self) ) {
183
        $borrowernumber =
184
          $borrowernumber ? $borrowernumber : $self->{'borrowernumber'};
185
    }
186
187
    return unless $borrowernumber;
188
189
    my $query = "
190
        SELECT * 
191
        FROM borrower_modifications
192
        WHERE borrowernumber = ?
193
    ";
194
195
    my $sth = C4::Context->dbh->prepare($query);
196
    $sth->execute($borrowernumber);
197
    my $data = $sth->fetchrow_hashref();
198
199
    foreach my $key ( keys %$data ) {
200
        delete $data->{$key} unless ( defined( $data->{$key} ) );
201
    }
202
203
    return $data;
204
}
205
206
1;
207
(-)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/sysprefs.sql (+5 lines)
Lines 375-377 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( Link Here
375
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('EnableBorrowerFiles','0','If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo');
375
INSERT INTO systempreferences (variable,value,explanation,type) VALUES('EnableBorrowerFiles','0','If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo');
376
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UpdateTotalIssuesOnCirc','0','Whether to update the totalissues field in the biblio on each circ.',NULL,'YesNo');
376
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UpdateTotalIssuesOnCirc','0','Whether to update the totalissues field in the biblio on each circ.',NULL,'YesNo');
377
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetSlipPrinterJS','','Use this JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/','','Free');
377
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetSlipPrinterJS','','Use this JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/','','Free');
378
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES 
379
('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'), 
380
('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'), 
381
('PatronSelfRegistrationUseTemporaryStatus', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'), 
382
('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');
(-)a/installer/data/mysql/updatedatabase.pl (+25 lines)
Lines 5566-5571 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
5566
    SetVersion ($DBversion);
5566
    SetVersion ($DBversion);
5567
}
5567
}
5568
5568
5569
$DBversion = '3.09.00.XXX';
5570
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5571
    $dbh->do("
5572
        INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES 
5573
        ('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'), 
5574
        ('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'), 
5575
        ('PatronSelfRegistrationUseTemporaryStatus', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'), 
5576
        ('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');
5577
    ");
5578
    
5579
    $dbh->do("
5580
    INSERT INTO  letter ( `module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content` )
5581
    VALUES ( 'members', 'OPAC_REG_VERIFY', '', 'Opac Self-Registration Verification Email', '1', 'Verify Your Account', 'Hello!
5582
    
5583
    Your library account has been created. Please verify your email address by clicking this link to complete the signup process:
5584
    
5585
    http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
5586
    
5587
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.'
5588
    )");
5589
    
5590
    print "Upgrade to $DBversion done (Add Patron Self Registration)\n";
5591
    SetVersion ($DBversion);
5592
}
5593
5569
=head1 FUNCTIONS
5594
=head1 FUNCTIONS
5570
5595
5571
=head2 TableExists($table)
5596
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+36 lines)
Lines 504-506 OPAC: Link Here
504
                  yes: Use
504
                  yes: Use
505
                  no: "Don't use"
505
                  no: "Don't use"
506
            - "the item collection code when finding items for the shelf browser."      
506
            - "the item collection code when finding items for the shelf browser."      
507
508
    Self Registration:
509
        -
510
            - pref: PatronSelfRegistration
511
              choices:
512
                  yes: Allow
513
                  no: "Don't allow"
514
            - "library patrons to register an account via the OPAC."
515
        -
516
            - pref: PatronSelfRegistrationDetectDuplicates
517
              choices:
518
                  yes: Attempt
519
                  no: "Don't attempt"
520
            - "to detect if a self-registering patron already has an account."
521
        -
522
            - pref: PatronSelfRegistrationVerifyByEmail
523
              choices:
524
                  yes: Require
525
                  no: "Don't require"
526
            - "that a self-registering patron verify his or herself via email."
527
        -
528
            - pref: PatronSelfRegistrationPrintTemporaryCard
529
              choices:
530
                  yes: Allow
531
                  no: "Don't allow"
532
            - "a self-registring patron to print out a temporary library card."
533
        -
534
            - "Use the patron category code"
535
            - pref: PatronSelfRegistrationUseTemporaryStatus
536
              class: short
537
            - "as the default patron category for patrons registered via the OPAC."
538
        -
539
            - "Delete patrons registered via the OPAC, but not yet verified after"
540
            - pref: PatronSelfRegistrationExpireTemporaryAccountsDelay
541
              class: integer
542
            - "days."
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt (-1 / +10 lines)
Lines 122-130 Link Here
122
                        <span class="pending-number-link">[% pendingtags %]</span>
122
                        <span class="pending-number-link">[% pendingtags %]</span>
123
                    </div>
123
                    </div>
124
                    [% END %]
124
                    [% END %]
125
126
127
                    [% IF ( CAN_user_borrowers && pending_borrower_modifications )%]
128
                    <div class="pending-info">
129
                        <a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>:
130
                        <span class="pending-number-link">[% pending_borrower_modifications %]</span>
131
                    </div>
132
                    [% END %]
133
125
                </div>
134
                </div>
126
            [% END %]
127
135
136
            [% END %]
128
137
129
</div>
138
</div>
130
            [% IF ( IntranetmainUserblock ) %]
139
            [% 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-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 (+703 lines)
Line 0 Link Here
1
[% USE KohaDates %]
2
3
    [% INCLUDE 'doc-head-open.inc' %]
4
        [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your fines and charges
5
    [% INCLUDE 'doc-head-close.inc' %]
6
</head>
7
8
<body id="opac-account">
9
    <div id="doc3" class="yui-t1">
10
        <div id="bd">
11
            [% INCLUDE 'masthead.inc' %]
12
13
            <div id="yui-main">
14
                <div class="yui-b">
15
                    <div class="yui-g">
16
                        <div id="useraccount" class="container">
17
18
                            [% IF empty_mandatory_fields %]
19
                                <div class="error">You have not filled out all required fields. Please fill in all missing fields and resubmit.</div>
20
                            [% END %]
21
22
                            [% IF failed_captcha %]
23
                                <div class="error">You typed in the wrong characters in the box before submitting. Please try again.</div>
24
                            [% END %]
25
26
                            <form method="post">
27
28
                                [% UNLESS
29
                                    hidden.defined('branchcode')
30
                                %]
31
32
                                <fieldset class="rows" id="memberentry_library">
33
34
                                    <legend id="library_legend">Library</legend>
35
                                        <ol>
36
                                            [% UNLESS hidden.defined('branchcode') %]
37
                                                <li>
38
                                                    [% IF mandatory.defined('branchcode') %]
39
                                                        <label for="borrower_branchcode" class="required">
40
                                                    [% ELSE %]
41
                                                        <label for="borrower_branchcode">
42
                                                    [% END %]
43
                                                    Home Library:</label>
44
45
                                                    <select id="borrower_branchcode" name="borrower_branchcode">
46
                                                        [% FOREACH b IN branches %]
47
                                                            [% IF b.value == borrower.branchcode %]
48
                                                                <option value="[% b.value %]" selected="selected">[% b.branchname %]</option>
49
                                                            [% ELSE %]
50
                                                                <option value="[% b.value %]">[% b.branchname %]</option>
51
                                                            [% END %]
52
                                                        [% END %]
53
                                                    </select>
54
                                                </li>
55
                                            [% END %]   
56
                                        </ol>
57
                                    </fieldset>
58
                                [% END %]
59
60
                                [% UNLESS
61
                                    hidden.defined('title') && hidden.defined('surname') && hidden.defined('firstname') &&
62
                                    hidden.defined('dateofbirth') && hidden.defined('initials') && hidden.defined('othernames') &&
63
                                    hidden.defined('sex')
64
                                %]
65
                                    <fieldset class="rows" id="memberentry_identity">
66
                                        <legend id="identity_legend">Identity</legend>
67
68
                                        <ol>
69
                                            [% UNLESS hidden.defined('title') %]
70
                                                <li>
71
                                                    [% IF mandatory.defined('title') %]
72
                                                        <label for="borrower_title" class="required">
73
                                                    [% ELSE %]
74
                                                        <label for="borrower_title">
75
                                                    [% END %]
76
                                                    Salutation:</label>
77
78
                                                    <select id="borrower_title" name="borrower_title">
79
                                                        <option value="">&nbsp;</option>
80
                                                        [% FOREACH mt IN member_titles %]
81
                                                            [% IF mt == borrower.title %]
82
                                                                <option value="[% mt %]" selected="selected">[% mt %]</option>
83
                                                            [% ELSE %]
84
                                                                <option value="[% mt %]">[% mt %]</option>
85
                                                            [% END %]
86
                                                        [% END %]
87
                                                    </select>
88
                                                </li>
89
                                            [% END %]   
90
91
                                            [% UNLESS hidden.defined('surname') %]
92
                                                <li>
93
                                                    [% IF mandatory.defined('surname') %]
94
                                                        <label for="borrower_surname" class="required">
95
                                                    [% ELSE %]
96
                                                        <label for="borrower_surname">
97
                                                    [% END %]
98
                                                    Surname:</label>
99
100
                                                    <input type="text" id="borrower_surname" name="borrower_surname" value="[% borrower.surname %]" />
101
                                                    [% IF mandatory.defined('surname') %]<span class="required">Required</span>[% END %]
102
                                                </li>
103
                                            [% END %]
104
105
                                            [% UNLESS hidden.defined('firstname') %]
106
                                                <li>
107
                                                    [% IF mandatory.defined('firstname') %]
108
                                                        <label for="borrower_firstname" class="required">
109
                                                    [% ELSE %]
110
                                                        <label for="borrower_firstname">
111
                                                    [% END %]
112
                                                    First name:</label>
113
114
                                                    <input type="text" id="borrower_firstname" name="borrower_firstname" value="[% borrower.firstname %]" />
115
                                                    [% IF mandatory.defined('firstname') %]<span class="required">Required</span>[% END %]
116
                                                </li>
117
                                            [% END %]
118
119
                                            [% UNLESS hidden.defined('dateofbirth') %]
120
                                                <li>
121
                                                    [% IF mandatory.defined('dateofbirth') %]
122
                                                        <label for="borrower_dateofbirth" class="required">
123
                                                    [% ELSE %]
124
                                                        <label for="borrower_dateofbirth">
125
                                                    [% END %]
126
                                                    Date of birth:</label>
127
128
                                                    <input type="text" id="borrower_dateofbirth" name="borrower_dateofbirth" value="[% borrower.dateofbirth %]" />
129
                                                    [% IF mandatory.defined('dateofbirth') %]<span class="required">Required</span>[% END %]
130
                                                </li>
131
                                            [% END %]
132
133
                                            [% UNLESS hidden.defined('initials') %]
134
                                                <li>
135
                                                    [% IF mandatory.defined('initials') %]
136
                                                        <label for="borrower_initials" class="required">
137
                                                    [% ELSE %]
138
                                                        <label for="borrower_initials">
139
                                                    [% END %]
140
                                                    Initials:</label>
141
142
                                                    <input type="text" id="borrower_initials" name="borrower_initials" value="[% borrower.initials %]" />
143
                                                    [% IF mandatory.defined('initials') %]<span class="required">Required</span>[% END %]
144
                                                </li>
145
                                            [% END %]
146
147
                                            [% UNLESS hidden.defined('othernames') %]
148
                                                <li>
149
                                                    [% IF mandatory.defined('othernames') %]
150
                                                        <label for="borrower_othernames" class="required">
151
                                                    [% ELSE %]
152
                                                        <label for="borrower_othernames">
153
                                                    [% END %]
154
                                                    Other names:</label>
155
156
                                                    <input type="text" id="borrower_othernames" name="borrower_othernames" value="[% borrower.othernames %]" />
157
                                                    [% IF mandatory.defined('othernames') %]<span class="required">Required</span>[% END %]
158
                                                </li>
159
                                            [% END %]
160
161
                                            [% UNLESS hidden.defined('sex') %]
162
                                                <li class="radio">
163
                                                    <label for="sex-female">Female:</label>
164
                                                    [% IF borrower.sex == 'F' %]
165
                                                        <input type="radio" name="borrower_sex" id="sex-female" value="F" checked="checked" />
166
                                                    [% ELSE %]
167
                                                        <input type="radio" name="borrower_sex" id="sex-female" value="F" />
168
                                                    [% END %]
169
170
                                                    <label for="sex-male">Male:</label>
171
                                                    [% IF borrower.sex == 'M' %]
172
                                                        <input type="radio" name="borrower_sex" id="sex-male" value="M" checked="checked" />
173
                                                    [% ELSE %]
174
                                                        <input type="radio" name="borrower_sex" id="sex-male" value="M" />
175
                                                    [% END %]
176
177
                                                    <label for="sex-none">N/A:</label>
178
                                                    [% IF borrower.sex == '' %]
179
                                                        <input type="radio" name="borrower_sex" id="sex-none" value="" checked="checked" />
180
                                                    [% ELSE %]
181
                                                        <input type="radio" name="borrower_sex" id="sex-none" value="" />
182
                                                    [% END %]
183
184
                                                    [% IF mandatory.defined('sex') %]<span class="required">Required</span>[% END %]
185
                                                </li>
186
                                            [% END %]
187
                                        </ol>
188
                                    </fieldset>
189
                                [% END %]
190
191
                                [% UNLESS
192
                                    hidden.defined('streetnumber') && hidden.defined('address') && hidden.defined('address2') &&
193
                                    hidden.defined('city') && hidden.defined('state') && hidden.defined('zipcode') &&
194
                                    hidden.defined('country')
195
                                %]
196
                                    <fieldset class="rows" id="memberentry_mainaddress">
197
                                        <legend id="mainaddress_legend">Main address</legend>
198
199
                                        <ol>
200
                                            [% UNLESS hidden.defined('streetnumber') %]
201
                                                <li>
202
                                                    [% IF mandatory.defined('streetnumber') %]
203
                                                        <label for="borrower_streetnumber" class="required">
204
                                                    [% ELSE %]
205
                                                        <label for="borrower_streetnumber">
206
                                                    [% END %]
207
                                                    Street number:</label>
208
209
                                                    <input type="text" id="borrower_streetnumber" name="borrower_streetnumber" value="[% borrower.streetnumber %]" />
210
                                                    [% IF mandatory.defined('streetnumber') %]<span class="required">Required</span>[% END %]
211
                                                </li>
212
                                            [% END %]
213
214
                                            [% UNLESS hidden.defined('address') %]
215
                                                <li>
216
                                                    [% IF mandatory.defined('address') %]
217
                                                        <label for="borrower_address" class="required">
218
                                                    [% ELSE %]
219
                                                        <label for="borrower_address">
220
                                                    [% END %]
221
                                                    Address:</label>
222
223
                                                    <input type="text" id="borrower_address" name="borrower_address" value="[% borrower.address %]" />
224
                                                    [% IF mandatory.defined('address') %]<span class="required">Required</span>[% END %]
225
                                                </li>
226
                                            [% END %]
227
228
                                            [% UNLESS hidden.defined('address2') %]
229
                                                <li>
230
                                                    [% IF mandatory.defined('address2') %]
231
                                                        <label for="borrower_address2" class="required">
232
                                                    [% ELSE %]
233
                                                        <label for="borrower_address2">
234
                                                    [% END %]
235
                                                    Address 2:</label>
236
237
                                                    <input type="text" id="borrower_address2" name="borrower_address2" value="[% borrower.address2 %]" />
238
                                                    [% IF mandatory.defined('address2') %]<span class="required">Required</span>[% END %]
239
                                                </li>
240
                                            [% END %]
241
242
                                            [% UNLESS hidden.defined('city') %]
243
                                                <li>
244
                                                    [% IF mandatory.defined('city') %]
245
                                                        <label for="borrower_city" class="required">
246
                                                    [% ELSE %]
247
                                                        <label for="borrower_city">
248
                                                    [% END %]
249
                                                    City:</label>
250
251
                                                    <input type="text" id="borrower_city" name="borrower_city" value="[% borrower.city %]" />
252
                                                    [% IF mandatory.defined('city') %]<span class="required">Required</span>[% END %]
253
                                                </li>
254
                                            [% END %]
255
256
                                            [% UNLESS hidden.defined('state') %]
257
                                                <li>
258
                                                    [% IF mandatory.defined('state') %]
259
                                                        <label for="borrower_state" class="required">
260
                                                    [% ELSE %]
261
                                                        <label for="borrower_state">
262
                                                    [% END %]
263
                                                    State:</label>
264
265
                                                    <input type="text" id="borrower_state" name="borrower_state" value="[% borrower.state %]" />
266
                                                    [% IF mandatory.defined('state') %]<span class="required">Required</span>[% END %]
267
                                                </li>
268
                                            [% END %]
269
270
                                            [% UNLESS hidden.defined('zipcode') %]
271
                                                <li>
272
                                                    [% IF mandatory.defined('zipcode') %]
273
                                                        <label for="borrower_zipcode" class="required">
274
                                                    [% ELSE %]
275
                                                        <label for="borrower_zipcode">
276
                                                    [% END %]
277
                                                    Zip/Postal code:</label>
278
279
                                                    <input type="text" id="borrower_zipcode" name="borrower_zipcode" value="[% borrower.zipcode %]" />
280
                                                    [% IF mandatory.defined('zipcode') %]<span class="required">Required</span>[% END %]
281
                                                </li>
282
                                            [% END %]
283
284
                                            [% UNLESS hidden.defined('country') %]
285
                                                <li>
286
                                                    [% IF mandatory.defined('country') %]
287
                                                        <label for="borrower_country" class="required">
288
                                                    [% ELSE %]
289
                                                        <label for="borrower_country">
290
                                                    [% END %]
291
                                                    Country:</label>
292
293
                                                    <input type="text" id="borrower_country" name="borrower_country" value="[% borrower.country %]" />
294
                                                    [% IF mandatory.defined('country') %]<span class="required">Required</span>[% END %]
295
                                                </li>
296
                                            [% END %]
297
298
                                        </ol>
299
                                    </fieldset>
300
                                [% END %]
301
302
                                [% UNLESS
303
                                    hidden.defined('phone') && hidden.defined('phonepro') && hidden.defined('mobile') &&
304
                                    hidden.defined('email') && hidden.defined('emailpro') && hidden.defined('fax')
305
                                %]
306
                                    <fieldset class="rows" id="memberentry_contact">
307
                                        <legend id="contact_legend">Contact information</legend>
308
309
                                        <ol>
310
                                            [% UNLESS hidden.defined('phone') %]
311
                                                <li>
312
                                                    [% IF mandatory.defined('phone') %]
313
                                                        <label for="borrower_phone" class="required">
314
                                                    [% ELSE %]
315
                                                        <label for="borrower_phone">
316
                                                    [% END %]
317
                                                    Primary phone:</label>
318
319
                                                    <input type="text" id="borrower_phone" name="borrower_phone" value="[% borrower.phone %]" />
320
                                                    [% IF mandatory.defined('phone') %]<span class="required">Required</span>[% END %]
321
                                                </li>
322
                                            [% END %]
323
324
                                            [% UNLESS hidden.defined('phonepro') %]
325
                                                <li>
326
                                                    [% IF mandatory.defined('phonepro') %]
327
                                                        <label for="borrower_phonepro" class="required">
328
                                                    [% ELSE %]
329
                                                        <label for="borrower_phonepro">
330
                                                    [% END %]
331
                                                    Secondary phone:</label>
332
333
                                                    <input type="text" id="borrower_phonepro" name="borrower_phonepro" value="[% borrower.phonepro %]" />
334
                                                    [% IF mandatory.defined('phonepro') %]<span class="required">Required</span>[% END %]
335
                                                </li>
336
                                            [% END %]
337
338
                                            [% UNLESS hidden.defined('mobile') %]
339
                                                <li>
340
                                                    [% IF mandatory.defined('mobile') %]
341
                                                        <label for="borrower_mobile" class="required">
342
                                                    [% ELSE %]
343
                                                        <label for="borrower_mobile">
344
                                                    [% END %]
345
                                                    Mobile phone:</label>
346
347
                                                    <input type="text" id="borrower_mobile" name="borrower_mobile" value="[% borrower.mobile %]" />
348
                                                    [% IF mandatory.defined('mobile') %]<span class="required">Required</span>[% END %]
349
                                                </li>
350
                                            [% END %]
351
352
                                            [% UNLESS hidden.defined('email') %]
353
                                                <li>
354
                                                    [% IF mandatory.defined('email') %]
355
                                                        <label for="borrower_email" class="required">
356
                                                    [% ELSE %]
357
                                                        <label for="borrower_email">
358
                                                    [% END %]
359
                                                    Primary email:</label>
360
361
                                                    <input type="text" id="borrower_email" name="borrower_email" value="[% borrower.email %]" />
362
                                                    [% IF mandatory.defined('email') %]<span class="required">Required</span>[% END %]
363
                                                </li>
364
                                            [% END %]
365
366
                                            [% UNLESS hidden.defined('emailpro') %]
367
                                                <li>
368
                                                    [% IF mandatory.defined('emailpro') %]
369
                                                        <label for="borrower_emailpro" class="required">
370
                                                    [% ELSE %]
371
                                                        <label for="borrower_emailpro">
372
                                                    [% END %]
373
                                                    Secondary email:</label>
374
375
                                                    <input type="text" id="borrower_emailpro" name="borrower_emailpro" value="[% borrower.emailpro %]" />
376
                                                    [% IF mandatory.defined('emailpro') %]<span class="required">Required</span>[% END %]
377
                                                </li>
378
                                            [% END %]
379
380
                                            [% UNLESS hidden.defined('fax') %]
381
                                                <li>
382
                                                    [% IF mandatory.defined('fax') %]
383
                                                        <label for="borrower_fax" class="required">
384
                                                    [% ELSE %]
385
                                                        <label for="borrower_fax">
386
                                                    [% END %]
387
                                                    Fax:</label>
388
389
                                                    <input type="text" id="borrower_fax" name="borrower_fax" value="[% borrower.fax %]" />
390
                                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
391
                                                </li>
392
                                            [% END %]
393
                                        </ol>
394
                                    </fieldset>
395
                                [% END %]
396
397
                                [% UNLESS
398
                                    hidden.defined('B_address') && hidden.defined('B_address2') && hidden.defined('B_city') &&
399
                                    hidden.defined('B_state') && hidden.defined('B_zipcode') && hidden.defined('B_county') &&
400
                                    hidden.defined('B_phone') && hidden.defined('B_email') && hidden.defined('contactnote')
401
                                %]
402
                                    <fieldset class="rows" id="memberentry_alternateaddress">
403
                                        <legend id="alternateaddress_legend">Alternate address</legend>
404
405
                                        <ol>
406
                                            [% UNLESS hidden.defined('B_address') %]
407
                                                <li>
408
                                                    [% IF mandatory.defined('B_address') %]
409
                                                        <label for="borrower_B_address" class="required">
410
                                                    [% ELSE %]
411
                                                        <label for="borrower_B_address">
412
                                                    [% END %]
413
                                                    Address:</label>
414
415
                                                    <input type="text" id="borrower_B_address" name="borrower_B_address" value="[% borrower.B_address %]" />
416
                                                    [% IF mandatory.defined('B_address') %]<span class="required">Required</span>[% END %]
417
                                                </li>
418
                                            [% END %]
419
420
                                            [% UNLESS hidden.defined('B_address2') %]
421
                                                <li>
422
                                                    [% IF mandatory.defined('B_address2') %]
423
                                                        <label for="borrower_B_address2" class="required">
424
                                                    [% ELSE %]
425
                                                        <label for="borrower_B_address2">
426
                                                    [% END %]
427
                                                    Address 2:</label>
428
429
                                                    <input type="text" id="borrower_B_address2" name="borrower_B_address2" value="[% borrower.B_address2 %]" />
430
                                                    [% IF mandatory.defined('B_address2') %]<span class="required">Required</span>[% END %]
431
                                                </li>
432
                                            [% END %]
433
434
                                            [% UNLESS hidden.defined('B_city') %]
435
                                                <li>
436
                                                    [% IF mandatory.defined('B_city') %]
437
                                                        <label for="borrower_B_city" class="required">
438
                                                    [% ELSE %]
439
                                                        <label for="borrower_B_city">
440
                                                    [% END %]
441
                                                    City:</label>
442
443
                                                    <input type="text" id="borrower_B_city" name="borrower_B_city" value="[% borrower.B_city %]" />
444
                                                    [% IF mandatory.defined('B_city') %]<span class="required">Required</span>[% END %]
445
                                                </li>
446
                                            [% END %]
447
448
                                            [% UNLESS hidden.defined('B_state') %]
449
                                                <li>
450
                                                    [% IF mandatory.defined('B_state') %]
451
                                                        <label for="borrower_B_state" class="required">
452
                                                    [% ELSE %]
453
                                                        <label for="borrower_B_state">
454
                                                    [% END %]
455
                                                    State:</label>
456
457
                                                    <input type="text" id="borrower_B_state" name="borrower_B_state" value="[% borrower.B_state %]" />
458
                                                    [% IF mandatory.defined('B_state') %]<span class="required">Required</span>[% END %]
459
                                                </li>
460
                                            [% END %]
461
462
                                            [% UNLESS hidden.defined('B_zipcode') %]
463
                                                <li>
464
                                                    [% IF mandatory.defined('B_zipcode') %]
465
                                                        <label for="borrower_B_zipcode" class="required">
466
                                                    [% ELSE %]
467
                                                        <label for="borrower_B_zipcode">
468
                                                    [% END %]
469
                                                    Zip/Postal code:</label>
470
471
                                                    <input type="text" id="borrower_B_zipcode" name="borrower_B_zipcode" value="[% borrower.B_zipcode %]" />
472
                                                    [% IF mandatory.defined('B_zipcode') %]<span class="required">Required</span>[% END %]
473
                                                </li>
474
                                            [% END %]
475
476
                                            [% UNLESS hidden.defined('B_country') %]
477
                                                <li>
478
                                                    [% IF mandatory.defined('B_country') %]
479
                                                        <label for="borrower_B_country" class="required">
480
                                                    [% ELSE %]
481
                                                        <label for="borrower_B_country">
482
                                                    [% END %]
483
                                                    Country:</label>
484
485
                                                    <input type="text" id="borrower_B_country" name="borrower_B_country" value="[% borrower.B_country %]" />
486
                                                    [% IF mandatory.defined('B_country') %]<span class="required">Required</span>[% END %]
487
                                                </li>
488
                                            [% END %]
489
490
                                            [% UNLESS hidden.defined('B_phone') %]
491
                                                <li>
492
                                                    [% IF mandatory.defined('B_phone') %]
493
                                                        <label for="borrower_B_phone" class="required">
494
                                                    [% ELSE %]
495
                                                        <label for="borrower_B_phone">
496
                                                    [% END %]
497
                                                    Phone:</label>
498
499
                                                    <input type="text" id="borrower_B_phone" name="borrower_B_phone" value="[% borrower.B_phone %]" />
500
                                                    [% IF mandatory.defined('B_phone') %]<span class="required">Required</span>[% END %]
501
                                                </li>
502
                                            [% END %]
503
504
                                            [% UNLESS hidden.defined('B_email') %]
505
                                                <li>
506
                                                    [% IF mandatory.defined('B_email') %]
507
                                                        <label for="borrower_B_email" class="required">
508
                                                    [% ELSE %]
509
                                                        <label for="borrower_B_email">
510
                                                    [% END %]
511
                                                    Email:</label>
512
513
                                                    <input type="text" id="borrower_B_email" name="borrower_B_email" value="[% borrower.B_email %]" />
514
                                                    [% IF mandatory.defined('B_email') %]<span class="required">Required</span>[% END %]
515
                                                </li>
516
                                            [% END %]
517
518
                                            [% UNLESS hidden.defined('contactnote') %]
519
                                                <li>
520
                                                    [% IF mandatory.defined('contactnote') %]
521
                                                        <label for="borrower_contactnote" class="required">
522
                                                    [% ELSE %]
523
                                                        <label for="borrower_contactnote">
524
                                                    [% END %]
525
                                                    Contact Note:</label>
526
527
                                                    <textarea id="borrower_contactnote" name="borrower_contactnote" cols="40" rows="2">[% borrower.contactnote %]</textarea>
528
                                                    [% IF mandatory.defined('contactnote') %]<span class="required">Required</span>[% END %]
529
                                                </li>
530
                                            [% END %]
531
532
                                        </ol>
533
                                    </fieldset>
534
                                [% END %]
535
536
                                [% UNLESS
537
                                    hidden.defined('altcontactsurname') && hidden.defined('altcontactfirstname') && hidden.defined('altcontactaddress1') &&
538
                                    hidden.defined('altcontactaddress2') && hidden.defined('altcontactaddress3') && hidden.defined('altcontactstate') &&
539
                                    hidden.defined('altcontactzipcode') && hidden.defined('altcontactcountry') && hidden.defined('altcontactphone')
540
                                %]
541
                                    <fieldset class="rows" id="memberentry_alternatecontact">
542
                                        <legend id="alternatecontact_legend">Alternate contact</legend>
543
544
                                        <ol>
545
                                            [% UNLESS hidden.defined('altcontactsurname') %]
546
                                                <li>
547
                                                    [% IF mandatory.defined('altcontactsurname') %]
548
                                                        <label for="borrower_altcontactsurname" class="required">
549
                                                    [% ELSE %]
550
                                                        <label for="borrower_altcontactsurname">
551
                                                    [% END %]
552
                                                    Surname:</label>
553
554
                                                    <input type="text" id="borrower_altcontactsurname" name="borrower_altcontactsurname" value="[% borrower.altcontactsurname %]" />
555
                                                    [% IF mandatory.defined('altcontactsurname') %]<span class="required">Required</span>[% END %]
556
                                                </li>
557
                                            [% END %]
558
559
                                            [% UNLESS hidden.defined('altcontactfirstname') %]
560
                                                <li>
561
                                                    [% IF mandatory.defined('altcontactfirstname') %]
562
                                                        <label for="borrower_altcontactfirstname" class="required">
563
                                                    [% ELSE %]
564
                                                        <label for="borrower_altcontactfirstname">
565
                                                    [% END %]
566
                                                    First name:</label>
567
568
                                                    <input type="text" id="borrower_altcontactfirstname" name="borrower_altcontactfirstname" value="[% borrower.altcontactfirstname %]" />
569
                                                    [% IF mandatory.defined('altcontactfirstname') %]<span class="required">Required</span>[% END %]
570
                                                </li>
571
                                            [% END %]
572
573
                                            [% UNLESS hidden.defined('altcontactaddress1') %]
574
                                                <li>
575
                                                    [% IF mandatory.defined('altcontactaddress1') %]
576
                                                        <label for="borrower_altcontactaddress1" class="required">
577
                                                    [% ELSE %]
578
                                                        <label for="borrower_altcontactaddress1">
579
                                                    [% END %]
580
                                                    Address:</label>
581
582
                                                    <input type="text" id="borrower_altcontactaddress1" name="borrower_altcontactaddress1" value="[% borrower.altcontactaddress1 %]" />
583
                                                    [% IF mandatory.defined('altcontactaddress1') %]<span class="required">Required</span>[% END %]
584
                                                </li>
585
                                            [% END %]
586
587
                                            [% UNLESS hidden.defined('altcontactaddress2') %]
588
                                                <li>
589
                                                    [% IF mandatory.defined('altcontactaddress2') %]
590
                                                        <label for="borrower_altcontactaddress2" class="required">
591
                                                    [% ELSE %]
592
                                                        <label for="borrower_altcontactaddress2">
593
                                                    [% END %]
594
                                                    Address 2:</label>
595
596
                                                    <input type="text" id="borrower_altcontactaddress2" name="borrower_altcontactaddress2" value="[% borrower.altcontactaddress2 %]" />
597
                                                    [% IF mandatory.defined('altcontactaddress2') %]<span class="required">Required</span>[% END %]
598
                                                </li>
599
                                            [% END %]
600
601
                                            [% UNLESS hidden.defined('altcontactaddress3') %]
602
                                                <li>
603
                                                    [% IF mandatory.defined('altcontactaddress3') %]
604
                                                        <label for="borrower_altcontactaddress3" class="required">
605
                                                    [% ELSE %]
606
                                                        <label for="borrower_altcontactaddress3">
607
                                                    [% END %]
608
                                                    City:</label>
609
610
                                                    <input type="text" id="borrower_altcontactaddress3" name="borrower_altcontactaddress3" value="[% borrower.altcontactaddress3 %]" />
611
                                                    [% IF mandatory.defined('altcontactaddress3') %]<span class="required">Required</span>[% END %]
612
                                                </li>
613
                                            [% END %]
614
615
                                            [% UNLESS hidden.defined('altcontactstate') %]
616
                                                <li>
617
                                                    [% IF mandatory.defined('altcontactstate') %]
618
                                                        <label for="borrower_altcontactstate" class="required">
619
                                                    [% ELSE %]
620
                                                        <label for="borrower_altcontactstate">
621
                                                    [% END %]
622
                                                    State:</label>
623
624
                                                    <input type="text" id="borrower_altcontactstate" name="borrower_altcontactstate" value="[% borrower.altcontactstate %]" />
625
                                                    [% IF mandatory.defined('altcontactstate') %]<span class="required">Required</span>[% END %]
626
                                                </li>
627
                                            [% END %]
628
629
                                            [% UNLESS hidden.defined('altcontactzipcode') %]
630
                                                <li>
631
                                                    [% IF mandatory.defined('altcontactzipcode') %]
632
                                                        <label for="borrower_altcontactzipcode" class="required">
633
                                                    [% ELSE %]
634
                                                        <label for="borrower_altcontactzipcode">
635
                                                    [% END %]
636
                                                    Zip/Postal code:</label>
637
638
                                                    <input type="text" id="borrower_altcontactzipcode" name="borrower_altcontactzipcode" value="[% borrower.altcontactzipcode %]" />
639
                                                    [% IF mandatory.defined('altcontactzipcode') %]<span class="required">Required</span>[% END %]
640
                                                </li>
641
                                            [% END %]
642
643
                                            [% UNLESS hidden.defined('altcontactcountry') %]
644
                                                <li>
645
                                                    [% IF mandatory.defined('altcontactcountry') %]
646
                                                        <label for="borrower_altcontactcountry" class="required">
647
                                                    [% ELSE %]
648
                                                        <label for="borrower_altcontactcountry">
649
                                                    [% END %]
650
                                                    Country:</label>
651
652
                                                    <input type="text" id="borrower_altcontactcountry" name="borrower_altcontactcountry" value="[% borrower.altcontactcountry %]" />
653
                                                    [% IF mandatory.defined('altcontactcountry') %]<span class="required">Required</span>[% END %]
654
                                                </li>
655
                                            [% END %]
656
657
                                            [% UNLESS hidden.defined('altcontactphone') %]
658
                                                <li>
659
                                                    [% IF mandatory.defined('altcontactphone') %]
660
                                                        <label for="borrower_altcontactphone" class="required">
661
                                                    [% ELSE %]
662
                                                        <label for="borrower_altcontactphone">
663
                                                    [% END %]
664
                                                    Phone:</label>
665
666
                                                    <input type="text" id="borrower_altcontactphone" name="borrower_altcontactphone" value="[% borrower.altcontactphone %]" />
667
                                                    [% IF mandatory.defined('altcontactphone') %]<span class="required">Required</span>[% END %]
668
                                                </li>
669
                                            [% END %]
670
                                        </ol>
671
                                    </fieldset>
672
                                [% END %]
673
674
                                [% UNLESS action == 'edit' %]
675
                                    <p>Please type this following characters into the box below : [% captcha %]</p>
676
                                    <p>
677
                                        <input type="text" name="captcha" id="captcha" />
678
                                        <input type="hidden" name="captcha_digest" value="[% captcha_digest %]" />
679
                                    </p>
680
                                [% END %]
681
682
                                [% IF action == 'edit' %]
683
                                    <input type="hidden" name="action" value="update" />
684
                                    <input type="submit" value="Submit Update Request" />
685
                                [% ELSE %]
686
                                    <input type="hidden" name="action" value="create" />
687
                                    <input type="submit" value="Submit" />
688
                                [% END %]
689
690
                            </form>
691
692
                        </div><!--/div id="useraccount" -->
693
                    </div>
694
                </div>
695
            </div>
696
697
            <div class="yui-b">
698
                <div id="leftmenus" class="container">
699
                    [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
700
                </div>
701
            </div>
702
        </div>
703
[% 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 and change your password.</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 (+55 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 strict;
21
#use warnings; FIXME - Bug 2505
22
23
BEGIN {
24
25
    # find Koha's Perl modules
26
    # test carefully before changing this
27
    use FindBin;
28
    eval { require "$FindBin::Bin/../kohalib.pl" };
29
}
30
31
use C4::Context;
32
use C4::Members qw/ DelMember /;
33
34
## Delete accounts that haven't been upgraded from the 'temporary' category code'
35
my $delay =
36
  C4::Context->preference('PatronSelfRegistrationExpireTemporaryAccountsDelay');
37
my $category_code =
38
  C4::Context->preference('PatronSelfRegistrationUseTemporaryStatus');
39
40
my $query = "
41
    SELECT borrowernumber 
42
    FROM borrowers 
43
    WHERE
44
        categorycode = ? 
45
      AND 
46
        DATEDIFF( DATE( NOW() ), DATE(dateenrolled) ) = ? )
47
";
48
49
my $dbh = C4::Context->dbh;
50
my $sth = $dbh->prepare($query);
51
$sth->execute( $category_code, $delay );
52
53
while ( my ($borrowernumber) = $sth->fetchrow_array() ) {
54
    DelMember($borrowernumber);
55
}
(-)a/misc/cronjobs/delete_unverified_opac_registrations.pl (+49 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 strict;
21
#use warnings; FIXME - Bug 2505
22
23
BEGIN {
24
25
    # find Koha's Perl modules
26
    # test carefully before changing this
27
    use FindBin;
28
    eval { require "$FindBin::Bin/../kohalib.pl" };
29
}
30
31
use C4::Context;
32
use C4::Members qw/ DelMember /;
33
34
## Delete accounts that haven't been upgraded from the 'temporary' category code'
35
my $delay =
36
  C4::Context->preference('PatronSelfRegistrationExpireTemporaryAccountsDelay');
37
38
my $query = "
39
    SELECT borrowernumber 
40
    FROM borrowers 
41
    WHERE
42
        categorycode = ? 
43
      AND 
44
        DATEDIFF( DATE( NOW() ), DATE(dateenrolled) ) = ? )
45
";
46
47
my $dbh = C4::Context->dbh;
48
49
$dbh->do("DELETE FROM borrower_modifications b WHERE b.borrowernumber = 0 AND TIME_TO_SEC( TIMEDIFF( NOW(), b.timestamp )) / 3600 > 24");
(-)a/opac/opac-memberentry.pl (+232 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( verification_token => $verification_token )->AddModifications(%borrower);
95
96
            #Send verification email
97
            my $letter = C4::Letters::GetPreparedLetter(
98
                module      => 'members',
99
                letter_code => 'OPAC_REG_VERIFY',
100
                tables      => {
101
                    borrower_modifications =>
102
                      [ $verification_token, $verification_token ],
103
                },
104
            );
105
106
            C4::Letters::EnqueueLetter(
107
                {
108
                    letter                 => $letter,
109
                    message_transport_type => 'email',
110
                    to_address             => $borrower{'email'},
111
                    from_address =>
112
                      C4::Context->preference('KohaAdminEmailAddress'),
113
                }
114
            );
115
        }
116
        else {
117
            ( $template, $borrowernumber, $cookie ) = get_template_and_user(
118
                {
119
                    template_name   => "opac-registration-confirmation.tmpl",
120
                    type            => "opac",
121
                    query           => $cgi,
122
                    authnotrequired => 1,
123
                }
124
            );
125
126
            my ( $borrowernumber, $password ) = AddMember_Opac(%borrower);
127
128
            $template->param( password_cleartext => $password );
129
            $template->param(
130
                borrower => GetMember( borrowernumber => $borrowernumber ) );
131
            $template->param(
132
                PatronSelfRegistrationAdditionalInstructions =>
133
                  C4::Context->preference(
134
                    'PatronSelfRegistrationAdditionalInstructions')
135
            );
136
        }
137
    }
138
}
139
elsif ( $action eq 'update' ) {
140
    ( $template, $borrowernumber, $cookie ) = get_template_and_user(
141
        {
142
            template_name   => "opac-memberentry-update-submitted.tmpl",
143
            type            => "opac",
144
            query           => $cgi,
145
            authnotrequired => 1,
146
        }
147
    );
148
149
    my %borrower = ParseCgiForBorrower($cgi);
150
151
    Koha::Borrower::Modifications->new( borrowernumber => $borrowernumber )->AddModifications(%borrower);
152
}
153
elsif ($borrowernumber) {    #Display logged in borrower's data
154
    $action = 'edit';
155
156
    $template->param(
157
        borrower => GetMember( borrowernumber => $borrowernumber ) );
158
}
159
160
my $captcha = random_string("CCCCC");
161
162
$template->param(
163
    captcha        => $captcha,
164
    captcha_digest => md5_base64($captcha)
165
);
166
167
$template->param( action => $action );
168
169
output_html_with_http_headers $cgi, $cookie, $template->output;
170
171
sub GetHiddenFields {
172
    my %hidden_fields;
173
174
    my $BorrowerUnwantedField =
175
      C4::Context->preference("BorrowerUnwantedField");
176
177
    my @fields = split( /\|/, $BorrowerUnwantedField );
178
    foreach (@fields) {
179
        next unless m/\w/o;
180
        $hidden_fields{$_} = 1;
181
    }
182
183
    return \%hidden_fields;
184
}
185
186
sub GetMandatoryFields {
187
    my %mandatory_fields;
188
189
    my $BorrowerMandatoryField =
190
      C4::Context->preference("BorrowerMandatoryField");
191
192
    my @fields = split( /\|/, $BorrowerMandatoryField );
193
194
    foreach (@fields) {
195
        $mandatory_fields{$_} = 1;
196
    }
197
198
    $mandatory_fields{'email'} = 1
199
      if C4::Context->boolean_preference('PatronSelfRegistrationVerifyByEmail');
200
201
    return \%mandatory_fields;
202
}
203
204
sub CheckMandatoryFields {
205
    my ($borrower) = @_;
206
207
    my @empty_mandatory_fields;
208
209
    my $mandatory_fields = GetMandatoryFields();
210
    delete $mandatory_fields->{'cardnumber'};
211
212
    foreach my $key ( keys %$mandatory_fields ) {
213
        push( @empty_mandatory_fields, $key )
214
          unless ( defined( $borrower->{$key} ) && $borrower->{$key} );
215
    }
216
217
    return @empty_mandatory_fields;
218
}
219
220
sub ParseCgiForBorrower {
221
    my ($cgi) = @_;
222
223
    my %borrower;
224
225
    foreach ( $cgi->param ) {
226
        my ($key) = substr( $_, 9 );
227
        $borrower{$key} = $cgi->param($_)
228
          if ( $_ =~ '^borrower_' && $cgi->param($_) );
229
    }
230
231
    return %borrower;
232
}
(-)a/opac/opac-registration-verify.pl (-1 / +68 lines)
Line 0 Link Here
0
- 
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
( $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
my $token = $cgi->param('token');
45
my $m = Koha::Borrower::Modifications->new( verification_token => token );
46
47
if ( $m->Verify() ) {
48
49
    my $password;
50
    ( $borrowernumber, $password ) = AddMember_Opac(%borrower);
51
52
    $m->Delete();
53
54
    $template->param( password_cleartext => $password );
55
    $template->param(
56
        borrower => GetMember( borrowernumber => $borrowernumber ) );
57
    $template->param(
58
        PatronSelfRegistrationAdditionalInstructions => C4::Context->preference(
59
            'PatronSelfRegistrationAdditionalInstructions')
60
    );
61
62
}
63
else {
64
65
}
66
67
output_html_with_http_headers $cgi, $cookie, $template->output;
68

Return to bug 7067