Bugzilla – Attachment 173765 Details for
Bug 37238
Add table settings to itemsearch results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37238: Add column configuration to item search results table
Bug-37238-Add-column-configuration-to-item-search-.patch (text/plain), 8.84 KB, created by
Jonathan Druart
on 2024-10-31 08:43:37 UTC
(
hide
)
Description:
Bug 37238: Add column configuration to item search results table
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-10-31 08:43:37 UTC
Size:
8.84 KB
patch
obsolete
>From 55a72032c9b3a2477fc0f8c099c9bea4c6043285 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 2 Jul 2024 22:11:20 +0000 >Subject: [PATCH] Bug 37238: Add column configuration to item search results > table > >To test: >1. APPLY PATCH >2. Do an item search that will return results. >3. To the right of the table notice thee Columns, Export, Configure buttons >4. Use the Columns button to hide and show various columns, make sure it works right. >5. Use the Export button to try and export the table in various file formats. You should only see visible columns in your export. >6. Go to Admin -> Table settings, make sure you can hide columns properly from there. > >Signed-off-by: Sam Lau <samalau@gmail.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > admin/columns_settings.yml | 52 ++++++++++++++++++ > .../prog/en/modules/catalogue/itemsearch.tt | 54 ++++++++++--------- > 2 files changed, 81 insertions(+), 25 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index e318746cb7f..09bb06855f1 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -646,6 +646,58 @@ modules: > cannot_be_toggled: 1 > cannot_be_modified: 1 > >+ itemsearch: >+ results: >+ columns: >+ - >+ columnname: itemsearch_checkbox >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ - >+ columnname: title >+ - >+ columnname: publication_date >+ - >+ columnname: publisher >+ - >+ columnname: collection >+ - >+ columnname: barcode >+ - >+ columnname: item_number >+ - >+ columnname: serial_enumeration >+ - >+ columnname: call_number >+ - >+ columnname: home_library >+ - >+ columnname: current_library >+ - >+ columnname: shelving_location >+ - >+ columnname: item_type >+ - >+ columnname: inventory_number >+ - >+ columnname: notforloan_status >+ - >+ columnname: lost_status >+ - >+ columnname: withdrawn_status >+ - >+ columnname: damaged_status >+ - >+ columnname: checkouts >+ - >+ columnname: last_checkout_date >+ - >+ columnname: due_date >+ - >+ columnname: actions >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ > cataloguing: > addbooks: > reservoir-table: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >index c02ba8d4cd3..624e1678536 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt >@@ -2,6 +2,7 @@ > [% USE To %] > [% USE Asset %] > [% USE AuthorisedValues %] >+[% USE TablesSettings %] > [% PROCESS 'i18n.inc' %] > [%- BLOCK form_label -%] > [%- SWITCH label -%] >@@ -355,6 +356,7 @@ > > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] > [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %] > [% INCLUDE 'select2.inc' %] > <script> >@@ -453,28 +455,28 @@ > function submitForm($form) { > var tr = '' > + ' <tr>' >- + ' <th id="items_checkbox"></th>' >- + ' <th id="items_title">' + _("Title") + '</th>' >- + ' <th id="items_pubdate">' + _("Publication date") + '</th>' >- + ' <th id="items_publisher">' + _("Publisher") + '</th>' >- + ' <th id="items_collection">' + _("Collection") + '</th>' >- + ' <th id="items_barcode">' + _("Barcode") + '</th>' >- + ' <th id="items_itemnumber">' + _("Item number") + '</th>' >- + ' <th id="items_enumchron">' + _("Serial enumeration") + '</th>' >- + ' <th id="items_callno">' + _("Call number") + '</th>' >- + ' <th id="items_homebranch">' + _("Home library") + '</th>' >- + ' <th id="items_holdingbranch">' + _("Current library") + '</th>' >- + ' <th id="items_location">' + _("Shelving location") + '</th>' >- + ' <th id="items_itype">' + _("Itemtype") + '</th>' >- + ' <th id="item_inventoryno">' + _("Inventory number") + '</th>' >- + ' <th id="items_status">' + _("Not for loan status") + '</th>' >- + ' <th id="items_itemlost">' + _("Lost status") + '</th>' >- + ' <th id="items_widthdrawn">' + _("Withdrawn status") + '</th>' >- + ' <th id="items_damaged">' + _("Damaged status") + '</th>' >- + ' <th id="items_checkouts">' + _("Checkouts") + '</th>' >- + ' <th id="items_datelastborrowed">' + _("Last checkout date") + '</th>' >- + ' <th id="items_date_due">' + _("Due date") + '</th>' >- + ' <th id=""></th>' >+ + ' <th id="items_checkbox" data-colname="itemsearch_checkbox"></th>' >+ + ' <th id="items_title" data-colname="title">' + _("Title") + '</th>' >+ + ' <th id="items_pubdate" data-colname="publication_date">' + _("Publication date") + '</th>' >+ + ' <th id="items_publisher" data-colname="publisher">' + _("Publisher") + '</th>' >+ + ' <th id="items_collection" data-colname="collection">' + _("Collection") + '</th>' >+ + ' <th id="items_barcode" data-colname="barcode">' + _("Barcode") + '</th>' >+ + ' <th id="items_itemnumber" data-colname="item_number">' + _("Item number") + '</th>' >+ + ' <th id="items_enumchron" data-colname="serial_enumeration">' + _("Serial enumeration") + '</th>' >+ + ' <th id="items_callno" data-colname="call_number">' + _("Call number") + '</th>' >+ + ' <th id="items_homebranch" data-colname="home_library">' + _("Home library") + '</th>' >+ + ' <th id="items_holdingbranch" data-colname="current_library">' + _("Current library") + '</th>' >+ + ' <th id="items_location" data-colname="shelving_location">' + _("Shelving location") + '</th>' >+ + ' <th id="items_itype" data-colname="item_type">' + _("Itemtype") + '</th>' >+ + ' <th id="item_inventoryno" data-colname="inventory_number">' + _("Inventory number") + '</th>' >+ + ' <th id="items_status" data-colname="notforloan_status">' + _("Not for loan status") + '</th>' >+ + ' <th id="items_itemlost" data-colname="lost_status">' + _("Lost status") + '</th>' >+ + ' <th id="items_widthdrawn" data-colname="withdrawn_status">' + _("Withdrawn status") + '</th>' >+ + ' <th id="items_damaged" data-colname="damaged_status">' + _("Damaged status") + '</th>' >+ + ' <th id="items_checkouts" data-colname="checkouts">' + _("Checkouts") + '</th>' >+ + ' <th id="items_datelastborrowed" data-colname="last_checkout_date">' + _("Last checkout date") + '</th>' >+ + ' <th id="items_date_due" data-colname="due_date">' + _("Due date") + '</th>' >+ + ' <th id="itmes_actions" data-colname="actions">Actions</th>' > + ' </tr>'; > > var table = '' >@@ -566,7 +568,9 @@ > > var params = getParams($form); > >- $('#results').dataTable($.extend(true, {}, dataTablesDefaults, { >+ var table_settings = [% TablesSettings.GetTableSettings( 'catalogue', 'itemsearch', 'results', 'json' ) | $raw %]; >+ KohaTable('results' , { >+ "bKohaColumnsUseNames": true, > "destroy": true, > "serverSide": true, > "processing": true, >@@ -585,7 +589,7 @@ > return d; > } > }, >- 'dom': '<"top pager"ilp>t<"bottom pager"ip>r', >+ 'dom': 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>', > 'order': [[1, 'asc']], > 'columns': [ > { 'name': 'checkbox', 'orderable': false }, >@@ -616,7 +620,7 @@ > prepSelections(); > }, > fixedHeader: false // There is a bug on this view >- })).columnFilter({ >+ }, table_settings ).columnFilter({ > 'sPlaceHolder': 'head:after', > "aoColumns": [ > null, >-- >2.34.1
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 37238
:
168409
|
168411
|
168483
|
170785
|
171037
|
173414
|
173415
|
173416
|
173740
|
173765
|
173766
|
173768
|
173785
|
173786
|
173787