LP#ll75400 No Perm message added
authorLiam Whalen <liam.whalen@bc.libraries.coop>
Fri, 6 Nov 2015 14:51:16 +0000 (06:51 -0800)
committerChris Sharp <csharp@georgialibraries.org>
Tue, 13 Sep 2016 12:55:40 +0000 (08:55 -0400)
Added a message to alert the user when they do not have a permission to
override an over allocation.

Signed-off-by: Liam Whalen <liam.whalen@bc.libraries.coop>
Open-ILS/src/templates/acq/funding_source/over_allocate_dialog.tt2
Open-ILS/web/js/ui/default/acq/financial/view_funding_source.js

index c644c32..82b936d 100644 (file)
@@ -1,5 +1,6 @@
 <div dojoType="dijit.Dialog" jsId='oilsFSOverAllocateDialog' style='display:none;'>
   <p>[% l('You are attempting to allocate more money than is available in the funding source.') %]</p>
+  <table><tr>
     <td>
       <button jsId='oilsFSOverAllocateContinue' 
         dojoType='dijit.form.Button'>[% l('Ok') %]</button>
   </tr></table>
 </div>
 
+<div dojoType="dijit.Dialog" jsId='oilsFSNoPermDialog' style='display:none;'>
+  <p>[% l('You do not have permission to override this allocation. You need the ACQ_OVERRIDE_OVER_ALLOCATION permission.') %]</p>
+    <table><td>
+      <button jsId='oilsFSNoPermOk' 
+        dojoType='dijit.form.Button'>[% l('Ok') %]</button>
+    </td>
+  </tr></table>
+</div>
index c505041..e9be908 100644 (file)
@@ -77,10 +77,19 @@ function applyFSAllocation(fields) {
             );
             if(!resp[0]) { 
                 doAllocation(fields);
+            } else {
+                oilsFSNoPermDialog.show();
             }
+
         }
     );
 
+    dojo.connect(oilsFSNoPermOk, 'onClick', 
+        function() {
+            oilsFSNoPermDialog.hide();
+        }
+    );
+    
     if(fields.amount > balance) {
         oilsFSOverAllocateDialog.show();
     } else {