[open-ils-commits] r16345 - in trunk/Open-ILS/web: js/ui/default/vandelay templates/default/vandelay/inc (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Apr 29 11:53:38 EDT 2010
Author: erickson
Date: 2010-04-29 11:53:35 -0400 (Thu, 29 Apr 2010)
New Revision: 16345
Modified:
trunk/Open-ILS/web/js/ui/default/vandelay/vandelay.js
trunk/Open-ILS/web/templates/default/vandelay/inc/queue.tt2
Log:
added support for selecting merge/overlay options during import of already queued records, same as main upload page
Modified: trunk/Open-ILS/web/js/ui/default/vandelay/vandelay.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/vandelay/vandelay.js 2010-04-29 15:14:20 UTC (rev 16344)
+++ trunk/Open-ILS/web/js/ui/default/vandelay/vandelay.js 2010-04-29 15:53:35 UTC (rev 16345)
@@ -109,6 +109,12 @@
vlUploadMergeProfile.searchAttr = 'name';
vlUploadMergeProfile.startup();
+ vlUploadMergeProfile2.store = new dojo.data.ItemFileReadStore({data:fieldmapper.vmp.toStoreData(profiles)});
+ vlUploadMergeProfile2.labelAttr = 'name';
+ vlUploadMergeProfile2.searchAttr = 'name';
+ vlUploadMergeProfile2.startup();
+
+
// Fetch the bib and authority attribute definitions
vlFetchBibAttrDefs(function () { checkInitDone(); });
vlFetchAuthAttrDefs(function () { checkInitDone(); });
@@ -793,6 +799,49 @@
}
);
}
+
+function vlHandleQueueItemsAction(action) {
+
+ dojo.connect(
+ queueItemsImportCancelButton,
+ 'onClick',
+ function() {
+ queueItemsImportDialog.hide();
+ }
+ );
+
+ dojo.connect(
+ queueItemsImportGoButton,
+ 'onClick',
+ function() {
+ queueItemsImportDialog.hide();
+
+ // hack to set the widgets the import funcs will be looking at. Reset them below.
+ vlUploadQueueAutoImport.attr('value', vlUploadQueueAutoImport2.attr('value'));
+ vlUploadQueueAutoOverlayExact.attr('value', vlUploadQueueAutoOverlayExact2.attr('value'));
+ vlUploadQueueAutoOverlay1Match.attr('value', vlUploadQueueAutoOverlay1Match2.attr('value'));
+ vlUploadMergeProfile.attr('value', vlUploadMergeProfile2.attr('value'));
+
+ if(action == 'import') {
+ vlImportSelectedRecords();
+ } else if(action == 'import_all') {
+ vlImportAllRecords();
+ }
+
+ // reset the widgets to prevent accidental future actions
+ vlUploadQueueAutoImport.attr('value', false);
+ vlUploadQueueAutoImport2.attr('value', false);
+ vlUploadQueueAutoOverlayExact.attr('value', false);
+ vlUploadQueueAutoOverlayExact2.attr('value', false);
+ vlUploadQueueAutoOverlay1Match.attr('value', false);
+ vlUploadQueueAutoOverlay1Match2.attr('value', false);
+ vlUploadMergeProfile.attr('value', '');
+ vlUploadMergeProfile2.attr('value', '');
+ }
+ );
+
+ queueItemsImportDialog.show();
+}
function vlImportSelectedRecords() {
@@ -808,10 +857,27 @@
}
}
+ var options = {overlay_map : currentOverlayRecordsMap};
+
+ if(vlUploadQueueAutoOverlayExact.checked) {
+ options.auto_overlay_exact = true;
+ vlUploadQueueAutoOverlayExact.checked = false;
+ }
+
+ if(vlUploadQueueAutoOverlay1Match.checked) {
+ options.auto_overlay_1match = true;
+ vlUploadQueueAutoOverlay1Match.checked = false;
+ }
+
+ var profile = vlUploadMergeProfile.attr('value');
+ if(profile != null && profile != '') {
+ options.merge_profile = profile;
+ }
+
fieldmapper.standardRequest(
['open-ils.vandelay', 'open-ils.vandelay.'+currentType+'_record.list.import'],
{ async: true,
- params: [authtoken, records, {overlay_map:currentOverlayRecordsMap}],
+ params: [authtoken, records, options],
onresponse: function(r) {
var resp = r.recv().content();
if(e = openils.Event.parse(resp))
@@ -849,7 +915,6 @@
options.auto_overlay_1match = true;
vlUploadQueueAutoOverlay1Match.checked = false;
}
-
var profile = vlUploadMergeProfile.attr('value');
if(profile != null && profile != '') {
Modified: trunk/Open-ILS/web/templates/default/vandelay/inc/queue.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/vandelay/inc/queue.tt2 2010-04-29 15:14:20 UTC (rev 16344)
+++ trunk/Open-ILS/web/templates/default/vandelay/inc/queue.tt2 2010-04-29 15:53:35 UTC (rev 16345)
@@ -14,6 +14,48 @@
<br/>
+<div jsId='queueItemsImportDialog' dojoType="dijit.Dialog" title="Import Items">
+ <div dojoType="dijit.layout.ContentPane">
+ <table class='form_table'>
+ <tbody>
+ <tr>
+ <td>&vandelay.auto.import.noncolliding;</td>
+ <td colspan='4'>
+ <input jsId='vlUploadQueueAutoImport2' dojoType='dijit.form.CheckBox'/>
+ </td>
+ </tr>
+ <tr>
+ <td>&vandelay.auto.import.auto_overlay_exact;</td>
+ <td colspan='4'>
+ <input jsId='vlUploadQueueAutoOverlayExact2' dojoType='dijit.form.CheckBox'/>
+ </td>
+ </tr>
+ <tr>
+ <td>&vandelay.auto.import.auto_overlay_1match;</td>
+ <td colspan='4'>
+ <input jsId='vlUploadQueueAutoOverlay1Match2' dojoType='dijit.form.CheckBox'/>
+ </td>
+ </tr>
+ <tr>
+ <td>&vandelay.auto.import.merge_profile;</td>
+ <td colspan='4'>
+ <div jsId='vlUploadMergeProfile2'
+ dojoType='dijit.form.FilteringSelect' required='false' labelAttr='name' searchAttr='name'/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <button dojoType='dijit.form.Button' jsId='queueItemsImportCancelButton'>Cancel</button>
+ </td>
+ <td>
+ <button dojoType='dijit.form.Button' jsId='queueItemsImportGoButton'>Import</button>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+</div>
+
<!-- queue grid navigation row -->
<div dojoType="dijit.layout.ContentPane" layoutAlign='client'>
@@ -30,8 +72,8 @@
var sel = dojo.byId('vl-queue-actions-selector');
sel.onchange = function(evt) {
switch(openils.Util.selectorValue(evt.target)) {
- case 'import': vlImportSelectedRecords(); break;;
- case 'import_all': vlImportAllRecords(); break;;
+ case 'import': vlHandleQueueItemsAction('import'); break;;
+ case 'import_all': vlHandleQueueItemsAction('import_all'); break;;
case 'delete_queue':
if(confirm('&vandelay.sure.to.delete.queue;')) {
vlDeleteQueue(currentType, currentQueueId,
More information about the open-ils-commits
mailing list