From 7840b43cb9dccd40f59fee1a6333ca9fa8c9266b Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 4 Aug 2017 18:38:58 -0300 Subject: [PATCH] Bug 19038: Remove the OPACShowBarcode syspref MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followed test plan and works as expected. Functionality of patch from bug 16759 appears intact too. Signed-off-by: Dilan Johnpullé --- C4/UsageStats.pm | 1 - .../bug_19038_remove_opacshowbarcode_syspref.perl | 21 +++++++++++++++++++++ installer/data/mysql/sysprefs.sql | 1 - .../prog/en/modules/admin/preferences/opac.pref | 7 ------- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 5 ++--- opac/opac-detail.pl | 1 - t/db_dependent/UsageStats.t | 1 - 7 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_19038_remove_opacshowbarcode_syspref.perl diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index 96e79fa..7524e05 100644 --- a/C4/UsageStats.pm +++ b/C4/UsageStats.pm @@ -243,7 +243,6 @@ sub BuildReport { OpacMaintenance OpacPublic OpacSeparateHoldings - OPACShowBarcode OPACShowCheckoutName OpacShowFiltersPulldownMobile OPACShowHoldQueueDetails diff --git a/installer/data/mysql/atomicupdate/bug_19038_remove_opacshowbarcode_syspref.perl b/installer/data/mysql/atomicupdate/bug_19038_remove_opacshowbarcode_syspref.perl new file mode 100644 index 0000000..5b76096 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_19038_remove_opacshowbarcode_syspref.perl @@ -0,0 +1,21 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + my $hide_barcode = C4::Context->preference('OPACShowBarcode') ? 0 : 1; + + $dbh->do(q{ + DELETE FROM systempreferences + WHERE + variable='OPACShowBarcode' + }); + + # Configure column visibility if it isn't + $dbh->do(q{ + INSERT IGNORE INTO columns_settings + (module,page,tablename,columnname,cannot_be_toggled,is_hidden) + VALUES + ('opac','biblio-detail','holdingst','item_barcode',0,?) + }, undef, $hide_barcode); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 19038: Remove OPACShowBarcode syspref)\n"; +} \ No newline at end of file diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 0bd8cac..3254347 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -374,7 +374,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('opacSerialDefaultTab','subscriptions','holdings|serialcollection|subscriptions','Define the default tab for serials in OPAC.','Choice'), ('OPACSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the OPAC','Integer'), ('OPACShelfBrowser','1','','Enable/disable Shelf Browser on item details page. WARNING: this feature is very resource consuming on collections with large numbers of items.','YesNo'), -('OPACShowBarcode','0','','Show items barcode in holding tab','YesNo'), ('OPACShowCheckoutName','0','','Displays in the OPAC the name of patron who has checked out the material. WARNING: Most sites should leave this off. It is intended for corporate or special sites which need to track who has the item.','YesNo'), ('OPACShowHoldQueueDetails','none','none|priority|holds|holds_priority','Show holds details in OPAC','Choice'), ('OpacShowRecentComments','0',NULL,'If ON a link to recent comments will appear in the OPAC masthead','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index b6954ef..e5da663 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -165,13 +165,6 @@ OPAC: no: "Don't show" - a link to recent comments in the OPAC masthead. - - - pref: OPACShowBarcode - default: 0 - choices: - yes: Show - no: "Don't show" - - the item's barcode on the holdings tab. - - - pref: GoogleIndicTransliteration default: 0 choices: 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 decc577..cc253f5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1201,8 +1201,7 @@ [% IF ( itemdata_itemnotes ) %] Notes[% END %] Date due - [% IF ( OPACShowBarcode ) %] - Barcode[% END %] + Barcode [% IF holds_count.defined %] Item holds [% ELSIF show_priority %] @@ -1331,7 +1330,7 @@ [% INCLUDE 'item-status-schema-org.inc' item = ITEM_RESULT %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %] [% IF ( itemdata_itemnotes ) %][% ITEM_RESULT.itemnotes %][% END %] [% ITEM_RESULT.datedue | $KohaDates as_due_date => 1 %] - [% IF ( OPACShowBarcode ) %][% ITEM_RESULT.barcode %][% END %] + [% ITEM_RESULT.barcode %] [% IF holds_count.defined || show_priority %] [% IF holds_count.defined %] [% ITEM_RESULT.holds_count %] [% END %] diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index ae89f82..495dc67 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -461,7 +461,6 @@ if ($session->param('busc')) { $template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) ); $template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); -$template->param('OPACShowBarcode' => C4::Context->preference("OPACShowBarcode") ); # adding items linked via host biblios diff --git a/t/db_dependent/UsageStats.t b/t/db_dependent/UsageStats.t index 5f4dfad..752d42c 100644 --- a/t/db_dependent/UsageStats.t +++ b/t/db_dependent/UsageStats.t @@ -496,7 +496,6 @@ sub mocking_systempreferences_to_a_set_value { OpacMaintenance OpacPublic OpacSeparateHoldings - OPACShowBarcode OPACShowCheckoutName OpacShowFiltersPulldownMobile OPACShowHoldQueueDetails -- 2.1.4