selector.setDisplayedValue('');
if(data[0])
selector.setValue(data[0].id());
+
+ var qInput = dijit.byId('vl-queue-name');
+
+ var selChange = function(val) {
+ console.log('selector onchange');
+ // user selected a queue from the selector; clear the input and
+ // set the item import profile already defined for the queue
+ var queue = allUserBibQueues.filter(function(q) { return (q.id() == val) })[0];
+ if(val) {
+ vlUploadQueueHoldingsImportProfile.attr('value', queue.item_attr_def() || '');
+ vlUploadQueueHoldingsImportProfile.attr('disabled', true);
+ } else {
+ vlUploadQueueHoldingsImportProfile.attr('value', '');
+ vlUploadQueueHoldingsImportProfile.attr('disabled', false);
+ }
+ dojo.disconnect(qInput._onchange);
+ qInput.attr('value', '');
+ qInput._onchange = dojo.connect(qInput, 'onChange', inputChange);
+ }
+
+ var inputChange = function(val) {
+ console.log('qinput onchange');
+ // user entered a new queue name. clear the selector
+ vlUploadQueueHoldingsImportProfile.attr('value', '');
+ vlUploadQueueHoldingsImportProfile.attr('disabled', false);
+ dojo.disconnect(selector._onchange);
+ selector.attr('value', '');
+ selector._onchange = dojo.connect(selector, 'onChange', selChange);
+ }
+
+ selector._onchange = dojo.connect(selector, 'onChange', selChange);
+ qInput._onchange = dojo.connect(qInput, 'onChange', inputChange);
}
function vlShowUploadForm() {
</td>
</tr>
<tr>
- <td>&vandelay.auto.import.noncolliding;</td>
- <td colspan='4'>
- <input jsId='vlUploadQueueAutoImport' dojoType='dijit.form.CheckBox'/>
+ <td>Holdings Import Profile</td>
+ <td>
+ <input jsId='vlUploadQueueHoldingsImportProfile'
+ dojoType='dijit.form.FilteringSelect' labelAttr='name' searchAttr='name'/>
</td>
</tr>
<tr>
- <td>&vandelay.auto.import.auto_overlay_exact;</td>
- <td colspan='4'>
- <input jsId='vlUploadQueueAutoOverlayExact' dojoType='dijit.form.CheckBox'/>
+ <td>&vandelay.import.bib_sources;</td>
+ <td>
+ <select name='bib_source' jsId='vlUploadSourceSelector'
+ dojoType='dijit.form.FilteringSelect' labelAttr='source' searchAttr='source'/>
</td>
</tr>
+ <tr><td colspan='2' style='margin-top:10px;border-bottom:1px solid #888;border-top:1px solid #888'><b>Import Actions</b></td></tr>
<tr>
- <td>&vandelay.auto.import.auto_overlay_1match;</td>
+ <td>&vandelay.auto.import.merge_profile;</td>
<td colspan='4'>
- <input jsId='vlUploadQueueAutoOverlay1Match' dojoType='dijit.form.CheckBox'/>
+ <div jsId='vlUploadMergeProfile' dojoType='dijit.form.FilteringSelect' required='false' labelAttr='name' searchAttr='name'/>
</td>
</tr>
<tr>
- <td>&vandelay.auto.import.merge_profile;</td>
+ <td>&vandelay.auto.import.noncolliding;</td>
<td colspan='4'>
- <div jsId='vlUploadMergeProfile' dojoType='dijit.form.FilteringSelect' required='false' labelAttr='name' searchAttr='name'/>
+ <input jsId='vlUploadQueueAutoImport' dojoType='dijit.form.CheckBox'/>
</td>
</tr>
<tr>
- <td>Holdings Import Profile</td>
- <td>
- <input jsId='vlUploadQueueHoldingsImportProfile'
- dojoType='dijit.form.FilteringSelect' labelAttr='name' searchAttr='name'/>
+ <td>&vandelay.auto.import.auto_overlay_exact;</td>
+ <td colspan='4'>
+ <input jsId='vlUploadQueueAutoOverlayExact' dojoType='dijit.form.CheckBox'/>
</td>
</tr>
<tr>
- <td>&vandelay.import.bib_sources;</td>
- <td>
- <select name='bib_source' jsId='vlUploadSourceSelector'
- dojoType='dijit.form.FilteringSelect' labelAttr='source' searchAttr='source'/>
+ <td>&vandelay.auto.import.auto_overlay_1match;</td>
+ <td colspan='4'>
+ <input jsId='vlUploadQueueAutoOverlay1Match' dojoType='dijit.form.CheckBox'/>
</td>
</tr>
+ <tr><td colspan='2' style='border-bottom:1px solid #888'></td></tr>
<tr>
- <td>
+ <td colspan='5'>
<span id="vl-file-label">&vandelay.file.to.upload;</span>
- </td>
- <td id='vl-input-td' colspan='4'>
<input size='48' type="file" name="marc_upload"/>
- </td>
- </tr>
- <tr>
- <td align='center' colspan='4'>
- <button dojoType="dijit.form.Button" onclick="batchUpload()">&vandelay.upload;</button>
+ <span style='margin-left:10px;'><button dojoType="dijit.form.Button" onclick="batchUpload()">&vandelay.upload;</button></span>
</td>
</tr>
</table>