[open-ils-commits] r12121 - in trunk/Open-ILS/web: js/ui/default/acq/financial templates/default/acq/financial templates/default/conify/global/acq (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Feb 9 13:51:27 EST 2009


Author: erickson
Date: 2009-02-09 13:51:24 -0500 (Mon, 09 Feb 2009)
New Revision: 12121

Added:
   trunk/Open-ILS/web/templates/default/conify/global/acq/currency_type.tt2
Removed:
   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:
moved currency type config into conify, using autogrid

Deleted: 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	2009-02-09 18:47:25 UTC (rev 12120)
+++ trunk/Open-ILS/web/js/ui/default/acq/financial/list_currency_types.js	2009-02-09 18:51:24 UTC (rev 12121)
@@ -1,49 +0,0 @@
-dojo.require("dijit.Dialog");
-dojo.require('dijit.form.Button');
-dojo.require('dojox.grid.DataGrid');
-dojo.require('dojo.data.ItemFileWriteStore');
-dojo.require('openils.acq.CurrencyType');
-dojo.require('openils.Event');
-dojo.require('openils.Util');
-dojo.require('fieldmapper.dojoData');
-
-var currencyTypes = [];
-
-function loadCTypesGrid() {
-    var store = new dojo.data.ItemFileWriteStore({data:acqct.initStoreData('code', {identifier:'code'})});
-    currencyTypeListGrid.setStore(store);
-    currencyTypeListGrid.render();
-
-    fieldmapper.standardRequest(
-        [ 'open-ils.acq', 'open-ils.acq.currency_type.all.retrieve'],
-        { async: true,
-          params: [openils.User.authtoken],
-          onresponse : function(r){
-                if(ct = openils.Util.readResponse(r)) {
-                    openils.acq.CurrencyType.cache[ct.code()] = ct;
-                    store.newItem(acqct.toStoreItem(ct));
-                }
-            }
-        }
-    );
-}
-
-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);

Deleted: trunk/Open-ILS/web/templates/default/acq/financial/list_currency_types.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/financial/list_currency_types.tt2	2009-02-09 18:47:25 UTC (rev 12120)
+++ trunk/Open-ILS/web/templates/default/acq/financial/list_currency_types.tt2	2009-02-09 18:51:24 UTC (rev 12121)
@@ -1,52 +0,0 @@
-[% WRAPPER 'default/base.tt2' %]
-<div id='oils-acq-list-header' class='container'>
-    <div id='oils-acq-list-header-label'>Currency Types</div>
-</div>
-
-<!-- load the page-specific JS -->
-<script src='[% ctx.media_prefix %]/js/ui/default/acq/financial/list_currency_types.js'> </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]);">
-            <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="code">Code: </label></td>
-                    <td><input dojoType="dijit.form.TextBox" name="code"/></td>
-                </tr>
-                <tr>
-                    <td colspan='2' align='center'>
-                        <button dojoType=dijit.form.Button type="submit">Create</button>
-                    </td>
-                </tr>
-            </table>
-        </div>
-    </div> 
-
-    <button dojoType="dijit.form.Button" onclick="deleteSelectedCT()">
-        Delete Selected
-    </button>
-</div>
-
-<!-- The main grid lives here -->
-</script> 
-<div dojoType="dijit.layout.ContentPane" layoutAlign="top"> 
-    <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'> 
-        <table jsId="currencyTypeListGrid" dojoType="dojox.grid.DataGrid" query="{code: '*'}" rowSelector='20px'> 
-            <thead> 
-                <tr> 
-                    <th field="code">Code</th> 
-                    <th field="label" width='auto'>Label</th> 
-                </tr> 
-            </thead> 
-        </table>     
-    </div> 
-</div> 
-
-[% END %]

Added: trunk/Open-ILS/web/templates/default/conify/global/acq/currency_type.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/acq/currency_type.tt2	                        (rev 0)
+++ trunk/Open-ILS/web/templates/default/conify/global/acq/currency_type.tt2	2009-02-09 18:51:24 UTC (rev 12121)
@@ -0,0 +1,26 @@
+[% WRAPPER default/base.tt2 %]
+<script>
+    dojo.require('openils.widget.AutoGrid');
+    openils.Util.addOnLoad(
+        function() { 
+            grid.loadAll({order_by:{acqct : 'code'}}); 
+        }
+    );
+</script>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+    <div>Currency Type</div>
+    <div><button dojoType='dijit.form.Button' onClick='grid.showCreateDialog()'>New</button></div>
+</div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'>
+    <table  jsId="grid" 
+            dojoType="openils.widget.AutoGrid" 
+            fieldOrder="['code', 'label']"
+            defaultCellWidth='12'
+            query="{code: '*'}" 
+            fmClass='acqct' 
+            editOnEnter='true'>
+    </table>
+</div>
+[% END %]
+
+



More information about the open-ils-commits mailing list