From 3f95f503c70571b5143bea76084f42b2f2561717 Mon Sep 17 00:00:00 2001 From: Ebin Joseph Date: Fri, 8 Jun 2012 15:11:50 +0530 Subject: [PATCH] Display barcode on OPAC detail page --- 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 | 2 ++ opac/opac-detail.pl | 1 + 5 files changed, 18 insertions(+), 0 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 2ffe2df..9fa3382 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -328,6 +328,7 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('BasketConfirmations', '1', 'When closing or reopening a basket,', 'always ask for confirmation.|do not ask for confirmation.', 'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('MARCAuthorityControlField008', '|| aca||aabn | a|a d', NULL, NULL, 'Textarea'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpenLibraryCovers',0,'If ON Openlibrary book covers will be show',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACShowBarcodeCatalogDetail','0','items barcode in catalog detail page ','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('BorrowerUnwantedField','','Name the fields you don\'t need to store for a patron\'s account',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index dbbdee3..06ddbea 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5308,6 +5308,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.09.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACShowBarcodeCatalogDetail','0','items barcode in catalog detail page ','','YesNo')"); + print "Upgrade to $DBversion done (Add syspref OPACShowBarcodeCatalogDetail)\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 e4ea15b..d5a14b5 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 @@ -50,6 +50,13 @@ OPAC: no: "don't" - open the website in a new window. - + - pref: OPACShowBarcodeCatalogDetail + default: 0 + choices: + yes: Show + no: "Don't show" + - items barcode in catalog detail page + - - pref: hidelostitems choices: yes: "Don't show" 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 3c45aff..56396cb 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 ( OPACShowBarcodeCatalogDetail ) %]Barcode[% END %] [% IF holds_count.defined %] Item holds [% ELSIF show_priority %] @@ -747,6 +748,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% INCLUDE 'item-status.inc' item = ITEM_RESULT %] [% IF ( itemdata_itemnotes ) %][% ITEM_RESULT.itemnotes %][% END %] [% ITEM_RESULT.datedue | $KohaDates %] + [% IF ( OPACShowBarcodeCatalogDetail ) %][% 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 0014c27..e2bb585 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -390,6 +390,7 @@ $template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) ); $template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") ); +$template->param('OPACShowBarcodeCatalogDetail' => C4::Context->preference("OPACShowBarcodeCatalogDetail") ); # change back when ive fixed request.pl my @all_items = GetItemsInfo( $biblionumber ); -- 1.7.1