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

(-)a/C4/Circulation.pm (-1 / +1 lines)
Lines 4542-4548 sub _CanBookBeAutoRenewed { Link Here
4542
    }
4542
    }
4543
4543
4544
    if ( C4::Context->preference('OPACFineNoRenewalsBlockAutoRenew') ) {
4544
    if ( C4::Context->preference('OPACFineNoRenewalsBlockAutoRenew') ) {
4545
        my $fine_no_renewals = C4::Context->preference("OPACFineNoRenewals");
4545
        my $fine_no_renewals = C4::Context->preference("FineNoRenewals");
4546
        my $amountoutstanding =
4546
        my $amountoutstanding =
4547
          C4::Context->preference("OPACFineNoRenewalsIncludeCredit")
4547
          C4::Context->preference("OPACFineNoRenewalsIncludeCredit")
4548
          ? $patron->account->balance
4548
          ? $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 255-260 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
255
('FinesIncludeGracePeriod','1',NULL,'If enabled, fines calculations will include the grace period.','YesNo'),
255
('FinesIncludeGracePeriod','1',NULL,'If enabled, fines calculations will include the grace period.','YesNo'),
256
('FinesLog','1',NULL,'If ON, log fines','YesNo'),
256
('FinesLog','1',NULL,'If ON, log fines','YesNo'),
257
('finesMode','off','off|production','Choose the fines mode, \'off\' (no charges), \'production\' (accrue overdue fines).  Requires accruefines cronjob.','Choice'),
257
('finesMode','off','off|production','Choose the fines mode, \'off\' (no charges), \'production\' (accrue overdue fines).  Requires accruefines cronjob.','Choice'),
258
('FineNoRenewals','100','','Fine limit above which user or staff cannot renew items','Integer'),
258
('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'),
259
('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'),
259
('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'),
260
('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'),
260
('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'),
261
('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 377-383 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
377
('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'),
378
('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'),
378
('MaxOpenSuggestions','',NULL,'Limit the number of open suggestions a patron can have at once','Integer'),
379
('MaxOpenSuggestions','',NULL,'Limit the number of open suggestions a patron can have at once','Integer'),
379
('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'),
380
('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'),
380
('OPACFineNoRenewalsBlockAutoRenew','0','','Block/Allow auto renewals if the patron owe more than OPACFineNoRenewals','YesNo'),
381
('OPACFineNoRenewalsBlockAutoRenew','0','','Block/Allow auto renewals if the patron owe more than FineNoRenewals','YesNo'),
381
('maxRecordsForFacets','20',NULL,NULL,'Integer'),
382
('maxRecordsForFacets','20',NULL,NULL,'Integer'),
382
('maxreserves','50','','Define maximum number of holds a patron can place','Integer'),
383
('maxreserves','50','','Define maximum number of holds a patron can place','Integer'),
383
('MaxSearchResultsItemsPerRecordStatusCheck','20','','Max number of items per record for which to check transit and hold status','Integer'),
384
('MaxSearchResultsItemsPerRecordStatusCheck','20','','Max number of items per record for which to check transit and hold status','Integer'),
Lines 450-456 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
450
('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd','','Define export options available on OPAC detail page.','multiple'),
451
('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd','','Define export options available on OPAC detail page.','multiple'),
451
('OPACFallback', 'prog', 'bootstrap|prog', 'Define the fallback theme for the OPAC interface.', 'Themes'),
452
('OPACFallback', 'prog', 'bootstrap|prog', 'Define the fallback theme for the OPAC interface.', 'Themes'),
452
('OpacFavicon','','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','free'),
453
('OpacFavicon','','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','free'),
453
('OPACFineNoRenewals','100','','Fine limit above which user cannot renew books via OPAC','Integer'),
454
('OPACFinesTab','1','','If OFF the patron fines tab in the OPAC is disabled.','YesNo'),
454
('OPACFinesTab','1','','If OFF the patron fines tab in the OPAC is disabled.','YesNo'),
455
('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'),
455
('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'),
456
('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'),
456
('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 536-542 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
536
('OpenURLResolverURL', '', NULL, 'URL of OpenURL Resolver', 'Free'),
536
('OpenURLResolverURL', '', NULL, 'URL of OpenURL Resolver', 'Free'),
537
('OpenURLText', '', NULL, 'Text of OpenURL links (or image title if OpenURLImageLocation is defined)', 'Free'),
537
('OpenURLText', '', NULL, 'Text of OpenURL links (or image title if OpenURLImageLocation is defined)', 'Free'),
538
('OpenURLImageLocation', '', NULL, 'Location of image for OpenURL links', 'Free'),
538
('OpenURLImageLocation', '', NULL, 'Location of image for OpenURL links', 'Free'),
539
('OPACFineNoRenewalsIncludeCredits','1',NULL,'If enabled the value specified in OPACFineNoRenewals should include any unapplied account credits in the calculation','YesNo'),
539
('OPACFineNoRenewalsIncludeCredits','1',NULL,'If enabled the value specified in FineNoRenewals should include any unapplied account credits in the calculation','YesNo'),
540
('OPACShowOpenURL', '0', NULL, 'Enable display of OpenURL links in OPAC search results and detail page', 'YesNo'),
540
('OPACShowOpenURL', '0', NULL, 'Enable display of OpenURL links in OPAC search results and detail page', 'YesNo'),
541
('OPACOpenURLItemTypes', '', NULL, 'Show the OpenURL link only for these item types', 'Free'),
541
('OPACOpenURLItemTypes', '', NULL, 'Show the OpenURL link only for these item types', 'Free'),
542
('OrderPdfFormat','pdfformat::layout3pages','Controls what script is used for printing (basketgroups)','','free'),
542
('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 510-516 Circulation: Link Here
510
                  blockitem: block renewing only for this item.
510
                  blockitem: block renewing only for this item.
511
                  block: block renewing for all the patron's items.
511
                  block: block renewing for all the patron's items.
512
        -
512
        -
513
            - If a patron owes more than the value of <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACFineNoRenewals">OPACFineNoRenewals</a>,
513
            - If a patron owes more than the value of <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=FineNoRenewals">FineNoRenewals</a>,
514
            - pref: OPACFineNoRenewalsBlockAutoRenew
514
            - pref: OPACFineNoRenewalsBlockAutoRenew
515
              choices:
515
              choices:
516
                  1: block
516
                  1: block
Lines 550-555 Circulation: Link Here
550
            - 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
550
            - 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
551
            - "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."
551
            - "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."
552
            - Each pair of values should be on a separate line.
552
            - Each pair of values should be on a separate line.
553
        -
554
            - Only allow patrons or staff to renew items if patron has less than
555
            - pref: FineNoRenewals
556
              class: currency
557
            - [% local_currency %] in fines (leave blank to disable).
553
    Checkin policy:
558
    Checkin policy:
554
        -
559
        -
555
            - pref: TrapHoldsOnOrder
560
            - pref: TrapHoldsOnOrder
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-7 / +1 lines)
Lines 602-619 OPAC: Link Here
602
                  none: "NULL"
602
                  none: "NULL"
603
                  opacrenew: "'OPACRenew'"
603
                  opacrenew: "'OPACRenew'"
604
            - as branchcode to store in the statistics table.
604
            - as branchcode to store in the statistics table.
605
        -
606
            - Only allow patrons to renew their own books on the OPAC if they have less than
607
            - pref: OPACFineNoRenewals
608
              class: currency
609
            - '[% local_currency %] in charges (leave blank to disable).'
610
            - <br /><strong>NOTE:</strong> If set, confirmation dialog is shown when renewing for patron with charges from staff interface.'
611
        -
605
        -
612
            - pref: OPACFineNoRenewalsIncludeCredits
606
            - pref: OPACFineNoRenewalsIncludeCredits
613
              choices:
607
              choices:
614
                  1: Include
608
                  1: Include
615
                  0: "Don't include"
609
                  0: "Don't include"
616
            - outstanding/unapplied credits when applying the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACFineNoRenewals">OPACFineNoRenewals</a> rule to patrons.
610
            - outstanding/unapplied credits when applying the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=FineNoRenewals">FineNoRenewals</a> rule to patrons.
617
        -
611
        -
618
            - pref: OpacHiddenItems
612
            - pref: OpacHiddenItems
619
              type: textarea
613
              type: textarea
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 / +1 lines)
Lines 917-923 Link Here
917
917
918
        [% UNLESS ( patron.borrowernumber ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %]
918
        [% UNLESS ( patron.borrowernumber ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %]
919
919
920
        var amountlimit = "[% Koha.Preference('OPACFineNoRenewals') | html %]";
920
        var amountlimit = "[% Koha.Preference('FineNoRenewals') | html %]";
921
        var fines = "[% fines | html %]";
921
        var fines = "[% fines | html %]";
922
        var MSG_CONFRIM_RENEW = _("The patron has a debt of %s.\n Are you sure you want to renew checkout(s)?").format(fines);
922
        var MSG_CONFRIM_RENEW = _("The patron has a debt of %s.\n Are you sure you want to renew checkout(s)?").format(fines);
923
923
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-1 / +1 lines)
Lines 710-716 Link Here
710
        table_settings_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'issues-table', 'json' ) | $raw %]
710
        table_settings_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'issues-table', 'json' ) | $raw %]
