Bug 19038: Remove the OPACShowBarcode syspref

This patch removes the OPACShowBarcode syspref in favour of the new
columns settings option introduced by bug 16759.

On the upgrade step, it picks the value for OPACShowBarcode and uses it
to populate the columns_settings table.

To test:
- Verify the upgrade process maintains the current behaviour

Regards

Sponsored-by: Dover

Followed test plan and works as expected. Functionality of patch from bug 16759
appears intact too.
Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Tomas Cohen Arazi 2017-08-04 18:38:58 -03:00 committed by Jonathan Druart
parent 667c07e048
commit e711c8e418
7 changed files with 23 additions and 14 deletions

View File

@ -243,7 +243,6 @@ sub BuildReport {
OpacMaintenance
OpacPublic
OpacSeparateHoldings
OPACShowBarcode
OPACShowCheckoutName
OpacShowFiltersPulldownMobile
OPACShowHoldQueueDetails

View File

@ -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";
}

View File

@ -378,7 +378,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'),

View File

@ -166,13 +166,6 @@ OPAC:
yes: Show
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

View File

@ -1201,8 +1201,7 @@
[% IF ( itemdata_itemnotes ) %]
<th id="item_notes" data-colname="item_notes" class="notes">Notes</th>[% END %]
<th id="item_datedue" data-colname="item_datedue" class="date_due">Date due</th>
[% IF ( OPACShowBarcode ) %]
<th id="item_barcode" data-colname="item_barcode" class="barcode">Barcode</th>[% END %]
<th id="item_barcode" data-colname="item_barcode" class="barcode">Barcode</th>
[% IF holds_count.defined %]
<th id="item_holds" data-colname="item_holds">Item holds</th>
[% ELSIF show_priority %]
@ -1336,7 +1335,7 @@
<td class="status">[% INCLUDE 'item-status-schema-org.inc' item = ITEM_RESULT %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
[% IF ( itemdata_itemnotes ) %]<td class="notes" property="description">[% ITEM_RESULT.itemnotes %]</td>[% END %]
<td class="date_due"><span title="[% ITEM_RESULT.datedue %]">[% ITEM_RESULT.datedue | $KohaDates as_due_date => 1 %]</span></td>
[% IF ( OPACShowBarcode ) %]<td class="barcode" property="serialNumber">[% ITEM_RESULT.barcode %]</td>[% END %]
<td class="barcode" property="serialNumber">[% ITEM_RESULT.barcode %]</td>
[% IF holds_count.defined || show_priority %]
<td class="holds_count">
[% IF holds_count.defined %] [% ITEM_RESULT.holds_count %] [% END %]

View File

@ -462,7 +462,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

View File

@ -496,7 +496,6 @@ sub mocking_systempreferences_to_a_set_value {
OpacMaintenance
OpacPublic
OpacSeparateHoldings
OPACShowBarcode
OPACShowCheckoutName
OpacShowFiltersPulldownMobile
OPACShowHoldQueueDetails