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

(-)a/C4/Circulation.pm (-1 / +1 lines)
Lines 4593-4599 sub _CanBookBeAutoRenewed { Link Here
4593
    }
4593
    }
4594
4594
4595
    if ( C4::Context->preference('OPACFineNoRenewalsBlockAutoRenew') ) {
4595
    if ( C4::Context->preference('OPACFineNoRenewalsBlockAutoRenew') ) {
4596
        my $fine_no_renewals = C4::Context->preference("OPACFineNoRenewals");
4596
        my $fine_no_renewals = C4::Context->preference("FineNoRenewals");
4597
        my $amountoutstanding =
4597
        my $amountoutstanding =
4598
          C4::Context->preference("OPACFineNoRenewalsIncludeCredit")
4598
          C4::Context->preference("OPACFineNoRenewalsIncludeCredit")
4599
          ? $patron->account->balance
4599
          ? $patron->account->balance
(-)a/circ/renew.pl (-1 / +1 lines)
Lines 67-73 if ($barcode) { Link Here
67
            $patron = $checkout->patron;
67
            $patron = $checkout->patron;
68
68
69
            $balance = $patron->account->balance;
69
            $balance = $patron->account->balance;
70
            my $amountlimit = C4::Context->preference("OPACFineNoRenewals");
70
            my $amountlimit = C4::Context->preference("FineNoRenewals");
71
71
72
            if ( ( $patron->is_debarred || q{} ) lt dt_from_string()->ymd() ) {
72
            if ( ( $patron->is_debarred || q{} ) lt dt_from_string()->ymd() ) {
73
                my $can_renew;
73
                my $can_renew;
(-)a/installer/data/mysql/atomicupdate/bug_23415.pl (+16 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "23415",
5
    description => "Rename OPACFineNoRenewals",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{
11
            UPDATE systempreferences SET variable = "FineNoRenewals", explanation = "Fine limit above which user or staff cannot renew items" WHERE variable = "OPACFineNoRenewals";
12
        });
13
14
        say $out "Updated system preference 'OPACFineNoRenewals'";
15
    },
16
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-3 / +3 lines)
Lines 262-267 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
262
('FinesIncludeGracePeriod','1',NULL,'If enabled, fines calculations will include the grace period.','YesNo'),
262
('FinesIncludeGracePeriod','1',NULL,'If enabled, fines calculations will include the grace period.','YesNo'),
263
('FinesLog','1',NULL,'If ON, log fines','YesNo'),
263
('FinesLog','1',NULL,'If ON, log fines','YesNo'),
264
('finesMode','off','off|production','Choose the fines mode, \'off\' (no charges), \'production\' (accrue overdue fines).  Requires accruefines cronjob.','Choice'),
264
('finesMode','off','off|production','Choose the fines mode, \'off\' (no charges), \'production\' (accrue overdue fines).  Requires accruefines cronjob.','Choice'),
265
('FineNoRenewals','100','','Fine limit above which user or staff cannot renew items','Integer'),
265
('FRBRizeEditions','0','','If ON, Koha will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'),
266
('FRBRizeEditions','0','','If ON, Koha will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'),
266
('GenerateAuthorityField667', 'Machine generated authority record', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 667$a field of MARC21 records', 'free'),
267
('GenerateAuthorityField667', 'Machine generated authority record', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 667$a field of MARC21 records', 'free'),
267
('GenerateAuthorityField670', 'Work cat.', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 670$a field of MARC21 records', 'free'),
268
('GenerateAuthorityField670', 'Work cat.', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 670$a field of MARC21 records', 'free'),
Lines 386-392 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
386
('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'),
387
('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'),
387
('MaxOpenSuggestions','',NULL,'Limit the number of open suggestions a patron can have at once','Integer'),
388
('MaxOpenSuggestions','',NULL,'Limit the number of open suggestions a patron can have at once','Integer'),
388
('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'),
389
('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'),
389
('OPACFineNoRenewalsBlockAutoRenew','0','','Block/Allow auto renewals if the patron owe more than OPACFineNoRenewals','YesNo'),
390
('OPACFineNoRenewalsBlockAutoRenew','0','','Block/Allow auto renewals if the patron owe more than FineNoRenewals','YesNo'),
390
('maxRecordsForFacets','20',NULL,NULL,'Integer'),
391
('maxRecordsForFacets','20',NULL,NULL,'Integer'),
391
('maxreserves','50','','Define maximum number of holds a patron can place','Integer'),
392
('maxreserves','50','','Define maximum number of holds a patron can place','Integer'),
392
('MaxSearchResultsItemsPerRecordStatusCheck','20','','Max number of items per record for which to check transit and hold status','Integer'),
393
('MaxSearchResultsItemsPerRecordStatusCheck','20','','Max number of items per record for which to check transit and hold status','Integer'),
Lines 459-465 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
459
('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd','','Define export options available on OPAC detail page.','multiple'),
460
('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd','','Define export options available on OPAC detail page.','multiple'),
460
('OPACFallback', 'prog', 'bootstrap|prog', 'Define the fallback theme for the OPAC interface.', 'Themes'),
461
('OPACFallback', 'prog', 'bootstrap|prog', 'Define the fallback theme for the OPAC interface.', 'Themes'),
461
('OpacFavicon','','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','free'),
462
('OpacFavicon','','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','free'),
462
('OPACFineNoRenewals','100','','Fine limit above which user cannot renew books via OPAC','Integer'),
463
('OPACFinesTab','1','','If OFF the patron fines tab in the OPAC is disabled.','YesNo'),
463
('OPACFinesTab','1','','If OFF the patron fines tab in the OPAC is disabled.','YesNo'),
464
('OPACFRBRizeEditions','0','','If ON, the OPAC will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'),
464
('OPACFRBRizeEditions','0','','If ON, the OPAC will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'),
465
('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at the OPAC. See http://wiki.koha-community.org/wiki/OpacHiddenItems for more information.','Textarea'),
465
('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at the OPAC. See http://wiki.koha-community.org/wiki/OpacHiddenItems for more information.','Textarea'),
Lines 545-551 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
545
('OpenURLResolverURL', '', NULL, 'URL of OpenURL Resolver', 'Free'),
545
('OpenURLResolverURL', '', NULL, 'URL of OpenURL Resolver', 'Free'),
546
('OpenURLText', '', NULL, 'Text of OpenURL links (or image title if OpenURLImageLocation is defined)', 'Free'),
546
('OpenURLText', '', NULL, 'Text of OpenURL links (or image title if OpenURLImageLocation is defined)', 'Free'),
547
('OpenURLImageLocation', '', NULL, 'Location of image for OpenURL links', 'Free'),
547
('OpenURLImageLocation', '', NULL, 'Location of image for OpenURL links', 'Free'),
548
('OPACFineNoRenewalsIncludeCredits','1',NULL,'If enabled the value specified in OPACFineNoRenewals should include any unapplied account credits in the calculation','YesNo'),
548
('OPACFineNoRenewalsIncludeCredits','1',NULL,'If enabled the value specified in FineNoRenewals should include any unapplied account credits in the calculation','YesNo'),
549
('OPACShowOpenURL', '0', NULL, 'Enable display of OpenURL links in OPAC search results and detail page', 'YesNo'),
549
('OPACShowOpenURL', '0', NULL, 'Enable display of OpenURL links in OPAC search results and detail page', 'YesNo'),
550
('OPACOpenURLItemTypes', '', NULL, 'Show the OpenURL link only for these item types', 'Free'),
550
('OPACOpenURLItemTypes', '', NULL, 'Show the OpenURL link only for these item types', 'Free'),
551
('OrderPdfFormat','pdfformat::layout3pages','Controls what script is used for printing (basketgroups)','','free'),
551
('OrderPdfFormat','pdfformat::layout3pages','Controls what script is used for printing (basketgroups)','','free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +6 lines)
Lines 513-519 Circulation: Link Here
513
                  blockitem: block renewing only for this item.
513
                  blockitem: block renewing only for this item.
514
                  block: block renewing for all the patron's items.
514
                  block: block renewing for all the patron's items.
515
        -
515
        -
516
            - If a patron owes more than the value of <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACFineNoRenewals">OPACFineNoRenewals</a>,
516
            - If a patron owes more than the value of <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=FineNoRenewals">FineNoRenewals</a>,
517
            - pref: OPACFineNoRenewalsBlockAutoRenew
517
            - pref: OPACFineNoRenewalsBlockAutoRenew
518
              choices:
518
              choices:
519
                  1: block
519
                  1: block
Lines 553-558 Circulation: Link Here
553
            - This is a list of value pairs. When an item is checked out, if the not for loan value on the left matches the items not for loan value
553
            - This is a list of value pairs. When an item is checked out, if the not for loan value on the left matches the items not for loan value
554
            - "it will be updated to the right-hand value. For example, '-1: 0' will cause an item that was set to 'Ordered' to now be available for loan."
554
            - "it will be updated to the right-hand value. For example, '-1: 0' will cause an item that was set to 'Ordered' to now be available for loan."
555
            - Each pair of values should be on a separate line.
555
            - Each pair of values should be on a separate line.
556
        -
557
            - Only allow patrons or staff to renew items if patron has less than
558
            - pref: FineNoRenewals
559
              class: currency
560
            - [% local_currency %] in fines (leave blank to disable).
556
    Checkin policy:
561
    Checkin policy:
557
        -
562
        -
558
            - pref: TrapHoldsOnOrder
563
            - pref: TrapHoldsOnOrder
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-7 / +1 lines)
Lines 603-620 OPAC: Link Here
603
                  none: "NULL"
603
                  none: "NULL"
604
                  opacrenew: "'OPACRenew'"
604
                  opacrenew: "'OPACRenew'"
605
            - as branchcode to store in the statistics table.
605
            - as branchcode to store in the statistics table.
606
        -
607
            - Only allow patrons to renew their own books on the OPAC if they have less than
608
            - pref: OPACFineNoRenewals
609
              class: currency
610
            - '[% local_currency %] in charges (leave blank to disable).'
611
            - <br /><strong>NOTE:</strong> If set, confirmation dialog is shown when renewing for patron with charges from staff interface.'
612
        -
606
        -
613
            - pref: OPACFineNoRenewalsIncludeCredits
607
            - pref: OPACFineNoRenewalsIncludeCredits
614
              choices:
608
              choices:
615
                  1: Include
609
                  1: Include
616
                  0: "Don't include"
610
                  0: "Don't include"
617
            - outstanding/unapplied credits when applying the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACFineNoRenewals">OPACFineNoRenewals</a> rule to patrons.
611
            - outstanding/unapplied credits when applying the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=FineNoRenewals">FineNoRenewals</a> rule to patrons.
618
        -
612
        -
619
            - pref: OpacHiddenItems
613
            - pref: OpacHiddenItems
620
              type: textarea
614
              type: textarea
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 / +1 lines)
Lines 928-934 Link Here
928
928
929
        [% UNLESS ( patron.borrowernumber ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %]
929
        [% UNLESS ( patron.borrowernumber ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %]
930
930
931
        var amountlimit = "[% Koha.Preference('OPACFineNoRenewals') | html %]";
931
        var amountlimit = "[% Koha.Preference('FineNoRenewals') | html %]";
932
        var fines = "[% fines | html %]";
932
        var fines = "[% fines | html %]";
933
        var MSG_CONFRIM_RENEW = _("The patron has a debt of %s.\n Are you sure you want to renew checkout(s)?").format(fines);
933
        var MSG_CONFRIM_RENEW = _("The patron has a debt of %s.\n Are you sure you want to renew checkout(s)?").format(fines);
934
934
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-1 / +1 lines)
Lines 727-733 Link Here
727
        table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'relatives-issues-table', 'json' ) | $raw %]
727
        table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'relatives-issues-table', 'json' ) | $raw %]
728
        table_settings_holds_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'holds-table', 'json' ) | $raw %]
728
        table_settings_holds_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'holds-table', 'json' ) | $raw %]
