[open-ils-commits] r8923 - in trunk/Open-ILS/xul/staff_client:
chrome/content/auth server/cat server/circ server/main server/patron
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Mar 8 03:28:00 EST 2008
Author: phasefx
Date: 2008-03-08 02:55:15 -0500 (Sat, 08 Mar 2008)
New Revision: 8923
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/auth/session.js
trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.js
trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.js
trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js
trunk/Open-ILS/xul/staff_client/server/cat/copy_summary.xul
trunk/Open-ILS/xul/staff_client/server/cat/z3950.js
trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js
trunk/Open-ILS/xul/staff_client/server/circ/in_house_use.js
trunk/Open-ILS/xul/staff_client/server/main/ws_info.xul
trunk/Open-ILS/xul/staff_client/server/patron/bill_details.xul
trunk/Open-ILS/xul/staff_client/server/patron/bill_history.xul
trunk/Open-ILS/xul/staff_client/server/patron/bills.js
trunk/Open-ILS/xul/staff_client/server/patron/holds.js
trunk/Open-ILS/xul/staff_client/server/patron/items.js
Log:
explicit number casting for JSON results
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/auth/session.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/auth/session.js 2008-03-08 07:46:39 UTC (rev 8922)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/auth/session.js 2008-03-08 07:55:15 UTC (rev 8923)
@@ -47,7 +47,7 @@
var robj = this.network.simple_request( 'AUTH_COMPLETE', [ params ]);
- switch (robj.ilsevent) {
+ switch (Number(robj.ilsevent)) {
case 0:
this.key = robj.payload.authtoken;
this.authtime = robj.payload.authtime;
Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.js 2008-03-08 07:46:39 UTC (rev 8922)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_browser.js 2008-03-08 07:55:15 UTC (rev 8923)
@@ -547,7 +547,7 @@
[ ses(), volumes, true ]
);
if (typeof r.ilsevent != 'undefined') {
- switch(r.ilsevent) {
+ switch(Number(r.ilsevent)) {
case 1705 /* VOLUME_LABEL_EXISTS */ :
alert("Edit failed: You tried to change a volume's callnumber to one that is already in use for the given library. You should transfer the items to the desired callnumber instead.");
break;
Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.js 2008-03-08 07:46:39 UTC (rev 8922)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.js 2008-03-08 07:55:15 UTC (rev 8923)
@@ -433,7 +433,7 @@
var robj = obj.network.simple_request('FM_ACP_FLESHED_BATCH_UPDATE',[ ses(), copies, true]);
if (typeof robj.ilsevent != 'undefined') {
- switch(robj.ilsevent) {
+ switch(Number(robj.ilsevent)) {
case 1227 /* COPY_DELETE_WARNING */ :
var copy;
for (var i = 0; i < copies.length; i++) { if (copies[i].id()==robj.payload) copy = function(a){return a;}(copies[i]); }
Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js 2008-03-08 07:46:39 UTC (rev 8922)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_editor.js 2008-03-08 07:55:15 UTC (rev 8923)
@@ -827,7 +827,7 @@
[
"Loan Duration",
{
- render: 'switch(fm.loan_duration()){ case 1: case "1": "Short"; break; case 2: case "2": "Normal"; break; case 3:case "3": "Long"; break; }',
+ render: 'switch(Number(fm.loan_duration())){ case 1: "Short"; break; case 2: "Normal"; break; case 3: "Long"; break; }',
input: 'c = function(v){ g.apply("loan_duration",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( [ [ "Short", "1" ], [ "Normal", "2" ], [ "Long", "3" ] ] ); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
}
@@ -835,7 +835,7 @@
[
"Fine Level",
{
- render: 'switch(fm.fine_level()){ case 1: case "1": "Low"; break; case 2: case "2": "Normal"; break; case 3: case "3": "High"; break; }',
+ render: 'switch(Number(fm.fine_level())){ case 1: "Low"; break; case 2: "Normal"; break; case 3: "High"; break; }',
input: 'c = function(v){ g.apply("fine_level",v); if (typeof post_c == "function") post_c(v); }; x = util.widgets.make_menulist( [ [ "Low", "1" ], [ "Normal", "2" ], [ "High", "3" ] ] ); x.addEventListener("apply",function(f){ return function(ev) { f(ev.target.value); } }(c), false);',
}
],
Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_summary.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_summary.xul 2008-03-08 07:46:39 UTC (rev 8922)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_summary.xul 2008-03-08 07:55:15 UTC (rev 8923)
@@ -105,7 +105,7 @@
try {
var cn = rreq.getResultObject();
if (typeof cn.ilsevent != 'undefined') {
- switch(cn.ilsevent) {
+ switch(Number(cn.ilsevent)) {
case 1508 /* ASSET_CALL_NUMBER_NOT_FOUND */ :
$w('callnumber','Not Cataloged');
break;
Modified: trunk/Open-ILS/xul/staff_client/server/cat/z3950.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/z3950.js 2008-03-08 07:46:39 UTC (rev 8922)
+++ trunk/Open-ILS/xul/staff_client/server/cat/z3950.js 2008-03-08 07:55:15 UTC (rev 8923)
@@ -530,7 +530,7 @@
try {
var r = obj.network.simple_request('MARC_XML_RECORD_IMPORT', [ ses(), new_marcxml, biblio_source ]);
if (typeof r.ilsevent != 'undefined') {
- switch(r.ilsevent) {
+ switch(Number(r.ilsevent)) {
case 1704 /* TCN_EXISTS */ :
var msg = 'A record with TCN ' + r.payload.tcn + ' already exists.\nFIXME: add record summary here';
var title = 'Import Collision';
@@ -655,7 +655,7 @@
if (! obj.confirm_overlay( [ obj.data.marked_record ] ) ) { return; }
var r = obj.network.simple_request('MARC_XML_RECORD_REPLACE', [ ses(), obj.data.marked_record, new_marcxml, biblio_source ]);
if (typeof r.ilsevent != 'undefined') {
- switch(r.ilsevent) {
+ switch(Number(r.ilsevent)) {
case 1704 /* TCN_EXISTS */ :
var msg = 'A record with TCN ' + r.payload.tcn + ' already exists.\nFIXME: add record summary here';
var title = 'Import Collision';
Modified: trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js 2008-03-08 07:46:39 UTC (rev 8922)
+++ trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js 2008-03-08 07:55:15 UTC (rev 8923)
@@ -478,7 +478,7 @@
);
if (typeof robj.ilsevent != 'undefined') {
- switch(robj.ilsevent) {
+ switch(Number(robj.ilsevent)) {
case 1208 /* TITLE_LAST_COPY */:
case 1227 /* COPY_DELETE_WARNING */:
break;
@@ -699,7 +699,7 @@
[ ses(), volumes, false ]
);
if (typeof r.ilsevent != 'undefined') {
- switch(r.ilsevent) {
+ switch(Number(r.ilsevent)) {
case 1705 /* VOLUME_LABEL_EXISTS */ :
alert(document.getElementById('circStrings').getString('staff.circ.copy_status.edit_volumes.duplicate'));
break;
@@ -1002,7 +1002,7 @@
if (details == null) {
throw(document.getElementById('circStrings').getString('staff.circ.copy_status.status.null_result'));
} else if (details.ilsevent) {
- switch(details.ilsevent) {
+ switch(Number(details.ilsevent)) {
case -1:
obj.error.standard_network_error_alert();
obj.controller.view.copy_status_barcode_entry_textbox.select();
Modified: trunk/Open-ILS/xul/staff_client/server/circ/in_house_use.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/in_house_use.js 2008-03-08 07:46:39 UTC (rev 8922)
+++ trunk/Open-ILS/xul/staff_client/server/circ/in_house_use.js 2008-03-08 07:55:15 UTC (rev 8923)
@@ -259,7 +259,7 @@
var copy = obj.network.simple_request('FM_ACP_RETRIEVE_VIA_BARCODE',[ barcode ]);
if (copy.ilsevent) {
- switch(copy.ilsevent) {
+ switch(Number(copy.ilsevent)) {
case -1 :
obj.error.standard_network_error_alert(document.getElementById('circStrings').getString('staff.circ.in_house_use.failed.verbose'));
break;
Modified: trunk/Open-ILS/xul/staff_client/server/main/ws_info.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/main/ws_info.xul 2008-03-08 07:46:39 UTC (rev 8922)
+++ trunk/Open-ILS/xul/staff_client/server/main/ws_info.xul 2008-03-08 07:55:15 UTC (rev 8923)
@@ -156,7 +156,7 @@
);
if (typeof robj.ilsevent != 'undefined') {
- switch(robj.ilsevent) {
+ switch(Number(robj.ilsevent)) {
case -1 : g.error.standard_network_error_alert(); break;
case 1703 /* WORKSTATION_NAME_EXISTS */ : /* handled with override request */ break;
default: g.error.standard_unexpected_error_alert(document.getElementById('commonStrings').getFormattedString('staff.main.gen_offline_widgets.registration.error', ['1']), robj); break;
Modified: trunk/Open-ILS/xul/staff_client/server/patron/bill_details.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bill_details.xul 2008-03-08 07:46:39 UTC (rev 8922)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill_details.xul 2008-03-08 07:55:15 UTC (rev 8923)
@@ -274,7 +274,7 @@
if (r == 0) {
var robj = g.network.simple_request('FM_MB_VOID',[ses()].concat(util.functional.map_list(mb_list,function(o){return o.id();})));
if (robj.ilsevent) {
- switch(robj.ilsevent) {
+ switch(Number(robj.ilsevent)) {
default:
g.error.standard_unexpected_error_alert('Error voiding bills.',robj);
retrieve_mbts();
Modified: trunk/Open-ILS/xul/staff_client/server/patron/bill_history.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bill_history.xul 2008-03-08 07:46:39 UTC (rev 8922)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill_history.xul 2008-03-08 07:55:15 UTC (rev 8923)
@@ -61,7 +61,7 @@
if (xul_param('current')) method = 'FM_MBTS_IDS_RETRIEVE_ALL_HAVING_BALANCE';
g.mbts_ids = g.network.simple_request(method,[ses(),g.patron_id]);
if (g.mbts_ids.ilsevent) {
- switch(g.mbts_ids.ilsevent) {
+ switch(Number(g.mbts_ids.ilsevent)) {
case -1: g.error.standard_network_error_alert('Please close this window and try again.'); break;
default: g.error.standard_unexpected_error_alert('Please close this window and try again.',g.mbts_ids); break;
}
@@ -113,7 +113,7 @@
try {
g.mbts = req.getResultObject();
if (g.mbts.ilsevent) {
- switch(g.mbts.ilsevent) {
+ switch(Number(g.mbts.ilsevent)) {
case -1: g.error.standard_network_error_alert('mbts_id = ' + g.mbts_id); break;
default: g.error.standard_unexpected_error_alert('mbts_id = ' + g.mbts_id,g.mbts); break;
}
Modified: trunk/Open-ILS/xul/staff_client/server/patron/bills.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bills.js 2008-03-08 07:46:39 UTC (rev 8922)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bills.js 2008-03-08 07:55:15 UTC (rev 8923)
@@ -583,7 +583,7 @@
);
if (robj == 1) { return true; }
if (typeof robj.ilsevent != 'undefined') {
- switch(robj.ilsevent) {
+ switch(Number(robj.ilsevent)) {
case 0 /* SUCCESS */ : return true; break;
case 1226 /* REFUND_EXCEEDS_DESK_PAYMENTS */ : alert(robj.desc + '\n\nAnother way to "zero" this transaction is to use Add Billing and add a misc bill to counter the negative balance.'); return false; break;
default: throw(robj); break;
@@ -1060,7 +1060,7 @@
if (r == 0) {
var robj = obj.network.simple_request('FM_MB_VOID',[ses()].concat(util.functional.map_list(mb_list,function(o){return o.id();})));
if (robj.ilsevent) {
- switch(robj.ilsevent) {
+ switch(Number(robj.ilsevent)) {
default:
obj.error.standard_unexpected_error_alert('Error voiding bills.',robj);
obj.refresh(); return;
Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2008-03-08 07:46:39 UTC (rev 8922)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2008-03-08 07:55:15 UTC (rev 8923)
@@ -589,7 +589,7 @@
for (var i = 0; i < transits.length; i++) {
var robj = obj.network.simple_request('FM_ATC_VOID',[ ses(), { 'barcode' : transits[i] } ]);
if (typeof robj.ilsevent != 'undefined') {
- switch(robj.ilsevent) {
+ switch(Number(robj.ilsevent)) {
case 1225 /* TRANSIT_ABORT_NOT_ALLOWED */ :
alert(robj.desc);
break;
Modified: trunk/Open-ILS/xul/staff_client/server/patron/items.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/items.js 2008-03-08 07:46:39 UTC (rev 8922)
+++ trunk/Open-ILS/xul/staff_client/server/patron/items.js 2008-03-08 07:55:15 UTC (rev 8923)
@@ -376,7 +376,7 @@
dump('Mark barcode lost = ' + barcode);
var robj = obj.network.simple_request( 'MARK_ITEM_LOST', [ ses(), { barcode: barcode } ]);
if (typeof robj.ilsevent != 'undefined') {
- switch(robj.ilsevent) {
+ switch(Number(robj.ilsevent)) {
case 7018 /* COPY_MARKED_LOST */ :
alert( 'Item Barcode ' + barcode + '\n' + robj.desc );
break;
More information about the open-ils-commits
mailing list