svn commit: r616183 - /ofbiz/branches/release4.0/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: r616183 - /ofbiz/branches/release4.0/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml

jleroux@apache.org
Author: jleroux
Date: Mon Jan 28 22:33:11 2008
New Revision: 616183

URL: http://svn.apache.org/viewvc?rev=616183&view=rev
Log:
Applied fix from trunk for revision: 616182

Modified:
    ofbiz/branches/release4.0/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml

Modified: ofbiz/branches/release4.0/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml?rev=616183&r1=616182&r2=616183&view=diff
==============================================================================
--- ofbiz/branches/release4.0/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml (original)
+++ ofbiz/branches/release4.0/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml Mon Jan 28 22:33:11 2008
@@ -568,11 +568,22 @@
             </if-validate-method>
         </if-compare>
         <if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="GIFT_CARD">
-            <if-validate-method field-name="${answerFieldName}" method="isGiftCard">
-                <else>
-                    <add-error><fail-message message="The question [${surveyQuestionAndAppl.question}] requires a valid gift-card number."/></add-error>
-                </else>
-            </if-validate-method>
+            <set field="finAccountMap.finAccountTypeId" value="GIFTCERT_ACCOUNT"/>
+            <set field="finAccountMap.statusId" value="FNACT_ACTIVE"/>
+            <set field="codeOk" value="false"/>            
+            <find-by-and entity-name="FinAccount" map-name="finAccountMap" list-name="finAccountList"/>
+            <iterate entry-name="finAccount" list-name="finAccountList">
+                <if-compare field-name="finAccount.finAccountCode" operator="equals" value="${${answerFieldName}}">
+                    <set field="codeOk" value="true"/>
+                </if-compare>
+            </iterate>
+            <if-compare field-name="codeOk" value="true"  operator="not-equals">
+                <if-validate-method field-name="${answerFieldName}" method="isGiftCard">
+                    <else>
+                        <add-error><fail-message message="The question [${surveyQuestionAndAppl.question}] requires a valid gift-card number."/></add-error>
+                    </else>
+                </if-validate-method>
+            </if-compare>
         </if-compare>
         <if-compare field-name="surveyQuestionAndAppl.surveyQuestionTypeId" operator="equals" value="DATE">
             <if-validate-method field-name="${answerFieldName}" method="isDate">