LP#1575177 Add text informing users they cannot add survey questions
authorKathy Lussier <klussier@masslnc.org>
Tue, 26 Apr 2016 15:47:27 +0000 (11:47 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 9 Aug 2016 17:04:32 +0000 (13:04 -0400)
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 <klussier@masslnc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/dojo/openils/conify/nls/conify.js
Open-ILS/web/js/ui/default/conify/global/action/survey/edit.js

index 608b998..961f9ef 100644 (file)
@@ -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)",
index 5dc659d..0993f0e 100644 (file)
@@ -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: "<h3>"+localeStrings.SURVEY_FOOT_LABEL+"</h3>"}, footRow);
-    var footCell = dojo.create('td', {innerHTML: "<hr>", 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: "<hr>", id: "foot_cell"}, footRule);
     getQuestions(svyId, survey);
 
 }