711
        table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'relatives-issues-table', 'json' ) | $raw %]
711
        table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'relatives-issues-table', 'json' ) | $raw %]
712
712
713
        var amountlimit = "[% Koha.Preference('OPACFineNoRenewals') | html %]";
713
        var amountlimit = "[% Koha.Preference('FineNoRenewals') | html %]";
714
        var fines = "[% fines | html %]";
714
        var fines = "[% fines | html %]";
715
        var MSG_CONFRIM_RENEW = _("The patron has a debt of %s.\n Are you sure you want to renew checkout(s)?").format(fines);
715
        var MSG_CONFRIM_RENEW = _("The patron has a debt of %s.\n Are you sure you want to renew checkout(s)?").format(fines);
716
716
(-)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 1113-1119 subtest "CanBookBeRenewed tests" => sub { Link Here
1113
            }
1113
            }
1114
        );
1114
        );
1115
        C4::Context->set_preference('OPACFineNoRenewalsBlockAutoRenew','1');
1115
        C4::Context->set_preference('OPACFineNoRenewalsBlockAutoRenew','1');
1116
        C4::Context->set_preference('OPACFineNoRenewals','10');
1116
        C4::Context->set_preference('FineNoRenewals','10');
1117
        C4::Context->set_preference('OPACFineNoRenewalsIncludeCredit','1');
