[open-ils-commits] r12850 - in trunk/Open-ILS/web: js/ui/default/acq/picklist templates/default/acq/picklist (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Apr 13 10:46:33 EDT 2009
Author: erickson
Date: 2009-04-13 10:46:31 -0400 (Mon, 13 Apr 2009)
New Revision: 12850
Modified:
trunk/Open-ILS/web/js/ui/default/acq/picklist/upload.js
trunk/Open-ILS/web/templates/default/acq/picklist/upload.tt2
Log:
added post-upload links to load the resulting PO and selection list
Modified: trunk/Open-ILS/web/js/ui/default/acq/picklist/upload.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/picklist/upload.js 2009-04-13 14:46:02 UTC (rev 12849)
+++ trunk/Open-ILS/web/js/ui/default/acq/picklist/upload.js 2009-04-13 14:46:31 UTC (rev 12850)
@@ -92,33 +92,38 @@
function acqHandlePostUpload(key) {
- console.log("UPLOADING");
fieldmapper.standardRequest(
['open-ils.acq', 'open-ils.acq.process_upload_records'],
{ async: true,
params: [openils.User.authtoken, key],
onresponse : function(r) {
- console.log("ON RESPONSE");
var resp = openils.Util.readResponse(r);
console.log(js2JSON(resp));
- if(resp) {
- if(resp.complete) {
- return; /* XXX */
- if(resp.picklist) {
- location.href = location.href + '/../view/' + resp.picklist.id();
- } else {
- location.href = location.href + '/../../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;
+ if(!resp) return;
+ 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-progress-bar');
+ openils.Util.show('acq-pl-upload-complete');
+
+ if(resp.picklist) {
+ openils.Util.show('acq-pl-upload-complete-pl');
+ dojo.byId('acq-pl-upload-complete-pl').setAttribute(
+ 'href', location.href + '/../view/' + resp.picklist.id());
+ }
+
+ if(resp.purchase_order) {
+ openils.Util.show('acq-pl-upload-complete-po');
+ dojo.byId('acq-pl-upload-complete-po').setAttribute(
+ 'href', location.href + '/../../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;
}
},
- oncomplete : function(r) {
- console.log("ON COMPLETE");
- }
}
);
}
Modified: trunk/Open-ILS/web/templates/default/acq/picklist/upload.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/picklist/upload.tt2 2009-04-13 14:46:02 UTC (rev 12849)
+++ trunk/Open-ILS/web/templates/default/acq/picklist/upload.tt2 2009-04-13 14:46:31 UTC (rev 12850)
@@ -47,24 +47,33 @@
<br/>
<br/>
<div id="acq-pl-upload-progress" class='hidden'>
- <div dojoType="dijit.ProgressBar" style="width:300px" indeterminate="true"></div>
+ <div id='acq-pl-upload-progress-bar'>
+ <div dojoType="dijit.ProgressBar" style="width:300px" indeterminate="true"></div>
+ </div>
<div>
<br/>
<span>Processing...</span>
<br/>
<table class='oils-generic-table'>
- <tr>
- <td>Lineitems Processed</td>
- <td><span id='acq-pl-upload-li-processed'></span></td>
- </tr>
- <tr>
- <td>Items Processed</td>
- <td><span id='acq-pl-upload-lid-processed'></span></td>
- </tr>
- <tr>
- <td>Debits Encumbered</td>
- <td><span id='acq-pl-upload-debits-processed'></span></td>
- </tr>
+ <tbody>
+ <tr>
+ <td>Lineitems Processed</td>
+ <td><span id='acq-pl-upload-li-processed'></span></td>
+ </tr>
+ <tr>
+ <td>Items Processed</td>
+ <td><span id='acq-pl-upload-lid-processed'></span></td>
+ </tr>
+ <tr>
+ <td>Debits Encumbered</td>
+ <td><span id='acq-pl-upload-debits-processed'></span></td>
+ </tr>
+ </tbody>
+ <tbody id='acq-pl-upload-complete' class='hidden'>
+ <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>
+ </tbody>
</table>
</div>
</div>
More information about the open-ils-commits
mailing list