From 07b793de469154897023f09d065fb25f405c4b6e Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 26 May 2023 12:23:56 +0000 Subject: [PATCH] Bug 33845: Use table settings and hide note by default This patch updates the holds table on circulation and moremembers to use table settings and hides the note column by default to preserve existing views To test: 1 - Apply patch 2 - Enable system preferece 'OpacHoldNotes' 3 - Place a hold on the opac and enter a note 4 - Confirm it shows on the patron's page 5 - View the patron in staff client 6 - Ensure the holds note does not display on Holds tab in Checkout or Details view 7 - Go to Admin->Table settings->Circulation 8 - Under holds_table confirm 'notes' is hidden by default 9 - Uncheck the box 10 - Refresh patron pages and confirm hold note shows Signed-off-by: Andrew Fuerste-Henry --- admin/columns_settings.yml | 32 +++++++++++++++++++ .../prog/en/modules/circ/circulation.tt | 1 + .../prog/en/modules/members/moremember.tt | 1 + koha-tmpl/intranet-tmpl/prog/js/holds.js | 8 ++--- 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 270c99984b..0b10d8be49 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -1440,6 +1440,38 @@ modules: columnname: phone is_hidden: 1 + holds_table: + columns: + - + columnname: reservedate + - + columnname: title + - + columnname: callnumber + - + columnname: itemtype + - + columnname: barcode + - + columnname: pickup_location + - + columnname: expirationdate + - + columnname: priority + - + columnname: notes + is_hidden: 1 + - + columnname: delete + cannot_be_toggled: 1 + cannot_be_modified: 1 + - + columnname: suspend + cannot_be_toggled: 1 + cannot_be_modified: 1 + - + columnname: status + returns: checkedintable: columns: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 3388e387a5..8f89155781 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -908,6 +908,7 @@ table_settings_issues_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %] table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'relatives-issues-table', 'json' ) | $raw %] table_settings_borrowers_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %] + table_settings_holds_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'holds_table', 'json' ) | $raw %] [% IF borrowernumber and patron %] if( Cookies.get("holdfor") != [% patron.borrowernumber | html %]){ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 639d2a6547..9bcf5f8a27 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -712,6 +712,7 @@ table_settings_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'issues-table', 'json' ) | $raw %] table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'members', 'moremember', 'relatives-issues-table', 'json' ) | $raw %] + table_settings_holds_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'holds_table', 'json' ) | $raw %] $(document).ready(function() { $("#info_digests").tooltip(); diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js index 6136fc8d5a..e2bd4401d3 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/holds.js +++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js @@ -126,10 +126,10 @@ $(document).ready(function() { var holds = new Array(); if ( ! holdsTable ) { var title; - holdsTable = $("#holds-table").dataTable($.extend(true, {}, dataTablesDefaults, { + holdsTable = KohaTable("holds-table", { "bAutoWidth": false, - "sDom": "rt", - "columns": [ + "dom": "rt", + "aoColumns": [ { "data": { _: "reservedate_formatted", "sort": "reservedate" } }, @@ -324,7 +324,7 @@ $(document).ready(function() { d.borrowernumber = borrowernumber; } }, - })); + }, table_settings_holds_table ); $('#holds-table').on( 'draw.dt', function () { $(".hold-suspend").on( "click", function() { -- 2.30.2