JBAS-2035 TPAC Syndetics support
authorBill Erickson <berickxx@gmail.com>
Thu, 2 Aug 2018 15:54:44 +0000 (11:54 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
* 'Reviews and More' opens the Syndetics index page for the record.
* 'Summaries and More' also opens the Syndetics index page for the
  record.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/openils/var/templates_kcls/opac/parts/misc_util.tt2
KCLS/openils/var/templates_kcls/opac/parts/record/extras.tt2
KCLS/openils/var/templates_kcls/opac/parts/record/summary.tt2
KCLS/openils/var/templates_kcls/opac/parts/record/summaryplus.tt2
KCLS/openils/var/templates_kcls/opac/parts/result/table.tt2

index a626c3b..f039dcb 100644 (file)
             END;
         END;
 
+        # Jacket image URL ---
+        IF ENV.OILS_SYNDETICS_USER;
+          # Content from Syndetics is loaded directly from their servers.
+          isbn_ident = args.isbn_clean;
+          upc_ident = args.upc;
+          jacket_url = ENV.OILS_SYNDETICS_BASE_URL _ '?';
+          IF isbn_ident;
+            jacket_url = jacket_url _ 'isbn=' _ isbn_ident _ '/sc.gif';
+          ELSIF upc_ident;
+            jacket_url = jacket_url _ 'isbn=/sc.gif&upc=' _ upc_ident;
+          ELSE;
+            jacket_url = '';
+          END;
+          args.jacket_url = jacket_url _ '&client=' _ ENV.OILS_SYNDETICS_USER;
+          args.jacket_url_large = args.jacket_url.replace('sc.gif', 'lc.gif');
+        ELSE;
+          args.jacket_url = ctx.media_prefix _ 
+            '/opac/extras/ac/jacket/small/r/' _ rec.id;
+          args.jacket_url_large = args.jacket_url.replace('small', 'large');
+        END;
+
     END;
 
     # Get the library or location group
index ebc9402..130e08b 100644 (file)
@@ -8,7 +8,7 @@
         IF attrs.summary.0; hide_summary = 0; ELSE;
             # Expose content cafe if it's reasonable to do so.
             # This approach only works when using embedded content cafe.
-            IF ENV.OILS_CONTENT_CAFE_USER
+            IF ENV.OILS_CONTENT_CAFE_USER OR ENV.OILS_SYNDETICS_USER;
                 ident = attrs.isbn_clean || attrs.upc; 
                 IF ident; hide_summary = 0; END;
             END;
index 412d514..c9e6cf5 100644 (file)
@@ -7,9 +7,9 @@
     <tbody id="rdetail_details_tbody">
         <tr>
             <td width="90" valign="top" id="rdetail_image_cell">
-                <a id='rdetail_img_link' href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/r/[% ctx.bre_id | uri %]'><img
+                <a id='rdetail_img_link' 
                     alt="[% l('Image of item') %]" id='rdetail_image'
-                    src='[% ctx.media_prefix %]/opac/extras/ac/jacket/small/r/[% ctx.bre_id | uri %]' /></a>
+                    href='[% attrs.jacket_url_large %]'><img src='[% attrs.jacket_url %]'/></a>
                 <br />
             </td>
     
index 7796213..db685e3 100644 (file)
@@ -9,11 +9,29 @@
     </div>
     [% END %]
 
-    <!-- Embedded content cafe iframe -->
-    [% ident = attrs.isbn_clean || attrs.upc %]
-    <iframe width="100%" height="400" frameborder="0" 
+  <!--
+    Syndetics or Content Cafe iframe
+  -->
+  [% 
+    isbn_ident = attrs.isbn_clean;
+    upc_ident = attrs.upc;
+    ident = isbn_ident || upc_ident;
+  %]
+  [% IF ident %]
+    <div class="results_aux_utils opac-auto-011">
+    [% IF ENV.OILS_SYNDETICS_USER %]
+      <iframe width="100%" height="400" frameborder="0" 
+        src="[% ENV.OILS_SYNDETICS_BASE_URL %]?isbn=[%-
+          isbn_ident %]/index.html&upc=[% upc_ident %]&issn=&client=[%-
+          ENV.OILS_SYNDETICS_USER %]&type=rn12">
+      </iframe>
+    [% ELSIF ENV.OILS_CONTENT_CAFE_USER %]
+      <iframe width="100%" height="400" frameborder="0" 
         src="[% ctx.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>
+      </iframe>
+    [% END %]
+    </div>
+  [% END %]
 </div>
 
index b665531..f043f47 100644 (file)
                                                 %].</td>
                                             <td class='result_table_pic_header' align='center'
                                                 width="78" nowrap="nowrap" valign="top">
-                                                <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"><img alt="[% l('Image of item') %]"
-                                                        name='item_jacket' class='result_table_pic' width="55"
-                                                        src='[% ctx.media_prefix %]/opac/extras/ac/jacket/small/r/[% rec.id | uri %]' /></a><br />
+                                                [% IF attrs.jacket_url %]
+                                                <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"><img 
+                                                  alt="[% l('Image of item') %]"
+                                                  name='item_jacket' class='result_table_pic' 
+                                                  width="55" src="[% attrs.jacket_url %]"
+                                                /></a>
+                                                <br/>
+                                                [% END %]
                                             </td>
                                             <td class='result_table_title_cell' name='result_table_title_cell' valign="top">
                                                 <div class="bold">
                                                                 src="[% ctx.media_prefix %]/images/clipboard.png" />
                                                             </form>
                                                         </div>
-                                                        [% IF ENV.OILS_CONTENT_CAFE_USER %]
-                                                            [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
-                                                        <div class="results_aux_utils opac-auto-011">
-                                                            <a title="[% l('Reviews and More') %]" target='_blank' 
-                                                                href="[% ctx.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">
-                                                                <img src='[% ctx.media_prefix %]/images/starz.png'/> 
-                                                                <span style='position:relative;top:-5px;'>[% l('Reviews &amp; More') %]</span>
-                                                            </a>
-                                                        </div>
-                                                            [% END %]
-                                                        [% END %]
+<!-- Link to reviews and more.  Opens a new tab.  
+      moving left for ease of editing -->
+[%
+  isbn_ident = attrs.isbn_clean;
+  upc_ident = attrs.upc;
+  ident = isbn_ident || upc_ident;
+%]
+[% IF ident %]
+  <div class="results_aux_utils opac-auto-011">
+  [% IF ENV.OILS_SYNDETICS_USER %]
+    <a title="[% l('Reviews and More') %]" target='_blank' 
+      href="[% ENV.OILS_SYNDETICS_BASE_URL %]?isbn=[%-
+        isbn_ident %]/index.html&upc=[% upc_ident %]&issn=&client=[%-
+        ENV.OILS_SYNDETICS_USER %]&type=rw12">
+      <img src='[% ctx.media_prefix %]/images/starz.png'/> 
+      <span style='position:relative;top:-5px;'>[% l('Reviews &amp; More') %]</span>
+    </a>
+  [% ELSIF ENV.OILS_CONTENT_CAFE_USER %]
+    <a title="[% l('Reviews and More') %]" target='_blank' 
+      href="[% ctx.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">
+      <img src='[% ctx.media_prefix %]/images/starz.png'/> 
+      <span style='position:relative;top:-5px;'>[% l('Reviews &amp; More') %]</span>
+    </a>
+  [% END %]
+  </div>
+[% END %]
                                                     </div>
                                                 </div>
                                             </td>