From 58367389573dbf99a09e1b67c1a98baf499d8075 Mon Sep 17 00:00:00 2001 From: Amit Gupta Date: Fri, 7 Oct 2011 10:57:24 +0530 Subject: [PATCH] Bug 6774 Display barcode on OPAC detail page(Correcting Typo). Signed-off-by: Katrin Fischer Rebased to current master, works in my tests, but needs another set of eyes. Signed-off-by: Julian Maurice --- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../prog/en/modules/admin/preferences/opac.pref | 7 +++++++ koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 4 +++- opac/opac-detail.pl | 3 ++- 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 5c9f36ce28..934427a8ac 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -369,3 +369,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SuspendHoldsIntranet', '1', NULL , 'Allow holds to be suspended from the intranet.', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SuspendHoldsOpac', '1', NULL , 'Allow holds to be suspended from the OPAC.', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('DefaultLanguageField008','','Fill in the default language for field 008 Range 35-37 (e.g. eng, nor, ger, see MARC Code List for Languages)','','Free'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACShowBarcode','0','Show items barcode in holding tab','','YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 0a2aea9954..7bc73b0a26 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5378,6 +5378,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.09.00.016"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACShowBarcode','0','Show items barcode in holding tab','','YesNo')"); + print "Upgrade to $DBversion done (Add syspref OPACShowBarcode)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) 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 e4ea15ba26..4f9092bc58 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 @@ -107,6 +107,13 @@ 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" + - Show items barcode in holding tab. - - pref: OpacHighlightedWords choices: diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 776f82f051..a79eca3009 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -718,6 +718,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { Status [% IF ( itemdata_itemnotes ) %]Notes[% END %] Date due + [% IF ( OPACShowBarcode ) %]Barcode[% END %] [% IF holds_count.defined %] Item holds [% ELSIF show_priority %] @@ -746,7 +747,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( itemdata_copynumber ) %][% ITEM_RESULT.copynumber %][% END %] [% INCLUDE 'item-status.inc' item = ITEM_RESULT %] [% IF ( itemdata_itemnotes ) %][% ITEM_RESULT.itemnotes %][% END %] - [% ITEM_RESULT.datedue | $KohaDates %] + [% ITEM_RESULT.datedue | $KohaDates %] + [% IF ( OPACShowBarcode ) %][% ITEM_RESULT.barcode %][% END %] [% 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 eaad3e257d..3e830c93fd 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -393,7 +393,8 @@ $template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) ); -$template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); +$template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); +$template->param('OPACShowBarcode' => C4::Context->preference("OPACShowBarcode") ); # change back when ive fixed request.pl my @all_items = GetItemsInfo( $biblionumber ); -- 2.39.5