[open-ils-commits] r11376 - in trunk/Open-ILS/web: js/ui/default/acq/financial templates/default/acq/financial

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Dec 1 18:42:36 EST 2008


Author: erickson
Date: 2008-12-01 18:42:30 -0500 (Mon, 01 Dec 2008)
New Revision: 11376

Modified:
   trunk/Open-ILS/web/js/ui/default/acq/financial/list_currency_types.js
   trunk/Open-ILS/web/templates/default/acq/financial/list_currency_types.tt2
Log:
added create functionality

Modified: trunk/Open-ILS/web/js/ui/default/acq/financial/list_currency_types.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/financial/list_currency_types.js	2008-12-01 23:41:59 UTC (rev 11375)
+++ trunk/Open-ILS/web/js/ui/default/acq/financial/list_currency_types.js	2008-12-01 23:42:30 UTC (rev 11376)
@@ -21,5 +21,22 @@
     );
 }
 
+function createCT(args) {
+    if(!(args.code && args.label)) return;
+    var ct = new acqct();
+    ct.code(args.code);
+    ct.label(args.label);
+    fieldmapper.standardRequest(
+        ['open-ils.permacrud', 'open-ils.permacrud.create.acqct'],
+        {   async: true,
+            params: [openils.User.authtoken, ct],
+            oncomplete: function(r) {
+                if(new String(openils.Util.readResponse(r)) != '0')
+                    loadCTypesGrid();
+            }
+        }
+    );
+}
 
+
 openils.Util.addOnLoad(loadCTypesGrid);

Modified: trunk/Open-ILS/web/templates/default/acq/financial/list_currency_types.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/financial/list_currency_types.tt2	2008-12-01 23:41:59 UTC (rev 11375)
+++ trunk/Open-ILS/web/templates/default/acq/financial/list_currency_types.tt2	2008-12-01 23:42:30 UTC (rev 11376)
@@ -6,29 +6,18 @@
 <!-- load the page-specific JS -->
 <script src='[% ctx.media_prefix %]/js/ui/default/acq/financial/list_currency_types.js'> </script>
 
-<script type="text/javascript">
-    function createCT(fields) {
-        alert('create: ' + fields.code);
-    }
-</script>
-
 <div class='oils-acq-actions-div'>
     <div dojoType="dijit.form.DropDownButton">
+        <!-- TODO: add perm and disable button if necessary XXX -->
         <span>New Currency Type</span>
-
         <div dojoType="dijit.TooltipDialog" execute="createCT(arguments[0]);">
-            <script type='dojo/connect' event='onOpen'>
-                // XXX check perm and disable button if necessary ...
-                //globalUser.buildPermOrgSelector('ADMIN_CURRENCY_TYPE', currencyTypeOwnerSelect);
-            </script>
-
             <table class='dijitTooltipTable'>
                 <tr>
                     <td><label for="label">Label: </label></td>
                     <td><input dojoType="dijit.form.TextBox" name="label"/></td>
                 </tr>
                 <tr>
-                    <td><label for="name">Code: </label></td>
+                    <td><label for="code">Code: </label></td>
                     <td><input dojoType="dijit.form.TextBox" name="code"/></td>
                 </tr>
                 <tr>



More information about the open-ils-commits mailing list