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 448-453 Link Here
448
                                                <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>
448
                                                <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>
449
                                            [% END %]
449
                                            [% END %]
450
                                        </li>
450
                                        </li>
451
                                        [% IF CAN_user_superlibrarian %]
452
                                            <li id="patron-password_expiration_date">
453
                                                <span class="label">Password expires:</span>
454
                                                [% IF ( patron.password_expiration_date ) %]
455
                                                    [% patron.password_expiration_date | $KohaDates %]
456
                                                [% ELSE %]
457
                                                    Never
458
                                                [% END %]
459
                                            </li>
460
                                        [% END %]
451
461
452
                                        [% IF ( patron.borrowernotes ) %]
462
                                        [% IF ( patron.borrowernotes ) %]
453
                                            <li id="patron-borrowernotes">
463
                                            <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 792-798 if (C4::Context->preference('uppercasesurnames')) { Link Here
792
    $data{'contactname'} &&= uc( $data{'contactname'} );
797
    $data{'contactname'} &&= uc( $data{'contactname'} );
793
}
798
}
794
799
795
foreach (qw(dateenrolled dateexpiry dateofbirth)) {
800
foreach (qw(dateenrolled dateexpiry dateofbirth password_expiration_date)) {
796
    if ( $data{$_} ) {
801
    if ( $data{$_} ) {
797
       $data{$_} = eval { output_pref({ dt => dt_from_string( $data{$_} ), dateonly => 1 } ); };  # back to syspref for display
802
       $data{$_} = eval { output_pref({ dt => dt_from_string( $data{$_} ), dateonly => 1 } ); };  # back to syspref for display
798
    }
803
    }
Lines 839-844 $template->param( Link Here
839
  nok     => $nok,#flag to know if an error
844
  nok     => $nok,#flag to know if an error
840
  NoUpdateLogin =>  $NoUpdateLogin,
845
  NoUpdateLogin =>  $NoUpdateLogin,
841
  NoUpdateEmail =>  $NoUpdateEmail,
846
  NoUpdateEmail =>  $NoUpdateEmail,
847
  CanUpdatePasswordExpiration => $CanUpdatePasswordExpiration,
842
  );
848
  );
843
849
844
# Generate CSRF token
850
# Generate CSRF token
845
- 

Return to bug 29926