From: phasefx Date: Wed, 16 Dec 2009 07:48:10 +0000 (+0000) Subject: Stat Cats (where usr_summary is true) in horizontal patron summary pane. Give pcrud... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1bdb969562c7c311deecc62cd8bfc6d82422e69a;p=evergreen%2Ftadl.git Stat Cats (where usr_summary is true) in horizontal patron summary pane. Give pcrud access to actsc git-svn-id: svn://svn.open-ils.org/ILS/trunk@15173 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 520ea516f2..6ee8c63854 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -3181,7 +3181,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - + @@ -3194,6 +3194,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + + + + + + + diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index bc16f85c3b..dd3d0f5717 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -92,6 +92,7 @@ const api = { 'FM_ACPN_DELETE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.copy_note.delete', 'secure' : false }, 'FM_ACTSC_RETRIEVE_BATCH' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.stat_cat.actor.retrieve.batch', 'secure' : false }, 'FM_ACTSC_RETRIEVE_VIA_AOU' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.stat_cat.actor.retrieve.all', 'secure' : false }, + 'FM_ACTSC_RETRIEVE_VIA_PCRUD' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.actsc.atomic', 'secure' : false }, 'FM_AHRN_CREATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold_note.create' }, 'FM_AHN_CREATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold_notification.create' }, 'FM_AHN_RETRIEVE_VIA_AHR' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold_notification.retrieve_by_hold' }, diff --git a/Open-ILS/xul/staff_client/server/patron/summary.js b/Open-ILS/xul/staff_client/server/patron/summary.js index 2ccdbe97c4..62be6483f9 100644 --- a/Open-ILS/xul/staff_client/server/patron/summary.js +++ b/Open-ILS/xul/staff_client/server/patron/summary.js @@ -30,7 +30,9 @@ patron.summary.prototype = { obj.OpenILS.data = new OpenILS.data(); obj.OpenILS.data.init({'via':'stash'}); var obscure_dob = String( obj.OpenILS.data.hash.aous['circ.obscure_dob'] ) == 'true'; - JSAN.use('util.functional'); JSAN.use('patron.util'); JSAN.use('util.list'); obj.group_list = new util.list('group_list'); + JSAN.use('util.functional'); JSAN.use('patron.util'); JSAN.use('util.list'); + + obj.group_list = new util.list('group_list'); obj.group_list.init( { 'columns' : [ { 'id' : 'gl_family_name', 'flex' : 1, @@ -63,6 +65,23 @@ patron.summary.prototype = { $('group_list_actions').appendChild( obj.group_list.render_list_actions() ); obj.group_list.set_list_actions(); + obj.stat_cat_list = new util.list('stat_cat_list'); + obj.stat_cat_list.init( { + 'columns' : [].concat( + obj.stat_cat_list.fm_columns( 'actsc', { + 'actsc_id' : { 'hidden' : true }, + 'actsc_opac_visible' : { 'hidden' : true }, + 'actsc_usr_summary' : { 'hidden' : true } + } ) + ).concat( + obj.stat_cat_list.fm_columns( 'actscecm', { + 'actscecm_id' : { 'hidden' : true } + } ) + ) + } ); + $('stat_cat_list_actions').appendChild( obj.stat_cat_list.render_list_actions() ); + obj.stat_cat_list.set_list_actions(); + JSAN.use('util.controller'); obj.controller = new util.controller(); obj.controller.init( { @@ -92,6 +111,42 @@ patron.summary.prototype = { } } ], + 'stat_cat_tab' : [ + ['command'], + function() { + try { + obj.stat_cat_list.clear(); + 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.hash.actsc[ entries[i].stat_cat() ]; + } + if (!stat_cat) { + var robj = obj.network.simple_request('FM_ACTSC_RETRIEVE_VIA_PCRUD',[ ses(), { 'id' : { '=' : entries[i].stat_cat() } }]); + if (typeof robj == 'object' && typeof robj.ilsevent != 'undefined') { + obj.OpenILS.data.hash.actsc[ entries[i].stat_cat() ] = robj; + obj.OpenILS.data.stash( 'hash' ); + stat_cat = robj; + } + } + if (!stat_cat) { continue; } + if (get_bool( stat_cat.usr_summary() )) { + obj.stat_cat_list.append( { + 'row' : { + 'my' : { + 'actsc' : stat_cat, + 'actscecm' : entries[i], + } + } + } ); + } + } + } catch(E) { + alert('Error in summary.js, stat_cat_tab: ' + E); + } + } + ], 'group_tab_retrieve_patron' : [ ['command'], function() { 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 e4c060c553..7bd07bacc2 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 @@ -37,7 +37,7 @@ - + @@ -52,9 +52,12 @@ accesskey="&staff.patron.summary_overlay.group_tab.retrieve_patron.accesskey;" /> - - - + + + + + +