Teach TPAC and selfcheck jackets by record ID
authorJeff Godin <jgodin@tadl.org>
Thu, 19 Sep 2013 15:17:27 +0000 (11:17 -0400)
committerBen Shum <bshum@biblio.org>
Thu, 26 Sep 2013 17:56:21 +0000 (13:56 -0400)
Teach TPAC and web-based selfcheck to display jackets by record ID.

Not covered yet: KPAC (uses a non-1x1 placeholder at this time) and
Acq (where we don't always have a bre.id).

Signed-off-by: Jeff Godin <jgodin@tadl.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/templates/opac/parts/record/cnbrowse.tt2
Open-ILS/src/templates/opac/parts/record/summary.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2
Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js

index 153dc9a..c75c088 100644 (file)
                     <td class='cn_browse_item' width='25%' valign='top'>
                         [%  rec_attrs = {marc_xml => cn.record.marc};
                             PROCESS get_marc_attrs args=rec_attrs;
-                            ident = rec_attrs.isbn_clean || rec_attrs.upc;
-                            IF ident %]
                         <a href="[% mkurl(ctx.opac_root _ '/record/' _ cn.record.id, {$loc_name => loc_value}, 1) %]"><img height='60' width='50' 
                             class='cn_browse_info' name='cn_browse_pic' border='0'
-                            src="[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ident | uri %]" /></a>
-                        [% END %]
+                            src="[% ctx.media_prefix %]/opac/extras/ac/jacket/small/r/[% cn.record_id | uri %]" /></a>
                         <div class='cn_browse_info bold' name='cn_browse_cn'>[% cn.label | html %]</div>
                         <div class='cn_browse_info'>
                             <a name='cn_browse_title' class='classic_link record_title'
index 0f892d4..0f14297 100644 (file)
@@ -26,9 +26,9 @@
     </div>
     <div id="rdetail_image_div">
         [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
-        <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/[% ident | uri %]'><img
+        <a href='[% ctx.media_prefix %]/opac/extras/ac/jacket/large/r/[% ctx.bre_id | uri %]'><img
             alt="[% l('Image of item') %]" id='rdetail_image'
-            src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/[% ident | uri %]' /></a>
+            src='[% ctx.media_prefix %]/opac/extras/ac/jacket/[% record.summary.jacket_size %]/r/[% ctx.bre_id | uri %]' /></a>
         [% END %]
         <br />
     </div>
index 81ca68a..fd1c20f 100644 (file)
                                                     result_count; result_count = result_count + 1
                                                 %].</td>
                                             <td class='result_table_pic_header'>
-                                                [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
                                                 <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/[% ident | uri %]' /></a><br />
-                                                [% END %]
+                                                        src='[% ctx.media_prefix %]/opac/extras/ac/jacket/small/r/[% rec.id | uri %]' /></a><br />
                                             </td>
                                             <td class='result_table_title_cell' name='result_table_title_cell'>
                                                <div class="result_metadata">
@@ -323,6 +321,7 @@ END;
                                                             [% END %]
                                                         </div>
                                                         [% IF ENV.OILS_CONTENT_CAFE_USER %]
+                                                        [% ident = attrs.isbn_clean || attrs.upc %]
                                                         <div class="results_aux_utils result_util">
                                                             <a title="[% l('Reviews and More') %]" target='_blank' 
                                                                 href="[% ctx.ext_proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%- 
index 04360cd..7ee02fd 100644 (file)
@@ -735,7 +735,7 @@ SelfCheckManager.prototype.insertHold = function(data) {
     var row = this.holdTemplate.cloneNode(true);
 
     if(data.mvr.isbn()) {
-        this.byName(row, 'jacket').setAttribute('src', '/opac/extras/ac/jacket/small/' + data.mvr.isbn());
+        this.byName(row, 'jacket').setAttribute('src', '/opac/extras/ac/jacket/small/r/' + data.mvr.doc_id());
     }
 
     this.byName(row, 'title').innerHTML = data.mvr.title();
@@ -1186,8 +1186,8 @@ SelfCheckManager.prototype.displayCheckout = function(evt, type, itemsOut) {
     var circ = evt.payload.circ;
     var row = this.circTemplate.cloneNode(true);
 
-    if(record.isbn()) {
-        this.byName(row, 'jacket').setAttribute('src', '/opac/extras/ac/jacket/small/' + record.isbn());
+    if(record.id()) {
+        this.byName(row, 'jacket').setAttribute('src', '/opac/extras/ac/jacket/small/r/' + record.doc_id());
     }
 
     this.byName(row, 'barcode').innerHTML = copy.barcode();