added an 'Add Brief Record' button to the PO interface, which is visible when there...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 21 Jul 2010 21:35:50 +0000 (21:35 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 21 Jul 2010 21:35:50 +0000 (21:35 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17006 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/acq/po/view_po.js
Open-ILS/web/templates/default/acq/po/view.tt2

index a9dd765..09e7862 100644 (file)
@@ -381,11 +381,13 @@ function init() {
     );
 
     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 @@ params: [openils.User.authtoken, {purchase_order:poId}, {flesh_attrs:true, flesh
             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');
             }
         }
     );
index 6ff5b21..d345af0 100644 (file)
     </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 %]