Bugzilla – Attachment 7062 Details for
Bug 7307
OPACBaseURL not used in opac-search.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch #2
0001-Bug-7307-OPACBaseURL-changes.patch (text/plain), 8.25 KB, created by
Adrien SAURAT
on 2012-01-06 09:59:29 UTC
(
hide
)
Description:
proposed patch #2
Filename:
MIME Type:
Creator:
Adrien SAURAT
Created:
2012-01-06 09:59:29 UTC
Size:
8.25 KB
patch
obsolete
>From c80ab825f09dd48e675ed4851edf561797c0728c Mon Sep 17 00:00:00 2001 >From: Adrien Saurat <adrien.saurat@biblibre.com> >Date: Fri, 6 Jan 2012 10:55:09 +0100 >Subject: [PATCH] Bug 7307 : OPACBaseURL changes > >1) OPACBaseURL must now contain the full address with http:// or https:// >(system preference help changed accordingly) >2) The RSS Feed in OPAC results now handle OPACBaseURL >--- > C4/Auth.pm | 13 +++++++++++-- > installer/data/mysql/sysprefs.sql | 2 +- > installer/data/mysql/updatedatabase.pl | 2 +- > .../prog/en/modules/virtualshelves/sendshelf.tt | 2 +- > .../opac-tmpl/prog/en/modules/opac-sendshelf.tt | 2 +- > opac/opac-search.pl | 6 ++++++ > 6 files changed, 21 insertions(+), 6 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index e360e10..8a2ac54 100755 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -421,6 +421,16 @@ sub get_template_and_user { > my $opaccolorstylesheet = C4::Context->preference("opaccolorstylesheet"); > $template->param( opaccolorstylesheet => $opaccolorstylesheet); > } >+ >+ my $opacbaseurl; >+ if ( C4::Context->preference('OPACBaseURL') ) { >+ $opacbaseurl = C4::Context->preference('OPACBaseURL') >+ } >+ else { >+ $opacbaseurl = ($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} . >+ ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}") >+ } >+ > $template->param( > AmazonContent => "" . C4::Context->preference("AmazonContent"), > AnonSuggestions => "" . C4::Context->preference("AnonSuggestions"), >@@ -442,8 +452,7 @@ sub get_template_and_user { > OPACUserCSS => "". C4::Context->preference("OPACUserCSS"), > OPACViewOthersSuggestions => "" . C4::Context->preference("OPACViewOthersSuggestions"), > OpacAuthorities => C4::Context->preference("OpacAuthorities"), >- OPACBaseURL => ($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} . >- ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}"), >+ OPACBaseURL => $opacbaseurl, > opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, > opac_search_limit => $opac_search_limit, > opac_limit_override => $opac_limit_override, >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 128c9b2..ad9a30c 100755 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -175,7 +175,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesCalendar',"noFinesWhenClosed",'Specify whether to use the Calendar in calculating duedates and fines',"ignoreCalendar|noFinesWhenClosed",'Choice'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('previousIssuesDefaultSortOrder',"asc",'Specify the sort order of Previous Issues on the circulation page',"asc|desc",'Choice'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('todaysIssuesDefaultSortOrder',"desc",'Specify the sort order of Todays Issues on the circulation page',"asc|desc",'Choice'); >-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACBaseURL',NULL,'Specify the Base URL of the OPAC, e.g., opac.mylibrary.com, the http:// will be added automatically by Koha.',NULL,'Free'); >+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACBaseURL',NULL,'Specify the Base URL of the OPAC, e.g., http://opac.mylibrary.com or https://opac.mylibrary.com',NULL,'Free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('language','en','Set the default language in the staff client.',NULL,'Languages'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('QueryAutoTruncate',1,'If ON, query truncation is enabled by default',NULL,'YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('QueryRemoveStopwords',0,'If ON, stopwords listed in the Administration area will be removed from queries',NULL,'YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 67708fa..13cb09a 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -892,7 +892,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > ADD `altcontactphone` varchar(50) default NULL > "); > $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES >-('OPACBaseURL',NULL,'Specify the Base URL of the OPAC, e.g., opac.mylibrary.com, the http:// will be added automatically by Koha.',NULL,'Free'), >+('OPACBaseURL',NULL,'Specify the Base URL of the OPAC, e.g., http://opac.mylibrary.com or https://opac.mylibrary.com',NULL,'Free'), > ('language','en','Set the default language in the staff client.',NULL,'Languages'), > ('QueryAutoTruncate',1,'If ON, query truncation is enabled by default',NULL,'YesNo'), > ('QueryRemoveStopwords',0,'If ON, stopwords listed in the Administration area will be removed from queries',NULL,'YesNo') >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt >index f307ba0..0bf443f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt >@@ -35,7 +35,7 @@ Classification: [% BIBLIO_RESULT.classification %][% END %][% IF ( BIBLIO_RESULT > LCCN: [% BIBLIO_RESULT.lccn %][% END %][% IF ( BIBLIO_RESULT.url ) %] > url : [% BIBLIO_RESULT.url %][% END %][% IF ( OPACBaseURL ) %] > In the online catalog: >- http://[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber |url %][% END %] >+ % OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber |url %][% END %] > Items : [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %] > [% ITEM_RESULT.branchname %] [% ITEM_RESULT.location %] [% IF ( ITEM_RESULT.itemcallnumber ) %]([% ITEM_RESULT.itemcallnumber %])[% END %] [% ITEM_RESULT.barcode %][% END %] > >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt >index f9f7c31..7ef2502 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt >@@ -36,7 +36,7 @@ Classification: [% BIBLIO_RESULT.classification %][% END %][% IF ( BIBLIO_RESULT > LCCN: [% BIBLIO_RESULT.lccn %][% END %][% IF ( BIBLIO_RESULT.url ) %] > url : [% BIBLIO_RESULT.url %][% END %][% IF ( OPACBaseURL ) %] > In the online catalog: >- http://[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber |url %][% END %] >+ [% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber |url %][% END %] > Items : [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %] > [% ITEM_RESULT.branchname %] [% ITEM_RESULT.location %] [% IF ( ITEM_RESULT.itemcallnumber ) %]([% ITEM_RESULT.itemcallnumber %])[% END %] [% ITEM_RESULT.barcode %][% END %] > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index aba23a8..ee645da 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -714,11 +714,17 @@ my $session = get_session($cgi->cookie("CGISESSID")); > my @addpubshelves; > my $pubshelves = $session->param('pubshelves'); > my $barshelves = $session->param('barshelves'); >+my $OPACrssURL; > foreach my $shelf (@$pubshelves) { > next if ( ($shelf->{'owner'} != ($borrowernumber ? $borrowernumber : -1)) && ($shelf->{'category'} < 3) ); > push (@addpubshelves, $shelf); > } > >+if ( C4::Context->preference('OPACBaseURL') ) { >+ $OPACrssURL = C4::Context->preference('OPACBaseURL'); >+ $template->param( OPACBaseURL => $OPACrssURL ); >+} >+ > if (@addpubshelves) { > $template->param( addpubshelves => scalar (@addpubshelves)); > $template->param( addpubshelvesloop => \@addpubshelves); >-- >1.7.4.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7307
:
6530
|
6567
| 7062