[open-ils-commits] r17510 - in branches/rel_2_0/Open-ILS/xul/staff_client: chrome/content/OpenILS server/circ server/patron (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Sep 8 02:52:43 EDT 2010
Author: phasefx
Date: 2010-09-08 02:52:39 -0400 (Wed, 08 Sep 2010)
New Revision: 17510
Modified:
branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
branches/rel_2_0/Open-ILS/xul/staff_client/server/circ/util.js
branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/summary.js
Log:
backport 17508, 17509, for better user stat cat lookups and exposing such stat cats in hold slips
Modified: branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js 2010-09-08 06:50:02 UTC (rev 17509)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js 2010-09-08 06:52:39 UTC (rev 17510)
@@ -184,6 +184,9 @@
case 'acpl':
found = obj.network.simple_request('FM_ACPL_RETRIEVE_VIA_ID.authoritative',[ value ]);
break;
+ case 'actsc':
+ found = obj.network.simple_request('FM_ACTSC_RETRIEVE_VIA_PCRUD',[ ses(), { 'id' : { '=' : value } }]);
+ break;
default: return undefined; break;
}
if (typeof found.ilsevent != 'undefined') throw(found);
Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/circ/util.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/circ/util.js 2010-09-08 06:50:02 UTC (rev 17509)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/circ/util.js 2010-09-08 06:52:39 UTC (rev 17510)
@@ -2428,7 +2428,9 @@
'request_date' : '',
'request_date_msg' : '',
'slip_date' : '',
- 'slip_date_msg' : ''
+ 'slip_date_msg' : '',
+ 'user' : '',
+ 'user_stat_cat_entries' : ''
};
if (check.payload && check.payload.cancelled_hold_transit) {
@@ -2531,6 +2533,26 @@
msg += '\n';
var au_obj = patron.util.retrieve_fleshed_au_via_id( session, check.payload.hold.usr() );
print_data.user = au_obj;
+ print_data.user_stat_cat_entries = [];
+ var entries = au_obj.stat_cat_entries();
+ for (var i = 0; i < entries.length; i++) {
+ var stat_cat = data.hash.my_actsc[ entries[i].stat_cat() ];
+ if (!stat_cat) {
+ stat_cat = data.lookup('actsc', entries[i].stat_cat());
+ }
+ print_data.user_stat_cat_entries.push( {
+ 'id' : entries[i].id(),
+ 'stat_cat' : {
+ 'id' : stat_cat.id(),
+ 'name' : stat_cat.name(),
+ 'opac_visible' : stat_cat.opac_visible(),
+ 'owner' : stat_cat.owner(),
+ 'usr_summary' : stat_cat.usr_summary()
+ },
+ 'stat_cat_entry' : entries[i].stat_cat_entry(),
+ 'target_usr' : entries[i].target_usr()
+ } );
+ }
msg += '\n';
if (au_obj.alias()) {
print_data.hold_for_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.payload.hold.patron_alias', [au_obj.alias()]);
Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/summary.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/summary.js 2010-09-08 06:50:02 UTC (rev 17509)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/summary.js 2010-09-08 06:52:39 UTC (rev 17510)
@@ -131,16 +131,8 @@
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() ];
+ stat_cat = obj.OpenILS.data.lookup('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( {
More information about the open-ils-commits
mailing list