Bug 6294: {BIBLIONUMBER} parsing for SearchForTitleIn
authorIan Walls <ian.walls@bywatersolutions.com>
Tue, 3 May 2011 15:37:46 +0000 (11:37 -0400)
committerChris Cormack <chrisc@catalyst.net.nz>
Sat, 7 May 2011 07:35:50 +0000 (19:35 +1200)
Adds support for parsing of the biblionumber into the SearchForTitleIn system preference, allowing
external sites with APIs (like Facebook or Twitter) to do link-backs to the details page for the
title.

Sample code for implementing Facebook "like" links and Twitter "tweet this" are included on the bug report

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
opac/opac-detail.pl

index 98c3611..7f92cd6 100644 (file)
@@ -154,7 +154,7 @@ OPAC:
               class: code
         -
             - 'Include a "More Searches" box on the detail pages of items on the OPAC, with the following HTML (leave blank to disable):'
-            - '<br />Note: The placeholders {CONTROLNUMBER}, {TITLE}, {ISBN} and {AUTHOR} will be replaced with information from the displayed record.'
+            - '<br />Note: The placeholders {BIBLIONUMBER}, {CONTROLNUMBER}, {TITLE}, {ISBN} and {AUTHOR} will be replaced with information from the displayed record.'
             - pref: OPACSearchForTitleIn
               type: textarea
               class: code
index 3e4c76c..b357a56 100755 (executable)
@@ -562,6 +562,7 @@ if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
     $dat->{title} ? $search_for_title =~ s/{TITLE}/$dat->{title}/g : $search_for_title =~ s/{TITLE}//g;
     $isbn ? $search_for_title =~ s/{ISBN}/$isbn/g : $search_for_title =~ s/{ISBN}//g;
     $marccontrolnumber ? $search_for_title =~ s/{CONTROLNUMBER}/$marccontrolnumber/g : $search_for_title =~ s/{CONTROLNUMBER}//g;
+    $search_for_title =~ s/{BIBLIONUMBER}/$biblionumber/g;
  $template->param('OPACSearchForTitleIn' => $search_for_title);
 }