From 57162f57fffb73ffcbbd33958a26acf40ac8348b Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 26 May 2009 12:36:47 +0000 Subject: [PATCH] layout tweaks git-svn-id: svn://svn.open-ils.org/ILS/trunk@13229 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../js/ui/default/conify/global/acq/provider.js | 38 +++++++---------- .../js/ui/default/conify/global/action/survey.js | 12 +++--- .../default/conify/global/acq/provider.tt2 | 49 +++++++++++----------- .../default/conify/global/action/survey.tt2 | 24 +++++------ 4 files changed, 55 insertions(+), 68 deletions(-) diff --git a/Open-ILS/web/js/ui/default/conify/global/acq/provider.js b/Open-ILS/web/js/ui/default/conify/global/acq/provider.js index 8900ed2d8d..83662ab80e 100644 --- a/Open-ILS/web/js/ui/default/conify/global/acq/provider.js +++ b/Open-ILS/web/js/ui/default/conify/global/acq/provider.js @@ -12,6 +12,7 @@ var subFields= []; function draw() { if(providerId) { openils.Util.addCSSClass(dojo.byId('provider-list-div'), 'hidden'); + console.log('in draw'); var pcrud = new openils.PermaCrud(); pcrud.retrieve('acqpro', providerId, { @@ -28,8 +29,8 @@ function draw() { drawProviderSummary(); } else { + openils.Util.addCSSClass(dojo.byId('provider-details-div'), 'hidden'); console.log('in else block'); - 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(); @@ -39,11 +40,6 @@ function draw() { } function drawProviderSummary(child) { - console.log(child); - openils.Util.addCSSClass(dojo.byId('provider-details-div'), 'visible'); - console.log('added provider.list.div'); - console.log("drawing provider-details-div"); - var loadedTabs = {'provider-address' : true}; if(child){ if(loadedTabs[child.id]) return; @@ -52,25 +48,23 @@ function drawProviderSummary(child) { case 'tab-pro-contact': pcListGrid.overrideEditWidgets.provider = new dijit.form.TextBox({disabled: 'true', value: providerId}); - 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; - } + count = list.length + if(count>=1){ + var contactIds = []; dojo.forEach(list, function(item) { + contactIds.push(pcListGrid.store.getValue(item, 'id')); } + ); + + pcaListGrid.overrideEditWidgets.contact = new + dijit.form.FilteringSelect({store: pcListGrid.store}); + pcaListGrid.resetStore(); + pcaListGrid.loadAll({order_by:{acqpca : 'contact'}}, {contact: contactIds}); + }else{ + return; + } } } ); @@ -108,8 +102,6 @@ function drawProviderSummary(child) { function getParsedTag(rowIndex, item) { - console.log("in getParsedTag"); - console.log(item); return item && xpathParser.parse(padListGrid.store.getValue(item, 'xpath')).tags; } diff --git a/Open-ILS/web/js/ui/default/conify/global/action/survey.js b/Open-ILS/web/js/ui/default/conify/global/action/survey.js index c699c68d81..5fb779bc2e 100644 --- a/Open-ILS/web/js/ui/default/conify/global/action/survey.js +++ b/Open-ILS/web/js/ui/default/conify/global/action/survey.js @@ -4,6 +4,7 @@ dojo.require('dojo.data.ItemFileWriteStore'); dojo.require('dijit.form.TextBox'); dojo.require('dijit.form.CurrencyTextBox'); dojo.require('dijit.Dialog'); +dojo.require('openils.DojoPatch'); dojo.require('dojox.widget.PlaceholderMenuItem'); dojo.require('fieldmapper.OrgUtils'); dojo.require('openils.widget.OrgUnitFilteringSelect'); @@ -18,13 +19,13 @@ var questionId; /** really need to put this in a shared location... */ function getOrgInfo(rowIndex, item) { if(!item) return ''; - var orgId = this.grid.store.getValue(item, this.field); + var orgId = svGrid.store.getValue(item, this.field); return fieldmapper.aou.findOrgUnit(orgId).shortname(); } function getDateTimeField(rowIndex, item) { if(!item) return ''; - var data = this.grid.store.getValue(item, this.field); + var data = svGrid.store.getValue(item, this.field); var date = dojo.date.stamp.fromISOString(data); return dojo.date.locale.format(date, {formatLength:'short'}); } @@ -52,7 +53,6 @@ function _endSurvey(list, idx) { var svId = svGrid.store.getValue(item, 'id'); var pcrud = new openils.PermaCrud(); var survey = pcrud.retrieve('asv', svId); - console.log(survey); var today = new Date(); var date = dojo.date.stamp.toISOString(today); survey.end_date(date); @@ -141,18 +141,17 @@ function svCreate(args) { sv.usr_summary('t') else sv.usr_summary('f'); - console.log(sv.name()); + var pcrud = new openils.PermaCrud(); pcrud.create(sv, { oncomplete: function(r) { var obj = openils.Util.readResponse(r); - if(!obj) return console.log('no obj'); + if(!obj) return ''; svGrid.store.newItem(asv.toStoreItem(obj)); svSurveyDialog.hide(); svId = obj.id(); document.location.href = "/eg/conify/global/action/survey/edit/"+svId; - //redirect(svId); } } ); @@ -183,7 +182,6 @@ function _deleteFromGrid(list, idx) { if(stat = openils.Util.readResponse(r)) { console.log(stat); svGrid.store.deleteItem(item); - // buildSVGrid(); } _deleteFromGrid(list, ++idx); diff --git a/Open-ILS/web/templates/default/conify/global/acq/provider.tt2 b/Open-ILS/web/templates/default/conify/global/acq/provider.tt2 index fb7aa98152..b3b5b704d4 100644 --- a/Open-ILS/web/templates/default/conify/global/acq/provider.tt2 +++ b/Open-ILS/web/templates/default/conify/global/acq/provider.tt2 @@ -63,7 +63,7 @@ function formatName(value) { -
+
Provider
@@ -90,8 +90,8 @@ function formatName(value) {
-
-
+
+
@@ -132,34 +132,33 @@ function formatName(value) { editOnEnter='true'>
- -
-
-
Contact Address
-
- - + +
+
Contact Address
+
+ + +
-
-
- - -
-
-
+
+ + +
+
+
Attribute Definitions
- - + +
diff --git a/Open-ILS/web/templates/default/conify/global/action/survey.tt2 b/Open-ILS/web/templates/default/conify/global/action/survey.tt2 index 9b0b796b67..4e43c197bd 100644 --- a/Open-ILS/web/templates/default/conify/global/action/survey.tt2 +++ b/Open-ILS/web/templates/default/conify/global/action/survey.tt2 @@ -1,6 +1,5 @@ [% WRAPPER default/base.tt2 %] -

Survey List


+
+
+
Survey List
+
+ + + +
+
- - - - - - - -
- +
+
-- 2.11.0
Survey ID