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

(-)a/C4/Circulation.pm (-1 / +11 lines)
Lines 2737-2743 sub CanBookBeRenewed { Link Here
2737
            }
2737
            }
2738
        }
2738
        }
2739
    }
2739
    }
2740
2741
    return ( 0, "on_reserve" ) if $resfound;    # '' when no hold was found
2740
    return ( 0, "on_reserve" ) if $resfound;    # '' when no hold was found
2742
2741
2743
    return ( 1, undef ) if $override_limit;
2742
    return ( 1, undef ) if $override_limit;
Lines 2749-2754 sub CanBookBeRenewed { Link Here
2749
    return ( 0, "too_many" )
2748
    return ( 0, "too_many" )
2750
      if $issuingrule->{renewalsallowed} <= $itemissue->{renewals};
2749
      if $issuingrule->{renewalsallowed} <= $itemissue->{renewals};
2751
2750
2751
    my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing');
2752
    my $restrictionblockrenewing = C4::Context->preference('RestrictionBlockRenewing');
2753
    my $restricted = Koha::Borrower::Debarments::IsDebarred($borrowernumber);
2754
    my $hasoverdues = C4::Members::HasOverdues($borrowernumber);
2755
2756
    if ( $restricted and $restrictionblockrenewing ) {
2757
        return ( 0, 'restriction');
2758
    } elsif ( ($hasoverdues and $overduesblockrenewing eq 'block') || ($itemissue->{overdue} and $overduesblockrenewing eq 'blockitem') ) {
2759
        return ( 0, 'overdue');
2760
    }
2761
2752
    if ( $issuingrule->{norenewalbefore} ) {
2762
    if ( $issuingrule->{norenewalbefore} ) {
2753
2763
2754
        # Get current time and add norenewalbefore.
2764
        # Get current time and add norenewalbefore.
(-)a/installer/data/mysql/atomicupdate/bug_8236-add-overduesblockrenewing.sql (+1 lines)
Line 0 Link Here
1
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OverduesBlockRenewing','allow','If any of a patron checked out documents is late, should renewal be allowed, blocked only on overdue items or blocked on whatever checked out document','allow|blockitem|block','Choice');
(-)a/installer/data/mysql/atomicupdate/bug_8236-add-restrictionblockrenewing.sql (+1 lines)
Line 0 Link Here
1
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('RestrictionBlockRenewing','0','If patron is restricted, should renewal be allowed or blocked',NULL,'YesNo');
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 333-338 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
333
('OverdueNoticeBcc','','','Email address to bcc outgoing overdue notices sent by email','free'),
333
('OverdueNoticeBcc','','','Email address to bcc outgoing overdue notices sent by email','free'),
334
('OverdueNoticeCalendar',0,NULL,'Take the calendar into consideration when generating overdue notices','YesNo'),
334
('OverdueNoticeCalendar',0,NULL,'Take the calendar into consideration when generating overdue notices','YesNo'),
335
('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'),
335
('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'),
336
('OverduesBlockRenewing','allow','allow|blockitem|block','If any of patron checked out documents is late, should renewal be allowed, blocked only on overdue items or blocked on whatever checked out document','Choice'),
336
('patronimages','0',NULL,'Enable patron images for the Staff Client','YesNo'),
337
('patronimages','0',NULL,'Enable patron images for the Staff Client','YesNo'),
337
('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'),
338
('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'),
338
('PatronSelfRegistrationAdditionalInstructions','','','A free text field to display additional instructions to newly self registered patrons.','free'),
339
('PatronSelfRegistrationAdditionalInstructions','','','A free text field to display additional instructions to newly self registered patrons.','free'),
Lines 368-373 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
368
('RestrictedPageLocalIPs','',NULL,'Beginning of IP addresses considered as local (comma separated ex: "127.0.0,127.0.2")','Free'),
369
('RestrictedPageLocalIPs','',NULL,'Beginning of IP addresses considered as local (comma separated ex: "127.0.0,127.0.2")','Free'),
369
('RestrictedPageContent','',NULL,'HTML content of the restricted page','TextArea'),
370
('RestrictedPageContent','',NULL,'HTML content of the restricted page','TextArea'),
370
('RestrictedPageTitle','',NULL,'Title of the restricted page (breadcrumb and header)','Free'),
371
('RestrictedPageTitle','',NULL,'Title of the restricted page (breadcrumb and header)','Free'),
372
('RestrictionBlockRenewing','0',NULL,'If patron is restricted, should renewal be allowed or blocked','YesNo'),
371
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
373
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
372
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
374
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
373
('ReturnToShelvingCart','0','','If set, when any item is \'checked in\', it\'s location code will be changed to CART.','YesNo'),
375
('ReturnToShelvingCart','0','','If set, when any item is \'checked in\', it\'s location code will be changed to CART.','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc (+2 lines)
Lines 2-7 Link Here
2
//<![CDATA[
2
//<![CDATA[
3
    var CIRCULATION_RETURNED = _("Checked in");
3
    var CIRCULATION_RETURNED = _("Checked in");
4
    var CIRCULATION_NOT_RETURNED = _("Unable to check in");
4
    var CIRCULATION_NOT_RETURNED = _("Unable to check in");
5
    var NOT_RENEWABLE_OVERDUE = _("Not allowed: overdue");
6
    var NOT_RENEWABLE_RESTRICTION = _("Not allowed: patron restricted");
5
    var CIRCULATION_RENEWED_DUE = _("Renewed, due:");
7
    var CIRCULATION_RENEWED_DUE = _("Renewed, due:");
6
    var CIRCULATION_RENEW_FAILED = _("Renew failed:");
8
    var CIRCULATION_RENEW_FAILED = _("Renew failed:");
7
    var NOT_CHECKED_OUT = _("not checked out");
9
    var NOT_CHECKED_OUT = _("not checked out");
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js (+18 lines)
Lines 106-111 $(document).ready(function() { Link Here
106
                        content += TOO_MANY_RENEWALS;
106
                        content += TOO_MANY_RENEWALS;
107
                    } else if ( data.error == "on_reserve" ) {
107
                    } else if ( data.error == "on_reserve" ) {
108
                        content += ON_RESERVE;
108
                        content += ON_RESERVE;
109
                    } else if ( data.error == "restriction" ) {
110
                        content += NOT_RENEWABLE_RESTRICTION;
111
                    } else if ( data.error == "overdue" ) {
112
                        content += NOT_RENEWABLE_OVERDUE;
109
                    } else if ( data.error ) {
113
                    } else if ( data.error ) {
110
                        content += data.error;
114
                        content += data.error;
111
                    } else {
115
                    } else {
Lines 307-312 $(document).ready(function() { Link Here
307
311
308
                            span_style = "display: none";
312
                            span_style = "display: none";
309
                            span_class = "renewals-allowed";
313
                            span_class = "renewals-allowed";
314
                        } else if ( oObj.can_renew_error == "restriction" ) {
315
                            content += "<span class='renewals-disabled'>"
316
                                    + NOT_RENEWABLE_RESTRICTION
317
                                    + "</span>";
318
319
                            span_style = "display: none";
320
                            span_class = "renewals-allowed";
321
                        } else if ( oObj.can_renew_error == "overdue" ) {
322
                            content += "<span class='renewals-disabled'>"
323
                                    + NOT_RENEWABLE_OVERDUE
324
                                    + "</span>";
325
326
                            span_style = "display: none";
327
                            span_class = "renewals-allowed";
310
                        } else if ( oObj.can_renew_error == "too_soon" ) {
328
                        } else if ( oObj.can_renew_error == "too_soon" ) {
311
                            content += "<span class='renewals-disabled'>"
329
                            content += "<span class='renewals-disabled'>"
312
                                    + NOT_RENEWABLE_TOO_SOON.format( oObj.can_renew_date )
330
                                    + NOT_RENEWABLE_TOO_SOON.format( oObj.can_renew_date )
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+15 lines)
Lines 391-396 Circulation: Link Here
391
                  yes: Enable
391
                  yes: Enable
392
                  no: Disable
392
                  no: Disable
393
            - the on-site for all cases (Even if a user is debarred, etc.).
393
            - the on-site for all cases (Even if a user is debarred, etc.).
394
        -
395
            - When a patron's checked out item is late,
396
            - pref: OverduesBlockRenewing
397
              type: choice
398
              choices:
399
                  allow: allow renewing.
400
                  blockitem: block renewing only for this item.
401
                  block: block renewing for all his items.
402
        -
403
            - If patron is restricted,
404
            - pref: RestrictionBlockRenewing
405
              choices:
406
                  yes: Block
407
                  no: Allow
408
            - renewing of items.
394
    Checkin Policy:
409
    Checkin Policy:
395
        -
410
        -
396
            - pref: BlockReturnOfWithdrawnItems
411
            - pref: BlockReturnOfWithdrawnItems
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (+4 lines)
Lines 230-235 Link Here
230
                                                        <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
230
                                                        <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
231
                                                    [% ELSIF ( ISSUE.too_many ) %]
231
                                                    [% ELSIF ( ISSUE.too_many ) %]
232
                                                        Not renewable
232
                                                        Not renewable
233
                                                    [% ELSIF ( ISSUE.norenew_overdue ) %]
234
                                                        Not allowed <span class="renewals">(overdue on a document)</span>
233
                                                    [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
235
                                                    [% ELSIF ( ISSUE.auto_renew || ISSUE.auto_too_soon ) %]
234
                                                        Automatic renewal
236
                                                        Automatic renewal
235
                                                        <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
237
                                                        <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
Lines 463-468 Link Here
463
                                                                <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% OVERDUE.itemnumber %]&amp;bornum=[% OVERDUE.borrowernumber %]">Renew</a>
465
                                                                <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&amp;item=[% OVERDUE.itemnumber %]&amp;bornum=[% OVERDUE.borrowernumber %]">Renew</a>
464
                                                            [% END %]
466
                                                            [% END %]
465
                                                                <span class="renewals">([% OVERDUE.renewsleft %] of [% OVERDUE.renewsallowed %] renewals remaining)</span>
467
                                                                <span class="renewals">([% OVERDUE.renewsleft %] of [% OVERDUE.renewsallowed %] renewals remaining)</span>
468
                                                        [% ELSIF ( OVERDUE.norenew_overdue ) %]
469
                                                            Not allowed<span class="renewals">(overdue on a document)</span>
466
                                                        [% ELSIF ( OVERDUE.onreserve ) %]
470
                                                        [% ELSIF ( OVERDUE.onreserve ) %]
467
                                                            On hold
471
                                                            On hold
468
                                                        [% ELSE %]
472
                                                        [% ELSE %]
(-)a/opac/opac-user.pl (-1 / +3 lines)
Lines 198-203 if ($issues){ Link Here
198
        if ($renewerror) {
198
        if ($renewerror) {
199
            $issue->{'too_many'}       = 1 if $renewerror eq 'too_many';
199
            $issue->{'too_many'}       = 1 if $renewerror eq 'too_many';
200
            $issue->{'on_reserve'}     = 1 if $renewerror eq 'on_reserve';
200
            $issue->{'on_reserve'}     = 1 if $renewerror eq 'on_reserve';
201
            $issue->{'norenew_overdue'} = 1 if $renewerror eq 'overdue';
201
            $issue->{'auto_renew'}     = 1 if $renewerror eq 'auto_renew';
202
            $issue->{'auto_renew'}     = 1 if $renewerror eq 'auto_renew';
202
            $issue->{'auto_too_soon'}  = 1 if $renewerror eq 'auto_too_soon';
203
            $issue->{'auto_too_soon'}  = 1 if $renewerror eq 'auto_too_soon';
203
204
Lines 244-249 if ($issues){ Link Here
244
                }
245
                }
245
    }
246
    }
246
}
247
}
248
my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing');
249
$canrenew = 0 if ($overduesblockrenewing ne 'allow' and $overdues_count == $count);
247
$template->param( ISSUES       => \@issuedat );
250
$template->param( ISSUES       => \@issuedat );
248
$template->param( issues_count => $count );
251
$template->param( issues_count => $count );
249
$template->param( canrenew     => $canrenew );
252
$template->param( canrenew     => $canrenew );
250
- 

Return to bug 8236