<class id="vms" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::match_set" oils_persist:tablename="vandelay.match_set" reporter:label="Record Matching Definition Set">
<fields oils_persist:primary="id" oils_persist:sequence="vandelay.match_set_id_seq">
- <field reporter:label="Match Set ID" name="id" reporter:datatype="id"/>
+ <field reporter:label="Match Set ID" name="id" reporter:datatype="id" reporter:selector="name"/>
<field reporter:label="Name" name="name" reporter:datatype="text"/>
<field reporter:label="Owning Library" name="owner" reporter:datatype="link"/>
<field reporter:label="Match Set Type" name="mtype" reporter:datatype="text"/>
--- /dev/null
+<tr>
+ <td>[% l('Upload to Queue') %]</td>
+ <td><div id='acq_vl:existing_queue'></div></td>
+ <td>
+ <span>[% l('Or create a new queue') %]</span>
+ <input dojoType='dijit.form.TextBox' id='acq_vl:queue_name' size='32'></input>
+ </td>
+</tr>
+<tr>
+ <td>[% l('Record Match Set') %]</td>
+ <td><div id='acq_vl:match_set'></div></td>
+</tr>
+<tr>
+ <td>[% l('Merge Profile') %]</td>
+ <td><div id='acq_vl:merge_profile'></div></td>
+</tr>
+<tr>
+ <td>[% l('Import Non-Matching Records') %]</td>
+ <td><input dojoType='dijit.form.CheckBox' id='acq_vl:import_no_match'></input></td>
+ <td><span style='padding-right:10px;'>[% l('Record Source') %]</span> <div id='acq_vl:bib_source'></div></td>
+</tr>
+<tr>
+ <td>[% l('Merge On Exact Match (901c)') %]</td>
+ <td><input dojoType='dijit.form.CheckBox' id='acq_vl:auto_overlay_exact'></input></td>
+</tr>
+<tr>
+ <td>[% l('Merge On Single Match') %]</td>
+ <td><input dojoType='dijit.form.CheckBox' id='acq_vl:auto_overlay_1match'></input></td>
+</tr>
+<tr>
+ <td>[% l('Merge On Best Match') %]</td>
+ <td><input dojoType='dijit.form.CheckBox' id='acq_vl:auto_overlay_best_match'></input></td>
+</tr>
+<tr>
+ <td>[% l('Best/Single Match Minimum Quality Ratio') %]</td>
+ <td colspan='4'>
+ <input style='width:3em' value='0.0' id='acq_vl:match_quality_ratio' dojoType='dijit.form.TextBox'/>
+ <span style='padding-left: 10px; font-size:90%'>[% l('New Record Quality / Quality of Best Match') %]</span>
+ </td>
+</tr>
+<tr>
+ <td>[% l('Insufficient Quality Fall-Through Profile') %]</td>
+ <td><div id='acq_vl:fall_through_merge_profile'></div></td>
+</tr>
+
<tr>
<td>Create Purchase Order</td>
<td>
- <input dojoType='dijit.form.CheckBox' name='create_po'></input>
+ <input dojoType='dijit.form.CheckBox' jsId='acqPlUploadCreatePo'></input>
</td>
</tr>
<tr>
<td>Activate Purchase Order</td>
<td>
- <input dojoType='dijit.form.CheckBox' name='activate_po'></input>
- </td>
- </tr>
- <tr>
- <!-- XXX CHECK IMPORT PERMS TO ENABLE -->
- <td>Load Bibs and Items into the ILS</td>
- <td>
- <input dojoType='dijit.form.CheckBox' name='create_assets'></input>
+ <input dojoType='dijit.form.CheckBox' jsId='acqPlUploadActivatePo'></input>
</td>
</tr>
<tr>
<select jsId='acqPlUploadPlSelector' dojoType='dijit.form.ComboBox'></select>
</td>
</tr>
+
+ <tr><td colspan='2'><hr/></td></tr>
+ [% INCLUDE 'acq/common/vlagent.tt2' %]
+ <tr><td colspan='2'><hr/></td></tr>
+
<tr>
- <td>Records File</td>
- <td><input size='36' type="file" name="marc_upload"></input></td>
- </tr>
- <tr>
- <td align='center' colspan='2'>
- <button dojoType="dijit.form.Button" onClick="acqUploadRecords()">Upload</button>
+ <td colspan='5'>
+ <span id="vl-file-label">[% l('File to Upload:') %]</span>
+ <input size='48' style='border:1px solid #888;' type="file" name="marc_upload"/>
+ <span style='margin-left:10px;'><button dojoType="dijit.form.Button" onclick="acqUploadRecords()">[% l('Upload') %]</button></span>
</td>
</tr>
+
</tbody>
</table>
<table class='oils-generic-table'>
<tbody>
<tr>
+ <td>[% l('Vandelay Records Queued') %]</td>
+ <td><span id='acq-pl-upload-vqbr-processed'>0</span></td>
+ </tr>
+ <tr>
<td>Lineitems Processed</td>
<td><span id='acq-pl-upload-li-processed'>0</span></td>
</tr>
<td><span id='acq-pl-upload-debits-processed'>0</span></td>
</tr>
<tr>
- <td>Bib Records Imported</td>
+ <td>[% l('Bib Records Merged/Created') %]</td>
<td><span id='acq-pl-upload-bibs-processed'>0</span></td>
</tr>
<tr>
- <td>Bib Records Indexed</td>
- <td><span id='acq-pl-upload-indexed-processed'>0</span></td>
- </tr>
- <tr>
<td>Copies Created</td>
<td><span id='acq-pl-upload-copies-processed'>0</span></td>
</tr>
<tr><td colspan='2'>Upload Complete!</td></tr>
<tr><td colspan='2'><a id='acq-pl-upload-complete-po'>View Purchase Order</a></td></tr>
<tr><td colspan='2'><a id='acq-pl-upload-complete-pl'>View Selection List</a></td></tr>
+ <tr><td colspan='2'><a id='acq-pl-upload-complete-q'></a></td></tr>
</tbody>
</table>
</div>
</div>
</form>
+<script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/acq/common/vlagent.js'> </script>
<script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/acq/picklist/upload.js'> </script>
[% END %]
--- /dev/null
+dojo.require('openils.widget.AutoFieldWidget');
+
+function VLAgent(args) {
+ args = args || {};
+ for (var key in args) {
+ this[key] = args[key];
+ }
+
+ this.widgets = [
+ {key : 'import_no_match'},
+ {key : 'auto_overlay_exact'},
+ {key : 'auto_overlay_1match'},
+ {key : 'auto_overlay_best_match'},
+ {key : 'match_quality_ratio'},
+ {key : 'queue_name'},
+ {key : 'match_set', cls : 'vms'},
+ {key : 'bib_source', cls : 'cbs'},
+ {key : 'merge_profile', cls : 'vmp'},
+ {key : 'fall_through_merge_profile', cls : 'vmp'},
+ {key : 'existing_queue', cls : 'vbq'}
+ ];
+
+ this.init = function() {
+ var self = this;
+
+ dojo.forEach(this.widgets,
+ function(widg) {
+ if (widg.cls) { // selectors
+
+ new openils.widget.AutoFieldWidget({
+ fmClass : widg.cls,
+ selfReference : true,
+ orgLimitPerms : [self.limitPerm || 'CREATE_PURCHASE_ORDER'],
+ parentNode : dojo.byId('acq_vl:' + widg.key)
+ }).build(function(dijit) {
+ widg.dijit = dijit;
+ });
+
+ } else { // bools
+ widg.dijit = dijit.byId('acq_vl:' + widg.key);
+ }
+ }
+ );
+ }
+
+ this.values = function() {
+ var values = {};
+ dojo.forEach(this.widgets,
+ function(widg) {
+ values[widg.key] = widg.dijit.attr('value');
+ }
+ );
+ return values;
+ }
+}
var VANDELAY_URL = '/vandelay-upload';
var providerWidget;
var orderAgencyWidget;
+var vlAgent;
function init() {
dojo.byId('acq-pl-upload-ses').value = openils.User.authtoken;
function(w) { orderAgencyWidget = w }
);
+ vlAgent = new VLAgent();
+ vlAgent.init();
+
fieldmapper.standardRequest(
['open-ils.acq', 'open-ils.acq.picklist.user.retrieve.atomic'],
{ async: true,
method: "post",
handleAs: "html",
form: dojo.byId('acq-pl-upload-form'),
- content : {
- picklist : args.picklist,
- provider : providerWidget.attr('value'),
- ordering_agency : orderAgencyWidget.attr('value')
- },
handle: function(data, ioArgs){
acqHandlePostUpload(data.documentElement.textContent);
}
function acqHandlePostUpload(key) {
+
+ var args = {
+ picklist : acqPlUploadPlSelector.attr('value'),
+ provider : providerWidget.attr('value'),
+ ordering_agency : orderAgencyWidget.attr('value'),
+ create_po : acqPlUploadCreatePo.attr('value'),
+ activate_po : acqPlUploadActivatePo.attr('value'),
+ vandelay : vlAgent.values()
+ };
+
fieldmapper.standardRequest(
['open-ils.acq', 'open-ils.acq.process_upload_records'],
{ async: true,
- params: [openils.User.authtoken, key],
+ params: [openils.User.authtoken, key, args],
onresponse : function(r) {
var resp = openils.Util.readResponse(r);
console.log(js2JSON(resp));
if(!resp) return;
+
+ dojo.byId('acq-pl-upload-vqbr-processed').innerHTML = resp.vqbr;
+ dojo.byId('acq-pl-upload-li-processed').innerHTML = resp.li;
+ dojo.byId('acq-pl-upload-lid-processed').innerHTML = resp.lid;
+ dojo.byId('acq-pl-upload-debits-processed').innerHTML = resp.debits_accrued;
+ dojo.byId('acq-pl-upload-bibs-processed').innerHTML = resp.bibs;
+ dojo.byId('acq-pl-upload-copies-processed').innerHTML = resp.copies;
+
if(resp.complete) {
openils.Util.hide('acq-pl-upload-complete-pl');
openils.Util.hide('acq-pl-upload-complete-po');
+ openils.Util.hide('acq-pl-upload-complete-q');
openils.Util.hide('acq-pl-upload-progress-bar');
openils.Util.show('acq-pl-upload-complete');
'href', oilsBasePath + '/acq/po/view/' + resp.purchase_order.id());
}
- } else {
- dojo.byId('acq-pl-upload-li-processed').innerHTML = resp.li;
- dojo.byId('acq-pl-upload-lid-processed').innerHTML = resp.lid;
- dojo.byId('acq-pl-upload-debits-processed').innerHTML = resp.debits_accrued;
- dojo.byId('acq-pl-upload-bibs-processed').innerHTML = resp.bibs;
- dojo.byId('acq-pl-upload-indexed-processed').innerHTML = resp.indexed;
- dojo.byId('acq-pl-upload-copies-processed').innerHTML = resp.copies;
+ if (resp.queue) {
+ link = dojo.byId('acq-pl-upload-complete-q');
+ openils.Util.show(link);
+ link.setAttribute('href', oilsBasePath + '/vandelay/vandelay?qtype=bib&qid=' + resp.queue.id());
+ link.innerHTML = resp.queue.name();
+ }
}
},
}