729
729
730
        var amountlimit = "[% Koha.Preference('OPACFineNoRenewals') | html %]";
730
        var amountlimit = "[% Koha.Preference('FineNoRenewals') | html %]";
731
        var fines = "[% fines | html %]";
731
        var fines = "[% fines | html %]";
732
        var MSG_CONFRIM_RENEW = _("The patron has a debt of %s.\n Are you sure you want to renew checkout(s)?").format(fines);
732
        var MSG_CONFRIM_RENEW = _("The patron has a debt of %s.\n Are you sure you want to renew checkout(s)?").format(fines);
733
733
(-)a/opac/opac-user.pl (-1 / +1 lines)
Lines 127-133 if ( $userdebarred || $borr->{'gonenoaddress'} || $borr->{'lost'} ) { Link Here
127
}
127
}
128
128
129
my $amountoutstanding = $patron->account->balance;
129
my $amountoutstanding = $patron->account->balance;
130
my $no_renewal_amt = C4::Context->preference( 'OPACFineNoRenewals' );
130
my $no_renewal_amt = C4::Context->preference( 'FineNoRenewals' );
131
$no_renewal_amt = undef unless looks_like_number( $no_renewal_amt );
131
$no_renewal_amt = undef unless looks_like_number( $no_renewal_amt );
132
my $amountoutstandingfornewal =
132
my $amountoutstandingfornewal =
133
  C4::Context->preference("OPACFineNoRenewalsIncludeCredit")
