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

(-)a/C4/Circulation.pm (-1 / +11 lines)
Lines 2717-2723 sub CanBookBeRenewed { Link Here
2717
            $resfound = 0;
2717
            $resfound = 0;
2718
        }
2718
        }
2719
    }
2719
    }
2720
2721
    return ( 0, "on_reserve" ) if $resfound;    # '' when no hold was found
2720
    return ( 0, "on_reserve" ) if $resfound;    # '' when no hold was found
2722
2721
2723
    return ( 1, undef ) if $override_limit;
2722
    return ( 1, undef ) if $override_limit;
Lines 2729-2734 sub CanBookBeRenewed { Link Here
2729
    return ( 0, "too_many" )
2728
    return ( 0, "too_many" )
2730
      if $issuingrule->{renewalsallowed} <= $itemissue->{renewals};
2729
      if $issuingrule->{renewalsallowed} <= $itemissue->{renewals};
2731
2730
2731
    my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing');
2732
    my $restrictionblockrenewing = C4::Context->preference('RestrictionBlockRenewing');
2733
    my $restricted = Koha::Borrower::Debarments::IsDebarred($borrowernumber);
2734
    my $hasoverdues = C4::Members::HasOverdues($borrowernumber);
2735
2736
    if ( $restricted and $restrictionblockrenewing ) {
2737
        return ( 0, 'restriction');
2738
    } elsif ( ($hasoverdues and $overduesblockrenewing eq 'block') || ($itemissue->{overdue} and $overduesblockrenewing eq 'blockitem') ) {
2739
        return ( 0, 'overdue');
2740
    }
2741
2732
    if ( $issuingrule->{norenewalbefore} ) {
2742
    if ( $issuingrule->{norenewalbefore} ) {
2733
2743
2734
        # Get current time and add norenewalbefore.
2744
        # Get current time and add norenewalbefore.
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 327-332 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
327
('OverdueNoticeBcc','','','Email address to bcc outgoing overdue notices sent by email','free'),
327
('OverdueNoticeBcc','','','Email address to bcc outgoing overdue notices sent by email','free'),
328
('OverdueNoticeCalendar',0,NULL,'Take the calendar into consideration when generating overdue notices','YesNo'),
328
('OverdueNoticeCalendar',0,NULL,'Take the calendar into consideration when generating overdue notices','YesNo'),
329
('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'),
329
('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'),
330
('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'),
330
('patronimages','0',NULL,'Enable patron images for the Staff Client','YesNo'),
331
('patronimages','0',NULL,'Enable patron images for the Staff Client','YesNo'),
331
('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'),
332
('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'),
332
('PatronSelfRegistrationAdditionalInstructions','','','A free text field to display additional instructions to newly self registered patrons.','free'),
333
('PatronSelfRegistrationAdditionalInstructions','','','A free text field to display additional instructions to newly self registered patrons.','free'),
Lines 358-363 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
358
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
359
('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'),
359
('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'),
360
('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'),
360
('ReservesNeedReturns','1','','If ON, a hold placed on an item available in this library must be checked-in, otherwise, a hold on a specific item, that is in the library & available is considered available','YesNo'),
361
('ReservesNeedReturns','1','','If ON, a hold placed on an item available in this library must be checked-in, otherwise, a hold on a specific item, that is in the library & available is considered available','YesNo'),
362
('RestrictionBlockRenewing','0',NULL,'If patron is restricted, should renewal be allowed or blocked','YesNo'),
361
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
363
('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'),
362
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
364
('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'),
363
('ReturnToShelvingCart','0','','If set, when any item is \'checked in\', it\'s location code will be changed to CART.','YesNo'),
365
('ReturnToShelvingCart','0','','If set, when any item is \'checked in\', it\'s location code will be changed to CART.','YesNo'),
(-)a/installer/data/mysql/updatedatabase.pl (+14 lines)
Lines 9971-9976 if ( CheckVersion($DBversion) ) { Link Here
9971
    SetVersion($DBversion);
9971
    SetVersion($DBversion);
9972
}
9972
}
9973
9973
9974
$DBversion = "3.19.00.XXX";
9975
if ( CheckVersion($DBversion) ) {
9976
    $dbh->do("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')");
9977
    print "Upgrade to $DBversion done (Bug 8236: Add system preference OverduesBlockRenewing)\n";
9978
    SetVersion($DBversion);
9979
}
9980
9981
$DBversion = "3.19.00.XXX";
9982
if ( CheckVersion($DBversion) ) {
9983
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('RestrictionBlockRenewing','0','If patron is restricted, should renewal be allowed or blocked',NULL,'YesNo')");
9984
    print "Upgrade to $DBversion done (Bug 8236: Add system preference RestrictionBlockRenewing)\n";
9985
    SetVersion($DBversion);
9986
}
9987
9974
9988
9975
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
9989
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
9976
# SEE bug 13068
9990
# SEE bug 13068
(-)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 309-314 $(document).ready(function() { Link Here
309
313
310
                            span_style = "display: none";
314
                            span_style = "display: none";
311
                            span_class = "renewals-allowed";
315
                            span_class = "renewals-allowed";
316
                        } else if ( oObj.can_renew_error == "restriction" ) {
317
                            content += "<span class='renewals-disabled'>"
318
                                    + NOT_RENEWABLE_RESTRICTION
319
                                    + "</span>";
320
321
                            span_style = "display: none";
322
                            span_class = "renewals-allowed";
323
                        } else if ( oObj.can_renew_error == "overdue" ) {
324
                            content += "<span class='renewals-disabled'>"
325
                                    + NOT_RENEWABLE_OVERDUE
326
                                    + "</span>";
327
328
                            span_style = "display: none";
329
                            span_class = "renewals-allowed";
312
                        } else if ( oObj.can_renew_error == "too_soon" ) {
330
                        } else if ( oObj.can_renew_error == "too_soon" ) {
313
                            content += "<span class='renewals-disabled'>"
331
                            content += "<span class='renewals-disabled'>"
314
                                    + NOT_RENEWABLE_TOO_SOON.format( oObj.can_renew_date )
332
                                    + NOT_RENEWABLE_TOO_SOON.format( oObj.can_renew_date )
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+15 lines)
Lines 398-403 Circulation: Link Here
398
                  yes: Enable
398
                  yes: Enable
399
                  no: Disable
399
                  no: Disable
400
            - the on-site for all cases (Even if a user is debarred, etc.).
400
            - the on-site for all cases (Even if a user is debarred, etc.).
401
        -
402
            - When a patron's checked out item is late,
403
            - pref: OverduesBlockRenewing
404
              type: choice
405
              choices:
406
                  allow: allow renewing.
407
                  blockitem: block renewing only for this item.
408
                  block: block renewing for all his items.
409
        -
410
            - If patron is restricted,
411
            - pref: RestrictionBlockRenewing
412
              choices:
413
                  yes: Block
414
                  no: Allow
415
            - renewing of items.
401
    Checkin Policy:
416
    Checkin Policy:
402
        -
417
        -
403
            - pref: BlockReturnOfWithdrawnItems
418
            - 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 199-204 if ($issues){ Link Here
199
        if ($renewerror) {
199
        if ($renewerror) {
200
            $issue->{'too_many'}       = 1 if $renewerror eq 'too_many';
200
            $issue->{'too_many'}       = 1 if $renewerror eq 'too_many';
201
            $issue->{'on_reserve'}     = 1 if $renewerror eq 'on_reserve';
201
            $issue->{'on_reserve'}     = 1 if $renewerror eq 'on_reserve';
202
            $issue->{'norenew_overdue'} = 1 if $renewerror eq 'overdue';
202
            $issue->{'auto_renew'}     = 1 if $renewerror eq 'auto_renew';
203
            $issue->{'auto_renew'}     = 1 if $renewerror eq 'auto_renew';
203
            $issue->{'auto_too_soon'}  = 1 if $renewerror eq 'auto_too_soon';
204
            $issue->{'auto_too_soon'}  = 1 if $renewerror eq 'auto_too_soon';
204
205
Lines 245-250 if ($issues){ Link Here
245
                }
246
                }
246
    }
247
    }
247
}
248
}
249
my $overduesblockrenewing = C4::Context->preference('OverduesBlockRenewing');
250
$canrenew = 0 if ($overduesblockrenewing ne 'allow' and $overdues_count == $count);
248
$template->param( ISSUES       => \@issuedat );
251
$template->param( ISSUES       => \@issuedat );
249
$template->param( issues_count => $count );
252
$template->param( issues_count => $count );
250
$template->param( canrenew     => $canrenew );
253
$template->param( canrenew     => $canrenew );
251
- 

Return to bug 8236