From 9434d0274719e96d721f5d1337341a8cf7964790 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 7 Nov 2023 21:41:34 +0000 Subject: [PATCH] Bug 30031: Add column settings to list view To test: 1. Apply patch and restart_all 2. Create a list 3. GO to Administration > Table settings 4. In Table settings look under Lists: Table id: searchresults 6. The search results table should be listed, with the ability to hide the author, date_added, or call_number 7. Go to the view of your list ( /cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=1 ) 8. Set item-level_itypes to 'bibliographic record' so the item type column will show. 9. Make sure you can hide the columns properly. ( The checkbox and Title columns should not be hidable ) Signed-off-by: Andrew Fuerste Henry Signed-off-by: Anni Rajala Signed-off-by: Ray Delahunty --- admin/columns_settings.yml | 21 +++ .../prog/en/modules/admin/columns_settings.tt | 15 ++ .../prog/en/modules/virtualshelves/shelves.tt | 158 ++++++++++-------- 3 files changed, 120 insertions(+), 74 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 41cfe87edb..81e9b1d8d2 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -976,6 +976,27 @@ modules: cannot_be_toggled: 1 cannot_be_modified: 1 + virtualshelves: + lists: + searchresults: + columns: + - + columnname: checkbox + cannot_be_toggled: 1 + cannot_be_modified: 1 + - + columnname: item_type + - + columnname: title + cannot_be_toggled: 1 + cannot_be_modified: 1 + - + columnname: author + - + columnname: date_added + - + columnname: call_number + members: fines: account-fines: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt index efb664fc91..47db515d29 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt @@ -312,6 +312,21 @@ [% PROCESS pagelist module=modules.members modulename="members" %] [% END %] [% END %] +
+ +
+
+

Lists tables

+ [% PROCESS pagelist module=modules.virtualshelves modulename="virtualshelves" %] +
+
+
[% WRAPPER accordion_item %] [% WRAPPER accordion_heading panel_id="pos" %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt index e82cf2f618..b3d1e4b936 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -3,6 +3,7 @@ [% USE Asset %] [% USE Koha %] [% USE KohaDates %] +[% USE TablesSettings %] [% USE AuthorisedValues %] [% USE Branches %] [% PROCESS 'i18n.inc' %] @@ -282,109 +283,111 @@ [% IF ( itemsloop ) %] -   +   [% END %] [% UNLESS ( item_level_itypes ) %] - Item type + Item type [% END %] [% IF sortfield == 'title' %] - + [% ELSE %] - + [% END %] Title [% IF sortfield == 'author' %] - + [% ELSE %] - + [% END %] Author [% IF sortfield == 'dateadded' %] - + [% ELSE %] - + [% END %] Date added [% IF sortfield == 'itemcallnumber' %] - + [% ELSE %] - + [% END %] Call number - [% FOREACH itemsloo IN itemsloop %] - - [% IF itemsloop %] - - - - [% END %] - [% UNLESS ( item_level_itypes ) %] - - [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %] - [% itemsloo.description | html %] - [% END %] - [% itemsloo.description | html %] - - [% END %] - - [% IF ( itemsloo.XSLTBloc ) %] - [% itemsloo.XSLTBloc | $raw %] - [% ELSE %] - [% INCLUDE 'biblio-title.inc' biblio=itemsloo link = 1 %] - + + [% FOREACH itemsloo IN itemsloop %] + + [% IF itemsloop %] + + + [% END %] -

- [% IF ( itemsloo.notforloan ) %] - No holds allowed - [% ELSE %] - [% IF ( itemsloo.ITEM_RESULTS.count ) %] - Holds - [% IF ( holdfor ) %] - | Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 %] - [% END %] - [% ELSE %] - No holds allowed + [% UNLESS ( item_level_itypes ) %] + + [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %] + [% itemsloo.description | html %] [% END %] + [% itemsloo.description | html %] + + [% END %] + + [% IF ( itemsloo.XSLTBloc ) %] + [% itemsloo.XSLTBloc | $raw %] + [% ELSE %] + [% INCLUDE 'biblio-title.inc' biblio=itemsloo link = 1 %] + [% END %] - [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] - | Edit record - [% END %] - [% IF ( CAN_user_editcatalogue_edit_items ) %] - | Edit items - [% END %] -

- - - [% itemsloo.author | html %] - - - [% itemsloo.dateadded | $KohaDates%] - - -
    - [% FOREACH item IN itemsloo.ITEM_RESULTS %] -
  • - [% Branches.GetName(item.holdingbranch) | html %] - [% IF ( item.location ) %] - - [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %] - - [% END %] - [% IF ( item.itemcallnumber ) %] - [[% item.itemcallnumber | html %]] +

    + [% IF ( itemsloo.notforloan ) %] + No holds allowed + [% ELSE %] + [% IF ( itemsloo.ITEM_RESULTS.count ) %] + Holds + [% IF ( holdfor ) %] + | Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 %] + [% END %] + [% ELSE %] + No holds allowed [% END %] -

  • - [% END # /FOREACH item %] -
- - - [% END #/FOREACH itemsloo %] + [% END %] + [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] + | Edit record + [% END %] + [% IF ( CAN_user_editcatalogue_edit_items ) %] + | Edit items + [% END %] +

+ + + [% itemsloo.author | html %] + + + [% itemsloo.dateadded | $KohaDates%] + + +
    + [% FOREACH item IN itemsloo.ITEM_RESULTS %] +
  • + [% Branches.GetName(item.holdingbranch) | html %] + [% IF ( item.location ) %] + + [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %] + + [% END %] + [% IF ( item.itemcallnumber ) %] + [[% item.itemcallnumber | html %]] + [% END %] +
  • + [% END # /FOREACH item %] +
+ + + [% END #/FOREACH itemsloo %] + @@ -598,6 +601,7 @@ [% MACRO jsinclude BLOCK %] [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'columns_settings.inc' %] [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %] [% IF print %]