[Koha-patches] [PATCH] Bug 1934: Changed variables per request in bug report

Nicole Engard nengard at gmail.com
Mon Aug 24 13:12:14 CEST 2009


>From bedb24aa806a723b0c231fcd682665148bdafba0 Mon Sep 17 00:00:00 2001
From: Nicole Engard <nengard at gmail.com>
Date: Sun, 23 Aug 2009 13:07:26 -0400
Subject: [PATCH] Bug 1934: Changed variables per request in bug report
Content-Type: text/plain; charset="utf-8"

System preference now looking for brackets around variables.
ex. {TITLE} instead of TITLE
---
 installer/data/mysql/en/mandatory/sysprefs.sql |    2 +-
 installer/data/mysql/updatedatabase.pl         |    5 ++---
 opac/opac-detail.pl                            |    6 +++---
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql
b/installer/data/mysql/en/mandatory/sysprefs.sql
index 0adefbc..49db7bb 100644
--- a/installer/data/mysql/en/mandatory/sysprefs.sql
+++ b/installer/data/mysql/en/mandatory/sysprefs.sql
@@ -256,4 +256,4 @@ INSERT INTO `systempreferences` ( `variable` ,
`value` , `options` , `explanatio
 INSERT INTO `systempreferences` ( `variable` , `value` , `options` ,
`explanation` , `type` ) VALUES ( 'ReturnToShelvingCart', '0', '', 'If
set, when any item is ''checked in'', it''s location code will be
changed to CART.', 'YesNo');
 INSERT INTO `systempreferences` ( `variable` , `value` , `options` ,
`explanation` , `type` ) VALUES ( 'DisplayClearScreenButton', '0', '',
'If set to ON, a clear screen button will appear on the circulation
page.', 'YesNo');
 INSERT INTO systempreferences
(variable,value,options,explanation,type)VALUES('HidePatronName', '0',
'', 'If this is switched on, patron''s cardnumber will be shown
instead of their name on the holds and catalog screens', 'YesNo');
-INSERT INTO `systempreferences`
(variable,value,explanation,options,type) VALUES
('OPACSearchForTitleIn','<li class="yuimenuitem"><a target="_blank"
class="yuimenuitemlabel"
href="http://worldcat.org/search?q=TITLE"">Other Libraries
(WorldCat)</a></li>\n<li class="yuimenuitem"><a
class="yuimenuitemlabel"
href="http://www.scholar.google.com/scholar?q=TITLE"
target="_blank">Other Databases (Google Scholar)</a></li>\n<li
class="yuimenuitem"><a class="yuimenuitemlabel"
href="http://www.bookfinder.com/search/?author=AUTHOR&amp;title=TITLE&amp;st=xl&amp;ac=qr"
target="_blank">Online Stores (Bookfinder.com)</a></li>','Enter the
HTML that will appear in the \'Search for this title in\' box on the
detail page in the OPAC.  Enter TITLE, AUTHOR, or ISBN in place of
their respective variables in the URL. Leave blank to disable \'More
Searches\' menu.','70|10','Textarea')
+INSERT INTO `systempreferences`
(variable,value,explanation,options,type) VALUES
('OPACSearchForTitleIn','<li class="yuimenuitem"><a target="_blank"
class="yuimenuitemlabel"
href="http://worldcat.org/search?q={TITLE}"">Other Libraries
(WorldCat)</a></li>\n<li class="yuimenuitem"><a
class="yuimenuitemlabel"
href="http://www.scholar.google.com/scholar?q={TITLE}"
target="_blank">Other Databases (Google Scholar)</a></li>\n<li
class="yuimenuitem"><a class="yuimenuitemlabel"
href="http://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr"
target="_blank">Online Stores (Bookfinder.com)</a></li>','Enter the
HTML that will appear in the \'Search for this title in\' box on the
detail page in the OPAC.  Enter {TITLE}, {AUTHOR}, or {ISBN} in place
of their respective variables in the URL. Leave blank to disable
\'More Searches\' menu.','70|10','Textarea')
diff --git a/installer/data/mysql/updatedatabase.pl
b/installer/data/mysql/updatedatabase.pl
index 6442a2d..7e82af5 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -2598,10 +2598,9 @@ if (C4::Context->preference("Version") <
TransformToNum($DBversion)) {

 $DBversion = '3.01.00.XXX';
      if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
-     $dbh->do("UPDATE systempreferences SET explanation='Fine limit
above which user cannot renew books via OPAC' WHERE
variable='OPACFineNoRenewals';");
-     $dbh->do("UPDATE systempreferences SET explanation='If set to
ON, a clear screen button will appear on the circulation page.' WHERE
variable='DisplayClearScreenButton';");
+     $dbh->do("UPDATE systempreferences set explanation='Enter the
HTML that will appear in the \'Search for this title in\' box on the
detail page in the OPAC.  Enter {TITLE}, {AUTHOR}, or {ISBN} in place
of their respective variables in the URL. Leave blank to disable
\'More Searches\' menu.', value='<li class="yuimenuitem"><a
target="_blank" class="yuimenuitemlabel"
href="http://worldcat.org/search?q={TITLE}"">Other Libraries
(WorldCat)</a></li>\n<li class="yuimenuitem"><a
class="yuimenuitemlabel"
href="http://www.scholar.google.com/scholar?q={TITLE}"
target="_blank">Other Databases (Google Scholar)</a></li>\n<li
class="yuimenuitem"><a class="yuimenuitemlabel"
href="http://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr"
target="_blank">Online Stores (Bookfinder.com)</a></li>' WHERE
variable='OPACSearchForTitleIn';");
      SetVersion ($DBversion);
-     print "Upgrade to $DBversion done (fixed typos in new sysprefs)\n";
+     print "Upgrade to $DBversion done (changed OPACSearchForTitleIn
per requests in bug 1934)\n";
      }

 =item DropAllForeignKeys($table)
diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index dd73cfc..52562c7 100755
--- a/opac/opac-detail.pl
+++ b/opac/opac-detail.pl
@@ -544,9 +544,9 @@ if (C4::Context->preference('TagsEnabled') and
$tag_quantity = C4::Context->pref

 #Search for title in links
 if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
-    $search_for_title =~ s/AUTHOR/$dat->{author}/g;
-    $search_for_title =~ s/TITLE/$dat->{title}/g;
-    $search_for_title =~ s/ISBN/$isbn/g;
+    $search_for_title =~ s/{AUTHOR}/$dat->{author}/g;
+    $search_for_title =~ s/{TITLE}/$dat->{title}/g;
+    $search_for_title =~ s/{ISBN}/$isbn/g;
  $template->param('OPACSearchForTitleIn' => $search_for_title);
 }

-- 
1.5.6.5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Bug-1934-Changed-variables-per-request-in-bug-repor.patch
Type: application/octet-stream
Size: 5981 bytes
Desc: not available
URL: </pipermail/koha-patches/attachments/20090824/b683ecd4/attachment-0001.obj>


More information about the Koha-patches mailing list