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

(-)a/circ/circulation.pl (-1 / +3 lines)
Lines 776-782 if ( $restoreduedatespec || $stickyduedate ) { Link Here
776
$template->param(
776
$template->param(
777
    borrowernumber            => $borrowernumber,
777
    borrowernumber            => $borrowernumber,
778
    branch                    => $branch,
778
    branch                    => $branch,
779
    was_renewed               => scalar $query->param('was_renewed') ? 1 : 0,
779
    was_renewed               => scalar $query->param('was_renewed')  ? 1 : 0,
780
    was_resetted              => scalar $query->param('was_resetted') ? 1 : 0,
780
    barcodes                  => $barcodes,
781
    barcodes                  => $barcodes,
781
    stickyduedate             => $stickyduedate,
782
    stickyduedate             => $stickyduedate,
782
    duedatespec               => $duedatespec,
783
    duedatespec               => $duedatespec,
Lines 814-819 $template->param( Link Here
814
    override_high_holds     => $override_high_holds,
815
    override_high_holds     => $override_high_holds,
815
    nopermission            => scalar $query->param('nopermission'),
816
    nopermission            => scalar $query->param('nopermission'),
816
    noguarantor             => scalar $query->param('noguarantor'),
817
    noguarantor             => scalar $query->param('noguarantor'),
818
    noresetnoguarantor      => scalar $query->param('noresetnoguarantor'),
817
    autoswitched            => $autoswitched,
819
    autoswitched            => $autoswitched,
818
    logged_in_user          => $logged_in_user,
820
    logged_in_user          => $logged_in_user,
819
);
821
);
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc (+23 lines)
Lines 67-72 Link Here
67
                    <span>
67
                    <span>
68
                        <a href="/cgi-bin/koha/members/member-password.pl?member=[% patron.borrowernumber | uri %]">Change password</a>
68
                        <a href="/cgi-bin/koha/members/member-password.pl?member=[% patron.borrowernumber | uri %]">Change password</a>
69
                        <span data-bs-toggle="tooltip" title="Resetting password will remove lock on account" data-bs-placement="right" class="fa fa-info-circle"> </span>
69
                        <span data-bs-toggle="tooltip" title="Resetting password will remove lock on account" data-bs-placement="right" class="fa fa-info-circle"> </span>
70
                        or <a href="" class="reset-login" data-bs-toggle="modal" data-bs-target="#resetAttemptsModal"> Reset login attempts </a>
70
                    </span>
71
                    </span>
71
                [% END %]
72
                [% END %]
72
            </li>
73
            </li>
Lines 435-437 Link Here
435
        </div>
436
        </div>
436
    [% END %]
437
    [% END %]
437
[% END # /IF patron_messages %]
438
[% END # /IF patron_messages %]
439
440
<div style="font-style:normal;" class="modal notesModal" id="resetAttemptsModal" tabindex="-1" role="dialog" aria-labelledby="resetAttemptsModalLabel">
441
    <div class="modal-dialog">
442
        <div class="modal-content">
443
            <div class="modal-header">
444
                <h1 class="modal-title" id="resetAttemptsLabel">Confirm reset</h1>
445
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
446
            </div>
447
            <form id="cancel_modal_form" method="post" action="/cgi-bin/koha/members/setstatus.pl">
448
                [% INCLUDE 'csrf-token.inc' %]
449
                <input type="hidden" name="op" value="cud-reset_login_attempts" />
450
                <input type="hidden" name="destination" value="[% moremember ? 'member' : 'circ' | html %]" />
451
                <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | uri %]" />
452
                <div class="modal-body"> This will allow the user to try again and login </div>
453
                <div class="modal-footer">
454
                    <button id="resetAttemptsModalConfirmBtn" type="submit" class="btn btn-primary">Confirm</button>
455
                    <button type="button" class="btn btn-default" data-bs-dismiss="modal">Close</button>
456
                </div>
457
            </form>
458
        </div>
459
    </div>
460
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+2 lines)
Lines 127-132 Link Here
127
127
128
    [% IF ( noguarantor ) %]
128
    [% IF ( noguarantor ) %]
129
        <div class="alert alert-warning">This patron could not be renewed: they need a guarantor.</div>
129
        <div class="alert alert-warning">This patron could not be renewed: they need a guarantor.</div>
130
    [% ELSIF ( noresetnoguarantor ) %]
131
        <div class="alert alert-warning">No operation can be performed on this patron while no guarantor has been defined</div>
130
    [% END %]
132
    [% END %]
131
133
132
    [% IF is_anonymous %]
134
    [% IF is_anonymous %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt (-1 lines)
Lines 351-357 Link Here
351
                    }
351
                    }
352
                }, {
352
                }, {
353
                    "targets": [-5],
353
                    "targets": [-5],
354
                    "className":  "editable",
355
                }, {
354
                }, {
356
                    "targets": [-4],
355
                    "targets": [-4],
357
                    "className":  "editable_int",
356
                    "className":  "editable_int",
(-)a/members/setstatus.pl (-1 / +15 lines)
Lines 39-44 my $destination = $input->param("destination") || ''; Link Here
39
my $borrowernumber = $input->param('borrowernumber');
39
my $borrowernumber = $input->param('borrowernumber');
40
my $status         = $input->param('status');
40
my $status         = $input->param('status');
41
my $reregistration = $input->param('reregistration') || '';
41
my $reregistration = $input->param('reregistration') || '';
42
my $op             = $input->param('op');
42
43
43
my $dbh = C4::Context->dbh;
44
my $dbh = C4::Context->dbh;
44
my $dateexpiry;
45
my $dateexpiry;
Lines 47-52 my $logged_in_user = Koha::Patrons->find( { userid => $loggedinuserid } ); Link Here
47
my $patron         = Koha::Patrons->find($borrowernumber);
48
my $patron         = Koha::Patrons->find($borrowernumber);
48
49
49
my $cannot_renew = '0';
50
my $cannot_renew = '0';
51
my $cannot_reset = '0';
50
52
51
# Ideally we should display a warning on the interface if the logged in user is
53
# Ideally we should display a warning on the interface if the logged in user is
52
# not allowed to modify this patron.
54
# not allowed to modify this patron.
Lines 64-69 if ( $logged_in_user->can_see_patron_infos($patron) ) { Link Here
64
                $_->rethrow();
66
                $_->rethrow();
65
            }
67
            }
