Bug 1934: Changed variables per request in bug report
authorNicole Engard <nengard@gmail.com>
Sun, 6 Sep 2009 17:45:05 +0000 (13:45 -0400)
committerGalen Charlton <gmcharlt@gmail.com>
Sun, 6 Sep 2009 17:47:33 +0000 (13:47 -0400)
System preference now looking for brackets around variables.
ex. {TITLE} instead of TITLE

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
installer/data/mysql/en/mandatory/sysprefs.sql
installer/data/mysql/updatedatabase.pl
opac/opac-detail.pl

index 0adefbc..49db7bb 100644 (file)
@@ -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')
index 80cce21..e5a3da4 100755 (executable)
@@ -2614,6 +2614,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     print "Upgrade to $DBversion done (bug 1600, bug 3454: add altcontactcountry and B_address2 to borrowers and deletedborrowers)\n";
 }
 
+$DBversion = '3.01.00.XXX';
+     if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+     $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 (changed OPACSearchForTitleIn per requests in bug 1934)\n";
+     }
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table
index cae305a..c3b104b 100755 (executable)
@@ -552,9 +552,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);
 }