[open-ils-commits] r17006 - in trunk/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
Wed Jul 21 17:35:56 EDT 2010


Author: erickson
Date: 2010-07-21 17:35:50 -0400 (Wed, 21 Jul 2010)
New Revision: 17006

Modified:
   trunk/Open-ILS/web/js/ui/default/acq/po/view_po.js
   trunk/Open-ILS/web/templates/default/acq/po/view.tt2
Log:
added an 'Add Brief Record' button to the PO interface, which is visible when there are no lineitems on an existing PO.

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	2010-07-21 21:17:00 UTC (rev 17005)
+++ trunk/Open-ILS/web/js/ui/default/acq/po/view_po.js	2010-07-21 21:35:50 UTC (rev 17006)
@@ -381,11 +381,13 @@
     );
 
     var totalEstimated = 0;
+    var zeroLi = true;
     fieldmapper.standardRequest(
         ['open-ils.acq', 'open-ils.acq.lineitem.search'],
         {   async: true,
 params: [openils.User.authtoken, {purchase_order:poId}, {flesh_attrs:true, flesh_notes:true, flesh_cancel_reason:true}],
             onresponse: function(r) {
+                zeroLi = false;
                 liTable.show('list');
                 var li = openils.Util.readResponse(r);
                 // TODO: Add po_item's to total estimated amount
@@ -396,6 +398,7 @@
             oncomplete : function() {
                 dojo.byId("acq-po-view-total-estimated").innerHTML = totalEstimated.toFixed(2);
                 if (liFocus) liTable.drawCopies(liFocus);
+                if(zeroLi) openils.Util.show('acq-po-no-lineitems');
             }
         }
     );

Modified: trunk/Open-ILS/web/templates/default/acq/po/view.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/po/view.tt2	2010-07-21 21:17:00 UTC (rev 17005)
+++ trunk/Open-ILS/web/templates/default/acq/po/view.tt2	2010-07-21 21:35:50 UTC (rev 17006)
@@ -118,6 +118,11 @@
     </script>
     [% INCLUDE 'default/acq/common/li_table.tt2' %]
     [% INCLUDE "default/acq/common/notes.tt2" which = "Po" %]
+    <div class='hidden' id='acq-po-no-lineitems'>
+        <button type='dijit.form.Button' onclick='location.href = oilsBasePath + "/acq/picklist/brief_record?po=" + poId'>
+            Add Brief Record
+        </button>
+    </div>
     [% INCLUDE "default/acq/po/item_table.tt2" %]
 </div>
 [% END %]



More information about the open-ils-commits mailing list