133
  C4::Context->preference("OPACFineNoRenewalsIncludeCredit")
(-)a/t/db_dependent/Circulation.t (-7 / +6 lines)
Lines 1184-1190 subtest "CanBookBeRenewed tests" => sub { Link Here
1184
            }
1184
            }
1185
        );
1185
        );
1186
        C4::Context->set_preference('OPACFineNoRenewalsBlockAutoRenew','1');
1186
        C4::Context->set_preference('OPACFineNoRenewalsBlockAutoRenew','1');
1187
        C4::Context->set_preference('OPACFineNoRenewals','10');
1187
        C4::Context->set_preference('FineNoRenewals','10');
1188
        C4::Context->set_preference('OPACFineNoRenewalsIncludeCredit','1');
1188
        C4::Context->set_preference('OPACFineNoRenewalsIncludeCredit','1');
1189
        my $fines_amount = 5;
1189
        my $fines_amount = 5;
1190
        my $account = Koha::Account->new({patron_id => $renewing_borrowernumber});
1190
        my $account = Koha::Account->new({patron_id => $renewing_borrowernumber});
Lines 1200-1206 subtest "CanBookBeRenewed tests" => sub { Link Here
1200
        ( $renewokay, $error ) =
1200
        ( $renewokay, $error ) =
1201
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1201
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1202
        is( $renewokay, 1, 'Renew, even if renewal is automatic' );
1202
        is( $renewokay, 1, 'Renew, even if renewal is automatic' );
1203
        is( $error, 'auto_renew', 'Can auto renew, OPACFineNoRenewals=10, patron has 5' );
1203
        is( $error, 'auto_renew', 'Can auto renew, FineNoRenewals=10, patron has 5' );
1204
1204
1205
        $account->add_debit(
1205
        $account->add_debit(
1206
            {
1206
            {
Lines 1214-1220 subtest "CanBookBeRenewed tests" => sub { Link Here
1214
        ( $renewokay, $error ) =
1214
        ( $renewokay, $error ) =
1215
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1215
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1216
        is( $renewokay, 1, 'Renew, even if renewal is automatic' );
1216
        is( $renewokay, 1, 'Renew, even if renewal is automatic' );
1217
        is( $error, 'auto_renew', 'Can auto renew, OPACFineNoRenewals=10, patron has 10' );
1217
        is( $error, 'auto_renew', 'Can auto renew, FineNoRenewals=10, patron has 10' );
1218
1218
1219
        $account->add_debit(
1219
        $account->add_debit(
1220
            {
1220
            {
Lines 1228-1234 subtest "CanBookBeRenewed tests" => sub { Link Here
1228
        ( $renewokay, $error ) =
1228
        ( $renewokay, $error ) =
1229
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1229
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1230
        is( $renewokay, 0, 'Do not renew, renewal is automatic' );
1230
        is( $renewokay, 0, 'Do not renew, renewal is automatic' );
1231
        is( $error, 'auto_too_much_oweing', 'Cannot auto renew, OPACFineNoRenewals=10, patron has 15' );
1231
        is( $error, 'auto_too_much_oweing', 'Cannot auto renew, FineNoRenewals=10, patron has 15' );
1232
1232
1233
        $account->add_credit(
1233
        $account->add_credit(
1234
            {
1234
            {
Lines 1241-1253 subtest "CanBookBeRenewed tests" => sub { Link Here
1241
        ( $renewokay, $error ) =
1241
        ( $renewokay, $error ) =
1242
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1242
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1243
        is( $renewokay, 1, 'Renew, even if renewal is automatic' );
1243
        is( $renewokay, 1, 'Renew, even if renewal is automatic' );
1244
        is( $error, 'auto_renew', 'Can auto renew, OPACFineNoRenewals=10, OPACFineNoRenewalsIncludeCredit=1, patron has 15 debt, 5 credit'  );
1244
        is( $error, 'auto_renew', 'Can auto renew, FineNoRenewals=10, OPACFineNoRenewalsIncludeCredit=1, patron has 15 debt, 5 credit'  );
1245
1245
1246
        C4::Context->set_preference('OPACFineNoRenewalsIncludeCredit','0');
1246
        C4::Context->set_preference('OPACFineNoRenewalsIncludeCredit','0');
1247
        ( $renewokay, $error ) =
1247
        ( $renewokay, $error ) =
1248
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1248
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1249
        is( $renewokay, 0, 'Do not renew, renewal is automatic' );
1249
        is( $renewokay, 0, 'Do not renew, renewal is automatic' );
1250
        is( $error, 'auto_too_much_oweing', 'Cannot auto renew, OPACFineNoRenewals=10, OPACFineNoRenewalsIncludeCredit=1, patron has 15 debt, 5 credit'  );
1250
        is( $error, 'auto_too_much_oweing', 'Cannot auto renew, FineNoRenewals=10, OPACFineNoRenewalsIncludeCredit=1, patron has 15 debt, 5 credit'  );
1251
1251
1252
        $dbh->do('DELETE FROM accountlines WHERE borrowernumber=?', undef, $renewing_borrowernumber);
1252
        $dbh->do('DELETE FROM accountlines WHERE borrowernumber=?', undef, $renewing_borrowernumber);
1253
        C4::Context->set_preference('OPACFineNoRenewalsIncludeCredit','1');
1253
        C4::Context->set_preference('OPACFineNoRenewalsIncludeCredit','1');
1254
- 

Return to bug 23415