Merge branch 'master' of git.evergreen-ils.org:Evergreen into social
[evergreen-equinox.git] / Open-ILS / web / opac / skin / default / js / copy_details.js
index 50361b6..c4c623a 100644 (file)
@@ -43,7 +43,7 @@ function cpdBuild( contextTbody, contextRow, record, callnumber, orgid, depth, c
        var print = $n(templateRow,'print');
        print.onclick = function() { cpdBuildPrintPane(
                contextRow, record, callnumber, orgid, depth) };
-    if (typeof callnumber == 'object') {
+    if (callnumber == null) {
         addCSSClass(print,'hide_me');
     }
 
@@ -123,11 +123,12 @@ function cpdStylePopupWindow(div) {
 
 
 /* builds a friendly print window for this CNs data */
-function cpdBuildPrintPane(contextRow, record, callnumber, orgid, depth) {
+function cpdBuildPrintPane(contextRow, record, cn, orgid, depth) {
 
        var div = cpdBuildPrintWindow( record, orgid);
 
-       $n(div, 'cn').appendChild(text(callnumber));
+    var whole_cn_text = (cn[0] ? cn[0] + ' ' : '') + cn[1] + (cn[2] ? ' ' + cn[2] : '');
+       $n(div, 'cn').appendChild(text(whole_cn_text));
 
        unHideMe($n(div, 'copy_header'));
 
@@ -250,7 +251,19 @@ function cpdDrawCopy(r) {
         return;
     }
 
-       var b = $n(row, 'barcode').appendChild(text(copy.barcode()));
+    // Make barcode more useful for staff client usage
+    if(isXUL()) {
+        var my_a = document.createElement('a');
+        my_a.appendChild(text(copy.barcode()));
+        my_a.setAttribute("href","javascript:void(0);");
+        my_a.onclick = function() {
+            xulG.new_tab(xulG.urls.XUL_COPY_STATUS, {}, {'from_item_details_new': true, 'barcodes': [copy.barcode()]});
+               };
+        $n(row, 'barcode').appendChild(my_a);
+    }
+    else {
+       $n(row, 'barcode').appendChild(text(copy.barcode()));
+    }
 
     /* show the peer type*/
     if (pt) {