[open-ils-commits] r9638 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
controllers/acq public/oils/media/ui_js/oils/default/acq/financial
templates/oils/default/acq/financial
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon May 19 12:19:30 EDT 2008
Author: erickson
Date: 2008-05-19 12:19:28 -0400 (Mon, 19 May 2008)
New Revision: 9638
Added:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/currency_type.py
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_currency_types.js
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_currency_types.html
Log:
added initial currency type config interface
Added: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/currency_type.py
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/currency_type.py (rev 0)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/currency_type.py 2008-05-19 16:19:28 UTC (rev 9638)
@@ -0,0 +1,8 @@
+from oilsweb.lib.base import *
+from oilsweb.lib.request import RequestMgr
+
+class CurrencyTypeController(BaseController):
+ def list(self, **kwargs):
+ r = RequestMgr()
+ return r.render('acq/financial/list_currency_types.html')
+
Added: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_currency_types.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_currency_types.js (rev 0)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/financial/list_currency_types.js 2008-05-19 16:19:28 UTC (rev 9638)
@@ -0,0 +1,24 @@
+dojo.require("dijit.Dialog");
+dojo.require('dijit.form.Button');
+dojo.require('dojox.grid.Grid');
+dojo.require('openils.acq.CurrencyType');
+dojo.require('openils.Event');
+dojo.require('fieldmapper.dojoData');
+
+var currencyTypes = [];
+
+function loadCTypesGrid() {
+ openils.acq.CurrencyType.fetchAll(
+ function(types) {
+ var store = new dojo.data.ItemFileReadStore(
+ {data:acqct.toStoreData(types, 'code', {identifier:'code'})});
+ var model = new dojox.grid.data.DojoData(null, store,
+ {rowsPerPage: 20, clientSort: true, query:{code:'*'}});
+ currencyTypeListGrid.setModel(model);
+ currencyTypeListGrid.update();
+ }
+ );
+}
+
+
+dojo.addOnLoad(loadCTypesGrid);
Added: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_currency_types.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_currency_types.html (rev 0)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_currency_types.html 2008-05-19 16:19:28 UTC (rev 9638)
@@ -0,0 +1,63 @@
+# -*- coding: utf-8 -*-
+<%inherit file='../base.html'/>
+<%def name="page_title()">${_('Currency Types')}</%def>
+<%def name="block_content()">
+
+<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='${c.oils.core.media_prefix.value}/ui_js/oils/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">
+ <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><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>
+ var currencyTypeListGridStructure = [{
+ cells : [[
+ {name: '${_("Code")}', field:'code'},
+ {name: '${_("Label")}', field:'label', width:'auto'}
+ ]]
+ }];
+</script>
+<div jsId='currencyTypeListGrid' dojoType="dojox.Grid" structure='currencyTypeListGridStructure'></div>
+
+</%def>
More information about the open-ils-commits
mailing list