Bugzilla – Attachment 90452 Details for
Bug 15726
Add columns configuration and export options to circulation and fine rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15726: Add columns configuration and export options to circulation and fine rules
Bug-15726-Add-columns-configuration-and-export-opt.patch (text/plain), 8.91 KB, created by
Owen Leonard
on 2019-06-10 12:38:20 UTC
(
hide
)
Description:
Bug 15726: Add columns configuration and export options to circulation and fine rules
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2019-06-10 12:38:20 UTC
Size:
8.91 KB
patch
obsolete
>From 6c62c0e1a4b84bfb795d925a160eacca9812b80b Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 @@ > <button name="cancel" class="clear_edit btn btn-default btn-xs"><i class="fa fa-undo"></i> Clear</button> > </td> > </tr> >+ </tbody> > <tfoot> > <tr> > <th>Patron category</th> >@@ -387,7 +389,6 @@ > <th> </th> > </tr> > </tfoot> >- </tbody> > </table> > </form> > </div> >@@ -586,7 +587,7 @@ > <td><input name="patron_maxissueqty" size="3" type="text" /></td> > <td><input name="patron_maxonsiteissueqty" size="3" type="text" /></td> > <td><input name="max_holds" size="3" type="text" /></td> >- <td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</td> >+ <td class="actions"><button type="submit" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add</button></td> > </tr> > </table> > </form> >@@ -612,7 +613,7 @@ > <tr> > <td> > <select name="refund"> >- [#% Default branch %#] >+ [% # Default branch %] > [% IF ( current_branch == '*' ) %] > [% IF ( ( not refundLostItemFeeRule.refund.defined ) || refundLostItemFeeRule.refund ) %] > <option value="1" selected="selected"> >@@ -666,7 +667,6 @@ > <td class="actions"> > <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button> > </td> >- </td> > </tr> > </table> > </form> >@@ -687,7 +687,7 @@ > <li><strong>From home library:</strong> Only patrons from the item's home library may put this book on hold.</li> > <li><strong>No holds allowed:</strong> No patron may put this book on hold.</li> > </ul> >- <p><strong>Note: </strong>If the system preference 'AllowHoldPolicyOverride' is enabled, these policies can be overridden by your circulation staff.</br /> >+ <p><strong>Note: </strong>If the system preference 'AllowHoldPolicyOverride' is enabled, these policies can be overridden by your circulation staff.<br /> > <strong>Important: </strong>The policies are applied based on the ReservesControlBranch system preference which is set to <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ReservesControlBranch">[% Koha.Preference('ReservesControlBranch') | html %]</a>. > </p> > >@@ -800,6 +800,8 @@ > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/admin-menu.js") | $raw %] > [% INCLUDE 'calendar.inc' %] >+ [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] > <script> > > function clear_edit(){ >@@ -925,7 +927,16 @@ > e.preventDefault(); > clear_edit(); > }); >+ >+ var columns_settings = [% ColumnsSettings.GetColumns('admin', 'circulationrules', 'circulation-rules', 'json') %]; >+ var table = KohaTable("default-circulation-rules", { >+ "autoWidth": false, >+ "dom": '<"top pager"<"table_entries"lp><"table_controls"fB>>t', >+ "ordering": false, >+ "paging": false, >+ }, columns_settings); > }); >+ > </script> > [% END %] > [% INCLUDE 'intranet-bottom.inc' %] >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15726
:
90452