View | Details | Raw Unified | Return to bug 5010
Collapse All | Expand All

(-)a/C4/Auth.pm (-6 / +1 lines)
Lines 339-344 sub get_template_and_user { Link Here
339
            noItemTypeImages             => C4::Context->preference("noItemTypeImages"),
339
            noItemTypeImages             => C4::Context->preference("noItemTypeImages"),
340
            marcflavour                  => C4::Context->preference("marcflavour"),
340
            marcflavour                  => C4::Context->preference("marcflavour"),
341
            persona                      => C4::Context->preference("persona"),
341
            persona                      => C4::Context->preference("persona"),
342
            OPACBaseURL                  => C4::Context->preference('OPACBaseURL'),
342
    );
343
    );
343
    if ( $in->{'type'} eq "intranet" ) {
344
    if ( $in->{'type'} eq "intranet" ) {
344
        $template->param(
345
        $template->param(
Lines 405-415 sub get_template_and_user { Link Here
405
        } elsif (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv && C4::Context->userenv->{'branch'}) {
406
        } elsif (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv && C4::Context->userenv->{'branch'}) {
406
            $opac_name = C4::Context->userenv->{'branch'};
407
            $opac_name = C4::Context->userenv->{'branch'};
407
        }
408
        }
408
        # FIXME Under Plack the CGI->https method always returns 'OFF' ($using_https will be set to 0 in this case)
409
        my $opac_base_url = C4::Context->preference("OPACBaseURL"); #FIXME uses $using_https below as well
410
        if (!$opac_base_url){
411
            $opac_base_url = $ENV{'SERVER_NAME'} . ($ENV{'SERVER_PORT'} eq ($using_https ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}");
412
        }
413
        $template->param(
409
        $template->param(
414
            opaccolorstylesheet       => C4::Context->preference("opaccolorstylesheet"),
410
            opaccolorstylesheet       => C4::Context->preference("opaccolorstylesheet"),
415
            AnonSuggestions           => "" . C4::Context->preference("AnonSuggestions"),
411
            AnonSuggestions           => "" . C4::Context->preference("AnonSuggestions"),
Lines 430-436 sub get_template_and_user { Link Here
430
            OPACMobileUserCSS         => "". C4::Context->preference("OPACMobileUserCSS"),
426
            OPACMobileUserCSS         => "". C4::Context->preference("OPACMobileUserCSS"),
431
            OPACViewOthersSuggestions => "" . C4::Context->preference("OPACViewOthersSuggestions"),
427
            OPACViewOthersSuggestions => "" . C4::Context->preference("OPACViewOthersSuggestions"),
432
            OpacAuthorities           => C4::Context->preference("OpacAuthorities"),
428
            OpacAuthorities           => C4::Context->preference("OpacAuthorities"),
433
            OPACBaseURL               => ($using_https ? "https://" : "http://") . $opac_base_url,
434
            opac_css_override         => $ENV{'OPAC_CSS_OVERRIDE'},
429
            opac_css_override         => $ENV{'OPAC_CSS_OVERRIDE'},
435
            opac_search_limit         => $opac_search_limit,
430
            opac_search_limit         => $opac_search_limit,
436
            opac_limit_override       => $opac_limit_override,
431
            opac_limit_override       => $opac_limit_override,
(-)a/catalogue/detail.pl (-6 lines)
Lines 396-407 if ( (C4::Context->preference("HTML5MediaEnabled") eq 'both') or (C4::Context->p Link Here
396
    $template->param( C4::HTML5Media->gethtml5media($record));
396
    $template->param( C4::HTML5Media->gethtml5media($record));
397
}
397
}
398
398
399
400
# Get OPAC URL
401
if (C4::Context->preference('OPACBaseURL')){
402
     $template->param( OpacUrl => C4::Context->preference('OPACBaseURL') );
403
}
404
405
# Displaying tags
399
# Displaying tags
406
400
407
my $tag_quantity;
401
my $tag_quantity;
(-)a/installer/data/mysql/de-DE/mandatory/sample_notices.sql (-1 / +1 lines)
Lines 100-106 VALUES ( Link Here
100
100
101
Ihr Bibliothekskonto wurde angelegt. Bitte bestätigen Sie Ihre E-Mail-Adresse indem Sie auf folgenden Link klicken:
101
Ihr Bibliothekskonto wurde angelegt. Bitte bestätigen Sie Ihre E-Mail-Adresse indem Sie auf folgenden Link klicken:
102
102
103
http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
103
<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
104
104
105
Wenn Sie keine Kontoanmeldung durchgeführt haben, können Sie diese Benachrichtigung ignorieren. Sie wird in Kürze ungültig.
105
Wenn Sie keine Kontoanmeldung durchgeführt haben, können Sie diese Benachrichtigung ignorieren. Sie wird in Kürze ungültig.
106
106
(-)a/installer/data/mysql/en/mandatory/sample_notices.sql (-1 / +1 lines)
Lines 113-119 VALUES ( Link Here
113
113
114
Your library account has been created. Please verify your email address by clicking this link to complete the signup process:
114
Your library account has been created. Please verify your email address by clicking this link to complete the signup process:
115
115
116
http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
116
<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
117
117
118
If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.'
118
If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.'
119
);
119
);
(-)a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql (-1 / +1 lines)
Lines 134-140 VALUES ( Link Here
134
134
135
D har blitt registrert som bruker av biblioteket. Verifiser epostadressen din ved å klikke på lenka nedenfor:
135
D har blitt registrert som bruker av biblioteket. Verifiser epostadressen din ved å klikke på lenka nedenfor:
136
136
137
http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
137
<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
138
138
139
Dersom du ikke har bedt om å bli registret som bruker av biblioteket kan du se bort fra denne engangsmeldingen. Forespørselen vil snart gå ut på dato.'
139
Dersom du ikke har bedt om å bli registret som bruker av biblioteket kan du se bort fra denne engangsmeldingen. Forespørselen vil snart gå ut på dato.'
140
);
140
);
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 222-228 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
222
('OPACAllowUserToChooseBranch','1','1','Allow the user to choose the branch they want to pickup their hold from','YesNo'),
222
('OPACAllowUserToChooseBranch','1','1','Allow the user to choose the branch they want to pickup their hold from','YesNo'),
223
('OPACAmazonCoverImages','0','','Display cover images on OPAC from Amazon Web Services','YesNo'),
223
('OPACAmazonCoverImages','0','','Display cover images on OPAC from Amazon Web Services','YesNo'),
224
('OpacAuthorities','1',NULL,'If ON, enables the search authorities link on OPAC','YesNo'),
224
('OpacAuthorities','1',NULL,'If ON, enables the search authorities link on OPAC','YesNo'),
225
('OPACBaseURL',NULL,NULL,'Specify the Base URL of the OPAC, e.g., opac.mylibrary.com, the http:// will be added automatically by Koha.','Free'),
225
('OPACBaseURL',NULL,NULL,'Specify the Base URL of the OPAC, e.g., http://opac.mylibrary.com, including the protocol (http:// or https://). Otherwise, the http:// will be added automatically by Koha upon saving.','Free'),
226
('opacbookbag','1','','If ON, enables display of Cart feature','YesNo'),
226
('opacbookbag','1','','If ON, enables display of Cart feature','YesNo'),
227
('OpacBrowser','0',NULL,'If ON, enables subject authorities browser on OPAC (needs to set misc/cronjob/sbuild_browser_and_cloud.pl)','YesNo'),
227
('OpacBrowser','0',NULL,'If ON, enables subject authorities browser on OPAC (needs to set misc/cronjob/sbuild_browser_and_cloud.pl)','YesNo'),
228
('OpacBrowseResults','1',NULL,'Disable/enable browsing and paging search results from the OPAC detail page.','YesNo'),
228
('OpacBrowseResults','1',NULL,'Disable/enable browsing and paging search results from the OPAC detail page.','YesNo'),
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +22 lines)
Lines 8766-8772 if(CheckVersion($DBversion)) { Link Here
8766
    SetVersion($DBversion);
8766
    SetVersion($DBversion);
8767
}
8767
}
8768
8768
8769
8770
$DBversion = '3.17.00.025';
8769
$DBversion = '3.17.00.025';
8771
if ( CheckVersion($DBversion) ) {
8770
if ( CheckVersion($DBversion) ) {
8772
    $dbh->do(qq{
8771
    $dbh->do(qq{
Lines 8776-8781 if ( CheckVersion($DBversion) ) { Link Here
8776
    SetVersion($DBversion);
8775
    SetVersion($DBversion);
8777
}
8776
}
8778
8777
8778
$DBversion = '3.17.00.XXX';
8779
if ( CheckVersion($DBversion) ) {
8780
    my $OPACBaseURL = C4::Context->preference('OPACBaseURL');
8781
    if (defined($OPACBaseURL) && substr($OPACBaseURL,0,4) ne "http") {
8782
        my $explanation = q{Specify the Base URL of the OPAC, e.g., http://opac.mylibrary.com, including the protocol (http:// or https://). Otherwise, the http:// will be added automatically by Koha upon saving.};
8783
        $OPACBaseURL = 'http://' . $OPACBaseURL;
8784
        my $sth_OPACBaseURL = $dbh->prepare( q{
8785
            UPDATE systempreferences SET value=?,explanation=?
8786
            WHERE variable='OPACBaseURL'; } );
8787
        $sth->execute($OPACBaseURL,$explanation);
8788
        $dbh->do( q{ UPDATE letter
8789
                     SET content=replace(content,
8790
                                         'http://<<OPACBaseURL>>',
8791
                                         '<<OPACBaseURL>>')
8792
                     WHERE content LIKE "%http://<<OPACBaseURL>>%"; } );
8793
    }
8794
8795
    print "Upgrade to $DBversion done (Bug 5010: Fix OPACBaseURL to include protocol)\n";
8796
    SetVersion($DBversion);
8797
}
8798
8799
8779
=head1 FUNCTIONS
8800
=head1 FUNCTIONS
8780
8801
8781
=head2 TableExists($table)
8802
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-2 / +2 lines)
Lines 6-15 OPAC: Link Here
6
              choices: opac-templates
6
              choices: opac-templates
7
            - theme on the OPAC.
7
            - theme on the OPAC.
8
        -
8
        -
9
            - "The OPAC is located at http://"
9
            - "The OPAC is located at "
10
            - pref: OPACBaseURL
10
            - pref: OPACBaseURL
11
              class: url
11
              class: url
12
            - . Do not include a trailing slash in the URL. (This must be filled in correctly for RSS, unAPI, and search plugins to work.)
12
            - . This should be a complete URL, starting with <code>http://</code> or <code>https://</code>. Do not include a trailing slash in the URL. (This must be filled in correctly for RSS, unAPI, and search plugins to work.)
13
        -
13
        -
14
            - Show
14
            - Show
15
            - pref: LibraryName
15
            - pref: LibraryName
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-2 / +2 lines)
Lines 418-426 function verify_images() { Link Here
418
</li>
418
</li>
419
    [% END %]
419
    [% END %]
420
    
420
    
421
    [% IF ( OpacUrl ) %]
421
    [% IF ( OPACBaseURL ) %]
422
        <li><strong>OPAC view:</strong>
422
        <li><strong>OPAC view:</strong>
423
    	<a href="http://[% OpacUrl %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]" target="_blank">Open in new window</a>
423
        <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]" target="_blank">Open in new window</a>
424
		</li>
424
		</li>
425
	[% END %]
425
	[% END %]
426
        <li id="catalogue_detail_marc_preview">
426
        <li id="catalogue_detail_marc_preview">
(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl (-1 / +1 lines)
Lines 828-834 Link Here
828
828
829
        <xsl:if test="$OPACBaseURL!=''">
829
        <xsl:if test="$OPACBaseURL!=''">
830
        <span class="results_summary"><span class="label">OPAC view: </span>
830
        <span class="results_summary"><span class="label">OPAC view: </span>
831
            <a><xsl:attribute name="href">http://<xsl:value-of select="$OPACBaseURL"/>/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/></xsl:attribute><xsl:attribute name="target">_blank</xsl:attribute>Open in new window</a>.
831
            <a><xsl:attribute name="href"><xsl:value-of select="$OPACBaseURL"/>/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/></xsl:attribute><xsl:attribute name="target">_blank</xsl:attribute>Open in new window</a>.
832
        </span>
832
        </span>
833
        </xsl:if>
833
        </xsl:if>
834
834
(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl (-1 / +1 lines)
Lines 569-575 Link Here
569
        <!-- This will only work if the OPACBaseURL syspref is set. -->
569
        <!-- This will only work if the OPACBaseURL syspref is set. -->
570
        <xsl:if test="string-length($OPACBaseURL) > 0">
570
        <xsl:if test="string-length($OPACBaseURL) > 0">
571
        <p>OPAC View: <a>
571
        <p>OPAC View: <a>
572
                      <xsl:attribute name="href">http://<xsl:value-of select="$OPACBaseURL"/>/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
572
                      <xsl:attribute name="href"><xsl:value-of select="$OPACBaseURL"/>/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute>
573
                      <xsl:attribute name="target">_blank</xsl:attribute>
573
                      <xsl:attribute name="target">_blank</xsl:attribute>
574
                      Open in new window
574
                      Open in new window
575
                      </a></p>
575
                      </a></p>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-5 / +5 lines)
Lines 1097-1108 Link Here
1097
                [% IF ( SocialNetworks ) %]
1097
                [% IF ( SocialNetworks ) %]
1098
                    <div id="social_networks" class="clearfix">
1098
                    <div id="social_networks" class="clearfix">
1099
                        <span>Share</span>
1099
                        <span>Share</span>
1100
                        <div><a id="facebook" href="http://www.facebook.com/sharer.php?u=[% protocol %][% current_url |url %]&amp;t=[% title |url %]" title="Share on Facebook">Facebook</a></div>
1100
                        <div><a id="facebook" href="http://www.facebook.com/sharer.php?u=[% current_url |url %]&amp;t=[% title |url %]" title="Share on Facebook">Facebook</a></div>
1101
                        <div><a id="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=[% protocol %][% current_url |url %]&amp;title=[% title |url %]" title="Share on LinkedIn">LinkedIn</a></div>
1101
                        <div><a id="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=[% current_url |url %]&amp;title=[% title |url %]" title="Share on LinkedIn">LinkedIn</a></div>
1102
                        <div><a id="delicious" href="http://www.delicious.com/save?url=[% protocol %][% current_url |url %]&amp;title=[% title |url %]" title="Share on Delicious">Delicious</a></div>
1102
                        <div><a id="delicious" href="http://www.delicious.com/save?url=[% current_url |url %]&amp;title=[% title |url %]" title="Share on Delicious">Delicious</a></div>
1103
                        <div><a id="email" href="mailto:?subject=[% title |url %]&amp;body=[% title |url %]%20([% protocol %][% current_url |url %])" title="Share by email">Email</a></div>
1103
                        <div><a id="email" href="mailto:?subject=[% title |url %]&amp;body=[% title |url %]%20([% current_url |url %])" title="Share by email">Email</a></div>
1104
                        <div><div class="g-plusone" data-size="small" data-count="false"></div></div>
1104
                        <div><div class="g-plusone" data-size="small" data-count="false"></div></div>
1105
                        <div><a id="twitter" href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-text="[% title %]" data-lang="[% lang %]">Tweet</a></div>
1105
                        <div><a id="twitter" href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-text="[% title |url %]" data-lang="[% lang %]">Tweet</a></div>
1106
                    </div>
1106
                    </div>
1107
                [% END %]
1107
                [% END %]
1108
            </div> <!-- / .ulactioncontainer -->
1108
            </div> <!-- / .ulactioncontainer -->
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-5 / +5 lines)
Lines 1471-1482 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
1471
[% IF ( SocialNetworks ) %]
1471
[% IF ( SocialNetworks ) %]
1472
    <div id="social_networks">
1472
    <div id="social_networks">
1473
        <span>Share</span>
1473
        <span>Share</span>
1474
        <div><a id="facebook" href="http://www.facebook.com/sharer.php?u=[% protocol %][% current_url |url %]&amp;t=[% title |url %]" title="Share on Facebook">Facebook</a></div>
1474
        <div><a id="facebook" href="http://www.facebook.com/sharer.php?u=[% current_url |url %]&amp;t=[% title |url %]" title="Share on Facebook">Facebook</a></div>
1475
        <div><a id="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=[% protocol %][% current_url |url %]&amp;title=[% title |url %]" title="Share on LinkedIn">LinkedIn</a></div>
1475
        <div><a id="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=[% current_url |url %]&amp;title=[% title |url %]" title="Share on LinkedIn">LinkedIn</a></div>
1476
        <div><a id="delicious" href="http://www.delicious.com/save?url=[% protocol %][% current_url |url %]&amp;title=[% title |url %]" title="Share on Delicious">Delicious</a></div>
1476
        <div><a id="delicious" href="http://www.delicious.com/save?url=[% current_url |url %]&amp;title=[% title |url %]" title="Share on Delicious">Delicious</a></div>
1477
        <div><a id="email" href="mailto:?subject=[% title |url %]&amp;body=[% title |url %] ([% protocol %][% current_url |url %])" title="Share by email">Email</a></div>
1477
        <div><a id="email" href="mailto:?subject=[% title |url %]&amp;body=[% title |url %] ([% current_url |url %])" title="Share by email">Email</a></div>
1478
        <div><g:plusone size="small" annotation="none"></g:plusone></div>
1478
        <div><g:plusone size="small" annotation="none"></g:plusone></div>
1479
        <div><a id="twitter" href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-text="[% title %]" data-lang="[% lang %]">Tweet</a></div>
1479
        <div><a id="twitter" href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-text="[% title |url %]" data-lang="[% lang %]">Tweet</a></div>
1480
    </div>
1480
    </div>
1481
[% END %]
1481
[% END %]
1482
1482
(-)a/opac/opac-shareshelf.pl (-2 / +1 lines)
Lines 179-186 sub send_invitekey { Link Here
179
    my ($param) = @_;
179
    my ($param) = @_;
180
    my $fromaddr = C4::Context->preference('KohaAdminEmailAddress');
180
    my $fromaddr = C4::Context->preference('KohaAdminEmailAddress');
181
    my $url =
181
    my $url =
182
        'http://'
182
        C4::Context->preference('OPACBaseURL')
183
      . C4::Context->preference('OPACBaseURL')
184
      . "/cgi-bin/koha/opac-shareshelf.pl?shelfnumber="
183
      . "/cgi-bin/koha/opac-shareshelf.pl?shelfnumber="
185
      . $param->{shelfnumber}
184
      . $param->{shelfnumber}
186
      . "&op=accept&key=";
185
      . "&op=accept&key=";
(-)a/t/db_dependent/Auth_with_cas.t (-1 / +1 lines)
Lines 38-44 my $dbh = C4::Context->dbh; Link Here
38
$dbh->{ AutoCommit } = 0;
38
$dbh->{ AutoCommit } = 0;
39
$dbh->{ RaiseError } = 1;
39
$dbh->{ RaiseError } = 1;
40
40
41
C4::Context->set_preference('OPACBaseURL','localhost');
41
C4::Context->set_preference('OPACBaseURL','http://localhost');
42
42
43
my $opac_base_url = C4::Context->preference('OpacBaseURL');
43
my $opac_base_url = C4::Context->preference('OpacBaseURL');
44
my $query_string = 'ticket=foo&bar=baz';
44
my $query_string = 'ticket=foo&bar=baz';
(-)a/virtualshelves/sendshelf.pl (-5 lines)
Lines 100-109 if ( $email ) { Link Here
100
        push( @results, $dat );
100
        push( @results, $dat );
101
    }
101
    }
102
102
103
  if (C4::Context->preference('OPACBaseURL')){
104
        $template2->param( OPACBaseURL => C4::Context->preference('OPACBaseURL') );
105
  }
106
107
    $template2->param(
103
    $template2->param(
108
        BIBLIO_RESULTS => \@results,
104
        BIBLIO_RESULTS => \@results,
109
        email_sender   => $email_from,
105
        email_sender   => $email_from,
110
- 

Return to bug 5010