give OpenILS.data.lookup the ability to handle actor stat cats
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 8 Sep 2010 06:49:34 +0000 (06:49 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 8 Sep 2010 06:49:34 +0000 (06:49 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17508 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
Open-ILS/xul/staff_client/server/patron/summary.js

index ad74593..7ec636d 100644 (file)
@@ -184,6 +184,9 @@ OpenILS.data.prototype = {
                 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);
index 38a612c..36e62fe 100644 (file)
@@ -131,15 +131,7 @@ patron.summary.prototype = {
                                 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;
-                                        }
+                                        stat_cat = obj.OpenILS.data.lookup('actsc',entries[i].stat_cat());
                                     }
                                     if (!stat_cat) { continue; }
                                     if (get_bool( stat_cat.usr_summary() )) {