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

(-)a/installer/data/mysql/atomicupdate/bug_25090-add_PatronSelfRegistrationVerificationRecipient_syspref.sql (+2 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('PatronSelfRegistrationVerificationRecipient', 'RegisteringPatron', 'PatronSelfRegistrationVerificationRecipientAddress|BranchEmailAddress|KohaAdminEmailAddress|RegisteringPatron', 'Choose email address that self registering users verification email will be sent to.', 'Choice');
2
INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('PatronSelfRegistrationVerificationRecipientAddress', '', '', 'If you choose PatronSelfRegistrationVerificationRecipientAddress you have to enter a valid email address:', 'free');
(-)a/installer/data/mysql/atomicupdate/bug_25090-add_STAFF_VER_OPAC_REG_and_SELF_REG_APPROVED_notices.perl (+42 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
        INSERT IGNORE INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('members', 'STAFF_VER_OPAC_REG', 'New patron Opac Self-Registration to verify', 'Verify new Opac patron self registration', '<h3>Opac self registration pending verification</h3>
5
<p><h4>Submitted Opac patron self registration:<h4>
6
    <ul>
7
    <li><<borrower_modifications.cardnumber>></li>
8
    <li><<borrower_modifications.title>> <<borrower_modifications.firstname>> <<borrower_modifications.surname>></li>
9
    <li>Physical address: <<borrower_modifications.streetnumber>> <<borrower_modifications.streettype>> <<borrower_modifications.address>> <<borrower_modifications.address2>>, <<borrower_modifications.city>>, <<borrower_modifications.state>> <<borrower_modifications.zipcode>>, <<borrower_modifications.country>></li>
10
    <li>Email: <<borrower_modifications.email>></li>
11
    <li>Phone: <<borrower_modifications.phone>></li>
12
    <li>Mobile: <<borrower_modifications.mobile>></li>
13
    <li>Fax: <<borrower_modifications.fax>></li>
14
    <li>Secondary email: <<borrower_modifications.emailpro>></li>
15
    <li>Secondary phone:<<borrower_modifications.phonepro>></li>
16
    <li>Home library: <<borrower_modifications.branchcode>></li>
17
    <li>Temporary patron category: <<borrower_modifications.categorycode>></li>
18
    </ul>
19
    </p>
20
    <p>
21
    If you wish to create a Koha patron account thereby giving this patron Opac access please click on this verification link:
22
    </p>
23
24
    <p>
25
    <<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>&approved=1
26
    </p>
27
28
    <p>
29
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.
30
    </p>
31
    </p>', 1, 'email')
32
    });
33
    $dbh->do(q{
34
        INSERT IGNORE INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('members', 'SELF_REG_APPROVED', 'Self registration approved', 'Your self registration has been approved', '<h3>Please click the password reset link below to reset your Koha password then you will be able to login to the OPAC:</h3>
35
    <p>
36
    <<OPACBaseURL>>/cgi-bin/koha/opac-password-recovery.pl?borrowernumber=<<borrowers.borrowernumber>>
37
    </p>', 1, 'email')
38
    });
39
40
    SetVersion( $DBversion );
41
    print "Upgrade to $DBversion done (Bug 25090 - Custom destination for OPAC self registration verification emails to allow libraries to moderate which registrations get Koha accounts)\n";
42
}
(-)a/installer/data/mysql/de-DE/mandatory/sample_notices.sql (+29 lines)
Lines 386-388 INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, Link Here
386
    </tr>
386
    </tr>
387
</tfoot>
387
</tfoot>
388
</table>', 'print', 'default');
388
</table>', 'print', 'default');
389
390
INSERT IGNORE INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('members', 'STAFF_VER_OPAC_REG', 'New patron Opac Self-Registration to verify', 'Verify new Opac patron self registration', '<h3>Opac self registration pending verification</h3>
391
<p><h4>Submitted Opac patron self registration:<h4>
392
    <ul>
393
    <li><<borrower_modifications.cardnumber>></li>
394
    <li><<borrower_modifications.title>> <<borrower_modifications.firstname>> <<borrower_modifications.surname>></li>
395
    <li>Physical address: <<borrower_modifications.streetnumber>> <<borrower_modifications.streettype>> <<borrower_modifications.address>> <<borrower_modifications.address2>>, <<borrower_modifications.city>>, <<borrower_modifications.state>> <<borrower_modifications.zipcode>>, <<borrower_modifications.country>></li>
396
    <li>Email: <<borrower_modifications.email>></li>
397
    <li>Phone: <<borrower_modifications.phone>></li>
398
    <li>Mobile: <<borrower_modifications.mobile>></li>
399
    <li>Fax: <<borrower_modifications.fax>></li>
400
    <li>Secondary email: <<borrower_modifications.emailpro>></li>
401
    <li>Secondary phone:<<borrower_modifications.phonepro>></li>
402
    <li>Home library: <<borrower_modifications.branchcode>></li>
403
    <li>Temporary patron category: <<borrower_modifications.categorycode>></li>
404
    </ul>
405
    </p>
406
    <p>
407
    If you wish to create a Koha patron account thereby giving this patron Opac access please click on this verification link:
408
    <p>
409
    <p>
410
    <<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>&approved=1
411
    </p>
412
    <p>
413
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.
414
    </p>', 1, 'email'), ('members', 'SELF_REG_APPROVED', 'Self registration approved', 'Your self registration has been approved', '<h3>Please click the password reset link below to reset your Koha password then you will be able to login to the OPAC:</h3>
415
    <p>
416
    <<OPACBaseURL>>/cgi-bin/koha/opac-password-recovery.pl?borrowernumber=<<borrowers.borrowernumber>>
417
    </p>', 1, 'email');
(-)a/installer/data/mysql/en/mandatory/sample_notices.yml (+48 lines)
Lines 736-741 tables: Link Here
736
            - "If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly."
736
            - "If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly."
737
737
738
        - module: members
738
        - module: members
739
          code: STAFF_VER_OPAC_REG
740
          branchode: ""
741
          name: "New patron Opac Self-Registration to verify"
742
          is_html: 1
743
          title: "Verify new Opac patron self registration"
744
          message_transport_type: email
745
          lang: default
746
          content:
747
              - "<h3>Opac self registration pending verification</h3>"
748
              - "<p><h4>Submitted Opac patron self registration:<h4>"
749
              - "<ul>"
750
              - "<li><<borrower_modifications.cardnumber>></li>"
751
              - "<li><<borrower_modifications.title>> <<borrower_modifications.firstname>> <<borrower_modifications.surname>></li>"
752
              - "<li>Physical address: <<borrower_modifications.streetnumber>> <<borrower_modifications.streettype>> <<borrower_modifications.address>> <<borrower_modifications.address2>>, <<borrower_modifications.city>>, <<borrower_modifications.state>> <<borrower_modifications.zipcode>>, <<borrower_modifications.country>></li>"
753
              - "<li>Email: <<borrower_modifications.email>></li>"
754
              - "<li>Phone: <<borrower_modifications.phone>></li>"
755
              - "<li>Mobile: <<borrower_modifications.mobile>></li>"
756
              - "<li>Fax: <<borrower_modifications.fax>></li>"
757
              - "<li>Secondary email: <<borrower_modifications.emailpro>></li>"
758
              - "<li>Secondary phone:<<borrower_modifications.phonepro>></li>"
759
              - "<li>Home library: <<borrower_modifications.branchcode>></li>"
760
              - "<li>Temporary patron category: <<borrower_modifications.categorycode>></li>"
761
              - "</ul>"
762
              - "</p>"
763
              - "<p>"
764
              - "If you wish to create a Koha patron account thereby giving this patron Opac access please click on this verification link:"
765
              - "<p>"
766
              - "<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>&approved=1"
767
              - "</p>"
768
              - "If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly."
769
              - "</p>"
770
771
        - module: members
772
          code: SELF_REG_APPROVED
773
          branchcode: ""
774
          name: "Self registration approved"
775
          is_html: 1
776
          title: "Your self registration has been approved"
777
          message_transport_type: email
778
          lang: default
779
          content:
780
            - "<html>"
781
            - "<h3>Please click the password reset link below to reset your Koha password then you'll be able to login to the OPAC:</h3>"
782
            - "<p>"
783
            - "<<OPACBaseURL>>/cgi-bin/koha/opac-password-recovery.pl?borrowernumber=<<borrowers.borrowernumber>>"
784
            - "</p>"
785
786
        - module: members
739
          code: PASSWORD_RESET
787
          code: PASSWORD_RESET
740
          branchcode: ""
788
          branchcode: ""
741
          name: "Online password reset"
789
          name: "Online password reset"
(-)a/installer/data/mysql/es-ES/mandatory/sample_notices.sql (+29 lines)
Lines 378-380 INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, Link Here
378
    </tr>
378
    </tr>
379
</tfoot>
379
</tfoot>
380
</table>', 'print', 'default');
380
</table>', 'print', 'default');
381
382
INSERT IGNORE INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('members', 'STAFF_VER_OPAC_REG', 'New patron Opac Self-Registration to verify', 'Verify new Opac patron self registration', '<h3>Opac self registration pending verification</h3>
383
<p><h4>Submitted Opac patron self registration:<h4>
384
    <ul>
385
    <li><<borrower_modifications.cardnumber>></li>
386
    <li><<borrower_modifications.title>> <<borrower_modifications.firstname>> <<borrower_modifications.surname>></li>
387
    <li>Physical address: <<borrower_modifications.streetnumber>> <<borrower_modifications.streettype>> <<borrower_modifications.address>> <<borrower_modifications.address2>>, <<borrower_modifications.city>>, <<borrower_modifications.state>> <<borrower_modifications.zipcode>>, <<borrower_modifications.country>></li>
388
    <li>Email: <<borrower_modifications.email>></li>
389
    <li>Phone: <<borrower_modifications.phone>></li>
390
    <li>Mobile: <<borrower_modifications.mobile>></li>
391
    <li>Fax: <<borrower_modifications.fax>></li>
392
    <li>Secondary email: <<borrower_modifications.emailpro>></li>
393
    <li>Secondary phone:<<borrower_modifications.phonepro>></li>
394
    <li>Home library: <<borrower_modifications.branchcode>></li>
395
    <li>Temporary patron category: <<borrower_modifications.categorycode>></li>
396
    </ul>
397
    </p>
398
    <p>
399
    If you wish to create a Koha patron account thereby giving this patron Opac access please click on this verification link:
400
    <p>
401
    <p>
402
    <<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>&approved=1
403
    </p>
404
    <p>
405
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.
406
    </p>', 1, 'email'),('members', 'SELF_REG_APPROVED', 'Self registration approved', 'Your self registration has been approved', '<h3>Please click the password reset link below to reset your Koha password then you will be able to login to the OPAC:</h3>
407
    <p>
408
    <<OPACBaseURL>>/cgi-bin/koha/opac-password-recovery.pl?borrowernumber=<<borrowers.borrowernumber>>
409
    </p>', 1, 'email');
(-)a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql (+30 lines)
Lines 268-270 INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, Link Here
268
    </tr>
268
    </tr>
269
</tfoot>
269
</tfoot>
270
</table>', 'print', 'default');
270
</table>', 'print', 'default');
271
272
273
INSERT IGNORE INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('members', 'STAFF_VER_OPAC_REG', 'New patron Opac Self-Registration to verify', 'Verify new Opac patron self registration', '<h3>Opac self registration pending verification</h3>
274
<p><h4>Submitted Opac patron self registration:<h4>
275
    <ul>
276
    <li><<borrower_modifications.cardnumber>></li>
277
    <li><<borrower_modifications.title>> <<borrower_modifications.firstname>> <<borrower_modifications.surname>></li>
278
    <li>Physical address: <<borrower_modifications.streetnumber>> <<borrower_modifications.streettype>> <<borrower_modifications.address>> <<borrower_modifications.address2>>, <<borrower_modifications.city>>, <<borrower_modifications.state>> <<borrower_modifications.zipcode>>, <<borrower_modifications.country>></li>
279
    <li>Email: <<borrower_modifications.email>></li>
280
    <li>Phone: <<borrower_modifications.phone>></li>
281
    <li>Mobile: <<borrower_modifications.mobile>></li>
282
    <li>Fax: <<borrower_modifications.fax>></li>
283
    <li>Secondary email: <<borrower_modifications.emailpro>></li>
284
    <li>Secondary phone:<<borrower_modifications.phonepro>></li>
285
    <li>Home library: <<borrower_modifications.branchcode>></li>
286
    <li>Temporary patron category: <<borrower_modifications.categorycode>></li>
287
    </ul>
288
    </p>
289
    <p>
290
    If you wish to create a Koha patron account thereby giving this patron Opac access please click on this verification link:
291
    <p>
292
    <p>
293
    <<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>&approved=1
294
    </p>
295
    <p>
296
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.
297
    </p>', 1, 'email'), ('members', 'SELF_REG_APPROVED', 'Self registration approved', 'Your self registration has been approved', '<h3>Please click the password reset link below to reset your Koha password then you will be able to login to the OPAC:</h3>
298
    <p>
299
    <<OPACBaseURL>>/cgi-bin/koha/opac-password-recovery.pl?borrowernumber=<<borrowers.borrowernumber>>
300
    </p>', 1, 'email');
(-)a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql (+29 lines)
Lines 379-381 INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, Link Here
379
    </tr>
379
    </tr>
380
</tfoot>
380
</tfoot>
381
</table>', 'print', 'default');
381
</table>', 'print', 'default');
382
383
INSERT IGNORE INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('members', 'STAFF_VER_OPAC_REG', 'New patron Opac Self-Registration to verify', 'Verify new Opac patron self registration', '<h3>Opac self registration pending verification</h3>
384
<p><h4>Submitted Opac patron self registration:<h4>
385
    <ul>
386
    <li><<borrower_modifications.cardnumber>></li>
387
    <li><<borrower_modifications.title>> <<borrower_modifications.firstname>> <<borrower_modifications.surname>></li>
388
    <li>Physical address: <<borrower_modifications.streetnumber>> <<borrower_modifications.streettype>> <<borrower_modifications.address>> <<borrower_modifications.address2>>, <<borrower_modifications.city>>, <<borrower_modifications.state>> <<borrower_modifications.zipcode>>, <<borrower_modifications.country>></li>
389
    <li>Email: <<borrower_modifications.email>></li>
390
    <li>Phone: <<borrower_modifications.phone>></li>
391
    <li>Mobile: <<borrower_modifications.mobile>></li>
392
    <li>Fax: <<borrower_modifications.fax>></li>
393
    <li>Secondary email: <<borrower_modifications.emailpro>></li>
394
    <li>Secondary phone:<<borrower_modifications.phonepro>></li>
395
    <li>Home library: <<borrower_modifications.branchcode>></li>
396
    <li>Temporary patron category: <<borrower_modifications.categorycode>></li>
397
    </ul>
398
    </p>
399
    <p>
400
    If you wish to create a Koha patron account thereby giving this patron Opac access please click on this verification link:
401
    <p>
402
    <p>
403
    <<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>&approved=1
404
    </p>
405
    <p>
406
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.
407
    </p>', 1, 'email'), ('members', 'SELF_REG_APPROVED', 'Self registration approved', 'Your self registration has been approved', '<h3>Please click the password reset link below to reset your Koha password then you will be able to login to the OPAC:</h3>
408
    <p>
409
    <<OPACBaseURL>>/cgi-bin/koha/opac-password-recovery.pl?borrowernumber=<<borrowers.borrowernumber>>
410
    </p>', 1, 'email');
(-)a/installer/data/mysql/it-IT/necessari/notices.sql (+29 lines)
Lines 382-384 INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, Link Here
382
    </tr>
382
    </tr>
383
</tfoot>
383
</tfoot>
384
</table>', 'print', 'default');
384
</table>', 'print', 'default');
385
386
INSERT IGNORE INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('members', 'STAFF_VER_OPAC_REG', 'New patron Opac Self-Registration to verify', 'Verify new Opac patron self registration', '<h3>Opac self registration pending verification</h3>
387
<p><h4>Submitted Opac patron self registration:<h4>
388
    <ul>
389
    <li><<borrower_modifications.cardnumber>></li>
390
    <li><<borrower_modifications.title>> <<borrower_modifications.firstname>> <<borrower_modifications.surname>></li>
391
    <li>Physical address: <<borrower_modifications.streetnumber>> <<borrower_modifications.streettype>> <<borrower_modifications.address>> <<borrower_modifications.address2>>, <<borrower_modifications.city>>, <<borrower_modifications.state>> <<borrower_modifications.zipcode>>, <<borrower_modifications.country>></li>
392
    <li>Email: <<borrower_modifications.email>></li>
393
    <li>Phone: <<borrower_modifications.phone>></li>
394
    <li>Mobile: <<borrower_modifications.mobile>></li>
395
    <li>Fax: <<borrower_modifications.fax>></li>
396
    <li>Secondary email: <<borrower_modifications.emailpro>></li>
397
    <li>Secondary phone:<<borrower_modifications.phonepro>></li>
398
    <li>Home library: <<borrower_modifications.branchcode>></li>
399
    <li>Temporary patron category: <<borrower_modifications.categorycode>></li>
400
    </ul>
401
    </p>
402
    <p>
403
    If you wish to create a Koha patron account thereby giving this patron Opac access please click on this verification link:
404
    <p>
405
    <p>
406
    <<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>&approved=1
407
    </p>
408
    <p>
409
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.
410
    </p>', 1, 'email'), ('members', 'SELF_REG_APPROVED', 'Self registration approved', 'Your self registration has been approved', '<h3>Please click the password reset link below to reset your Koha password then you will be able to login to the OPAC:</h3>
411
    <p>
412
    <<OPACBaseURL>>/cgi-bin/koha/opac-password-recovery.pl?borrowernumber=<<borrowers.borrowernumber>>
413
    </p>', 1, 'email');
(-)a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql (+30 lines)
Lines 398-400 INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, Link Here
398
    </tr>
398
    </tr>
399
</tfoot>
399
</tfoot>
400
</table>', 'print', 'default');
400
</table>', 'print', 'default');
401
402
403
INSERT IGNORE INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('members', 'STAFF_VER_OPAC_REG', 'New patron Opac Self-Registration to verify', 'Verify new Opac patron self registration', '<h3>Opac self registration pending verification</h3>
404
<p><h4>Submitted Opac patron self registration:<h4>
405
    <ul>
406
    <li><<borrower_modifications.cardnumber>></li>
407
    <li><<borrower_modifications.title>> <<borrower_modifications.firstname>> <<borrower_modifications.surname>></li>
408
    <li>Physical address: <<borrower_modifications.streetnumber>> <<borrower_modifications.streettype>> <<borrower_modifications.address>> <<borrower_modifications.address2>>, <<borrower_modifications.city>>, <<borrower_modifications.state>> <<borrower_modifications.zipcode>>, <<borrower_modifications.country>></li>
409
    <li>Email: <<borrower_modifications.email>></li>
410
    <li>Phone: <<borrower_modifications.phone>></li>
411
    <li>Mobile: <<borrower_modifications.mobile>></li>
412
    <li>Fax: <<borrower_modifications.fax>></li>
413
    <li>Secondary email: <<borrower_modifications.emailpro>></li>
414
    <li>Secondary phone:<<borrower_modifications.phonepro>></li>
415
    <li>Home library: <<borrower_modifications.branchcode>></li>
416
    <li>Temporary patron category: <<borrower_modifications.categorycode>></li>
417
    </ul>
418
    </p>
419
    <p>
420
    If you wish to create a Koha patron account thereby giving this patron Opac access please click on this verification link:
421
    <p>
422
    <p>
423
    <<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>&approved=1
424
    </p>
425
    <p>
426
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.
427
    </p>', 1, 'email'), ('members', 'SELF_REG_APPROVED', 'Self registration approved', 'Your self registration has been approved', '<h3>Please click the password reset link below to reset your Koha password then you will be able to login to the OPAC:</h3>
428
    <p>
429
    <<OPACBaseURL>>/cgi-bin/koha/opac-password-recovery.pl?borrowernumber=<<borrowers.borrowernumber>>
430
    </p>', 1, 'email');
(-)a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql (+29 lines)
Lines 376-378 INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, Link Here
376
    </tr>
376
    </tr>
377
</tfoot>
377
</tfoot>
378
</table>', 'print', 'default');
378
</table>', 'print', 'default');
379
380
INSERT IGNORE INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('members', 'STAFF_VER_OPAC_REG', 'New patron Opac Self-Registration to verify', 'Verify new Opac patron self registration', '<h3>Opac self registration pending verification</h3>
381
<p><h4>Submitted Opac patron self registration:<h4>
382
    <ul>
383
    <li><<borrower_modifications.cardnumber>></li>
384
    <li><<borrower_modifications.title>> <<borrower_modifications.firstname>> <<borrower_modifications.surname>></li>
385
    <li>Physical address: <<borrower_modifications.streetnumber>> <<borrower_modifications.streettype>> <<borrower_modifications.address>> <<borrower_modifications.address2>>, <<borrower_modifications.city>>, <<borrower_modifications.state>> <<borrower_modifications.zipcode>>, <<borrower_modifications.country>></li>
386
    <li>Email: <<borrower_modifications.email>></li>
387
    <li>Phone: <<borrower_modifications.phone>></li>
388
    <li>Mobile: <<borrower_modifications.mobile>></li>
389
    <li>Fax: <<borrower_modifications.fax>></li>
390
    <li>Secondary email: <<borrower_modifications.emailpro>></li>
391
    <li>Secondary phone:<<borrower_modifications.phonepro>></li>
392
    <li>Home library: <<borrower_modifications.branchcode>></li>
393
    <li>Temporary patron category: <<borrower_modifications.categorycode>></li>
394
    </ul>
395
    </p>
396
    <p>
397
    If you wish to create a Koha patron account thereby giving this patron Opac access please click on this verification link:
398
    <p>
399
    <p>
400
    <<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>&approved=1
401
    </p>
402
    <p>
403
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.
404
    </p>', 1, 'email'), ('members', 'SELF_REG_APPROVED', 'Self registration approved', 'Your self registration has been approved', '<h3>Please click the password reset link below to reset your Koha password then you will be able to login to the OPAC:</h3>
405
    <p>
406
    <<OPACBaseURL>>/cgi-bin/koha/opac-password-recovery.pl?borrowernumber=<<borrowers.borrowernumber>>
407
    </p>', 1, 'email');
(-)a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql (+29 lines)
Lines 378-380 INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, Link Here
378
    </tr>
378
    </tr>
379
</tfoot>
379
</tfoot>
380
</table>', 'print', 'default');
380
</table>', 'print', 'default');
381
382
INSERT IGNORE INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('members', 'STAFF_VER_OPAC_REG', 'New patron Opac Self-Registration to verify', 'Verify new Opac patron self registration', '<h3>Opac self registration pending verification</h3>
383
<p><h4>Submitted Opac patron self registration:<h4>
384
    <ul>
385
    <li><<borrower_modifications.cardnumber>></li>
386
    <li><<borrower_modifications.title>> <<borrower_modifications.firstname>> <<borrower_modifications.surname>></li>
387
    <li>Physical address: <<borrower_modifications.streetnumber>> <<borrower_modifications.streettype>> <<borrower_modifications.address>> <<borrower_modifications.address2>>, <<borrower_modifications.city>>, <<borrower_modifications.state>> <<borrower_modifications.zipcode>>, <<borrower_modifications.country>></li>
388
    <li>Email: <<borrower_modifications.email>></li>
389
    <li>Phone: <<borrower_modifications.phone>></li>
390
    <li>Mobile: <<borrower_modifications.mobile>></li>
391
    <li>Fax: <<borrower_modifications.fax>></li>
392
    <li>Secondary email: <<borrower_modifications.emailpro>></li>
393
    <li>Secondary phone:<<borrower_modifications.phonepro>></li>
394
    <li>Home library: <<borrower_modifications.branchcode>></li>
395
    <li>Temporary patron category: <<borrower_modifications.categorycode>></li>
396
    </ul>
397
    </p>
398
    <p>
399
    If you wish to create a Koha patron account thereby giving this patron Opac access please click on this verification link:
400
    <p>
401
    <p>
402
    <<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>&approved=1
403
    </p>
404
    <p>
405
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.
406
    </p>', 1, 'email'), ('members', 'SELF_REG_APPROVED', 'Self registration approved', 'Your self registration has been approved', '<h3>Please click the password reset link below to reset your Koha password then you will be able to login to the OPAC:</h3>
407
    <p>
408
    <<OPACBaseURL>>/cgi-bin/koha/opac-password-recovery.pl?borrowernumber=<<borrowers.borrowernumber>>
409
    </p>', 1, 'email');
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 497-502 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
497
('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'),
497
('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'),
498
('PatronSelfRegistrationLibraryList','',NULL,'Only display libraries listed. If empty, all libraries are displayed.','Free'),
498
('PatronSelfRegistrationLibraryList','',NULL,'Only display libraries listed. If empty, all libraries are displayed.','Free'),
499
('PatronSelfRegistrationPrefillForm','1',NULL,'Display password and prefill login form after a patron has self registered','YesNo'),
499
('PatronSelfRegistrationPrefillForm','1',NULL,'Display password and prefill login form after a patron has self registered','YesNo'),
500
('PatronSelfRegistrationVerificationRecipient', 'RegisteringPatron', 'PatronSelfRegistrationVerificationRecipientAddress|BranchEmailAddress|KohaAdminEmailAddress|RegisteringPatron', 'Choose email address that self registering users verification email will be sent to', 0, 'Choice'),
501
('PatronSelfRegistrationVerificationRecipientAddress', '', '', 'If you choose PatronSelfRegistrationVerificationRecipientAddress you have to enter a valid email address:', 'free'),
500
('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'),
502
('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'),
501
('PatronsPerPage','20','20','Number of Patrons Per Page displayed by default','Integer'),
503
('PatronsPerPage','20','20','Number of Patrons Per Page displayed by default','Integer'),
502
('EnablePayPalOpacPayments',  '0', NULL ,  'Enables the ability to pay fees and fines from  the OPAC via PayPal',  'YesNo' ),
504
('EnablePayPalOpacPayments',  '0', NULL ,  'Enables the ability to pay fees and fines from  the OPAC via PayPal',  'YesNo' ),
(-)a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql (+29 lines)
Lines 469-471 INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, Link Here
469
    </tr>
469
    </tr>
470
</tfoot>
470
</tfoot>
471
</table>', 'print', 'default');
471
</table>', 'print', 'default');
472
473
INSERT IGNORE INTO `letter` (module, code, name, title, content, is_html, message_transport_type) VALUES ('members', 'STAFF_VER_OPAC_REG', 'New patron Opac Self-Registration to verify', 'Verify new Opac patron self registration', '<h3>Opac self registration pending verification</h3>
474
<p><h4>Submitted Opac patron self registration:<h4>
475
    <ul>
476
    <li><<borrower_modifications.cardnumber>></li>
477
    <li><<borrower_modifications.title>> <<borrower_modifications.firstname>> <<borrower_modifications.surname>></li>
478
    <li>Physical address: <<borrower_modifications.streetnumber>> <<borrower_modifications.streettype>> <<borrower_modifications.address>> <<borrower_modifications.address2>>, <<borrower_modifications.city>>, <<borrower_modifications.state>> <<borrower_modifications.zipcode>>, <<borrower_modifications.country>></li>
479
    <li>Email: <<borrower_modifications.email>></li>
480
    <li>Phone: <<borrower_modifications.phone>></li>
481
    <li>Mobile: <<borrower_modifications.mobile>></li>
482
    <li>Fax: <<borrower_modifications.fax>></li>
483
    <li>Secondary email: <<borrower_modifications.emailpro>></li>
484
    <li>Secondary phone:<<borrower_modifications.phonepro>></li>
485
    <li>Home library: <<borrower_modifications.branchcode>></li>
486
    <li>Temporary patron category: <<borrower_modifications.categorycode>></li>
487
    </ul>
488
    </p>
489
    <p>
490
    If you wish to create a Koha patron account thereby giving this patron Opac access please click on this verification link:
491
    <p>
492
    <p>
493
    <<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>&approved=1
494
    </p>
495
    <p>
496
    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.
497
    </p>', 1, 'email'), ('members', 'SELF_REG_APPROVED', 'Self registration approved', 'Your self registration has been approved', '<h3>Please click the password reset link below to reset your Koha password then you will be able to login to the OPAC:</h3>
498
    <p>
499
    <<OPACBaseURL>>/cgi-bin/koha/opac-password-recovery.pl?borrowernumber=<<borrowers.borrowernumber>>
500
    </p>', 1, 'email');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+13 lines)
Lines 826-831 OPAC: Link Here
826
            - "library patrons to register or modify their account via the OPAC."
826
            - "library patrons to register or modify their account via the OPAC."
827
            - "<br><strong>NOTE:</strong> This needs PatronSelfRegistrationDefaultCategory to be set to a valid patron category code."
827
            - "<br><strong>NOTE:</strong> This needs PatronSelfRegistrationDefaultCategory to be set to a valid patron category code."
828
        -
828
        -
829
            - "Choose email address that self registration verification emails will be sent to: "
830
            - pref: PatronSelfRegistrationVerificationRecipient
831
              default: RegisteringPatron
832
              choices:
833
                  RegisteringPatron: email address of Self registering patron
834
                  PatronSelfRegistrationVerificationRecipientAddress: PatronSelfRegistrationVerificationRecipientAddress
835
                  BranchEmailAddress: email address of branch
836
                  KohaAdminEmailAddress: KohaAdminEmailAddress
837
            - "<br><strong>NOTE:</strong> This system preferences requires the PatronSelfRegistrationVerifyByEmail to be set to Require."
838
            - "<br>If you choose PatronSelfRegistrationVerificationRecipientAddress you have to enter a valid email address:"
839
            - pref: PatronSelfRegistrationVerificationRecipientAddress
840
              class: email
841
        -
829
            - pref: PatronSelfRegistrationVerifyByEmail
842
            - pref: PatronSelfRegistrationVerifyByEmail
830
              choices:
843
              choices:
831
                  yes: Require
844
                  yes: Require
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt (-1 / +10 lines)
Lines 31-36 Link Here
31
                    <div class="span9">
31
                    <div class="span9">
32
                [% END %]
32
                [% END %]
33
33
34
                [% IF verificationapproved == 1 %]
35
                    <div id="registration-complete">
36
                        <h1>New patron registered!</h1>
37
38
                        <p>You have successfully registered a new Koha patron account for [% borrower.firstname | html %] [% borrower.surname | html %].</p>
39
                        <p>An email containing a password reset link has been sent to [% borrower.firstname | html %] [% borrower.surname | html %]'s email address: [% borrower.email | html %]:</p>
40
                        <p>Once [% borrower.firstname | html %] [% borrower.surname | html %] has reset their password they will be able to log into and use the Koha OPAC.</p>
41
                    </div>
42
                [% ELSE %]
34
                    <div id="registration-complete">
43
                    <div id="registration-complete">
35
                        <h1>Registration Complete!</h1>
44
                        <h1>Registration Complete!</h1>
36
45
Lines 65-71 Link Here
65
74
66
                        <div id="PatronSelfRegistrationAdditionalInstructions">[% PatronSelfRegistrationAdditionalInstructions | $raw %]</div>
75
                        <div id="PatronSelfRegistrationAdditionalInstructions">[% PatronSelfRegistrationAdditionalInstructions | $raw %]</div>
67
                    </div>
76
                    </div>
68
77
                [% END %]
69
                </div> <!-- / .span7/9 -->
78
                </div> <!-- / .span7/9 -->
70
79
71
                    [% SET OpacNavRight = KohaNews.get( location => "OpacNavRight", lang => news_lang, library => branchcode ) %]
80
                    [% SET OpacNavRight = KohaNews.get( location => "OpacNavRight", lang => news_lang, library => branchcode ) %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-email-sent.tt (+12 lines)
Lines 25-30 Link Here
25
                [% ELSE %]
25
                [% ELSE %]
26
                    <div class="span12">
26
                    <div class="span12">
27
                [% END %]
27
                [% END %]
28
                [% IF verificationrecipient == 'RegisteringPatron' %]
28
                    <div id="reistration-confirmation-pending">
29
                    <div id="reistration-confirmation-pending">
29
                        <div id="confirmation-pending" class="alert alert-info">
30
                        <div id="confirmation-pending" class="alert alert-info">
30
                            <h1>Please confirm your registration</h1>
31
                            <h1>Please confirm your registration</h1>
Lines 34-39 Link Here
34
                            <p>Your account will not be activated until you follow the link provided in the confirmation email.</p>
35
                            <p>Your account will not be activated until you follow the link provided in the confirmation email.</p>
35
                        </div>
36
                        </div>
36
                    </div>
37
                    </div>
38
                [% ELSE %]
39
                    <div id="registration-confirmation-pending">
40
                        <div id="confirmation-pending" class="alert alert-info">
41
                            <h1>Thank you for submitting your library registration</h1>
42
43
                            <p>A library staff member will review your registration shortly, and if approved an email will be sent to <strong>[% email | html %]</strong> containing your OPAC login credentials.</p>
44
45
                            <p>Your account will not be activated until it has been approved by a library staff member.</p>
46
                        </div>
47
                    </div>
48
                [% END %]
37
                </div>
49
                </div>
38
            </div>
50
            </div>
39
        </div>
51
        </div>
(-)a/opac/opac-memberentry.pl (-12 / +56 lines)
Lines 182-209 if ( $action eq 'create' ) { Link Here
182
182
183
            Koha::Patron::Modification->new( \%borrower )->store();
183
            Koha::Patron::Modification->new( \%borrower )->store();
184
184
185
            #Send verification email
185
            my $verificationrecipient = C4::Context->preference("PatronSelfRegistrationVerificationRecipient");
186
            my $letter = C4::Letters::GetPreparedLetter(
186
            my $customverificationrecipient = C4::Context->preference("PatronSelfRegistrationVerificationRecipientAddress");
187
                module      => 'members',
187
            # Determine the 'to_address' of the verification email
188
                letter_code => 'OPAC_REG_VERIFY',
188
            my $toaddress;
189
                lang        => 'default', # Patron does not have a preferred language defined yet
189
            if ($verificationrecipient eq "BranchEmailAddress" ) {
190
                tables      => {
190
                my $library = Koha::Libraries->find( $borrower{branchcode} );
191
                    borrower_modifications => $verification_token,
191
                $toaddress = $library->branchreplyto
192
                },
192
                || $library->branchemail
193
            );
193
                || C4::Context->preferences('ReplytoDefault')
194
                || C4::Context->preferences('KohaAdminEmailAddress')
195
            }
196
            elsif ( $verificationrecipient eq "KohaAdminEmailAddress" ) {
197
                $toaddress = C4::Context->preference('ReplytoDefault')
198
                || C4::Context->preference('KohaAdminEmailAddress');
199
200
            } elsif ( $verificationrecipient eq "RegisteringPatron" ) {
201
                $toaddress = $borrower{'email'}
202
            } else {
203
                $toaddress =
204
                    $customverificationrecipient
205
                 || C4::Context->preference('ReplytoDefault')
206
                 || C4::Context->preference('KohaAdminEmailAddress');
207
            }
208
            $template->param( verificationrecipient => $verificationrecipient );
209
210
            my $letter;
211
            if ($verificationrecipient eq "RegisteringPatron" ) {
212
                # Send verification email directly to registering patron
213
                $letter = C4::Letters::GetPreparedLetter(
214
                    module      => 'members',
215
                    letter_code => 'OPAC_REG_VERIFY',
216
                    lang        => 'default', # Patron does not have a preferred language defined yet
217
                    tables      => {
218
                        borrower_modifications => $verification_token,
219
                    },
220
                );
221
            } else {
222
                # Send verification email to library
223
                $letter = C4::Letters::GetPreparedLetter(
224
                    module      => 'members',
225
                    letter_code => 'STAFF_VER_OPAC_REG',
226
                    lang        => 'default', # Patron does not have a preferred language defined yet
227
                    tables      => {
228
                        borrower_modifications => $verification_token,
229
                    },
230
                );
231
            }
194
232
195
            C4::Letters::EnqueueLetter(
233
            C4::Letters::EnqueueLetter(
196
                {
234
                {
197
                    letter                 => $letter,
235
                    letter                 => $letter,
198
                    message_transport_type => 'email',
236
                    message_transport_type => 'email',
199
                    to_address             => $borrower{'email'},
237
                    to_address             => $toaddress,
200
                    from_address =>
238
                    from_address =>
201
                      C4::Context->preference('KohaAdminEmailAddress'),
239
                      C4::Context->preference('KohaAdminEmailAddress'),
202
                }
240
                }
203
            );
241
            );
204
            my $num_letters_attempted = C4::Letters::SendQueuedMessages( {
242
            if ($verificationrecipient eq "RegisteringPatron") {
243
                my $num_letters_attempted = C4::Letters::SendQueuedMessages( {
205
                    letter_code => 'OPAC_REG_VERIFY'
244
                    letter_code => 'OPAC_REG_VERIFY'
206
                    } );
245
                } );
246
            } else {
247
                 my $num_letters_attempted = C4::Letters::SendQueuedMessages( {
248
                    letter_code => 'STAFF_VER_OPAC_REG'
249
                } );
250
            }
207
        }
251
        }
208
        else {
252
        else {
209
            ( $template, $borrowernumber, $cookie ) = get_template_and_user(
253
            ( $template, $borrowernumber, $cookie ) = get_template_and_user(
(-)a/opac/opac-password-recovery.pl (-1 / +7 lines)
Lines 34-39 my $uniqueKey = $query->param('uniqueKey'); Link Here
34
my $username       = $query->param('username') // q{};
34
my $username       = $query->param('username') // q{};
35
my $borrower_number;
35
my $borrower_number;
36
36
37
$borrower_number = $query->param('borrowernumber') if ($query->param('borrowernumber'));
38
37
#errors
39
#errors
38
my $hasError;
40
my $hasError;
39
41
Lines 208-214 elsif ($uniqueKey) { #reset password form Link Here
208
    );
210
    );
209
}
211
}
210
else {    #password recovery form (to send email)
212
else {    #password recovery form (to send email)
211
    $template->param( password_recovery => 1 );
213
    my $borrower = Koha::Patrons->find($borrower_number);
214
    $template->param( email => $borrower->email, username => $borrower->userid ) if $borrower;
215
    $template->param(
216
        password_recovery => 1,
217
    );
212
}
218
}
213
219
214
output_html_with_http_headers $query, $cookie, $template->output;
220
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/opac/opac-registration-verify.pl (-1 / +28 lines)
Lines 38-43 unless ( C4::Context->preference('PatronSelfRegistration') ) { Link Here
38
38
39
my $token = $cgi->param('token');
39
my $token = $cgi->param('token');
40
my $m = Koha::Patron::Modifications->find( { verification_token => $token } );
40
my $m = Koha::Patron::Modifications->find( { verification_token => $token } );
41
my $verificationapproval = $cgi->param('approved');
41
42
42
my ( $template, $borrowernumber, $cookie );
43
my ( $template, $borrowernumber, $cookie );
43
44
Lines 67-72 if ( Link Here
67
    delete $patron_attrs->{changed_fields};
68
    delete $patron_attrs->{changed_fields};
68
    my $patron = Koha::Patron->new( $patron_attrs )->store;
69
    my $patron = Koha::Patron->new( $patron_attrs )->store;
69
70
71
    if ($verificationapproval) {
72
        # Send password reset email directly to registering patron
73
        my $letter = C4::Letters::GetPreparedLetter(
74
            module      => 'members',
75
            letter_code => 'SELF_REG_APPROVED',
76
            lang        => 'default', # Patron does not have a preferred language defined yet
77
            tables      => {
78
                borrowers => $patron->borrowernumber,
79
            },
80
        );
81
82
        C4::Letters::EnqueueLetter(
83
            {
84
                letter                 => $letter,
85
                message_transport_type => 'email',
86
                to_address             => $patron->email,
87
                from_address           => C4::Context->preference('KohaAdminEmailAddress'),
88
            }
89
        );
90
91
        my $num_letters_attempted = C4::Letters::SendQueuedMessages( {
92
            letter_code => 'SELF_REG_APPROVED'
93
        } );
94
95
        $template->param( verificationapproved => $verificationapproval );
96
    }
97
70
    Koha::Patron::Consent->new({ borrowernumber => $patron->borrowernumber, type => 'GDPR_PROCESSING', given_on => $consent_dt })->store if $consent_dt;
98
    Koha::Patron::Consent->new({ borrowernumber => $patron->borrowernumber, type => 'GDPR_PROCESSING', given_on => $consent_dt })->store if $consent_dt;
71
99
72
    if ($patron) {
100
    if ($patron) {
73
- 

Return to bug 25090