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

(-)a/circ/circulation.pl (+1 lines)
Lines 785-790 $template->param( Link Here
785
    patron_lists_count      => $patron_lists_count,
785
    patron_lists_count      => $patron_lists_count,
786
    override_high_holds     => $override_high_holds,
786
    override_high_holds     => $override_high_holds,
787
    nopermission            => scalar $query->param('nopermission'),
787
    nopermission            => scalar $query->param('nopermission'),
788
    noguarantor             => scalar $query->param('noguarantor'),
788
    autoswitched            => $autoswitched,
789
    autoswitched            => $autoswitched,
789
    logged_in_user          => $logged_in_user,
790
    logged_in_user          => $logged_in_user,
790
);
791
);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+4 lines)
Lines 105-110 Link Here
105
                        <div class="alert alert-warning">Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.</div>
105
                        <div class="alert alert-warning">Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.</div>
106
                    [% END %]
106
                    [% END %]
107
107
108
                    [% IF ( noguarantor ) %]
109
                        <div class="alert alert-warning">This patron could not be renewed: they need a guarantor.</div>
110
                    [% END %]
111
108
                    [% IF is_anonymous %]
112
                    [% IF is_anonymous %]
109
                        <div class="alert alert-warning">This is the anonymous patron, so circulation is disabled.</div>
113
                        <div class="alert alert-warning">This is the anonymous patron, so circulation is disabled.</div>
110
                    [% END %]
114
                    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+4 lines)
Lines 81-86 Link Here
81
                                <h3>Unable to delete patron</h3>
81
                                <h3>Unable to delete patron</h3>
82
                                <p>Insufficient privileges.</p>
82
                                <p>Insufficient privileges.</p>
83
                            [% END %]
83
                            [% END %]
84
                            [% IF ( error == 'CANT_RENEW_CHILD_WITHOUT_GUARANTOR' ) %]
85
                                <h3>Unable to renew patron</h3>
86
                                <p>They must have a guarantor defined</p>
87
                            [% END %]
84
                        </div>
88
                        </div>
85
                    [% END %]
89
                    [% END %]
86
90
(-)a/members/setstatus.pl (-4 / +21 lines)
Lines 24-29 Link Here
24
# along with Koha; if not, see <http://www.gnu.org/licenses>.
24
# along with Koha; if not, see <http://www.gnu.org/licenses>.
25
25
26
use Modern::Perl;
26
use Modern::Perl;
27
use Try::Tiny;
27
28
28
use CGI qw ( -utf8 );
29
use CGI qw ( -utf8 );
29
use C4::Auth qw( checkauth );
30
use C4::Auth qw( checkauth );
Lines 47-59 my $dateexpiry; Link Here
47
my $logged_in_user = Koha::Patrons->find( { userid =>  $loggedinuserid } );
48
my $logged_in_user = Koha::Patrons->find( { userid =>  $loggedinuserid } );
48
my $patron         = Koha::Patrons->find( $borrowernumber );
49
my $patron         = Koha::Patrons->find( $borrowernumber );
49
50
51
my $cannot_renew = '0';
52
50
# 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
51
# not allowed to modify this patron.
54
# not allowed to modify this patron.
52
# But a librarian is not supposed to hack the system
55
# But a librarian is not supposed to hack the system
53
if ( $logged_in_user->can_see_patron_infos($patron) ) {
56
if ( $logged_in_user->can_see_patron_infos($patron) ) {
54
    if ( $reregistration eq 'y' ) {
57
    if ( $reregistration eq 'y' ) {
58
55
        # re-reregistration function to automatic calcul of date expiry
59
        # re-reregistration function to automatic calcul of date expiry
56
        $dateexpiry = $patron->renew_account;
60
        try {
61
            $dateexpiry = $patron->renew_account;
62
        } catch {
63
            if ( ref($_) eq 'Koha::Exceptions::Patron::Relationship::NoGuarantor' ) {
64
                $cannot_renew = '1';
65
            } else {
66
                $_->rethrow();
67
            }
68
        }
57
    } else {
69
    } else {
58
        my $sth = $dbh->prepare("UPDATE borrowers SET debarred = ?, debarredcomment = '' WHERE borrowernumber = ?");
70
        my $sth = $dbh->prepare("UPDATE borrowers SET debarred = ?, debarredcomment = '' WHERE borrowernumber = ?");
59
        $sth->execute( $status, $borrowernumber );
71
        $sth->execute( $status, $borrowernumber );
Lines 62-74 if ( $logged_in_user->can_see_patron_infos($patron) ) { Link Here
62
}
74
}
63
75
64
if($destination eq "circ"){
76
if($destination eq "circ"){
65
    if($dateexpiry){
77
    if ($cannot_renew) {
78
        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&noguarantor=1");
79
    } elsif ($dateexpiry) {
66
        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&was_renewed=1");
80
        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&was_renewed=1");
67
    } else {
81
    } else {
68
        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
82
        print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber");
69
    }
83
    }
70
} else {
84
} else {
71
    if($dateexpiry){
85
    if ($cannot_renew) {
86
        print $input->redirect(
87
            "/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber&error=CANT_RENEW_CHILD_WITHOUT_GUARANTOR"
88
        );
89
    } elsif ($dateexpiry) {
72
        print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber&was_renewed=1");
90
        print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber&was_renewed=1");
73
    } else {
91
    } else {
74
        print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber");
92
        print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber");
75
- 

Return to bug 38847