From: phasefx Date: Mon, 20 Sep 2010 17:31:51 +0000 (+0000) Subject: Change behavior of stat cat display in horizontal patron summary. Stat Cat tab shows... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4a71494cafd61faf250aff1765a4423ea23200f8;p=evergreen%2Fpines.git Change behavior of stat cat display in horizontal patron summary. Stat Cat tab shows all patron.stat_cat_entries. Entries with usr_summary true also get shown in the Patron Info pane, underneath Email git-svn-id: svn://svn.open-ils.org/ILS/trunk@17838 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/patron/summary.js b/Open-ILS/xul/staff_client/server/patron/summary.js index 36e62febb4..55ad6348be 100644 --- a/Open-ILS/xul/staff_client/server/patron/summary.js +++ b/Open-ILS/xul/staff_client/server/patron/summary.js @@ -126,6 +126,7 @@ patron.summary.prototype = { ['command'], function() { try { + var rows = $('patron_info_rows'); obj.stat_cat_list.clear(); var entries = obj.patron.stat_cat_entries(); for (var i = 0; i < entries.length; i++) { @@ -134,15 +135,35 @@ patron.summary.prototype = { stat_cat = obj.OpenILS.data.lookup('actsc',entries[i].stat_cat()); } if (!stat_cat) { continue; } - if (get_bool( stat_cat.usr_summary() )) { - obj.stat_cat_list.append( { - 'row' : { - 'my' : { - 'actsc' : stat_cat, - 'actscecm' : entries[i], - } + // Every stat cat gets rendered in the Stat Cats tab + obj.stat_cat_list.append( { + 'row' : { + 'my' : { + 'actsc' : stat_cat, + 'actscecm' : entries[i], } - } ); + } + } ); + // But 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); + rows.appendChild(row); + } + 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) { @@ -943,7 +964,12 @@ patron.summary.prototype = { */ // Update the screen - chain.push( function() { obj.controller.render(); } ); + chain.push( function() { + obj.controller.render(); + if ($('stat_cat_tab')) { + util.widgets.dispatch('command','stat_cat_tab'); + } + } ); // On Complete diff --git a/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul b/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul index 1e30b78f12..5b2e9c21e5 100644 --- a/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul +++ b/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul @@ -100,7 +100,7 @@ - +