[open-ils-commits] r7556 - in
branches/rel_1_2/Open-ILS/xul/staff_client/server: cat patron
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Jul 16 16:19:37 EDT 2007
Author: phasefx
Date: 2007-07-16 16:14:11 -0400 (Mon, 16 Jul 2007)
New Revision: 7556
Modified:
branches/rel_1_2/Open-ILS/xul/staff_client/server/cat/record_buckets.js
branches/rel_1_2/Open-ILS/xul/staff_client/server/patron/hold_notices.xul
Log:
fancy_prompt and modal_xulG bug where window.open was being used instead of the JSAN wrapper library (util.window) where the modal_xulG way of passing data to/from modal windows is managed
Modified: branches/rel_1_2/Open-ILS/xul/staff_client/server/cat/record_buckets.js
===================================================================
--- branches/rel_1_2/Open-ILS/xul/staff_client/server/cat/record_buckets.js 2007-07-16 20:12:03 UTC (rev 7555)
+++ branches/rel_1_2/Open-ILS/xul/staff_client/server/cat/record_buckets.js 2007-07-16 20:14:11 UTC (rev 7556)
@@ -508,7 +508,8 @@
xml += '</tr></table></form>';
//obj.data.temp_merge_top = top_xml; obj.data.stash('temp_merge_top');
//obj.data.temp_merge_mid = xml; obj.data.stash('temp_merge_mid');
- window.open(
+ JSAN.use('util.window'); var win = new util.window();
+ var fancy_prompt_data = win.open(
urls.XUL_FANCY_PROMPT,
//+ '?xml_in_stash=temp_merge_mid'
//+ '&top_xml_in_stash=temp_merge_top'
@@ -518,15 +519,15 @@
'top_xml' : top_xml, 'xml' : xml, 'title' : 'Record Merging'
}
);
- obj.data.stash_retrieve();
- if (obj.data.fancy_prompt_data == '') { alert('Merge Aborted'); return; }
+ //obj.data.stash_retrieve();
+ if (fancy_prompt_data.fancy_status == 'incomplete') { alert('Merge Aborted'); return; }
var robj = obj.network.simple_request('MERGE_RECORDS',
[
ses(),
- obj.data.fancy_prompt_data.lead,
+ fancy_prompt_data.lead,
util.functional.filter_list( record_ids,
function(o) {
- return o != obj.data.fancy_prompt_data.lead;
+ return o != fancy_prompt_data.lead;
}
)
]
@@ -550,6 +551,82 @@
}
],
+
+ 'cmd_delete_records' : [
+ ['command'],
+ function() {
+ try {
+ obj.list2.select_all();
+ obj.data.stash_retrieve();
+ JSAN.use('util.functional');
+
+ var record_ids = util.functional.map_list(
+ obj.list2.dump_retrieve_ids(),
+ function (o) {
+ return JSON2js(o).docid; // docid
+ }
+ );
+
+ netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserWrite');
+ var top_xml = '<vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1" >';
+ top_xml += '<description>Delete these records?</description>';
+ top_xml += '<hbox><button id="lead" disabled="false" label="Delete" name="fancy_submit"/><button label="Cancel" accesskey="C" name="fancy_cancel"/></hbox></vbox>';
+
+ var xml = '<form xmlns="http://www.w3.org/1999/xhtml">';
+ xml += '<table><tr valign="top">';
+ for (var i = 0; i < record_ids.length; i++) {
+ xml += '<td>Record #' + record_ids[i] + '</td>';
+ }
+ xml += '</tr><tr valign="top">';
+ for (var i = 0; i < record_ids.length; i++) {
+ xml += '<td nowrap="nowrap"><iframe src="' + urls.XUL_BIB_BRIEF;
+ xml += '?docid=' + record_ids[i] + '"/></td>';
+ }
+ xml += '</tr><tr valign="top">';
+ for (var i = 0; i < record_ids.length; i++) {
+ html = obj.network.simple_request('MARC_HTML_RETRIEVE',[ record_ids[i] ]);
+ xml += '<td nowrap="nowrap"><iframe style="min-height: 1000px; min-width: 300px;" flex="1" src="data:text/html,' + window.escape(html) + '"/></td>';
+ }
+ xml += '</tr></table></form>';
+ //obj.data.temp_merge_top = top_xml; obj.data.stash('temp_merge_top');
+ //obj.data.temp_merge_mid = xml; obj.data.stash('temp_merge_mid');
+ JSAN.use('util.window'); var win = new util.window();
+ var fancy_prompt_data = win.open(
+ urls.XUL_FANCY_PROMPT,
+ //+ '?xml_in_stash=temp_merge_mid'
+ //+ '&top_xml_in_stash=temp_merge_top'
+ //+ '&title=' + window.escape('Record Purging'),
+ 'fancy_prompt', 'chrome,resizable,modal,width=700,height=500',
+ {
+ 'top_xml' : top_xml, 'xml' : xml, 'title' : 'Record Purging'
+ }
+ );
+ //obj.data.stash_retrieve();
+ if (fancy_prompt_data.fancy_status == 'incomplete') { alert('Delete Aborted'); return; }
+ var s = '';
+ for (var i = 0; i < record_ids.length; i++) {
+ var robj = obj.network.simple_request('FM_BRE_DELETE',[ses(),record_ids[i]]);
+ if (typeof robj.ilsevent != 'undefined') {
+ if (!s) s = 'Error deleting these records:\n';
+ s += 'Record #' + record_ids[i] + ' : ' + robj.textcode + ' : ' + robj.desc + '\n';
+ }
+ }
+ if (s) { alert(s); } else { alert('Records deleted.'); }
+
+ obj.render_pending_records(); // FIXME -- need a generic refresh for lists
+ setTimeout(
+ function() {
+ JSAN.use('util.widgets');
+ util.widgets.dispatch('change_bucket',obj.controller.view.bucket_menulist);
+ }, 0
+ );
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('Records were not likely deleted.',E);
+ }
+
+ }
+ ],
+
'cmd_broken' : [
['command'],
function() { alert('Not Yet Implemented'); }
Modified: branches/rel_1_2/Open-ILS/xul/staff_client/server/patron/hold_notices.xul
===================================================================
--- branches/rel_1_2/Open-ILS/xul/staff_client/server/patron/hold_notices.xul 2007-07-16 20:12:03 UTC (rev 7555)
+++ branches/rel_1_2/Open-ILS/xul/staff_client/server/patron/hold_notices.xul 2007-07-16 20:14:11 UTC (rev 7556)
@@ -195,7 +195,7 @@
//g.data.init({'via':'stash'});
//g.data.temp_notification_xml = xml; g.data.stash('temp_notification_xml');
JSAN.use('util.window'); var win = new util.window();
- var fancy_prompt_data = window.open(
+ var fancy_prompt_data = win.open(
urls.XUL_FANCY_PROMPT,
//+ '?xml_in_stash=temp_notification_xml'
//+ '&focus=' + window.escape('method')
More information about the open-ils-commits
mailing list