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(); });
}
);
}
+
+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() {
}
}
+ 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))
options.auto_overlay_1match = true;
vlUploadQueueAutoOverlay1Match.checked = false;
}
-
var profile = vlUploadMergeProfile.attr('value');
if(profile != null && profile != '') {
<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'>
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,