From 22685c5abcc5dd7aa8843244ac381029bf8f8b31 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 Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- 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 1d517a51c4..34b59b55de 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -1447,6 +1447,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 54cc80c85b..7bf6984689 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -916,6 +916,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 6facce6e5c..21d5a07080 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -717,6 +717,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 802c6e1dcd..d8321d0080 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.39.5