LP#1098669: improve handling of Content Cafe external content in staff client
authorGalen Charlton <gmc@esilibrary.com>
Fri, 11 Jan 2013 18:11:48 +0000 (13:11 -0500)
committerBill Erickson <berick@esilibrary.com>
Tue, 15 Jan 2013 19:41:50 +0000 (14:41 -0500)
This patch introduces a new TPac content variable, ctx.ext_proto, to
specify whether external content should be retrieved via HTTP or HTTPS.
ctx.proto can't be used for that purpose since it's set to 'oils' when
TPac is running inside the staff client.

This fixes a bug where Content Cafe reviews wouldn't display in the staff
client bib record page and where clicking on the reviews link from search
results would open an empty window.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm
Open-ILS/src/templates/opac/parts/record/summaryplus.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2

index cb65581..8787ee5 100644 (file)
@@ -144,6 +144,7 @@ sub load_context {
     $ctx->{skin} = $cgi->cookie(OILS_HTTP_COOKIE_SKIN) || 'default';
     $ctx->{theme} = $cgi->cookie(OILS_HTTP_COOKIE_THEME) || 'default';
     $ctx->{proto} = $cgi->https ? 'https' : 'http';
+    $ctx->{ext_proto} = $ctx->{proto};
     my $default_locale = $r->dir_config('OILSWebDefaultLocale') || 'en_us';
 
     my @template_paths = uniq $r->dir_config->get('OILSWebTemplatePath');
index 27513be..23e21ea 100644 (file)
@@ -12,7 +12,7 @@
     <!-- Embedded content cafe iframe -->
     [% ident = attrs.isbn_clean || attrs.upc %]
     <iframe width="100%" height="400" frameborder="0" 
-        src="[% ctx.proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%- 
+        src="[% ctx.ext_proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%- 
             ENV.OILS_CONTENT_CAFE_USER %]&amp;Password=[% ENV.OILS_CONTENT_CAFE_PASS %]&amp;ItemKey=[% ident | uri %]&amp;Options=Y" >
     </iframe>
     [%- END %]
index b63ec88..d53c8f2 100644 (file)
                                                         [% IF ENV.OILS_CONTENT_CAFE_USER %]
                                                         <div class="results_aux_utils result_util">
                                                             <a title="[% l('Reviews and More') %]" target='_blank' 
-                                                                href="[% ctx.proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%- 
+                                                                href="[% ctx.ext_proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%- 
                                                                     ENV.OILS_CONTENT_CAFE_USER %]&amp;Password=[%-
-                                                                    ENV.OILS_CONTENT_CAFE_PASS %]&amp;ItemKey=[% ident | uri %]&Options=Y">
+                                                                    ENV.OILS_CONTENT_CAFE_PASS %]&amp;ItemKey=[% ident | uri %]&amp;Options=Y">
                                                                 <img src='[% ctx.media_prefix %]/images/starz.png'/> 
                                                                 <span class="results_reviews">[% l('Reviews &amp; More') %]</span>
                                                             </a>