show copy part in copy detail grid on rdetail page
authorBill Erickson <erickson@esilibrary.com>
Mon, 28 Mar 2011 14:20:27 +0000 (10:20 -0400)
committerBill Erickson <erickson@esilibrary.com>
Mon, 28 Mar 2011 14:20:27 +0000 (10:20 -0400)
Open-ILS/web/opac/locale/en-US/opac.dtd
Open-ILS/web/opac/skin/default/js/copy_details.js
Open-ILS/web/opac/skin/default/xml/rdetail/rdetail_cn_details.xml

index ac9d626..c1ebf6b 100644 (file)
@@ -489,6 +489,7 @@ Please see a librarian to renew your account.">
        Rdetail
        ================================================================= -->
 <!ENTITY rdetail.print "print these details">
+<!ENTITY rdetail.cn.part "Part">
 <!ENTITY rdetail.cn.barcode "Barcode">
 <!ENTITY rdetail.cn.location "Location">
 <!ENTITY rdetail.cn.hold.age "Age Hold Protection">
index e5c50c0..04e8e41 100644 (file)
@@ -208,6 +208,7 @@ function cpdDrawCopies(r) {
 function cpdDrawCopy(r) {
        var copy = r.getResultObject();
        var row  = r.row;
+    var trow = r.args.templateRow;
 
     if (r.args.copy_location && copy.location().name() != r.args.copy_location) {
         hideMe(row);
@@ -218,6 +219,18 @@ function cpdDrawCopy(r) {
        $n(row, 'location').appendChild(text(copy.location().name()));
        $n(row, 'status').appendChild(text(copy.status().name()));
 
+    // append comma-separated list of part this copy is linked to
+    if(copy.parts() && copy.parts().length) {
+        unHideMe($n(trow, 'copy_part_label'));
+        unHideMe($n(row, 'copy_part'));
+        for(var i = 0; i < copy.parts().length; i++) {
+            var part = copy.parts()[i];
+            var node = $n(row, 'copy_part');
+            if(i > 0) node.appendChild(text(','));
+            node.appendChild(text(part.label()));
+        }
+    }
+
        if(isXUL()) {
                /* show the hold link */
                var l = $n(row, 'copy_hold_link');
index 09765fd..45a5c85 100644 (file)
@@ -13,6 +13,7 @@
                                                                <td width='33%'>&rdetail.cn.barcode;</td>
                                                                <td>&common.status;</td>
                                                                <td>&rdetail.cn.location;</td>
+                                                               <td name='copy_part_label' class='hide_me'>&rdetail.cn.part;</td>
                                                                <td name='age_protect_label' class='hide_me'>&rdetail.cn.hold.age;</td>
                                                                <td name='create_date_label' class='hide_me'>&rdetail.cn.genesis;</td>
                                                                <td name='holdable_label' class='hide_me'>&rdetail.cn.holdable;</td>
@@ -35,6 +36,7 @@
 
                                                                <td name='status'> </td>
                                                                <td name='location'> </td>
+                                                               <td name='copy_part' class='hide_me'> </td>
                                                                <td name='age_protect_value' class='hide_me'>&rdetail.cn.disabled;</td>
                                                                <td name='create_date_value' class='hide_me'> </td>