Bugzilla – Attachment 159084 Details for
Bug 30031
Add lists to table settings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30031: Add column settings to list view
Bug-30031-Add-column-settings-to-list-view.patch (text/plain), 20.46 KB, created by
Lucas Gass (lukeg)
on 2023-11-17 14:28:29 UTC
(
hide
)
Description:
Bug 30031: Add column settings to list view
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2023-11-17 14:28:29 UTC
Size:
20.46 KB
patch
obsolete
>From b7f281cdddc53f20804bcb9bbf92fa663dea9662 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >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 ) >--- > admin/columns_settings.yml | 21 +++ > .../prog/en/modules/admin/columns_settings.tt | 16 ++ > .../prog/en/modules/virtualshelves/shelves.tt | 158 ++++++++++-------- > 3 files changed, 121 insertions(+), 74 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index dd6396671fe..e831fd0151c 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -950,6 +950,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 526391b4bda..d86f647e05b 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 >@@ -353,6 +353,22 @@ > </div> <!-- /.panel-collapse --> > </div> > >+ <div class="panel panel-default"> >+ <div class="panel-heading" role="tab" id="virtualshelvesHeading"> >+ <h2 class="panel-title"> >+ <a id="virtualshelvesToggle" class="collapsed" role="button" data-toggle="collapse" data-parent="#modules" href="#virtualshelves" aria-expanded="false" aria-controls="collapseOne"> >+ Lists >+ </a> >+ </h2> >+ </div> <!-- /.panel-heading --> >+ <div id="virtualshelves" class="panel-collapse collapse" role="tabpanel" aria-labelledby="virtualshelvesHeading"> >+ <div class="panel-body"> >+ <h3>Lists tables</h3> >+ [% PROCESS pagelist module=modules.virtualshelves modulename="virtualshelves" %] >+ </div> <!-- /.panel-body --> >+ </div> <!-- /.panel-collapse --> >+ </div> >+ > <div class="panel panel-default"> > <div class="panel-heading" role="tab" id="membersHeading"> > <h2 class="panel-title"> >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 0cffa3c0891..230db6faf7b 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' %] >@@ -281,109 +282,111 @@ > <thead> > <tr> > [% IF ( itemsloop ) %] >- <th class="checkall"> </th> >+ <th class="checkall" data-colname="checkbox"> </th> > [% END %] > [% UNLESS ( item_level_itypes ) %] >- <th>Item type</th> >+ <th data-colname="item_type">Item type</th> > [% END %] > [% IF sortfield == 'title' %] >- <th class="sorting_[% direction | html %]"> >+ <th class="sorting_[% direction | html %]" data-colname="title"> > [% ELSE %] >- <th class="sorting"> >+ <th class="sorting" data-colname="title"> > [% END %] > <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]&sortfield=title&direction=[% IF sortfield != 'title' %]asc[% ELSE %][% new_direction | uri %][% END %]">Title</a> > </th> > [% IF sortfield == 'author' %] >- <th class="sorting_[% direction | html %]"> >+ <th class="sorting_[% direction | html %]" data-colname="author"> > [% ELSE %] >- <th class="sorting"> >+ <th class="sorting" data-colname="author"> > [% END %] > <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]&sortfield=author&direction=[% IF sortfield != 'author' %]asc[% ELSE %][% new_direction | uri %][% END %]">Author</a> > </th> > [% IF sortfield == 'dateadded' %] >- <th class="sorting_[% direction | html %]"> >+ <th class="sorting_[% direction | html %]" data-colname="date_added"> > [% ELSE %] >- <th class="sorting"> >+ <th class="sorting" data-colname="date_added"> > [% END %] > <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]&sortfield=dateadded&direction=[% IF sortfield != 'dateadded' %]asc[% ELSE %][% new_direction | uri %][% END %]">Date added</a> > </th> > [% IF sortfield == 'itemcallnumber' %] >- <th class="sorting_[% direction | html %]"> >+ <th class="sorting_[% direction | html %]" data-colname="call_number"> > [% ELSE %] >- <th class="sorting"> >+ <th class="sorting" data-colname="call_number"> > [% END %] > <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber | uri %]&sortfield=itemcallnumber&direction=[% IF sortfield != 'itemcallnumber' %]asc[% ELSE %][% new_direction | uri %][% END %]">Call number</a> > </th> > </tr> > </thead> >- [% FOREACH itemsloo IN itemsloop %] >- <tr> >- [% IF itemsloop %] >- <td> >- <input type="checkbox" class="selection" value="[% itemsloo.biblionumber | html %]" name="biblionumber" /> >- </td> >- [% END %] >- [% UNLESS ( item_level_itypes ) %] >- <td> >- [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %] >- <img src="[% itemsloo.imageurl | html %]" alt="[% itemsloo.description | html %]" title="[% itemsloo.description | html %]" /> >- [% END %] >- <span class="itypetext">[% itemsloo.description | html %]</span> >- </td> >- [% END %] >- <td> >- [% IF ( itemsloo.XSLTBloc ) %] >- [% itemsloo.XSLTBloc | $raw %] >- [% ELSE %] >- [% INCLUDE 'biblio-title.inc' biblio=itemsloo link = 1 %] >- </a> >+ </tbody> >+ [% FOREACH itemsloo IN itemsloop %] >+ <tr> >+ [% IF itemsloop %] >+ <td> >+ <input type="checkbox" class="selection" value="[% itemsloo.biblionumber | html %]" name="biblionumber" /> >+ </td> > [% END %] >- <p class="hold"> >- [% IF ( itemsloo.notforloan ) %] >- <span class="noholdstext">No holds allowed</span> >- [% ELSE %] >- [% IF ( itemsloo.ITEM_RESULTS.count ) %] >- <a id="reserve_[% itemsloo.biblionumber | html %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | html %]">Holds</a> >- [% IF ( holdfor ) %] >- <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | uri %]&findborrower=[% holdfor_patron.cardnumber | uri %]">Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 %]</a></span> >- [% END %] >- [% ELSE %] >- <span class="noholdstext">No holds allowed</span> >+ [% UNLESS ( item_level_itypes ) %] >+ <td> >+ [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %] >+ <img src="[% itemsloo.imageurl | html %]" alt="[% itemsloo.description | html %]" title="[% itemsloo.description | html %]" /> > [% END %] >+ <span class="itypetext">[% itemsloo.description | html %]</span> >+ </td> >+ [% END %] >+ <td> >+ [% IF ( itemsloo.XSLTBloc ) %] >+ [% itemsloo.XSLTBloc | $raw %] >+ [% ELSE %] >+ [% INCLUDE 'biblio-title.inc' biblio=itemsloo link = 1 %] >+ </a> > [% END %] >- [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] >- | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit record</a> >- [% END %] >- [% IF ( CAN_user_editcatalogue_edit_items ) %] >- | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit items</a> >- [% END %] >- </p> >- </td> >- <td> >- [% itemsloo.author | html %] >- </td> >- <td> >- [% itemsloo.dateadded | $KohaDates%] >- </td> >- <td> >- <ul> >- [% FOREACH item IN itemsloo.ITEM_RESULTS %] >- <li> >- [% Branches.GetName(item.holdingbranch) | html %] >- [% IF ( item.location ) %] >- <span class="shelvingloc"> >- [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %] >- </span> >- [% END %] >- [% IF ( item.itemcallnumber ) %] >- [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% item.itemcallnumber | uri %]%22">[% item.itemcallnumber | html %]</a>] >+ <p class="hold"> >+ [% IF ( itemsloo.notforloan ) %] >+ <span class="noholdstext">No holds allowed</span> >+ [% ELSE %] >+ [% IF ( itemsloo.ITEM_RESULTS.count ) %] >+ <a id="reserve_[% itemsloo.biblionumber | html %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | html %]">Holds</a> >+ [% IF ( holdfor ) %] >+ <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | uri %]&findborrower=[% holdfor_patron.cardnumber | uri %]">Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 %]</a></span> >+ [% END %] >+ [% ELSE %] >+ <span class="noholdstext">No holds allowed</span> > [% END %] >- </li> >- [% END # /FOREACH item %] >- </ul> >- </td> >- </tr> >- [% END #/FOREACH itemsloo %] >+ [% END %] >+ [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] >+ | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit record</a> >+ [% END %] >+ [% IF ( CAN_user_editcatalogue_edit_items ) %] >+ | <a href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% itemsloo.biblionumber | uri %]">Edit items</a> >+ [% END %] >+ </p> >+ </td> >+ <td> >+ [% itemsloo.author | html %] >+ </td> >+ <td> >+ [% itemsloo.dateadded | $KohaDates%] >+ </td> >+ <td data-sort="[% item.itemcallnumber | html %]"> >+ <ul> >+ [% FOREACH item IN itemsloo.ITEM_RESULTS %] >+ <li> >+ [% Branches.GetName(item.holdingbranch) | html %] >+ [% IF ( item.location ) %] >+ <span class="shelvingloc"> >+ [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %] >+ </span> >+ [% END %] >+ [% IF ( item.itemcallnumber ) %] >+ [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% item.itemcallnumber | uri %]%22">[% item.itemcallnumber | html %]</a>] >+ [% END %] >+ </li> >+ [% END # /FOREACH item %] >+ </ul> >+ </td> >+ </tr> >+ [% END #/FOREACH itemsloo %] >+ </tbody> > </table> <!-- /#searchresults --> > </div> <!-- /.page-section --> > >@@ -597,6 +600,7 @@ > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] > [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %] > [% IF print %] > <script> >@@ -725,6 +729,12 @@ > [% IF shelf AND op == 'view' %] > var Sticky; > $(document).ready(function(){ >+ var table_settings = [% TablesSettings.GetTableSettings( 'virtualshelves', 'lists', 'searchresults', 'json' ) | $raw %]; >+ KohaTable("searchresults", { >+ 'bPaginate': false, >+ "bKohaColumnsUseNames": true, >+ }, table_settings ); >+ > Sticky = $("#searchheader"); > Sticky.hcSticky({ > stickTo: "#listform", >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30031
:
130182
|
130183
|
131798
|
132037
|
132049
|
132050
|
132051
|
144887
|
144962
|
144966
|
158626
|
159084
|
159119
|
159859
|
162085
|
166716