Prevent years in "New Fund" dialog from being displayed with a comma separator
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 27 Jul 2010 21:34:43 +0000 (21:34 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 27 Jul 2010 21:34:43 +0000 (21:34 +0000)
Also limit to a seemingly reasonable range of 2000 - 2200 for the year

git-svn-id: svn://svn.open-ils.org/ILS/trunk@17042 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/templates/default/acq/financial/list_funds.tt2

index 7ac7971..cb653d9 100644 (file)
            showing tags */
         return link;
     }
+
+    function createNewFund() {
+        /* Set the display constraints before drawing the edit dialog;
+           introduce Y2K and Y2K2C problem */
+        lfGrid.overrideWidgetArgs = {year: { dijitArgs: {constraints : {min: 2000, max: 2200, pattern : '####'}}}};
+        lfGrid.showCreateDialog();
+    }
+
 </script>
 
 <table style='width:100%;'>
@@ -31,7 +39,7 @@
         <td style='text-align:left;font-size:130%;font-weight: bold;'>Funds</td>
         <td style='text-align:right;width:90%;'>
 
-            <button dojoType='dijit.form.Button' onClick='lfGrid.showCreateDialog()'>New Fund</button>
+            <button dojoType='dijit.form.Button' onClick='createNewFund()'>New Fund</button>
             <button dojoType='dijit.form.Button' onClick='lfGrid.deleteSelected()'>Delete Selected</button>
 
             <div dojoType="dijit.form.DropDownButton">