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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-2 / +11 lines)
Lines 176-181 legend:hover { Link Here
176
                                    [% IF ( ERROR_password_mismatch ) %]
176
                                    [% IF ( ERROR_password_mismatch ) %]
177
                                        <li id="ERROR_password_mismatch">Passwords do not match.</li>
177
                                        <li id="ERROR_password_mismatch">Passwords do not match.</li>
178
                                    [% END %]
178
                                    [% END %]
179
                                    [% IF ( ERROR_password_expiration_date ) %]
180
                                        <li id="ERROR_dateexpiry">Password expiration date is invalid.</li>
181
                                    [% END %]
179
                                    [% IF ( ERROR_extended_unique_id_failed ) %]
182
                                    [% IF ( ERROR_extended_unique_id_failed ) %]
180
                                        <li id="ERROR_extended_unique_id_failed"><strong>[% ERROR_extended_unique_id_failed_description | html %]:</strong> Attribute value "[% ERROR_extended_unique_id_failed_value | html %]" is already in use by another patron record.</li>
183
                                        <li id="ERROR_extended_unique_id_failed"><strong>[% ERROR_extended_unique_id_failed_description | html %]:</strong> Attribute value "[% ERROR_extended_unique_id_failed_value | html %]" is already in use by another patron record.</li>
181
                                    [% END %]
184
                                    [% END %]
Lines 1129-1135 legend:hover { Link Here
1129
                                    </fieldset> <!-- /#memberentry_subscription -->
1132
                                    </fieldset> <!-- /#memberentry_subscription -->
1130
                                [% END # hide fieldset %]
1133
                                [% END # hide fieldset %]
1131
1134
1132
                                [% UNLESS nouserid && nopassword %]
1135
                                [% UNLESS nouserid && nopassword && !CanUpdatePasswordExpiration %]
1133
                                    <fieldset class="rows" id="memberentry_userid">
1136
                                    <fieldset class="rows" id="memberentry_userid">
1134
                                        <legend id="opac_staff_login_lgd">OPAC/Staff interface login</legend>
1137
                                        <legend id="opac_staff_login_lgd">OPAC/Staff interface login</legend>
1135
                                        <ol>
1138
                                        <ol>
Lines 1274-1282 legend:hover { Link Here
1274
                                                    [% END %]
1277
                                                    [% END %]
1275
                                                </li>
1278
                                                </li>
1276
                                            [% END # /UNLESS nopassword %]
1279
                                            [% END # /UNLESS nopassword %]
1280
                                            [% UNLESS ( !CanUpdatePasswordExpiration ) %]
1281
                                                <li>
1282
                                                    <label for="password_expiration_date">Password expiration date:</label>
1283
                                                    <input type="text" id="password_expiration_date" name="password_expiration_date" maxlength="10" size="10" value="[% password_expiration_date | html %]" class="flatpickr" />
1284
                                                </li>
1285
                                            [% END %]
1277
                                        </ol>
1286
                                        </ol>
1278
                                    </fieldset> <!-- /#memberentry_userid -->
1287
                                    </fieldset> <!-- /#memberentry_userid -->
1279
                                [% END # UNLESS nouserid && nopassword %]
1288
                                [% END # UNLESS nouserid && nopassword && !CanUpdatePasswordExpiration %]
1280
1289
1281
                                <!--this zones are not necessary in modif mode -->
1290
                                <!--this zones are not necessary in modif mode -->
1282
                                [% UNLESS ( opadd || opduplicate ) %]
1291
                                [% UNLESS ( opadd || opduplicate ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+10 lines)
Lines 489-494 Link Here
489
                                                <i class="fa fa-exclamation-circle problem" aria-hidden="true"></i> <a href="/cgi-bin/koha/members/member-password.pl?member=[% patron.borrowernumber | uri %]">Undefined</a>
489
                                                <i class="fa fa-exclamation-circle problem" aria-hidden="true"></i> <a href="/cgi-bin/koha/members/member-password.pl?member=[% patron.borrowernumber | uri %]">Undefined</a>
490
                                            [% END %]
490
                                            [% END %]
491
                                        </li>
491
                                        </li>
492
                                        [% IF CAN_user_superlibrarian %]
493
                                            <li id="patron-password_expiration_date">
494
                                                <span class="label">Password expires:</span>
495
                                                [% IF ( patron.password_expiration_date ) %]
496
                                                    [% patron.password_expiration_date | $KohaDates %]
497
                                                [% ELSE %]
498
                                                    Never
499
                                                [% END %]
500
                                            </li>
501
                                        [% END %]
492
502
493
                                        [% IF ( patron.borrowernotes ) %]
503
                                        [% IF ( patron.borrowernotes ) %]
494
                                            <li id="patron-borrowernotes">
504
                                            <li id="patron-borrowernotes">
(-)a/members/memberentry.pl (-3 / +8 lines)
Lines 92-97 my @errors; Link Here
92
my $borrower_data;
92
my $borrower_data;
93
my $NoUpdateLogin;
93
my $NoUpdateLogin;
94
my $NoUpdateEmail;
94
my $NoUpdateEmail;
95
my $CanUpdatePasswordExpiration;
95
my $userenv = C4::Context->userenv;
96
my $userenv = C4::Context->userenv;
96
my @messages;
97
my @messages;
97
98
Lines 166-171 if ( $op eq 'modify' or $op eq 'save' or $op eq 'duplicate' ) { Link Here
166
    if ( $patron->is_superlibrarian && !$logged_in_user->is_superlibrarian ) {
167
    if ( $patron->is_superlibrarian && !$logged_in_user->is_superlibrarian ) {
167
        $NoUpdateEmail = 1;
168
        $NoUpdateEmail = 1;
168
    }
169
    }
170
    if ($logged_in_user->is_superlibrarian) {
171
        $CanUpdatePasswordExpiration = 1;
172
    }
169
173
170
    $borrower_data = $patron->unblessed;
174
    $borrower_data = $patron->unblessed;
171
    $borrower_data->{category_type} = $patron->category->category_type;
175
    $borrower_data->{category_type} = $patron->category->category_type;
Lines 194-200 if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' ) Link Here
194
        }
198
        }
195
    }
199
    }
196
200
197
    foreach (qw(dateenrolled dateexpiry dateofbirth)) {
201
    foreach (qw(dateenrolled dateexpiry dateofbirth password_expiration_date)) {
198
        next unless exists $newdata{$_};
202
        next unless exists $newdata{$_};
199
        my $userdate = $newdata{$_} or next;
203
        my $userdate = $newdata{$_} or next;
200
204
Lines 244-249 if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' ) Link Here
244
        qr/^delete_guarantor$/,
248
        qr/^delete_guarantor$/,
245
    );
249
    );
246
    push @keys_to_delete, map { qr/^$_$/ } split( /\s*\|\s*/, C4::Context->preference('BorrowerUnwantedField') || q{} );
250
    push @keys_to_delete, map { qr/^$_$/ } split( /\s*\|\s*/, C4::Context->preference('BorrowerUnwantedField') || q{} );
251
    push @keys_to_delete, qr/^password_expiration_date$/ unless $CanUpdatePasswordExpiration;
247
    for my $regexp (@keys_to_delete) {
252
    for my $regexp (@keys_to_delete) {
248
        for (keys %newdata) {
253
        for (keys %newdata) {
249
            delete($newdata{$_}) if /$regexp/;
254
            delete($newdata{$_}) if /$regexp/;
Lines 790-796 if (C4::Context->preference('uppercasesurnames')) { Link Here
790
    $data{'contactname'} &&= uc( $data{'contactname'} );
795
    $data{'contactname'} &&= uc( $data{'contactname'} );
791
}
796
}
792
797
793
foreach (qw(dateenrolled dateexpiry dateofbirth)) {
798
foreach (qw(dateenrolled dateexpiry dateofbirth password_expiration_date)) {
794
    if ( $data{$_} ) {
799
    if ( $data{$_} ) {
795
       $data{$_} = eval { output_pref({ dt => dt_from_string( $data{$_} ), dateonly => 1 } ); };  # back to syspref for display
800
       $data{$_} = eval { output_pref({ dt => dt_from_string( $data{$_} ), dateonly => 1 } ); };  # back to syspref for display
796
    }
801
    }
Lines 837-842 $template->param( Link Here
837
  nok     => $nok,#flag to know if an error
842
  nok     => $nok,#flag to know if an error
838
  NoUpdateLogin =>  $NoUpdateLogin,
843
  NoUpdateLogin =>  $NoUpdateLogin,
839
  NoUpdateEmail =>  $NoUpdateEmail,
844
  NoUpdateEmail =>  $NoUpdateEmail,
845
  CanUpdatePasswordExpiration => $CanUpdatePasswordExpiration,
840
  );
846
  );
841
847
842
# Generate CSRF token
848
# Generate CSRF token
843
- 

Return to bug 29926