Stat Cat Summary Display Fixes
authorThomas Berezansky <tsbere@mvlc.org>
Fri, 12 Aug 2011 15:47:43 +0000 (11:47 -0400)
committerJason Etheridge <jason@esilibrary.com>
Thu, 8 Sep 2011 07:19:40 +0000 (03:19 -0400)
1 - Suppress sip field and format in horizontal interface
2 - Make "show in summary" work for vertical interface

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/server/patron/summary.js

index 55ad634..12bb752 100644 (file)
@@ -81,7 +81,9 @@ patron.summary.prototype = {
                     obj.stat_cat_list.fm_columns( 'actsc', {
                         'actsc_id' : { 'hidden' : true },
                         'actsc_opac_visible' : { 'hidden' : true },
-                        'actsc_usr_summary' : { 'hidden' : true }
+                        'actsc_usr_summary' : { 'hidden' : true },
+                        'actsc_sip_format' : { 'hidden' : true },
+                        'astsc_sip_field' : { 'hidden' : true }
                     } )
                 ).concat(
                     obj.stat_cat_list.fm_columns( 'actscecm', {
@@ -969,6 +971,43 @@ patron.summary.prototype = {
                 if ($('stat_cat_tab')) {
                     util.widgets.dispatch('command','stat_cat_tab'); 
                 }
+                if ($('pdcgpr')) {
+                    try {
+                        var rows = $('pdcgpr');
+                        var entries = obj.patron.stat_cat_entries();
+                        for (var i = 0; i < entries.length; i++) {
+                            var stat_cat = obj.OpenILS.data.hash.my_actsc[ entries[i].stat_cat() ];
+                            if (!stat_cat) {
+                                stat_cat = obj.OpenILS.data.lookup('actsc',entries[i].stat_cat());
+                            }
+                            if (!stat_cat) { continue; }
+                            // Only a proud few share the Patron Info pane
+                            if (rows && get_bool( stat_cat.usr_summary() )) {
+                                var row_id = 'stat_cat_id_' + stat_cat.id();
+                                var row; var label1; var label2;
+                                if ($(row_id)) {
+                                    row = $(row_id);
+                                    label1 = row.firstChild;
+                                    label2 = row.lastChild;
+                                } else {
+                                    row = document.createElement('row');
+                                    row.setAttribute('id',row_id);
+                                    label1 = document.createElement('label');
+                                    label2 = document.createElement('label');
+                                    row.appendChild(label1);
+                                    row.appendChild(label2);
+                                    // Place before the spacer at the end
+                                    rows.insertBefore(row, rows.lastChild);
+                                }
+                                label1.setAttribute('value',stat_cat.name());
+                                label1.setAttribute('tooltiptext','stat cat id ' + stat_cat.id());
+                                label2.setAttribute('value',entries[i].stat_cat_entry());
+                            }
+                        }
+                    } catch(E) {
+                        alert('Error in summary.js: ' + E);
+                    }
+                }
             } );
 
             // On Complete