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

(-)a/C4/Auth.pm (+2 lines)
Lines 458-463 sub get_template_and_user { Link Here
458
            SyndeticsCoverImageSize      => C4::Context->preference("SyndeticsCoverImageSize"),
458
            SyndeticsCoverImageSize      => C4::Context->preference("SyndeticsCoverImageSize"),
459
            OPACLocalCoverImages         => C4::Context->preference("OPACLocalCoverImages"),
459
            OPACLocalCoverImages         => C4::Context->preference("OPACLocalCoverImages"),
460
            PatronSelfRegistration       => C4::Context->preference("PatronSelfRegistration"),
460
            PatronSelfRegistration       => C4::Context->preference("PatronSelfRegistration"),
461
            PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"),
461
        );
462
        );
462
463
463
        $template->param(OpacPublic => '1') if ($user || C4::Context->preference("OpacPublic"));
464
        $template->param(OpacPublic => '1') if ($user || C4::Context->preference("OpacPublic"));
Lines 969-974 sub checkauth { Link Here
969
        AutoLocation       => C4::Context->preference("AutoLocation"),
970
        AutoLocation       => C4::Context->preference("AutoLocation"),
970
        wrongip            => $info{'wrongip'},
971
        wrongip            => $info{'wrongip'},
971
	PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"),
972
	PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"),
973
	PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"),
972
    );
974
    );
973
975
974
    $template->param( OpacPublic => C4::Context->preference("OpacPublic"));
976
    $template->param( OpacPublic => C4::Context->preference("OpacPublic"));
