[open-ils-commits] r12797 - in trunk/Open-ILS/web: js/ui/default/acq/common js/ui/default/acq/po templates/default/acq/common (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Apr 6 11:22:42 EDT 2009


Author: erickson
Date: 2009-04-06 11:22:40 -0400 (Mon, 06 Apr 2009)
New Revision: 12797

Modified:
   trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
   trunk/Open-ILS/web/js/ui/default/acq/po/view_po.js
   trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
Log:
started plugging in PO printing, at least to HTML.  this assumes a format.po.html trigger hook

Modified: trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js	2009-04-06 14:43:55 UTC (rev 12796)
+++ trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js	2009-04-06 15:22:40 UTC (rev 12797)
@@ -9,6 +9,7 @@
 dojo.require('openils.acq.Picklist');
 dojo.require('openils.widget.AutoFieldWidget');
 dojo.require('dojo.data.ItemFileReadStore');
+dojo.require('openils.widget.ProgressDialog');
 
 function AcqLiTable() {
 
@@ -442,9 +443,33 @@
                 this._loadPLSelect();
                 acqLitSavePlDialog.show();
                 break;
+
+            case 'print_po':
+                this.printPO();
+                break;
         }
     }
 
+    this.printPO = function() {
+        if(!this.isPO) return;
+        progressDialog.show();
+        console.log("printing PO " + this.isPO);
+        fieldmapper.standardRequest(
+            ['open-ils.acq', 'open-ils.acq.purchase_order.format'],
+            {   async: true,
+                params: [this.authtoken, this.isPO, 'html'],
+                oncomplete: function(r) {
+                    progressDialog.hide();
+                    var evt = openils.Util.readResponse(r);
+                    if(evt && evt.template_output()) {
+                        win = window.open('','', 'resizable,width=700,height=500,scrollbars=1');
+                        win.document.body.innerHTML = evt.template_output().data();
+                    }
+                }
+            }
+        );
+    }
+
     this._createPO = function(fields) {
         this.show('acq-lit-create-po-progress');
         var po = new fieldmapper.acqpo();

Modified: trunk/Open-ILS/web/js/ui/default/acq/po/view_po.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/po/view_po.js	2009-04-06 14:43:55 UTC (rev 12796)
+++ trunk/Open-ILS/web/js/ui/default/acq/po/view_po.js	2009-04-06 15:22:40 UTC (rev 12797)
@@ -8,7 +8,7 @@
 function init() {
     liTable = new AcqLiTable();
     liTable.reset();
-    liTable.isPO = true;
+    liTable.isPO = poId;
 
     fieldmapper.standardRequest(
         ['open-ils.acq', 'open-ils.acq.purchase_order.retrieve'],

Modified: trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2	2009-04-06 14:43:55 UTC (rev 12796)
+++ trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2	2009-04-06 15:22:40 UTC (rev 12797)
@@ -252,5 +252,7 @@
         </table>
     </div>
 
+    <div class='hidden'><div dojoType='openils.widget.ProgressDialog' jsId='progressDialog' indeterminate='true'/></div>
+
 </div>
 



More information about the open-ils-commits mailing list