svn commit: r543397 - /ofbiz/trunk/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r543397 - /ofbiz/trunk/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml

byersa-3
Author: byersa
Date: Thu May 31 22:54:40 2007
New Revision: 543397

URL: http://svn.apache.org/viewvc?view=rev&rev=543397
Log:
There were a couple of places where the multi response column functionality was causing problems.
In createSurveryResponse, it was testing to see if responseAnswer.surveyMultiRespColId was empty, but processSurveyResponseInline
was putting "_NA_" in that field, so I modified the test to also look for "_NA_".

In processSurveyResponseInline, it was testing on surveyMultiRespColumn.surveyMultiRespColId, but surveyMultiRespColumn does not
always exist, so I tested for its existence.

I suppose this is a release branch fix? I was afraid of that.

Modified:
    ofbiz/trunk/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml

Modified: ofbiz/trunk/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml?view=diff&rev=543397&r1=543396&r2=543397
==============================================================================
--- ofbiz/trunk/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml (original)
+++ ofbiz/trunk/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml Thu May 31 22:54:40 2007
@@ -499,9 +499,19 @@
         <get-related value-name="surveyResponse" relation-name="SurveyResponseAnswer" list-name="existingAnswers"/>
         <iterate entry-name="existingAnswer" list-name="existingAnswers">
             <set field="currentAnswersFieldName" from-field="existingAnswer.surveyQuestionId"/>
-            <if-not-empty field-name="existingAnswer.surveyMultiRespColId">
-                <set field="currentAnswersFieldName" value="${currentAnswersFieldName}_${existingAnswer.surveyMultiRespColId}"/>
-            </if-not-empty>
+            <if>
+                <condition>
+                    <and>
+                        <not>
+                            <if-empty field-name="existingAnswer.surveyMultiRespColId"/>
+                        </not>
+                        <if-compare operator="not-equals" field-name="existingAnswer.surveyMultiRespColId" value="_NA_"/>
+                    </and>
+                </condition>
+                <then>
+                    <set field="currentAnswersFieldName" value="${currentAnswersFieldName}_${existingAnswer.surveyMultiRespColId}"/>
+                </then>
+            </if>
             <set field="currentAnswers.${currentAnswersFieldName}" from-field="existingAnswer"/>
         </iterate>
 
@@ -613,12 +623,17 @@
             <set field="responseAnswer" from-field="currentAnswers.${currentFieldName}"/>
         </if-not-empty>
         
-        <if>
+       <if>
             <condition>
                 <or>
                     <if-empty field-name="responseAnswer"/>
                     <if-compare-field field-name="responseAnswer.surveyQuestionId" operator="not-equals" to-field-name="surveyQuestionAndAppl.surveyQuestionId"/>
-                    <if-compare-field field-name="responseAnswer.surveyMultiRespColId" operator="not-equals" to-field-name="surveyMultiRespColumn.surveyMultiRespColId"/>
+                    <and>
+                        <not>
+                            <if-empty field-name="surveyMultiRespColumn"/>
+                        </not>
+                        <if-compare-field field-name="responseAnswer.surveyMultiRespColId" operator="not-equals" to-field-name="surveyMultiRespColumn.surveyMultiRespColId" />
+                    </and>
                 </or>
             </condition>
             <then>
@@ -638,7 +653,6 @@
                 <create-value value-name="responseAnswer"/>
             </then>
         </if>
-        
         <if-not-empty field-name="answers.${currentFieldName}">
             <if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="BOOLEAN">
                 <set field="responseAnswer.booleanResponse" from-field="answers.${currentFieldName}"/>