From 4d9ec7c82f64ecee25a7966d8ef794d68fb447df Mon Sep 17 00:00:00 2001 From: Arthur Suzuki Date: Thu, 26 Sep 2024 17:22:27 +0200 Subject: [PATCH] Bug 30221: make the tables on opac-user.tt configurable Test plan: - apply patch - as an admin go to Administration / Table settings / Opac / Patron details - hide a few columns (duedate, barcode) - make a couple checkouts and/or holds for a patron - login to the opac as this patron - verify the tables on the patron account table is missing the selected columns sponsored-by: Lyon 2 University Signed-off-by: Lucas Gass --- admin/columns_settings.yml | 71 +++++++++++++++++++ .../bootstrap/en/includes/holds-table.inc | 18 ++--- .../bootstrap/en/modules/opac-user.tt | 55 +++++++------- 3 files changed, 110 insertions(+), 34 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 8b4eb1f8ef7..6ac3c768ce3 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -2519,6 +2519,77 @@ modules: - columnname: link + patron_details: + checkoutst: + columns: + - + columnname: title + - + columnname: author + - + columnname: datedue + - + columnname: itemtype + - + columnname: barcode + - + columnname: callnumber + - + columnname: renew + - + columnname: fines + - + columnname: links + holdst: + columns: + - + columnname: title + - + columnname: placed_on + - + columnname: expires_on + - + columnname: pickup_location + - + columnname: priority + - + columnname: notes + - + columnname: suspend + - + columnname: modify + overduest: + columns: + - + columnname: title + - + columnname: itemtype + - + columnname: barcode + - + columnname: callnumber + - + columnname: checkoutdate + - + columnname: duedate + - + columnname: renew + - + columnname: fines + + opac_user_relative_issues_table: + columns: + - + columnname: title + - + columnname: duedate + - + columnname: barcode + - + columnname: callnumber + - + columnname: relative + serials: claims: claimst: diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc index 1bafd09778d..e6b5cdc49cc 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc @@ -9,28 +9,28 @@ - Title + Title [% IF ( showpriority ) %] - Placed on + Placed on [% ELSE %] - Placed on + Placed on [% END %] - Expires on + Expires on [% UNLESS( singleBranchMode) %] - Pickup location + Pickup location [% END %] [% IF ( showpriority ) %] - Priority + Priority [% END %] [% IF Koha.Preference('OpacHoldNotes') %] - Notes + Notes [% END %] Status [% IF SuspendHoldsOpac and ! onlyinfo %] - Suspend + Suspend [% END %] [% IF ! onlyinfo %] - Modify + Modify [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 5c8edacfe22..ab33a46a139 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -2,6 +2,7 @@ [% USE Asset %] [% USE Koha %] [% USE KohaDates %] +[% USE TablesSettings %] [% USE Branches %] [% USE I18N %] [% USE ItemTypes %] @@ -309,29 +310,29 @@ [% IF ( JacketImages ) %] [% END %] - Title - Author - Checked out on - Due + Title + Author + Checked out on + Due [% IF ( Koha.Preference('BiblioItemtypeInfo') || !item_level_itypes ) %] - Item type + Item type [% END %] [% IF ( show_barcode ) %] - Barcode + Barcode [% END %] - Call number + Call number [% IF ( OpacRenewalAllowed && !( logged_in_user.is_expired && logged_in_user.category.effective_BlockExpiredPatronOpacActions_contains('renew') ) ) %] - Renew + Renew [% END %] [% IF ( OPACFinesTab ) %] - Fines + Fines [% END %] [% IF Koha.Preference('OPACMySummaryHTML') %] - Links + Links [% END %] [% IF ( Koha.Preference('AllowCheckoutNotes') ) %] Checkout note - Report a problem + Report a problem [% END %] @@ -650,11 +651,11 @@ Relatives' checkouts - Title - Due - Barcode - Call number - Relative + Title + Due + Barcode + Call number + Relative @@ -692,17 +693,17 @@ [% IF ( JacketImages ) %] [% END %] - Title - [% UNLESS ( item_level_itypes ) %]Item type[% END %] - [% IF ( show_barcode ) %]Barcode[% END %] - Call number - Checked out on - Due + Title + [% UNLESS ( item_level_itypes ) %]Item type [% END %] + [% IF ( show_barcode ) %]Barcode[% END %] + Call number + Checked out on + Due [% IF ( OpacRenewalAllowed ) %] - Renew + Renew [% END %] [% IF ( OPACFinesTab ) %] - Fines + Fines [% END %] @@ -1175,6 +1176,10 @@ ); }); + var tables_settings = new Map(); + [% FOREACH table IN ['checkoutst', 'holdst', 'overduest','opac_user_relative_issues_table'] %] + tables_settings.set("[% table | $raw %]", [% TablesSettings.GetTableSettings( 'opac', 'patron_details', table, 'json') | $raw %]); + [% END %] var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table"); dTables.each(function(){ var thIndex = $(this).find("th.psort").index(); @@ -1216,7 +1221,7 @@ } } ] - }); + }, tables_settings.get($(this).attr('id'))); }); var dataTables = $("#recalls-table,#article-requests-table"); -- 2.39.5