(-)a/C4/Members.pm (-5 / +6 lines)
Lines 757-766 sub AddMember { Link Here
757
    # generate a proper login if none provided
757
    # generate a proper login if none provided
758
    $data{'userid'} = Generate_Userid($data{'borrowernumber'}, $data{'firstname'}, $data{'surname'}) if $data{'userid'} eq '';
758
    $data{'userid'} = Generate_Userid($data{'borrowernumber'}, $data{'firstname'}, $data{'surname'}) if $data{'userid'} eq '';
759
759
760
    # create a disabled account if no password provided
761
    $data{'password'} = ($data{'password'})? md5_base64($data{'password'}) : '!';
762
    $data{'borrowernumber'}=InsertInTable("borrowers",\%data);
763
764
    # add expiration date if it isn't already there
760
    # add expiration date if it isn't already there
765
    unless ( $data{'dateexpiry'} ) {
761
    unless ( $data{'dateexpiry'} ) {
766
        $data{'dateexpiry'} = GetExpiryDate( $data{'categorycode'}, C4::Dates->new()->output("iso") );
762
        $data{'dateexpiry'} = GetExpiryDate( $data{'categorycode'}, C4::Dates->new()->output("iso") );
Lines 771-776 sub AddMember { Link Here
771
        $data{'dateenrolled'} = C4::Dates->new()->output("iso");
767
        $data{'dateenrolled'} = C4::Dates->new()->output("iso");
772
    }
768
    }
773
769
770
    # create a disabled account if no password provided
771
    $data{'password'} = ($data{'password'})? md5_base64($data{'password'}) : '!';
772
    $data{'borrowernumber'}=InsertInTable("borrowers",\%data);
773
774
774
    # mysql_insertid is probably bad.  not necessarily accurate and mysql-specific at best.
775
    # mysql_insertid is probably bad.  not necessarily accurate and mysql-specific at best.
775
    logaction("MEMBERS", "CREATE", $data{'borrowernumber'}, "") if C4::Context->preference("BorrowersLog");
776
    logaction("MEMBERS", "CREATE", $data{'borrowernumber'}, "") if C4::Context->preference("BorrowersLog");
776
    
777
    
Lines 2383-2389 sub GetBorrowersWithEmail { Link Here
2383
sub AddMember_Opac {
2384
sub AddMember_Opac {
2384
    my ( %borrower ) = @_;
2385
    my ( %borrower ) = @_;
2385
2386
2386
    $borrower{'categorycode'} = C4::Context->preference('PatronSelfRegistrationUseTemporaryStatus');
2387
    $borrower{'categorycode'} = C4::Context->preference('PatronSelfRegistrationDefaultCategory');
2387
2388
2388
    my $sr = new String::Random;
2389
    my $sr = new String::Random;
2389
    $sr->{'A'} = [ 'A'..'Z', 'a'..'z' ];
2390
    $sr->{'A'} = [ 'A'..'Z', 'a'..'z' ];
(-)a/Koha/Borrower/Modifications.pm (-9 / +23 lines)
Lines 144-160 Returns the number of pending modifications for existing borrowers. Link Here
144
=cut
144
=cut
145
145
146
sub GetPendingModificationsCount {
146
sub GetPendingModificationsCount {
147
    my ($self) = @_;
147
    my ( $self, $branchcode ) = @_;
148
148
149
    my $dbh   = C4::Context->dbh;
149
    my $dbh   = C4::Context->dbh;
150
    my $query = "
150
    my $query = "
151
        SELECT COUNT(*) AS count
151
        SELECT COUNT(*) AS count
152
        FROM borrower_modifications
152
        FROM borrower_modifications, borrowers
153
        WHERE borrowernumber > 0
153
        WHERE borrower_modifications.borrowernumber > 0
154
        AND borrower_modifications.borrowernumber = borrowers.borrowernumber
154
    ";
155
    ";
155
156
157
    my @params;
158
    if ($branchcode) {
159
        $query .= " AND borrowers.branchcode = ? ";
160
        push( @params, $branchcode );
161
    }
162
156
    my $sth = $dbh->prepare($query);
163
    my $sth = $dbh->prepare($query);
157
    $sth->execute();
164
    $sth->execute(@params);
158
    my $result = $sth->fetchrow_hashref();
165
    my $result = $sth->fetchrow_hashref();
159
166
160
    return $result->{'count'};
167
    return $result->{'count'};
Lines 169-185 Returns an arrayref of hashrefs for all pending modifications for existing borro Link Here
169
=cut
176
=cut
170
177
171
sub GetPendingModifications {
178
sub GetPendingModifications {
172
    my ($self) = @_;
179
    my ( $self, $branchcode ) = @_;
173
180
174
    my $dbh   = C4::Context->dbh;
181
    my $dbh   = C4::Context->dbh;
175
    my $query = "
182
    my $query = "
176
        SELECT *
183
        SELECT borrower_modifications.*
177
        FROM borrower_modifications
184
        FROM borrower_modifications, borrowers
178
        WHERE borrowernumber > 0
185
        WHERE borrower_modifications.borrowernumber > 0
186
        AND borrower_modifications.borrowernumber = borrowers.borrowernumber
179
    ";
187
    ";
180
188
189
    my @params;
190
    if ($branchcode) {
191
        $query .= " AND borrowers.branchcode = ? ";
192
        push( @params, $branchcode );
193
    }
194
181
    my $sth = $dbh->prepare($query);
195
    my $sth = $dbh->prepare($query);
182
    $sth->execute();
196
    $sth->execute(@params);
183
197
184
    my @m;
198
    my @m;
185
    while ( my $row = $sth->fetchrow_hashref() ) {
199
    while ( my $row = $sth->fetchrow_hashref() ) {
(-)a/installer/data/mysql/sysprefs.sql (-2 / +2 lines)
Lines 377-383 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( Link Here
377
INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES
377
INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES
378
('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'),
378
('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'),
379
('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'),
379
('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'),
380
('PatronSelfRegistrationUseTemporaryStatus', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'),
380
('PatronSelfRegistrationDefaultCategory', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'),
381
('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'),
381
('PatronSelfRegistrationExpireTemporaryAccountsDelay', '0', NULL, 'If PatronSelfRegistrationDefaultCategory is enabled, this system preference controls how long a patron can have a temporary status before the account is deleted automatically. It is an integer value representing a number of days to wait before deleting a temporary patron account. Setting it to 0 disables the deleting of temporary accounts.', 'Integer'),
382
('PatronSelfRegistrationBorrowerMandatoryField',  'surname|firstname', NULL ,  'Choose the mandatory fields for a patron''s account, when registering via the OPAC.',  'free'),
382
('PatronSelfRegistrationBorrowerMandatoryField',  'surname|firstname', NULL ,  'Choose the mandatory fields for a patron''s account, when registering via the OPAC.',  'free'),
383
('PatronSelfRegistrationBorrowerUnwantedField',  '', NULL ,  'Name the fields you don''t want to display when registering a new patron via the OPAC.',  'free');
383
('PatronSelfRegistrationBorrowerUnwantedField',  '', NULL ,  'Name the fields you don''t want to display when registering a new patron via the OPAC.',  'free');
(-)a/installer/data/mysql/updatedatabase.pl (-2 / +2 lines)
Lines 5798-5805 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
5798
        INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES
5798
        INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES
5799
        ('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'),
5799
        ('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'),
5800
        ('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'),
5800
        ('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'),
5801
        ('PatronSelfRegistrationUseTemporaryStatus', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'),
5801
        ('PatronSelfRegistrationDefaultCategory', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'),
5802
        ('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'),
5802
        ('PatronSelfRegistrationExpireTemporaryAccountsDelay', '0', NULL, 'If PatronSelfRegistrationDefaultCategory is enabled, this system preference controls how long a patron can have a temporary status before the account is deleted automatically. It is an integer value representing a number of days to wait before deleting a temporary patron account. Setting it to 0 disables the deleting of temporary accounts.', 'Integer'),
5803
        ('PatronSelfRegistrationBorrowerMandatoryField',  'surname|firstname', NULL ,  'Choose the mandatory fields for a patron''s account, when registering via the OPAC.',  'free'),
5803
        ('PatronSelfRegistrationBorrowerMandatoryField',  'surname|firstname', NULL ,  'Choose the mandatory fields for a patron''s account, when registering via the OPAC.',  'free'),
5804
        ('PatronSelfRegistrationBorrowerUnwantedField',  '', NULL ,  'Name the fields you don''t want to display when registering a new patron via the OPAC.',  'free');
5804
        ('PatronSelfRegistrationBorrowerUnwantedField',  '', NULL ,  'Name the fields you don''t want to display when registering a new patron via the OPAC.',  'free');
5805
    ");
5805
    ");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +1 lines)
Lines 515-521 OPAC: Link Here
515
            - "that a self-registering patron verify his or herself via email."
515
            - "that a self-registering patron verify his or herself via email."
516
        -
516
        -
517
            - "Use the patron category code"
517
            - "Use the patron category code"
518
            - pref: PatronSelfRegistrationUseTemporaryStatus
518
            - pref: PatronSelfRegistrationDefaultCategory
519
              class: short
519
              class: short
520
            - "as the default patron category for patrons registered via the OPAC."
520
            - "as the default patron category for patrons registered via the OPAC."
521
        -
521
        -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt (-1 / +2 lines)
Lines 100-105 Link Here
100
<div class="yui-g">
100
<div class="yui-g">
101
            [% IF ( ( CAN_user_tools_moderate_comments  && pendingcomments ) 
101
            [% IF ( ( CAN_user_tools_moderate_comments  && pendingcomments ) 
102
                    || ( CAN_user_tools_moderate_tags && pendingtags )
102
                    || ( CAN_user_tools_moderate_tags && pendingtags )
103
                    || ( CAN_user_borrowers && pending_borrower_modifications )
103
                    || ( CAN_user_acquisition && pendingsuggestions ) ) %]
104
                    || ( CAN_user_acquisition && pendingsuggestions ) ) %]
104
                <div id="area-pending">
105
                <div id="area-pending">
105
                    [% IF ( CAN_user_acquisition && pendingsuggestions ) %]
106
                    [% IF ( CAN_user_acquisition && pendingsuggestions ) %]
Lines 125-131 Link Here
125
                    [% END %]
126
                    [% END %]
126
127
127
128
128
                    [% IF ( CAN_user_borrowers && pending_borrower_modifications )%]
129
                    [% IF ( CAN_user_borrowers && pending_borrower_modifications ) %]
129
                    <div class="pending-info">
130
                    <div class="pending-info">
130
                        <a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>:
131
                        <a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>:
131
                        <span class="pending-number-link">[% pending_borrower_modifications %]</span>
132
                        <span class="pending-number-link">[% pending_borrower_modifications %]</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt (-55 / +58 lines)
Lines 64-135 Link Here
64
        <div id="yui-main">
64
        <div id="yui-main">
65
            <div class="yui-b">
65
            <div class="yui-b">
66
                <div class="yui-g">
66
                <div class="yui-g">
67
                    [% IF PendingModifications %]
68
                        <form method="post" action="members-update-do.pl">
67
69
68
                    <form method="post" action="members-update-do.pl">
70
                            <table>
69
71
                                <thead>
70
                        <table>
72
                                    <tr>
71
                            <thead>
73
                                        <th colspan="3">Action</th>
72
                                <tr>
74
                                        <th rowspan="2">Patron</th>
73
                                    <th colspan="3">Action</th>
75
                                        <th rowspan="2">Changes</th>
74
                                    <th rowspan="2">Patron</th>
76
                                    </tr>
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
77
85
                            <tbody>
86
                                [% FOREACH pm IN PendingModifications %]
87
                                    [% SET borrowernumber = pm.borrowernumber %]
88
                                    <tr>
78
                                    <tr>
89
                                        <td>
79
                                        <th>Approve</th>
90
                                            <input type="radio" name="modify_[% pm.borrowernumber %]" value="approve" />
80
                                        <th>Deny</th>
91
                                        </td>
81
                                        <th>Ignore</th>
92
                                        <td>
82
                                    </tr>
93
                                            <input type="radio" name="modify_[% pm.borrowernumber %]" value="deny" />
83
                                </thead>
94
                                        </td>
84
95
                                        <td>
85
                                <tbody>
96
                                            <input type="radio" name="modify_[% pm.borrowernumber %]" value="ignore" checked="checked"/>
86
                                    [% FOREACH pm IN PendingModifications %]
97
                                        </td>
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
98
99
                                        <td>
99
                                            <td>
100
                                            [% borrowers.$borrowernumber.firstname %] [% borrowers.$borrowernumber.surname %]
100
                                                [% borrowers.$borrowernumber.firstname %] [% borrowers.$borrowernumber.surname %]
101
                                        </td>
101
                                            </td>
102
102
103
                                        <td>
103
                                            <td>
104
                                            <table>
104
                                                <table>
105
                                                <tr>
105
                                                    <tr>
106
                                                    <th>Field</th>
106
                                                        <th>Field</th>
107
                                                    <th>From</th>
107
                                                        <th>From</th>
108
                                                    <th>To</th>
108
                                                        <th>To</th>
109
                                                </tr>
109
                                                    </tr>
110
110
111
111
112
                                                [% FOREACH key IN pm.keys %]
112
                                                    [% FOREACH key IN pm.keys %]
113
                                                    [% IF field_display_names.$key %]
113
                                                        [% IF field_display_names.$key %]
114
                                                        [% IF ( ( pm.$key OR borrowers.$borrowernumber.$key ) && ( pm.$key != borrowers.$borrowernumber.$key ) ) %]
114
                                                            [% IF ( ( pm.$key OR borrowers.$borrowernumber.$key ) && ( pm.$key != borrowers.$borrowernumber.$key ) ) %]
115
                                                            <tr>
115
                                                                <tr>
116
                                                                <td>[% field_display_names.$key %]</td>
116
                                                                    <td>[% field_display_names.$key %]</td>
117
                                                                <td>[% borrowers.$borrowernumber.$key %]</td>
117
                                                                    <td>[% borrowers.$borrowernumber.$key %]</td>
118
                                                                <td>[% pm.$key %]</td>
118
                                                                    <td>[% pm.$key %]</td>
119
                                                            </td>
119
                                                                </tr>
120
                                                            [% END %]
120
                                                        [% END %]
121
                                                        [% END %]
121
                                                    [% END %]
122
                                                    [% END %]
122
                                                [% END %]
123
                                                </table>
123
                                            </table>
124
                                            </td>
124
                                        </td>
125
                                        </tr>
125
                                    </tr>
126
                                    [% END %]
126
                                [% END %]
127
                                </tbody>
127
                            </tbody>
128
                            </table>
128
                        </table>
129
129
130
                        <p><input type="submit" /></p>
130
                            <p><input type="submit" /></p>
131
131
132
                    </form>
132
                        </form>
133
                    [% ELSE %]
134
                        <p>There are no pending patron modifications.</p>
135
                    [% END %]
133
                </div>
136
                </div>
134
            </div>
137
            </div>
135
        </div>
138
        </div>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt (-1 / +1 lines)
Lines 86-92 please choose against which one you would like to authenticate: </p> Link Here
86
<input type="submit" value="Log In" class="submit" />
86
<input type="submit" value="Log In" class="submit" />
87
<div id="nologininstructions">
87
<div id="nologininstructions">
88
    <h5>Don't have a password yet?</h5><p> If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.</p>
88
    <h5>Don't have a password yet?</h5><p> If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.</p>
89
    <h5>Don't have a library card?</h5><p> If you don't have a library card, stop by your local library to sign up[% IF PatronSelfRegistration %] or  <a href="/cgi-bin/koha/opac-memberentry.pl">register here</a>[% END %].  </p>
89
    <h5>Don't have a library card?</h5><p> If you don't have a library card, stop by your local library to sign up[% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %] or  <a href="/cgi-bin/koha/opac-memberentry.pl">register here</a>[% END %].</p>
90
</div>
90
</div>
91
</form>
91
</form>
92
92
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt (-1 / +1 lines)
Lines 55-61 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 %]
58
        [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]<div>Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></div>[% END %]
59
59
60
	 </fieldset></fieldset>
60
	 </fieldset></fieldset>
61
	</form>
61
	</form>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt (-11 / +34 lines)
Lines 7-13 Link Here
7
7
8
    <script type="text/javascript">
8
    <script type="text/javascript">
9
        $(document).ready(function() {
9
        $(document).ready(function() {
10
            $( "#borrower_dateofbirth" ).datepicker({ yearRange: "c-120:c" });
10
            [% IF action == 'edit' && !OPACPatronDetails %]
11
                $("#memberentry-form :input").attr('readonly', true);
12
                $("#borrower_branchcode").attr('disabled',true);
13
                $("#borrower_title").attr('disabled',true);
14
                $('#memberentry-form :radio').attr('disabled',true);
15
                $('span.required').remove();
16
                $('label.required').removeClass('required');
17
            [% ELSE %]
18
                $( "#borrower_dateofbirth" ).datepicker({ yearRange: "c-120:c" });
19
            [% END %]
11
        });
20
        });
12
    </script>
21
    </script>
13
</head>
22
</head>
Lines 21-26 Link Here
21
                <div class="yui-b">
30
                <div class="yui-b">
22
                    <div class="yui-g">
31
                    <div class="yui-g">
23
                        <div id="useraccount" class="container">
32
                        <div id="useraccount" class="container">
33
                            [% UNLESS OPACPatronDetails %]
34
                                <div>To make changes to your record please contact the library.</div>
35
                            [% END %]
24
36
25
                            [% IF empty_mandatory_fields %]
37
                            [% IF empty_mandatory_fields %]
26
                                <div class="dialog alert">You have not filled out all required fields. Please fill in all missing fields and resubmit.</div>
38
                                <div class="dialog alert">You have not filled out all required fields. Please fill in all missing fields and resubmit.</div>
Lines 30-36 Link Here
30
                                <div class="dialog alert">You typed in the wrong characters in the box before submitting. Please try again.</div>
42
                                <div class="dialog alert">You typed in the wrong characters in the box before submitting. Please try again.</div>
31
                            [% END %]
43
                            [% END %]
32
44
33
                            <form method="post">
45
                            <form method="post" id="memberentry-form">
34
46
35
                                [% UNLESS
47
                                [% UNLESS
36
                                    hidden.defined('branchcode')
48
                                    hidden.defined('branchcode')
Lines 132-140 Link Here
132
                                                    [% END %]
144
                                                    [% END %]
133
                                                    Date of birth:</label>
145
                                                    Date of birth:</label>
134
146
135
                                                    <input type="text" id="borrower_dateofbirth" name="borrower_dateofbirth" value="[% borrower.dateofbirth | $KohaDates %]" readonly="readonly" size="10" />
147
                                                    <input type="text" id="borrower_dateofbirth" name="borrower_dateofbirth" value="[% borrower.dateofbirth | $KohaDates %]" size="10" />
136
148
137
                                                    <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('borrower_dateofbirth').value='';return false;">Clear date</a><p></p>
149
                                                    [% UNLESS action == 'edit' && !OPACPatronDetails %]
150
                                                        <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('borrower_dateofbirth').value='';return false;">Clear date</a><p></p>
151
                                                    [% END %]
138
152
139
                                                    [% IF mandatory.defined('dateofbirth') %]<span class="required">Required</span>[% END %]
153
                                                    [% IF mandatory.defined('dateofbirth') %]<span class="required">Required</span>[% END %]
140
                                                </li>
154
                                                </li>
Lines 682-697 Link Here
682
                                [% END %]
696
                                [% END %]
683
697
684
                                [% UNLESS action == 'edit' %]
698
                                [% UNLESS action == 'edit' %]
685
                                    <p>Please type this following characters into the box below : [% captcha %]</p>
699
                                    <fieldset class="rows" id="memberentry_captcha">
686
                                    <p>
700
                                        <ol>
687
                                        <input type="text" name="captcha" id="captcha" />
701
                                            <li>
688
                                        <input type="hidden" name="captcha_digest" value="[% captcha_digest %]" />
702
                                                <label for="borrower_altcontactphone" class="required">Verification</label>
689
                                    </p>
703
704
                                                <input type="text" name="captcha" id="captcha" />
705
                                                <input type="hidden" name="captcha_digest" value="[% captcha_digest %]" />
706
707
                                                <span class="required">Please type this following characters into the preceding box: <strong>[% captcha %]</strong></span>
708
                                            </li>
709
                                        </ol>
710
                                    </fieldset>
690
                                [% END %]
711
                                [% END %]
691
712
692
                                [% IF action == 'edit' %]
713
                                [% IF action == 'edit' %]
693
                                    <input type="hidden" name="action" value="update" />
714
                                    [% IF OPACPatronDetails %]
694
                                    <input type="submit" value="Submit Update Request" />
715
                                        <input type="hidden" name="action" value="update" />
716
                                        <input type="submit" value="Submit Update Request" />
717
                                    [% END %]
695
                                [% ELSE %]
718
                                [% ELSE %]
696
                                    <input type="hidden" name="action" value="create" />
719
                                    <input type="hidden" name="action" value="create" />
697
                                    <input type="submit" value="Submit" />
720
                                    <input type="submit" value="Submit" />
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-invalid.tt (+30 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="opac-main">
6
[% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
7
   <div id="bd">
8
[% INCLUDE 'masthead.inc' %]
9
10
<div id="yui-main">
11
    <div class="yui-b">
12
        <div id="loggedin" class="yui-ge">
13
            <div class="yui-u first">
14
                <h1>Registration invalid!</h1>
15
16
                <p>There were problems processing your registration. Please contact your library for help.</p>
17
18
            </div>
19
        </div>
20
    </div>
21
</div>
22
23
[% IF ( OpacNav ) %]<div class="yui-b">
24
    <div id="opacnav" class="container">
25
        [% INCLUDE 'navigation.inc' %]
26
    </div>
27
[% END %]
28
29
</div>
30
[% INCLUDE 'opac-bottom.inc' %]
(-)a/mainpage.pl (-2 / +8 lines)
Lines 32-38 use Koha::Borrower::Modifications; Link Here
32
32
33
my $query = new CGI;
33
my $query = new CGI;
34
34
35
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
35
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
36
    {
36
    {
37
        template_name   => "intranet-main.tmpl",
37
        template_name   => "intranet-main.tmpl",
38
        query           => $query,
38
        query           => $query,
Lines 50-60 $template->param( Link Here
50
    koha_news_count => $koha_news_count
50
    koha_news_count => $koha_news_count
51
);
51
);
52
52
53
my $branch =
54
  C4::Context->preference("IndependantBranches")
55
  && !$flags->{'superlibrarian'}
56
  ? C4::Context->userenv()->{'branch'}
57
  : undef;
58
53
my $pendingcomments    = numberofreviews(0);
59
my $pendingcomments    = numberofreviews(0);
54
my $pendingtags        = get_count_by_tag_status(0);
60
my $pendingtags        = get_count_by_tag_status(0);
55
my $pendingsuggestions = CountSuggestion("ASKED");
61
my $pendingsuggestions = CountSuggestion("ASKED");
56
my $pending_borrower_modifications =
62
my $pending_borrower_modifications =
57
  Koha::Borrower::Modifications->GetPendingModificationsCount();
63
  Koha::Borrower::Modifications->GetPendingModificationsCount( $branch );
58
64
59
$template->param(
65
$template->param(
60
    pendingcomments                => $pendingcomments,
66
    pendingcomments                => $pendingcomments,
(-)a/members/members-update-do.pl (-1 / +1 lines)
Lines 61-64 foreach my $param (@params) { Link Here
61
    }
61
    }
62
}
62
}
63
63
64
print $query->redirect("/cgi-bin/koha/mainpage.pl");
64
print $query->redirect("/cgi-bin/koha/members/members-update.pl");
(-)a/members/members-update.pl (-2 / +8 lines)
Lines 30-36 use Koha::Borrower::Modifications; Link Here
30
30
31
my $query = new CGI;
31
my $query = new CGI;
32
32
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
33
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
34
    {
34
    {
35
        template_name   => "members/members-update.tmpl",
35
        template_name   => "members/members-update.tmpl",
36
        query           => $query,
36
        query           => $query,
Lines 41-48 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
41
    }
41
    }
42
);
42
);
43
43
44
my $branch =
45
  C4::Context->preference("IndependantBranches")
46
  && !$flags->{'superlibrarian'}
47
  ? C4::Context->userenv()->{'branch'}
48
  : undef;
49
44
my $pending_modifications =
50
my $pending_modifications =
45
  Koha::Borrower::Modifications->GetPendingModifications();
51
  Koha::Borrower::Modifications->GetPendingModifications($branch);
46
52
47
my $borrowers;
53
my $borrowers;
48
foreach my $pm (@$pending_modifications) {
54
foreach my $pm (@$pending_modifications) {
(-)a/misc/cronjobs/delete_expired_opac_registrations.pl (-1 / +27 lines)
Lines 18-23 Link Here
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
use Getopt::Long;
21
22
22
BEGIN {
23
BEGIN {
23
24
Lines 30-40 BEGIN { Link Here
30
use C4::Context;
31
use C4::Context;
31
use C4::Members qw/ DelMember /;
32
use C4::Members qw/ DelMember /;
32
33
34
my $help;
35
my $confirm;
36
37
GetOptions(
38
    'h|help'    => \$help,
39
    'c|confirm' => \$confirm,
40
);
41
my $usage = << 'ENDUSAGE';
42
43
This script remove confirmed OPAC based patron registrations
44
that have not been changed from the patron category specified
45
in the system preference PatronSelfRegistrationDefaultCategory
46
within the required time period.
47
48
This script has the following parameters :
49
    -h --help:    This message
50
51
    -c --confirm: Without this flag set, this script will do nothing.
52
ENDUSAGE
53
54
if ( $help || !$confirm ) {
55
    print $usage;
56
    exit;
57
}
58
33
## Delete accounts that haven't been upgraded from the 'temporary' category code'
59
## Delete accounts that haven't been upgraded from the 'temporary' category code'
34
my $delay =
60
my $delay =
35
  C4::Context->preference('PatronSelfRegistrationExpireTemporaryAccountsDelay');
61
  C4::Context->preference('PatronSelfRegistrationExpireTemporaryAccountsDelay');
36
my $category_code =
62
my $category_code =
37
  C4::Context->preference('PatronSelfRegistrationUseTemporaryStatus');
63
  C4::Context->preference('PatronSelfRegistrationDefaultCategory');
38
64
39
my $query = "
65
my $query = "
40
    SELECT borrowernumber
66
    SELECT borrowernumber
(-)a/misc/cronjobs/delete_unverified_opac_registrations.pl (-2 / +31 lines)
Lines 18-23 Link Here
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
use Getopt::Long;
21
22
22
BEGIN {
23
BEGIN {
23
24
Lines 30-35 BEGIN { Link Here
30
use C4::Context;
31
use C4::Context;
31
use C4::Members qw/ DelMember /;
32
use C4::Members qw/ DelMember /;
32
33
34
my $help;
35
my $confirm;
36
my $hours = 24;
37
38
GetOptions(
39
    'h|help'    => \$help,
40
    'c|confirm' => \$confirm,
41
    't|time=i'  => \$hours,
42
);
43
my $usage = << 'ENDUSAGE';
44
45
This script removes unconfirmed OPAC based patron registrations
46
that have not been confirmed within the required time period.
47
48
This script has the following parameters :
49
    -h --help:    This message
50
51
    -t --time:    The length in hours to wait before removing an unconfirmed registration.
52
                  Defaults to 24 hours if not set.
53
54
    -c --confirm: Without this flag set, this script will do nothing.
55
ENDUSAGE
56
57
if ( $help || !$confirm ) {
58
    print $usage;
59
    exit;
60
}
61
33
my $dbh = C4::Context->dbh;
62
my $dbh = C4::Context->dbh;
34
63
35
$dbh->do( "
64
$dbh->do( "
Lines 37-41 $dbh->do( " Link Here
37
         WHERE
66
         WHERE
38
             borrowernumber = 0
67
             borrowernumber = 0
39
           AND
68
           AND
40
             TIME_TO_SEC( TIMEDIFF( NOW(), timestamp )) / 3600 > 24
69
             TIME_TO_SEC( TIMEDIFF( NOW(), timestamp )) / 3600 > ?
41
" );
70
", undef, $hours );
(-)a/opac/opac-memberentry.pl (-13 / +16 lines)
Lines 30-40 use C4::Branch qw(GetBranchesLoop); Link Here
30
my $cgi = new CGI;
30
my $cgi = new CGI;
31
my $dbh = C4::Context->dbh;
31
my $dbh = C4::Context->dbh;
32
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(
33
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
39
    {
34
    {
40
        template_name   => "opac-memberentry.tmpl",
35
        template_name   => "opac-memberentry.tmpl",
Lines 44-54 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
44
    }
39
    }
45
);
40
);
46
41
42
unless ( C4::Context->preference('PatronSelfRegistration') || $borrowernumber ) {
43
    print $cgi->redirect("/cgi-bin/koha/opac-main.pl");
44
    exit;
45
}
46
47
$template->param(
47
$template->param(
48
    hidden        => GetHiddenFields(),
48
    hidden            => GetHiddenFields(),
49
    mandatory     => GetMandatoryFields(),
49
    mandatory         => GetMandatoryFields(),
50
    member_titles => GetTitles(),
50
    member_titles     => GetTitles(),
51
    branches      => GetBranchesLoop()
51
    branches          => GetBranchesLoop(),
52
    OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),
52
);
53
);
53
54
54
my $action = $cgi->param('action') || q{};
55
my $action = $cgi->param('action') || q{};
Lines 167-173 elsif ($borrowernumber) { #Display logged in borrower's data Link Here
167
    $action = 'edit';
168
    $action = 'edit';
168
169
169
    $template->param(
170
    $template->param(
170
        borrower => GetMember( borrowernumber => $borrowernumber ) );
171
        borrower => GetMember( borrowernumber => $borrowernumber ),
172
    );
171
}
173
}
172
174
173
my $captcha = random_string("CCCCC");
175
my $captcha = random_string("CCCCC");
Lines 236-244 sub ParseCgiForBorrower { Link Here
236
    my %borrower;
238
    my %borrower;
237
239
238
    foreach ( $cgi->param ) {
240
    foreach ( $cgi->param ) {
239
        my ($key) = substr( $_, 9 );
241
        if ( $_ =~ '^borrower_' ) {
240
        $borrower{$key} = $cgi->param($_)
242
            my ($key) = substr( $_, 9 );
241
          if ( $_ =~ '^borrower_' );
243
            $borrower{$key} = $cgi->param($_);
244
        }
242
    }
245
    }
243
246
244
    $borrower{'dateofbirth'} =
247
    $borrower{'dateofbirth'} =
(-)a/opac/opac-registration-verify.pl (-14 / +21 lines)
Lines 32-53 unless ( C4::Context->preference('PatronSelfRegistration') ) { Link Here
32
    exit;
32
    exit;
33
}
33
}
34
34
35
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
36
    {
37
        template_name   => "opac-registration-confirmation.tmpl",
38
        type            => "opac",
39
        query           => $cgi,
40
        authnotrequired => 1,
41
    }
42
);
43
44
$template->param(
45
    OpacPasswordChange => C4::Context->preference('OpacPasswordChange') );
46
47
my $token = $cgi->param('token');
35
my $token = $cgi->param('token');
48
my $m = Koha::Borrower::Modifications->new( verification_token => $token );
36
my $m = Koha::Borrower::Modifications->new( verification_token => $token );
49
37
38
my ( $template, $borrowernumber, $cookie );
50
if ( $m->Verify() ) {
39
if ( $m->Verify() ) {
40
    ( $template, $borrowernumber, $cookie ) = get_template_and_user(
41
        {
42
            template_name   => "opac-registration-confirmation.tmpl",
43
            type            => "opac",
44
            query           => $cgi,
45
            authnotrequired => 1,
46
        }
47
    );
48
49
    $template->param(
50
        OpacPasswordChange => C4::Context->preference('OpacPasswordChange') );
51
51
    my $borrower = $m->GetModifications();
52
    my $borrower = $m->GetModifications();
52
53
53
    my $password;
54
    my $password;
Lines 68-74 if ( $m->Verify() ) { Link Here
68
69
69
}
70
}
70
else {
71
else {
71
72
    ( $template, $borrowernumber, $cookie ) = get_template_and_user(
73
        {
74
            template_name   => "opac-registration-invalid.tmpl",
75
            type            => "opac",
76
            query           => $cgi,
77
            authnotrequired => 1,
78
        }
79
    );
72
}
80
}
73
81
74
output_html_with_http_headers $cgi, $cookie, $template->output;
82
output_html_with_http_headers $cgi, $cookie, $template->output;
75
- 

Return to bug 7067