From 20de991fd83c749cd4460ced67edcded6a1edc3b Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 28 Jul 2017 16:28:08 -0300 Subject: [PATCH] Bug 16759: Make OPAC holdings table configurable This patch makes the holdings table in the OPAC biblio detail page configurable using the Columns configuration tools. This patch: - Moves the holdingst table from plain DataTable to KohaTable - Creates a sample yml colvis configuration for this table containing all the currently available columns To test: - Visit some record's detail page in the OPAC - Apply this patch - Reload => SUCCESS: The page shows the same information - On the staff interface, go to: Home > Administration > Columns settings => SUCCESS: There's a new OPAC section containing the configuration for holdingst. - Choose to hide some fields (both currently displayed and currently hidden). - Reload the OPAC detail page => SUCCESS: - Required fields are hidden - It doesn't explode because of trying to hide stuff that is not there to start with - Sign off :-D Sponsored-by: DOVER Signed-off-by: Owen Leonard Followed test plan, patch worked as described. Also passed QA test tool Signed-off-by: Alex Buckley Signed-off-by: Nick Clemens --- admin/columns_settings.yml | 34 +++++++++ .../prog/en/modules/admin/columns_settings.tt | 6 ++ .../bootstrap/en/includes/columns_settings.inc | 37 ++++++++++ .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 86 +++++++++++----------- 4 files changed, 118 insertions(+), 45 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/columns_settings.inc diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index 5198c0d..ab23de9 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -255,6 +255,40 @@ modules: cannot_be_toggled: 1 cannot_be_modified: 1 + opac: + biblio-detail: + holdingst: + - + columnname: item_itemtype + - + columnname: item_current_location + - + columnname: item_home_location + - + columnname: item_ccode + - + columnname: item_callnumber + - + columnname: item_enumchron + - + columnname: item_url + - + columnname: item_copy + - + columnname: item_status + - + columnname: item_notes + - + columnname: item_datedue + - + columnname: item_barcode + - + columnname: item_holds + - + columnname: item_priority + - + columnname: item_coursereserves + reports: lostitems: lostitems-table: 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 4bdaf07..884cc77 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 @@ -156,6 +156,12 @@ [% PROCESS pagelist module=modules.members modulename="members" %] +

OPAC

+
+

OPAC tables

+ [% PROCESS pagelist module=modules.opac modulename="opac" %] +
+

Reports

Reports tables

diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/columns_settings.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/columns_settings.inc new file mode 100644 index 0000000..b065a35 --- /dev/null +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/columns_settings.inc @@ -0,0 +1,37 @@ +[% USE ColumnsSettings %] + + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 8d0fae1..528d7d2 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -2,6 +2,7 @@ [% USE Koha %] [% USE KohaDates %] [% USE Branches %] +[% USE ColumnsSettings %] [% USE AuthorisedValues %] [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnDetail ) %] [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnDetail ) %] @@ -1179,28 +1180,34 @@ - [% IF ( item_level_itypes ) %][% END %] - [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %] - - [% END %] - [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %] - - [% END %] - [% IF ( itemdata_ccode ) %][% END %] - - [% IF ( itemdata_enumchron ) %][% END %] - [% IF ( itemdata_uri ) %][% END %] - [% IF ( itemdata_copynumber ) %][% END %] - - [% IF ( itemdata_itemnotes ) %][% END %] - - [% IF ( OPACShowBarcode ) %][% END %] - [% IF holds_count.defined %] - - [% ELSIF show_priority %] - - [% END %] - [% IF ( ShowCourseReservesHeader ) %][% END %] + [% IF ( item_level_itypes ) %] + [% END %] + [% IF ( OpacLocationBranchToDisplay == 'holding' || OpacLocationBranchToDisplay == 'both' ) %] + [% END %] + [% IF ( OpacLocationBranchToDisplay == 'home' || OpacLocationBranchToDisplay == 'both' ) %] + [% END %] + [% IF ( itemdata_ccode ) %] + [% END %] + + [% IF ( itemdata_enumchron ) %] + [% END %] + [% IF ( itemdata_uri ) %] + [% END %] + [% IF ( itemdata_copynumber ) %] + [% END %] + + [% IF ( itemdata_itemnotes ) %] + [% END %] + + [% IF ( OPACShowBarcode ) %] + [% END %] + [% IF holds_count.defined %] + + [% ELSIF show_priority %] + + [% END %] + [% IF ( ShowCourseReservesHeader ) %] + [% END %] @@ -1361,6 +1368,7 @@ [% BLOCK jsinclude %] [% INCLUDE 'datatables.inc' %] +[% INCLUDE 'columns_settings.inc' %] [% IF ( SocialNetworks ) %]
Item typeCurrent locationHome libraryCollectionCall numberVol infoURLCopy numberStatusNotesDate dueBarcodeItem holdsItem hold queue priorityCourse reservesItem typeCurrent locationHome libraryCollectionCall numberVol infoURLCopy numberStatusNotesDate dueBarcodeItem holdsItem hold queue priorityCourse reserves