From d28706ebb23e440fc4dc60fbb3284baa8e0b8a11 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 9 Jun 2009 15:31:22 +0000 Subject: [PATCH] Patch from Laura McFarland (who's previous gajillion patches went woefully unattributed) to tidy up and fix some bugs in the new survey editor UI. git-svn-id: svn://svn.open-ils.org/ILS/trunk@13345 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/ui/default/conify/global/action/survey/edit.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/js/ui/default/conify/global/action/survey/edit.js b/Open-ILS/web/js/ui/default/conify/global/action/survey/edit.js index b24b9a3495..2c2b8ed67b 100644 --- a/Open-ILS/web/js/ui/default/conify/global/action/survey/edit.js +++ b/Open-ILS/web/js/ui/default/conify/global/action/survey/edit.js @@ -9,7 +9,6 @@ dojo.require('dojox.widget.PlaceholderMenuItem'); dojo.require('fieldmapper.OrgUtils'); dojo.require('openils.widget.OrgUnitFilteringSelect'); dojo.require('openils.PermaCrud'); -dojo.require('openils.DojoPatch'); dojo.require('openils.widget.GridColumnPicker'); dojo.require('openils.widget.EditPane'); dojo.requireLocalization('openils.conify', 'conify'); @@ -25,19 +24,22 @@ function drawSurvey(svyId) { var surveyTable = dojo.byId('edit-pane'); var surveyHead = dojo.create('thead', {id: "survey_head"}, surveyTable); var headRow = dojo.create('tr', null, surveyHead); - var headCell = dojo.create('td', {id: "head_cell", innerHTML: "

" +dojo.string.substitute(localeStrings.SURVEY_ID, [svyId])+"

" }, headRow); + var headCell = dojo.create('td', {id: "head_cell", innerHTML: "

" +dojo.string.substitute(localeStrings.SURVEY_ID, [svyId])+"

" }, headRow); var pcrud = new openils.PermaCrud(); var survey = pcrud.retrieve('asv', svyId); startDate = dojo.date.stamp.fromISOString(survey.start_date()); endDate = dojo.date.stamp.fromISOString(survey.end_date()); var pane = new openils.widget.EditPane({fmObject : survey, hideActionButtons:false}, dojo.byId('edit-pane')); + if ( endDate > today) { - var buttonBody = dojo.create( 'td', null, headRow); + var buttonBody = dojo.create( 'td', null, surveyHead); var endButton = new dijit.form.Button({label: localeStrings.END_SURVEY, onClick:function() {endSurvey(survey.id())} }, buttonBody); } + pane.fieldOrder = ['id', 'name', 'description', 'owner', 'start_date', 'end_date']; pane.onCancel = cancelEdit; pane.startup(); + var surveyFoot = dojo.create('tfoot', { id: "survey_foot"}, surveyTable); var footRow = dojo.create('tr', {id: "foot_row"}, surveyFoot); var footLabel = dojo.create('td', {id: "foot_label", innerHTML: "

"+localeStrings.SURVEY_FOOT_LABEL+"

"}, footRow); -- 2.11.0