1117
        C4::Context->set_preference('OPACFineNoRenewalsIncludeCredit','1');
1118
        my $fines_amount = 5;
1118
        my $fines_amount = 5;
1119
        my $account = Koha::Account->new({patron_id => $renewing_borrowernumber});
1119
        my $account = Koha::Account->new({patron_id => $renewing_borrowernumber});
Lines 1129-1135 subtest "CanBookBeRenewed tests" => sub { Link Here
1129
        ( $renewokay, $error ) =
1129
        ( $renewokay, $error ) =
1130
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1130
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1131
        is( $renewokay, 0, 'Do not renew, renewal is automatic' );
1131
        is( $renewokay, 0, 'Do not renew, renewal is automatic' );
1132
        is( $error, 'auto_renew', 'Can auto renew, OPACFineNoRenewals=10, patron has 5' );
1132
        is( $error, 'auto_renew', 'Can auto renew, FineNoRenewals=10, patron has 5' );
1133
1133
1134
        $account->add_debit(
1134
        $account->add_debit(
1135
            {
1135
            {
Lines 1143-1149 subtest "CanBookBeRenewed tests" => sub { Link Here
1143
        ( $renewokay, $error ) =
1143
        ( $renewokay, $error ) =
1144
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1144
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1145
        is( $renewokay, 0, 'Do not renew, renewal is automatic' );
1145
        is( $renewokay, 0, 'Do not renew, renewal is automatic' );
1146
        is( $error, 'auto_renew', 'Can auto renew, OPACFineNoRenewals=10, patron has 10' );
1146
        is( $error, 'auto_renew', 'Can auto renew, FineNoRenewals=10, patron has 10' );
1147
1147
1148
        $account->add_debit(
1148
        $account->add_debit(
1149
            {
1149
            {
Lines 1157-1163 subtest "CanBookBeRenewed tests" => sub { Link Here
1157
        ( $renewokay, $error ) =
1157
        ( $renewokay, $error ) =
1158
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1158
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1159
        is( $renewokay, 0, 'Do not renew, renewal is automatic' );
1159
        is( $renewokay, 0, 'Do not renew, renewal is automatic' );
1160
        is( $error, 'auto_too_much_oweing', 'Cannot auto renew, OPACFineNoRenewals=10, patron has 15' );
1160
        is( $error, 'auto_too_much_oweing', 'Cannot auto renew, FineNoRenewals=10, patron has 15' );
1161
1161
1162
        $account->add_credit(
1162
        $account->add_credit(
1163
            {
1163
            {
Lines 1170-1182 subtest "CanBookBeRenewed tests" => sub { Link Here
1170
        ( $renewokay, $error ) =
1170
        ( $renewokay, $error ) =
1171
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1171
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1172
        is( $renewokay, 0, 'Do not renew, renewal is automatic' );
1172
        is( $renewokay, 0, 'Do not renew, renewal is automatic' );
1173
        is( $error, 'auto_renew', 'Can auto renew, OPACFineNoRenewals=10, OPACFineNoRenewalsIncludeCredit=1, patron has 15 debt, 5 credit'  );
1173
        is( $error, 'auto_renew', 'Can auto renew, FineNoRenewals=10, OPACFineNoRenewalsIncludeCredit=1, patron has 15 debt, 5 credit'  );
1174
1174
1175
        C4::Context->set_preference('OPACFineNoRenewalsIncludeCredit','0');
1175
        C4::Context->set_preference('OPACFineNoRenewalsIncludeCredit','0');
1176
        ( $renewokay, $error ) =
1176
        ( $renewokay, $error ) =
1177
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1177
          CanBookBeRenewed( $renewing_borrower_obj, $issue );
1178
        is( $renewokay, 0, 'Do not renew, renewal is automatic' );
1178
        is( $renewokay, 0, 'Do not renew, renewal is automatic' );
1179
        is( $error, 'auto_too_much_oweing', 'Cannot auto renew, OPACFineNoRenewals=10, OPACFineNoRenewalsIncludeCredit=1, patron has 15 debt, 5 credit'  );
1179
        is( $error, 'auto_too_much_oweing', 'Cannot auto renew, FineNoRenewals=10, OPACFineNoRenewalsIncludeCredit=1, patron has 15 debt, 5 credit'  );
1180
1180
1181
        $dbh->do('DELETE FROM accountlines WHERE borrowernumber=?', undef, $renewing_borrowernumber);
1181
        $dbh->do('DELETE FROM accountlines WHERE borrowernumber=?', undef, $renewing_borrowernumber);
1182
        C4::Context->set_preference('OPACFineNoRenewalsIncludeCredit','1');
1182
        C4::Context->set_preference('OPACFineNoRenewalsIncludeCredit','1');
1183
- 

Return to bug 23415