[open-ils-commits] r12158 - in trunk/Open-ILS/web: js/ui/default/conify/global js/ui/default/conify/global/acq templates/default/conify/global/acq (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Feb 12 12:01:28 EST 2009
Author: erickson
Date: 2009-02-12 12:01:20 -0500 (Thu, 12 Feb 2009)
New Revision: 12158
Added:
trunk/Open-ILS/web/js/ui/default/conify/global/acq/
trunk/Open-ILS/web/js/ui/default/conify/global/acq/provider.js
trunk/Open-ILS/web/templates/default/conify/global/acq/provider.tt2
Log:
new provider ui, based on autogrid and moved into conify (editing static data). leaving other in place until all functionality is ported over
Added: trunk/Open-ILS/web/js/ui/default/conify/global/acq/provider.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/conify/global/acq/provider.js (rev 0)
+++ trunk/Open-ILS/web/js/ui/default/conify/global/acq/provider.js 2009-02-12 17:01:20 UTC (rev 12158)
@@ -0,0 +1,39 @@
+dojo.require('openils.widget.AutoGrid');
+dojo.require('openils.PermaCrud');
+var provider;
+
+function draw() {
+ if(providerId) {
+ drawProviderSummary();
+ } else {
+ openils.Util.removeCSSClass(dojo.byId('provider-list-div'), 'hidden');
+ pListGrid.onPostCreate = function(fmObject) {
+ location.href = location.href + '/' + fmObject.id();
+ }
+ pListGrid.loadAll({order_by:{acqpro : 'name'}});
+ }
+}
+openils.Util.addOnLoad(draw);
+
+function drawProviderSummary() {
+ openils.Util.removeCSSClass(dojo.byId('provider-details-div'), 'hidden');
+ openils.Util.addCSSClass(dojo.byId('provider-list-div'), 'hidden');
+ var pcrud = new openils.PermaCrud();
+ pcrud.retrieve('acqpro', providerId, {
+ oncomplete : function(r) {
+ provider = openils.Util.readResponse(r);
+ var pane = new openils.widget.EditPane({fmObject:provider, readOnly:true}, dojo.byId('provider-summary-pane'));
+ pane.startup();
+
+ }
+ });
+}
+
+function getProviderName(rowIndex, item) {
+ if(!item) return '';
+ return '<a href="' + location.href + '/' +
+ this.grid.store.getValue(item, 'id') + '">' +
+ this.grid.store.getValue(item, 'name') + '</a>';
+}
+
+
Added: trunk/Open-ILS/web/templates/default/conify/global/acq/provider.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/acq/provider.tt2 (rev 0)
+++ trunk/Open-ILS/web/templates/default/conify/global/acq/provider.tt2 2009-02-12 17:01:20 UTC (rev 12158)
@@ -0,0 +1,30 @@
+[% WRAPPER default/base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/provider.js'> </script>
+<script> var providerId = '[% ctx.page_args.0 %]';</script>
+
+<div id='provider-list-div' class='hidden'>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div>Provider</div>
+ <div><button dojoType='dijit.form.Button' onClick='pListGrid.showCreateDialog()'>New</button></div>
+ </div>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'>
+ <table jsId="pListGrid"
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['id', 'name', 'code', 'owner', 'currency_type']"
+ defaultCellWidth='12'
+ query="{id: '*'}"
+ fmClass='acqpro'
+ editOnEnter='true'>
+ <thead>
+ <tr><th field='name' get='getProviderName'/></tr>
+ </thead>
+ </table>
+ </div>
+</div>
+<div id='provider-details-div' class='hidden'>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'>
+ <div id='provider-summary-pane'/>
+ </div>
+</div>
+[% END %]
+
More information about the open-ils-commits
mailing list