From a009ce37c1a3fe9760b6b95c5502d05316f7c433 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 29 Dec 2022 16:10:45 +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 Catalog for lists. 5. The search results table should be listed, with the ability to hide the author, date_added, or call_number 6. Go to the view of your list ( /cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=1 ) 7. Make sure you can hide the columns properly. ( The checkbox and Title columns should not be hidable ) 8. Turn on the item-level_itypes system preferecne which will add the item type column, make sure you can hide it and all other columns correctlly now. Note: I have also added the page-section class to this table. --- admin/columns_settings.yml | 20 ++ .../prog/en/modules/virtualshelves/shelves.tt | 221 +++++++++--------- 2 files changed, 136 insertions(+), 105 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index ec2a21dcd31..d06438da482 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -347,6 +347,26 @@ modules: cannot_be_modified: 1 catalogue: + 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 + detail: holdings_table: columns: 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 605a074f5e2..f3cf1236015 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -2,6 +2,7 @@ [% USE Asset %] [% USE Koha %] [% USE KohaDates %] +[% USE TablesSettings %] [% USE AuthorisedValues %] [% USE Branches %] [% SET footerjs = 1 %] @@ -280,115 +281,118 @@ [% END %] - - - - - [% IF ( itemsloop ) %] - - [% END %] - [% UNLESS ( item_level_itypes ) %] - - [% END %] - [% IF sortfield == 'title' %] - - [% IF sortfield == 'author' %] - - [% IF sortfield == 'dateadded' %] - - [% IF sortfield == 'itemcallnumber' %] - - - - [% FOREACH itemsloo IN itemsloop %] - - [% IF itemsloop %] - - [% END %] - [% UNLESS ( item_level_itypes ) %] - - [% END %] - + + + + + [% END #/FOREACH itemsloo %] + +
 Item type - [% ELSE %] - - [% END %] - Title - - [% ELSE %] - - [% END %] - Author - - [% ELSE %] - - [% END %] - Date added - - [% ELSE %] - - [% END %] - Call number -
- - - [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %] - [% itemsloo.description | html %] - [% END %] - [% itemsloo.description | html %] - - [% IF ( itemsloo.XSLTBloc ) %] - [% itemsloo.XSLTBloc | $raw %] +
+ + + + [% IF ( itemsloop ) %] + + [% END %] + [% UNLESS ( item_level_itypes ) %] + + [% END %] + [% IF sortfield == 'title' %] + + [% IF sortfield == 'author' %] + + [% IF sortfield == 'dateadded' %] + + [% IF sortfield == 'itemcallnumber' %] + + + + + [% FOREACH itemsloo IN itemsloop %] + + [% IF itemsloop %] + + [% END %] + [% UNLESS ( item_level_itypes ) %] + + [% END %] + - - - - - [% END #/FOREACH itemsloo %] -
 Item type [% ELSE %] - [% INCLUDE 'biblio-title.inc' biblio=itemsloo link = 1 %] - + [% 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 + Title +

+ [% ELSE %] + + [% END %] + Author + + [% ELSE %] + + [% END %] + Date added + + [% ELSE %] + + [% END %] + Call number +
+ + + [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %] + [% itemsloo.description | html %] [% END %] + [% itemsloo.description | html %] + + [% 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 %] + [% 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 %] +
+
+
[% pagination_bar | $raw %]
[% END # /IF itemsloop %] @@ -593,6 +597,7 @@ [% MACRO jsinclude BLOCK %] [% INCLUDE 'datatables.inc' %] + [% INCLUDE 'columns_settings.inc' %] [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %] [% IF print %]