From 4c92d095da106a4c2a54bf26e392d5ad57938f4d Mon Sep 17 00:00:00 2001 From: Kathy Lussier Date: Tue, 26 Apr 2016 11:47:27 -0400 Subject: [PATCH] LP#1575177 Add text informing users they cannot add survey questions Survey questions cannot be added or modified once a survey has started, so let's add some warning text in the interface letting them know why they can't perform these actions. Signed-off-by: Kathy Lussier Signed-off-by: Mike Rylander --- Open-ILS/web/js/dojo/openils/conify/nls/conify.js | 1 + .../web/js/ui/default/conify/global/action/survey/edit.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/dojo/openils/conify/nls/conify.js b/Open-ILS/web/js/dojo/openils/conify/nls/conify.js index 608b99836f..961f9efdd1 100644 --- a/Open-ILS/web/js/dojo/openils/conify/nls/conify.js +++ b/Open-ILS/web/js/dojo/openils/conify/nls/conify.js @@ -86,6 +86,7 @@ "SURVEY_QUESTION": "Question:", "SURVEY_ID": "Survey ID # ${0}", "SURVEY_FOOT_LABEL": "Questions & Answers", + "SURVEY_WARN_TEXT": "No questions can be modified or added at this time. The survey Start Date must be set for the future to add new questions or modify existing questions.", "EVENT_DEF_LABEL" : "${0}: ${1}", "ACQ_DISTRIB_FORMULA_NAME_PROMPT" : "Enter new formula name", "ACQ_DISTRIB_FORMULA_NAME_CLONE" : "${0} (Clone)", 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 5dc659d688..0993f0e9cd 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 @@ -43,7 +43,12 @@ function drawSurvey(svyId) { 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); - var footCell = dojo.create('td', {innerHTML: "
", id: "foot_cell"}, footRow); + if (startDate <= today) { + var warnRow = dojo.create('tr', {id: "warn_row"}, surveyFoot); + var warnText = dojo.create('td', {id: "warn_text", style: "padding: 5px", innerHTML: localeStrings.SURVEY_WARN_TEXT}, warnRow); + } + var footRule = dojo.create('tr', {id:"foot_rule"}, surveyFoot); + var footCell = dojo.create('td', {innerHTML: "
", id: "foot_cell"}, footRule); getQuestions(svyId, survey); } -- 2.43.2