@@ -, +, @@ tables - adds a switch to turn off and on row grouping (today's checkouts vs previous checkouts) (on by default) - adds "column settings" for relatives' checkouts tables - factorize some code that was duplicated across the two DataTables configurations (mDataProp) the relatives checkouts table contain at least 10 checkouts. in both tables (sorting, pagination, the data itself, ...) --- admin/columns_settings.yml | 60 +- installer/data/mysql/atomicupdate/bug_15219.sql | 2 + installer/data/mysql/sysprefs.sql | 1 + .../plugins/jquery.dataTables.rowGrouping.js | 10 +- .../prog/en/includes/checkouts-table-footer.inc | 2 +- .../prog/en/includes/checkouts-table.inc | 1 - .../prog/en/includes/checkouts.js.inc | 24 + .../prog/en/includes/columns_settings.inc | 2 +- .../intranet-tmpl/prog/en/includes/strings.inc | 1 + .../en/modules/admin/preferences/circulation.pref | 6 + .../prog/en/modules/circ/circulation.tt | 13 +- .../prog/en/modules/members/moremember.tt | 12 +- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 709 +++++++++++---------- svc/checkouts | 108 ++-- 14 files changed, 503 insertions(+), 448 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_15219.sql create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/checkouts.js.inc --- a/admin/columns_settings.yml +++ a/admin/columns_settings.yml @@ -208,7 +208,7 @@ modules: moremember: issues-table: - - columnname: sort_order + columnname: group_order cannot_be_toggled: 1 cannot_be_modified: 1 is_hidden: 1 @@ -218,11 +218,6 @@ modules: cannot_be_modified: 1 is_hidden: 1 - - columnname: due_date_unformatted - cannot_be_toggled: 1 - cannot_be_modified: 1 - is_hidden: 1 - - columnname: due_date - columnname: title @@ -256,6 +251,29 @@ modules: columnname: export cannot_be_toggled: 1 cannot_be_modified: 1 + relatives-issues-table: + - + columnname: due_date + - + columnname: title + - + columnname: item_type + - + columnname: location + - + columnname: checkout_on + - + columnname: checkout_from + - + columnname: callno + - + columnname: charge + - + columnname: fine + - + columnname: price + - + columnname: patron reports: lostitems: @@ -293,7 +311,7 @@ modules: circulation: issues-table: - - columnname: sort_order + columnname: group_order cannot_be_toggled: 1 cannot_be_modified: 1 is_hidden: 1 @@ -303,11 +321,6 @@ modules: cannot_be_modified: 1 is_hidden: 1 - - columnname: due_date_unformatted - cannot_be_toggled: 1 - cannot_be_modified: 1 - is_hidden: 1 - - columnname: due_date - columnname: title @@ -341,6 +354,29 @@ modules: columnname: export cannot_be_toggled: 1 cannot_be_modified: 1 + relatives-issues-table: + - + columnname: due_date + - + columnname: title + - + columnname: item_type + - + columnname: location + - + columnname: checkout_on + - + columnname: checkout_from + - + columnname: callno + - + columnname: charge + - + columnname: fine + - + columnname: price + - + columnname: patron returns: checkedintable: --- a/installer/data/mysql/atomicupdate/bug_15219.sql +++ a/installer/data/mysql/atomicupdate/bug_15219.sql @@ -0,0 +1,2 @@ +INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) +VALUES ('ServerSideCheckoutsTables','0',NULL,'If enabled, use the "server-side processing" feature for checkouts tables. Can improve performance when there is a big number of checkouts to display.','YesNo'); --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -463,6 +463,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('SelfCheckTimeout','120','','Define the number of seconds before the Web-based Self Checkout times out a patron','Integer'), ('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'), ('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'), +('ServerSideCheckoutsTables','0',NULL,'If enabled, use the "server-side processing" feature for checkouts tables. Can improve performance when there is a big number of checkouts per patron.','YesNo'), ('SessionRestrictionByIP','1','Check for change in remote IP address for session security. Disable only when remote IP address changes frequently.','','YesNo'), ('SessionStorage','mysql','mysql|Pg|tmp','Use database or a temporary file for storing session data','Choice'), ('ShelfBrowserUsesCcode','1','0','Use the item collection code when finding items for the shelf browser.','YesNo'), --- a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.dataTables.rowGrouping.js +++ a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/jquery.dataTables.rowGrouping.js @@ -608,15 +608,15 @@ } - oTable.fnSetColumnVis(properties.iGroupingColumnIndex, !properties.bHideGroupingColumn); + oTable.fnSetColumnVis(properties.iGroupingColumnIndex, !properties.bHideGroupingColumn, false); if (properties.bCustomColumnOrdering) { - oTable.fnSetColumnVis(properties.iGroupingOrderByColumnIndex, !properties.bHideGroupingOrderByColumn); + oTable.fnSetColumnVis(properties.iGroupingOrderByColumnIndex, !properties.bHideGroupingOrderByColumn, false); } if (properties.iGroupingColumnIndex2 != -1) { - oTable.fnSetColumnVis(properties.iGroupingColumnIndex2, !properties.bHideGroupingColumn2); + oTable.fnSetColumnVis(properties.iGroupingColumnIndex2, !properties.bHideGroupingColumn2, false); } if (properties.bCustomColumnOrdering2) { - oTable.fnSetColumnVis(properties.iGroupingOrderByColumnIndex2, !properties.bHideGroupingOrderByColumn2); + oTable.fnSetColumnVis(properties.iGroupingOrderByColumnIndex2, !properties.bHideGroupingOrderByColumn2, false); } oTable.fnSettings().aoDrawCallback.push({ "fn": _fnDrawCallBackWithGrouping, @@ -687,4 +687,4 @@ }); }; -})(jQuery); +})(jQuery); --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc @@ -1,6 +1,6 @@ - Totals: + Totals: [% totaldue %] [% finetotal %] [% totalprice %] --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc @@ -13,7 +13,6 @@     Due date - Due date Title Item type Location --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts.js.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts.js.inc @@ -0,0 +1,24 @@ +[% USE Koha %] + + + + --- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc @@ -28,7 +28,7 @@ function KohaTable(selector, dt_parameters, columns_settings) { var table = $(selector).dataTable($.extend(true, {}, dataTablesDefaults, dt_parameters)); $(hidden_ids).each(function(index, value) { - table.fnSetColumnVis( value, false ); + table.fnSetColumnVis( value, false, false ); }); return table; --- a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc @@ -41,5 +41,6 @@ var SUSPEND_HOLD_ERROR_NOT_FOUND = _("Unable to suspend hold, hold not found"); var RESUME_HOLD_ERROR_NOT_FOUND = _("Unable to resume, hold not found"); var CURRENT = _(" (current) "); + var GROUP_TODAYS_CHECKOUTS = _("Group today's checkouts"); //]]> --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -46,6 +46,12 @@ Circulation: desc: latest to earliest - due date. - + - pref: ServerSideCheckoutsTables + choices: + yes: Enable + no: Do not enable + - server-side processing on checkouts tables. It can improve performance when there is a big number of checkouts to display. + - - pref: SpecifyDueDate choices: yes: Allow --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -28,30 +28,20 @@ [% INCLUDE 'timepicker.inc' %] - +[% INCLUDE 'checkouts.js.inc' %] - +[% INCLUDE 'checkouts.js.inc' %]