[open-ils-commits] r13960 - in branches/rel_1_6/Open-ILS/web: js/ui/default/acq/po templates/default/acq/po (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Sep 4 11:24:12 EDT 2009
Author: erickson
Date: 2009-09-04 11:24:09 -0400 (Fri, 04 Sep 2009)
New Revision: 13960
Modified:
branches/rel_1_6/Open-ILS/web/js/ui/default/acq/po/view_po.js
branches/rel_1_6/Open-ILS/web/templates/default/acq/po/view.tt2
Log:
expose PO ID and PO name. plugged in option to change the PO name
Modified: branches/rel_1_6/Open-ILS/web/js/ui/default/acq/po/view_po.js
===================================================================
--- branches/rel_1_6/Open-ILS/web/js/ui/default/acq/po/view_po.js 2009-09-04 15:23:54 UTC (rev 13959)
+++ branches/rel_1_6/Open-ILS/web/js/ui/default/acq/po/view_po.js 2009-09-04 15:24:09 UTC (rev 13960)
@@ -1,6 +1,7 @@
dojo.require('dijit.layout.ContentPane');
dojo.require('openils.User');
dojo.require('openils.Util');
+dojo.require('openils.PermaCrud');
var PO = null;
var liTable;
@@ -16,6 +17,8 @@
params: [openils.User.authtoken, poId, {flesh_price_summary:true, flesh_lineitem_count:true}],
oncomplete: function(r) {
PO = openils.Util.readResponse(r);
+ dojo.byId('acq-po-view-id').innerHTML = PO.id();
+ dojo.byId('acq-po-view-name').innerHTML = PO.name();
dojo.byId('acq-po-view-total-li').innerHTML = PO.lineitem_count();
dojo.byId('acq-po-view-total-enc').innerHTML = PO.amount_encumbered();
dojo.byId('acq-po-view-total-spent').innerHTML = PO.amount_spent();
@@ -35,4 +38,18 @@
);
}
+function updatePoName() {
+ var value = prompt('Enter new purchase order name:', PO.name()); // TODO i18n
+ if(!value || value == PO.name()) return;
+ PO.name(value);
+ var pcrud = new openils.PermaCrud();
+ pcrud.update(PO, {
+ oncomplete : function(r) {
+ var stat = openils.Util.readResponse(r);
+ if(stat)
+ dojo.byId('acq-po-view-name').innerHTML = value;
+ }
+ });
+}
+
openils.Util.addOnLoad(init);
Modified: branches/rel_1_6/Open-ILS/web/templates/default/acq/po/view.tt2
===================================================================
--- branches/rel_1_6/Open-ILS/web/templates/default/acq/po/view.tt2 2009-09-04 15:23:54 UTC (rev 13959)
+++ branches/rel_1_6/Open-ILS/web/templates/default/acq/po/view.tt2 2009-09-04 15:24:09 UTC (rev 13960)
@@ -7,6 +7,8 @@
Purchase Order
</div>
<table class='oils-generic-table'>
+ <tr><td>ID</td><td><a id='acq-po-view-id'/></td></tr>
+ <tr><td>Name</td><td><a id='acq-po-view-name' href='javascript:void(0);' onclick='updatePoName()'/></td></tr>
<tr><td>Total Lineitems</td><td><span id='acq-po-view-total-li'/></td></tr>
<tr><td>Total Encumbered</td><td>$<span id='acq-po-view-total-enc'/></td></tr>
<tr><td>Total Spent</td><td>$<span id='acq-po-view-total-spent'/></td></tr>
More information about the open-ils-commits
mailing list