[open-ils-commits] r17241 - trunk/Open-ILS/xul/staff_client/server/cat (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Aug 18 11:57:27 EDT 2010
Author: phasefx
Date: 2010-08-18 11:57:24 -0400 (Wed, 18 Aug 2010)
New Revision: 17241
Modified:
trunk/Open-ILS/xul/staff_client/server/cat/util.js
Log:
some defensive coding. TODO: disable actions in Holds list interfaces that affects items when the selected holds have no Current Copy
Modified: trunk/Open-ILS/xul/staff_client/server/cat/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/util.js 2010-08-18 15:53:10 UTC (rev 17240)
+++ trunk/Open-ILS/xul/staff_client/server/cat/util.js 2010-08-18 15:57:24 UTC (rev 17241)
@@ -323,6 +323,9 @@
JSAN.use('util.error'); error = new util.error();
JSAN.use('util.functional'); JSAN.use('util.date');
JSAN.use('util.network'); var network = new util.network();
+ if (!copy_ids) { return; }
+ copy_ids = util.functional.filter_list( copy_ids, function(o) { return o != null; } );
+ if (copy_ids.length < 1) { return; }
var copies = network.simple_request('FM_ACP_FLESHED_BATCH_RETRIEVE.authoritative', [ copy_ids ]);
if (typeof copies.ilsevent != 'undefined') throw(copies);
var magic_status = false;
@@ -466,6 +469,9 @@
JSAN.use('util.error'); error = new util.error();
JSAN.use('util.functional');
JSAN.use('util.network'); var network = new util.network();
+ if (!copy_ids) { return; }
+ copy_ids = util.functional.filter_list( copy_ids, function(o) { return o != null; } );
+ if (copy_ids.length < 1) { return; }
var copies = network.simple_request('FM_ACP_FLESHED_BATCH_RETRIEVE.authoritative', [ copy_ids ]);
if (typeof copies.ilsevent != 'undefined') throw(copies);
var magic_status = false;
@@ -556,6 +562,9 @@
}
cat.util.make_bookable = function(copy_ids) {
+ if (!copy_ids) { return; }
+ copy_ids = util.functional.filter_list( copy_ids, function(o) { return o != null; } );
+ if (copy_ids.length < 1) { return; }
var results = fieldmapper.standardRequest(
["open-ils.booking", "open-ils.booking.resources.create_from_copies"],
[ses(), copy_ids]
@@ -747,6 +756,9 @@
JSAN.use('util.network'); var network = new util.network();
JSAN.use('util.print'); var print = new util.print();
JSAN.use('util.window'); var win = new util.window();
+ if (!copy_ids) { return; }
+ copy_ids = util.functional.filter_list( copy_ids, function(o) { return o != null; } );
+ if (copy_ids.length < 1) { return; }
var copies = network.simple_request('FM_ACP_FLESHED_BATCH_RETRIEVE.authoritative', [ copy_ids ]);
if (typeof copies.ilsevent != 'undefined') throw(copies);
More information about the open-ils-commits
mailing list