From 6c62c0e1a4b84bfb795d925a160eacca9812b80b Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 6 Jun 2019 18:49:00 +0000 Subject: [PATCH] Bug 15726: Add columns configuration and export options to circulation and fine rules This patch adds DataTables search, column configuration, and export options to the circulation and fine rules table. It does not add or change sorting. Some changes to admin/smart-rules.pl were necessary to ensure that form fields removed by hidden columns wouldn't trigger errors because of empty values. This patch also makes minor markup corrections to fix HTML validator errors. To test, apply the patch and go to Administration -> Circulation and fine rules. - Test all aspects of the circulation and fine rules table: Adding new rules, editing rules, cloning rules, deleting rules. - Test the new DataTables features: Search, columns configuration, and export. - Make changes to the table's column configuration in Administration -> Configure columns. Confirm that they are correctly applied to the table. --- admin/columns_settings.yml | 75 ++++++++++++++++++++++ admin/smart-rules.pl | 4 +- .../prog/en/modules/admin/smart-rules.tt | 21 ++++-- 3 files changed, 93 insertions(+), 7 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index f484ed9..b6f52ea 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -157,6 +157,81 @@ modules: cannot_be_toggled: 1 cannot_be_modified: 1 + circulationrules: + circulation-rules: + - + columnname: patron_category + cannot_be_toggled: 1 + cannot_be_modified: 1 + - + columnname: item_type + cannot_be_toggled: 1 + cannot_be_modified: 1 + - + columnname: actions + cannot_be_toggled: 1 + cannot_be_modified: 1 + - + columnname: note + - + columnname: current_checkouts_allowed + - + columnname: current_on-site_checkouts_allowed + - + columnname: loan_period + - + columnname: unit + - + columnname: hard_due_date + - + columnname: fine_amount + - + columnname: fine_charging_interval + - + columnname: when_to_charge + - + columnname: fine_grace_period + - + columnname: overdue_fines_cap + - + columnname: cap_fine_at_replacement_price + - + columnname: suspension_in_days + - + columnname: max._suspension_duration + - + columnname: suspension_charging_interval + - + columnname: renewals_allowed + - + columnname: renewal_period + - + columnname: no_renewal_before + - + columnname: automatic_renewal + - + columnname: no_automatic_renewal_after + - + columnname: no_automatic_renewal_after_hard_limit + - + columnname: holds_allowed_total + - + columnname: holds_allowed_daily + - + columnname: holds_per_record_count + - + columnname: on_shelf_holds_allowed + - + columnname: item_level_holds + - + columnname: article_requests + - + columnname: rental_discount + - + columnname: actions + cannot_be_toggled: 1 + cannot_be_modified: 1 + libraries: libraries: - diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 927533d..f06b16f 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -148,7 +148,7 @@ elsif ($op eq 'add') { my $suspension_chargeperiod = $input->param('suspension_chargeperiod') || 1; my $firstremind = $input->param('firstremind'); my $chargeperiod = $input->param('chargeperiod'); - my $chargeperiod_charge_at = $input->param('chargeperiod_charge_at'); + my $chargeperiod_charge_at = $input->param('chargeperiod_charge_at') || 0; my $maxissueqty = $input->param('maxissueqty'); my $maxonsiteissueqty = $input->param('maxonsiteissueqty'); my $renewalsallowed = $input->param('renewalsallowed'); @@ -177,7 +177,7 @@ elsif ($op eq 'add') { my $hardduedate = $input->param('hardduedate') || undef; $hardduedate = eval { dt_from_string( $input->param('hardduedate') ) } if ( $hardduedate ); $hardduedate = output_pref( { dt => $hardduedate, dateonly => 1, dateformat => 'iso' } ) if ( $hardduedate ); - my $hardduedatecompare = $input->param('hardduedatecompare'); + my $hardduedatecompare = $input->param('hardduedatecompare') || -1; my $rentaldiscount = $input->param('rentaldiscount'); my $opacitemholds = $input->param('opacitemholds') || 0; my $article_requests = $input->param('article_requests') || 'no'; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index 0f26380..cb00ac4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -4,6 +4,7 @@ [% USE Branches %] [% USE Categories %] [% USE CirculationRules %] +[% USE ColumnsSettings %] [% SET footerjs = 1 %] [% SET branchcode = humanbranch %] @@ -351,6 +352,7 @@ + Patron category @@ -387,7 +389,6 @@   - @@ -586,7 +587,7 @@ - @@ -612,7 +613,7 @@