[open-ils-commits] r12624 - in trunk/Open-ILS/web: js/ui/default/conify/global/acq templates/default/conify/global/acq (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Mar 20 10:26:41 EDT 2009
Author: erickson
Date: 2009-03-20 10:26:39 -0400 (Fri, 20 Mar 2009)
New Revision: 12624
Modified:
trunk/Open-ILS/web/js/ui/default/conify/global/acq/provider.js
trunk/Open-ILS/web/templates/default/conify/global/acq/provider.tt2
Log:
initial support for editing provider addrs, contacts, contact addrs. still got some bugs to work out, but mostly functionaly.
Modified: trunk/Open-ILS/web/js/ui/default/conify/global/acq/provider.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/conify/global/acq/provider.js 2009-03-20 12:42:01 UTC (rev 12623)
+++ trunk/Open-ILS/web/js/ui/default/conify/global/acq/provider.js 2009-03-20 14:26:39 UTC (rev 12624)
@@ -1,39 +1,62 @@
dojo.require('openils.widget.AutoGrid');
+dojo.require('dijit.form.FilteringSelect');
dojo.require('openils.PermaCrud');
var provider;
-
+var contactIds = [];
function draw() {
if(providerId) {
+ openils.Util.addCSSClass(dojo.byId('provider-list-div'), 'hidden');
drawProviderSummary();
} else {
- openils.Util.removeCSSClass(dojo.byId('provider-list-div'), 'hidden');
- pListGrid.onPostCreate = function(fmObject) {
+ openils.Util.addCSSClass(dojo.byId('provider-details-div'), 'hidden');
+ pListGrid.onPostCreate = function(fmObject) {
location.href = location.href + '/' + fmObject.id();
}
- pListGrid.loadAll({order_by:{acqpro : 'name'}});
+ 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'));
+ var pane = new openils.widget.EditPane({fmObject:provider}, dojo.byId('provider-summary-pane'));
pane.startup();
-
+
}
});
+ paListGrid.overrideEditWidgets.provider = new
+ dijit.form.TextBox({style:'display:none', value: providerId});
+ paListGrid.loadAll({order_by:{acqpa : 'provider'}}, {provider : providerId});
+ pcListGrid.overrideEditWidgets.provider = new
+ dijit.form.TextBox({style:'display:none', value: providerId});
+ pcListGrid.loadAll(
+ {
+ order_by:{acqpc : 'name'},
+
+ oncomplete: function(){
+ pcListGrid.store.fetch({
+ onComplete: function(items) {
+ dojo.forEach(items, function(item) {
+ contactIds.push(pcListGrid.store.getValue(item, 'id')); }
+ );
+ console.log("contact IDs are " + js2JSON(contactIds));
+ pcaListGrid.overrideEditWidgets.contact = new
+ dijit.form.FilteringSelect({store: pcListGrid.store});
+ pcaListGrid.loadAll({order_by:{acqpca : 'contact'}}, {contact: contactIds});
+ }
+ });
+ }
+ }, {provider : providerId});
}
function getProviderName(rowIndex, item) {
if(!item) return '';
- return '<a href="' + location.href + '/' +
- this.grid.store.getValue(item, 'id') + '">' +
+ return '<a href="' + location.href + '/' +
+ this.grid.store.getValue(item, 'id') + '">' +
this.grid.store.getValue(item, 'name') + '</a>';
}
-
Modified: trunk/Open-ILS/web/templates/default/conify/global/acq/provider.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/acq/provider.tt2 2009-03-20 12:42:01 UTC (rev 12623)
+++ trunk/Open-ILS/web/templates/default/conify/global/acq/provider.tt2 2009-03-20 14:26:39 UTC (rev 12624)
@@ -2,18 +2,16 @@
<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']"
+
+<div id='provider-list-div'>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <div>Provider <button dojoType='dijit.form.Button' onClick='pListGrid.showCreateDialog()'>New Provider</button></div>
+ <table jsId="pListGrid"
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['id', 'name', 'code', 'owner', 'currency_type']"
+ query="{id: '*'}"
defaultCellWidth='12'
- query="{id: '*'}"
- fmClass='acqpro'
+ fmClass='acqpro'
editOnEnter='true'>
<thead>
<tr><th field='name' get='getProviderName'/></tr>
@@ -21,9 +19,58 @@
</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 id='provider-details-div'>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="top">
+ <div id='provider-summary-pane'/>
+ </div>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div>Provider Address</div>
+ <button dojoType='dijit.form.Button' onClick='paListGrid.showCreateDialog()'>New Provider Address</button>
+ </div>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:100px'>
+ <table jsId="paListGrid"
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['id', 'address_type', 'provider', 'street1', 'street2', 'city', 'county', 'state', 'country', 'post_code']"
+ query="{id: '*'}"
+ fmClass='acqpa'
+ editOnEnter='true'>
+ </table>
+ </div>
+
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div>Provider Contact</div>
+ <button dojoType='dijit.form.Button' onClick='pcListGrid.showCreateDialog()'>New Contact</button>
+ </div>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:200px'>
+ <table jsId="pcListGrid"
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['id', 'name', 'provider', 'role', 'email']"
+ defaultCellWidth='12'
+ query="{id: '*'}"
+ fmClass='acqpc'
+ editOnEnter='true'>
+ </table>
+ </div>
+
+
+
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div>Contact Address</div>
+ <button dojoType='dijit.form.Button' onClick='pcaListGrid.showCreateDialog()'>New Contact Address</button>
+ </div>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:200px'>
+ <table jsId="pcaListGrid"
+ dojoType="openils.widget.AutoGrid"
+ fieldOrder="['id', 'address_type', 'provider', 'street1', 'street2', 'city', 'county', 'state', 'country', 'post_code']"
+ query="{id: '*'}"
+ fmClass='acqpca'
+ editOnEnter='true'>
+
+ </table>
+ </div>
</div>
</div>
[% END %]
More information about the open-ils-commits
mailing list