var g = {};
g.map_acn = {};
-var xulG = {};
-
function $(id) { return document.getElementById(id); }
function my_init() {
g.render();
g.check_for_unmet_required_fields();
+ if (xulG.unified_interface) {
+ xulG.refresh_copy_editor = function() {
+ try {
+ g.copies = xulG.copies;
+ g.original_copies = js2JSON( g.copies );
+ g.summarize( g.copies );
+ g.render();
+ g.check_for_unmet_required_fields();
+ document.getElementById(caption.id).focus();
+ } catch(E) {
+ alert('Error in copy_editor.js, xulG.refresh_copy_editor(): ' + E);
+ }
+ }
+ }
+
} catch(E) {
var err_msg = $("commonStrings").getFormattedString('common.exception', ['cat/copy_editor.js', E]);
try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); dump(js2JSON(E)); }
$("catStrings").getString('staff.cat.volume_copy_creator.render_barcode_entry.alert_confirm'));
setTimeout( function() { ev.target.select(); ev.target.focus(); }, 0);
}
+ if (xulG.unified_interface) {
+ g.gather_copies();
+ try {
+ xulG.refresh_copy_editor();
+ } catch(E) {
+ alert('Error in volume_copy_editor.js trying to call xulG.refresh_copy_editor(): ' + E);
+ }
+ }
}, false);
tb.addEventListener( 'focus', function(ev) { g.last_focus = ev.target; }, false );
}
g.new_node_id = -1;
-g.stash_and_close = function(param) {
-
+g.gather_copies = function() {
try {
-
var nl = document.getElementsByTagName('textbox');
var volumes_hash = {};
for (var i = 0; i < volumes_hash[ou_id][cn_label].length; i++) {
var barcode = volumes_hash[ou_id][cn_label][i].barcode;
var acp_id = volumes_hash[ou_id][cn_label][i].acp_id;
- var copy;
- if (acp_id < 0) {
+ var copy = g.id_copy_map[ acp_id ];
+ if (!copy) {
copy = new_copy(acp_id,ou_id,acn_id,barcode);
+ g.id_copy_map[ acp_id ] = copy;
} else {
- copy = g.id_copy_map[ acp_id ];
- copy.barcode( barcode );
- copy.call_number( acn_id );
copy.ischanged('1');
}
+ copy.barcode( barcode );
+ copy.call_number( acn_id );
copies.push( copy );
}
}
}
+ xulG.copies = copies;
+ return copies;
+
+ } catch(E) {
+ g.error.standard_unexpected_error_alert('Error in volume_copy_creator.js, g.gather_copies():',E);
+ }
+}
+
+g.stash_and_close = function(param) {
+
+ try {
+
+ var copies = g.gather_copies();
+
var dont_close = false;
JSAN.use('util.window'); var win = new util.window();
if (copies.length > 0) {