[Koha-patches] [PATCH] Bug 6774 Display barcode on OPAC detail page(Correcting Typo).

Amit Gupta amit.gupta at osslabs.biz
Fri Oct 7 02:01:26 CEST 2011


---
 installer/data/mysql/sysprefs.sql                  |    2 ++
 installer/data/mysql/updatedatabase.pl             |    6 ++++++
 .../prog/en/modules/admin/preferences/opac.pref    |    8 ++++++++
 koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt |    2 ++
 opac/opac-detail.pl                                |    3 ++-
 5 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql
index 79d4893..f8aac7c 100755
--- a/installer/data/mysql/sysprefs.sql
+++ b/installer/data/mysql/sysprefs.sql
@@ -318,3 +318,5 @@ 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('OPACShowBarcode','0','Show items barcode in holding tab','','YesNo');
+
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 6b88c29..0a207cd 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -4446,6 +4446,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.05.00.XXX";
+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
 
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 8bbf692..c942527 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
@@ -86,6 +86,14 @@ OPAC:
                   no: "Don't show"
             - the name of the patron that has an item checked out on item detail pages on the OPAC.
         -
+            - pref: OPACShowBarcode
+              default: 0
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - Show items barcode in holding tab.
+        -
+
             - pref: OpacHighlightedWords
               choices:
                   yes: Highlight
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 3e8586d..2a0f9d1 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
@@ -412,6 +412,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 		<th>Status</th>
 		[% IF ( itemdata_itemnotes ) %]<th>Notes</th>[% END %]
 		<th>Date Due</th>
+		[% IF ( OPACShowBarcode ) %]<th>Barcode</th>[% END %]
 	    </tr></thead>
 	    <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %]
 	    <tr>[% IF ( item_level_itypes ) %]<td>[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %]<img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />[% END %][% END %] [% ITEM_RESULT.description %]</td>[% END %]
@@ -424,6 +425,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 		<td>[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
 		[% IF ( itemdata_itemnotes ) %]<td>[% ITEM_RESULT.itemnotes %]</td>[% END %]
 		<td>[% ITEM_RESULT.datedue %]</td>
+		[% IF ( OPACShowBarcode ) %]<td>[% ITEM_RESULT.barcode %]</td>[% END %]
 	    </tr>
 	    [% END %]</tbody>
 	</table>
diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index e18e046..5e57566 100755
--- a/opac/opac-detail.pl
+++ b/opac/opac-detail.pl
@@ -83,7 +83,8 @@ if (C4::Context->preference("OPACXSLTDetailsDisplay") ) {
     $template->param( 'XSLTBloc' => XSLTParse4Display($biblionumber, $record, 'Detail', 'opac') );
 }
 
-$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 );
 my @items;
-- 
1.6.4.2



More information about the Koha-patches mailing list