[open-ils-commits] r7552 - in trunk/Open-ILS/xul/staff_client:
chrome/content/main server/cat
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Jul 14 23:09:53 EDT 2007
Author: phasefx
Date: 2007-07-14 23:04:42 -0400 (Sat, 14 Jul 2007)
New Revision: 7552
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js
trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.xul
trunk/Open-ILS/xul/staff_client/server/cat/record_buckets_overlay.xul
Log:
option for batch record deletion in bucket interface
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js 2007-07-15 02:41:24 UTC (rev 7551)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js 2007-07-15 03:04:42 UTC (rev 7552)
@@ -110,6 +110,7 @@
'FM_BRE_RETRIEVE_VIA_ID' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record.metadata.retrieve', 'secure' : false },
'FM_BRE_ID_SEARCH_VIA_BARCODE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.find_by_barcode', 'secure' : false },
'FM_BRE_ID_SEARCH_VIA_TCN' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.biblio.tcn', 'secure' : false },
+ 'FM_BRE_DELETE' : { 'app' : 'open-ils.cat', 'method' : 'open-ils.cat.biblio.record_entry.delete', 'secure' : false },
'FM_BRN_FROM_MARCXML' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.z3950.marcxml_to_brn', 'secure' : false },
'FM_CCS_RETRIEVE' : { 'app' : 'open-ils.search', 'method' : 'open-ils.search.config.copy_status.retrieve.all', 'secure' : false },
'FM_CIRC_DETAILS' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.fleshed.retrieve' },
Modified: trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js 2007-07-15 02:41:24 UTC (rev 7551)
+++ trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js 2007-07-15 03:04:42 UTC (rev 7552)
@@ -550,6 +550,81 @@
}
],
+
+ '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? (Select the "lead" record first)</description>';
+ top_xml += '<hbox><button id="lead" disabled="true" 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');
+ window.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 (obj.data.fancy_prompt_data == '') { 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: trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.xul 2007-07-15 02:41:24 UTC (rev 7551)
+++ trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.xul 2007-07-15 03:04:42 UTC (rev 7552)
@@ -93,6 +93,7 @@
<command id="cmd_record_buckets_reprint" />
<command id="cmd_record_buckets_done" />
<command id="cmd_merge_records" />
+ <command id="cmd_delete_records" />
<command id="cmd_sel_opac" />
</commandset>
Modified: trunk/Open-ILS/xul/staff_client/server/cat/record_buckets_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/record_buckets_overlay.xul 2007-07-15 02:41:24 UTC (rev 7551)
+++ trunk/Open-ILS/xul/staff_client/server/cat/record_buckets_overlay.xul 2007-07-15 03:04:42 UTC (rev 7552)
@@ -70,6 +70,7 @@
<hbox style="background: grey">
<vbox><spacer flex="1"/><label value="Batch:" style="font-weight: bold"/><spacer flex="1"/></vbox>
<button command="cmd_sel_opac" label="Show All in Catalog" accesskey="S"/>
+ <button id="record_buckets_delete_records" command="cmd_delete_records" label="Delete All Records"/>
<button id="record_buckets_merge_records" command="cmd_merge_records" label="Merge All Records"/>
</hbox>
</hbox>
More information about the open-ils-commits
mailing list