in patron retrieval interface for checkouts, replace the barcode.exist call with...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 23 Dec 2008 19:44:01 +0000 (19:44 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 23 Dec 2008 19:44:01 +0000 (19:44 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@11668 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/barcode_entry.xul

index 448439a..03c9141 100644 (file)
 
                                tb.disabled = true;
                                document.getElementById('progress').setAttribute('hidden','false');
-                               net.simple_request('PATRON_BARCODE_EXISTS.authoritative',[ ses(), barcode ],
+                               net.simple_request('FM_AU_ID_RETRIEVE_VIA_BARCODE_OR_USERNAME',[ ses(), barcode, null ],
                                        function(req) {
                                                document.getElementById('progress').setAttribute('hidden','true');
                                                tb.disabled = false; tb.select(); tb.focus(); ;
                                                var robj = req.getResultObject();
                                                if (typeof robj.ilsevent != 'undefined') {
                                                        sound.bad();
-                                                       add_msg($("patronStrings").getFormattedString('staff.patron.barcode_entry.barcode_retrieval_problem', [barcode, js2JSON(robj)]));
-                                                       return;
-                                               } else if (robj == 0) {
-                                                       sound.bad(); 
-                                                       add_msg($("patronStrings").getFormattedString('staff.patron.barcode_entry.barcode_not_found', [barcode]));
+                            switch(Number(robj.ilsevent)) {
+                                                           case 1002 /* ACTOR_USER_NOT_FOUND */: 
+                                                               add_msg($("patronStrings").getFormattedString('staff.patron.barcode_entry.barcode_not_found', [barcode]));
+                                break;
+                                default:
+                                    add_msg($("patronStrings").getFormattedString('staff.patron.barcode_entry.barcode_retrieval_problem', [barcode, js2JSON(robj)]));
+                            }
                                                        return;
                                                }
 
                                                if (g.data.user_org_unit_opt_in_enabled) {
-                                                       var r = net.simple_request('USER_ORG_UNIT_OPT_IN_CHECK',[ ses(), robj ]); // FIXME -- robj is no longer returning a usr id
+                                                       var r = net.simple_request('USER_ORG_UNIT_OPT_IN_CHECK',[ ses(), robj ]);
                                                        if (typeof r.ilsevent != 'undefined') {
                                                                throw(r);
                                                        } else {