66
        }
68
        }
69
    } elsif ( $op == "cud-reset_login_attempts" ) {
70
        try {
71
            $patron->login_attempts(0)->store;
72
            $dateexpiry = $patron->renew_account;
73
        } catch {
74
            if ( ref($_) eq 'Koha::Exceptions::Patron::Relationship::NoGuarantor' ) {
75
                $cannot_reset = '1';
76
            } else {
77
                $_->rethrow();
78
            }
79
        }
67
    } else {
80
    } else {
68
        my $sth = $dbh->prepare("UPDATE borrowers SET debarred = ?, debarredcomment = '' WHERE borrowernumber = ?");
81
        my $sth = $dbh->prepare("UPDATE borrowers SET debarred = ?, debarredcomment = '' WHERE borrowernumber = ?");
69
        $sth->execute( $status, $borrowernumber );
82
        $sth->execute( $status, $borrowernumber );
Lines 74-79 if ( $logged_in_user->can_see_patron_infos($patron) ) { Link Here
74
if ( $destination eq "circ" ) {
87
if ( $destination eq "circ" ) {
75
    if ($cannot_renew) {
88
    if ($cannot_renew) {
76
        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&noguarantor=1");
89
        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&noguarantor=1");
90
    } elsif ($cannot_reset) {
91
        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&noresetnoguarantor=1");
77
    } elsif ($dateexpiry) {
92
    } elsif ($dateexpiry) {
78
        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&was_renewed=1");
93
        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&was_renewed=1");
79
    } else {
94
    } else {
80
- 

Return to bug 37512