[open-ils-commits] r13155 - 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
Wed May 13 14:51:24 EDT 2009
Author: erickson
Date: 2009-05-13 14:51:20 -0400 (Wed, 13 May 2009)
New Revision: 13155
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:
more dojo1.3 fixes
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-05-13 17:00:37 UTC (rev 13154)
+++ trunk/Open-ILS/web/js/ui/default/conify/global/acq/provider.js 2009-05-13 18:51:20 UTC (rev 13155)
@@ -29,7 +29,7 @@
drawProviderSummary();
} else {
console.log('in else block');
- openils.Util.addCSSClass(dojo.byId('provider-details-div'), 'hidden');
+ openils.Util.removeCSSClass(dojo.byId('provider-details-div'), 'hidden');
pListGrid.loadAll({order_by:{acqpro : 'name'}});
pListGrid.onPostCreate = function(fmObject) {
location.href = location.href + '/' + fmObject.id();
@@ -41,7 +41,8 @@
function drawProviderSummary(child) {
console.log(child);
openils.Util.addCSSClass(dojo.byId('provider-details-div'), 'visible');
- console.log("hidden provider-details");
+ console.log('added provider.list.div');
+ console.log("drawing provider-details-div");
var loadedTabs = {'provider-address' : true};
if(child){
@@ -54,26 +55,26 @@
openils.Util.removeCSSClass(dojo.byId('contact-addr-div'), 'hidden');
pcListGrid.resetStore();
pcListGrid.loadAll( {oncomplete:function(r){
- var count = 0;
- pcListGrid.store.fetch( {onComplete:function(list) {
- count = list.length
- if(count>=1){
- var contactIds = [];
- dojo.forEach(list, function(item) {
- contactIds.push(pcListGrid.store.getValue(item, 'id')); }
- );
- openils.Util.addCSSClass(dojo.byId('contact-addr-div'), 'visible');
- pcaListGrid.overrideEditWidgets.contact = new
- dijit.form.FilteringSelect({store: pcListGrid.store});
- pcaListGrid.resetStore();
- pcaListGrid.loadAll({order_by:{acqpca : 'contact'}}, {contact: contactIds});
- }else{
- return;
- }
+ var count = 0;
+ pcListGrid.store.fetch( {onComplete:function(list) {
+ count = list.length
+ if(count>=1){
+ var contactIds = [];
+ dojo.forEach(list, function(item) {
+ contactIds.push(pcListGrid.store.getValue(item, 'id')); }
+ );
+ openils.Util.addCSSClass(dojo.byId('contact-addr-div'), 'visible');
+ pcaListGrid.overrideEditWidgets.contact = new
+ dijit.form.FilteringSelect({store: pcListGrid.store});
+ pcaListGrid.resetStore();
+ pcaListGrid.loadAll({order_by:{acqpca : 'contact'}}, {contact: contactIds});
+ }else{
+ return;
+ }
+ }
+ }
+ );
}
- }
- );
- }
}, {provider : providerId});
break;
Modified: trunk/Open-ILS/web/templates/default/conify/global/acq/provider.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/acq/provider.tt2 2009-05-13 17:00:37 UTC (rev 13154)
+++ trunk/Open-ILS/web/templates/default/conify/global/acq/provider.tt2 2009-05-13 18:51:20 UTC (rev 13155)
@@ -1,45 +1,51 @@
[% WRAPPER default/base.tt2 %]
<script src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/provider.js'> </script>
-<script>
+<script type="text/javascript">
var providerId = '[% ctx.page_args.0 %]';
- function formatName(inDatum) {
- switch (inDatum) {
- case 'owning_lib':
- return 'Owning Library';
- case 'quantity':
- return 'Quantity';
- case 'call_number':
- return 'Call Number';
- case 'fund_code':
- return 'Fund Code';
- case 'local_note':
- return 'Local Note';
- case 'price':
- return 'Price';
- case 'circ-Modifier':
- return 'Circulation Modifier';
- case 'copy_location':
- return 'Copy Location';
- case 'collection_code':
- return 'Collection Code';
- }
+
+
+function formatName(inDatum) {
+ switch (inDatum) {
+ case 'owning_lib':
+ return 'Owning Library';
+ case 'quantity':
+ return 'Quantity';
+ case 'call_number':
+ return 'Call Number';
+ case 'fund_code':
+ return 'Fund Code';
+ case 'local_note':
+ return 'Local Note';
+ case 'price':
+ return 'Price';
+ case 'circ_modifier':
+ return 'Circulation Modifier';
+ case 'copy_location':
+ return 'Copy Location';
+ case 'collection_code':
+ return 'Collection Code';
}
+}
- function getProviderName(rowIndex, item) {
- if(!item) return '';
- var name = this.grid.store.getValue(item, 'name');
- var id = this.grid.store.getValue(item, 'id');
- return id + ':' + name;
+function getProviderName(rowIndex, item) {
+ if(!item) return '';
+ var name = this.grid.store.getValue(item, 'name');
+ var id = this.grid.store.getValue(item, 'id');
+ return id + ':' + name;
+}
+
+function formatName(value) {
+ if(value) {
+ var vals = value.split(/:/);
+ return '<a href="[% ctx.base_path %]/conify/global/acq/provider/'+vals[0]+'">'+vals[1]+'</a>';
}
+}
- function formatName(value) {
- if(value) {
- var vals = value.split(/:/);
- return '<a href="[% ctx.base_path %]/conify/global/acq/provider/'+vals[0]+'">'+vals[1]+'</a>';
- }
- }
+
+
+
</script>
@@ -80,7 +86,7 @@
<tr><th field='name' get='getProviderName' formatter='formatName'/></tr>
</thead>
</table>
- <div/>
+ <div></div>
</div>
</div>
@@ -95,8 +101,8 @@
<div>
<button dojoType='dijit.form.Button' onClick='paListGrid.showCreateDialog()'>New Provider Address</button>
<button dojoType='dijit.form.Button' onClick='paListGrid.deleteSelected()'>Delete Selected</button>
+ </div>
</div>
- </div>
<div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:100px'>
<table jsId="paListGrid"
dojoType="openils.widget.AutoGrid"
More information about the open-ils-commits
mailing list