@@ -, +, @@ --- 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(-) --- a/C4/Auth.pm +++ a/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, --- a/installer/data/mysql/sysprefs.sql +++ a/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'); --- a/installer/data/mysql/updatedatabase.pl +++ a/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') --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt +++ a/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 %] --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-sendshelf.tt +++ a/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 %] --- a/opac/opac-search.pl +++ a/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); --