'set_other_sunit' : function() {
var obj = this;
try {
- g.serial_items_sunit_select = '';
- g.serial_items_sdist_ids = obj.sdist_ids;
JSAN.use('util.window'); var win = new util.window();
- win.open(
+ var select_unit_window = win.open(
xulG.url_prefix(urls.XUL_SERIAL_SELECT_UNIT),
'_blank',
- 'chrome,resizable,modal,centerscreen'
+ 'chrome,resizable,modal,centerscreen',
+ {'sdist_ids' : obj.sdist_ids}
);
- if (!g.serial_items_sunit_select) {
+ if (!select_unit_window.sunit_selection) {
return;
}
- var selection = g.serial_items_sunit_select;
+ var selection = select_unit_window.sunit_selection;
var sunit_id = selection.sunit;
var sdist_id = selection.sdist;
var sstr_id = selection.sstr;
var ml;
JSAN.use('util.network'); g.network = new util.network();
+ var sdist_ids = xul_param('sdist_ids',{'modal_xulG':true});
+ //TODO: unit_list.retrieve option for binding units only (that is, units containing bound items only)
var robj = g.network.request(
'open-ils.serial',
'open-ils.serial.unit_list.retrieve',
- opener.g.serial_items_sdist_ids
+ sdist_ids
);
if (typeof robj.ilsevent != 'undefined') throw(robj);
ml = util.widgets.make_menulist(robj);
g.select_unit = function() {
var selection = JSON2js($('unit_menu').value);
selection.label = $('unit_menu').selectedItem.label;
- opener.g.serial_items_sunit_select = selection;
+ update_modal_xulG({'sunit_selection' : selection});
window.close();
}