[OFBiz] SVN: r7252 - in trunk/applications/content: script/org/ofbiz/content/survey servicedef src/org/ofbiz/content/survey webapp/content/survey widget widget/compdoc
jonesde@svn.ofbiz.org
jonesde at svn.ofbiz.org
Mon Apr 10 01:17:13 CDT 2006
Author: jonesde
Date: 2006-04-10 01:17:04 -0500 (Mon, 10 Apr 2006)
New Revision: 7252
Modified:
trunk/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml
trunk/applications/content/servicedef/services_survey.xml
trunk/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java
trunk/applications/content/webapp/content/survey/EditSurveyResponse.ftl
trunk/applications/content/widget/SurveyScreens.xml
trunk/applications/content/widget/compdoc/CompDocForms.xml
trunk/applications/content/widget/compdoc/CompDocMenus.xml
Log:
A few cleanups and link fixes and such; also implemented changes to fill out survey responses more easily, allow multiple responses by default, etc
Modified: trunk/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml
===================================================================
--- trunk/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml 2006-04-10 05:39:15 UTC (rev 7251)
+++ trunk/applications/content/script/org/ofbiz/content/survey/SurveyServices.xml 2006-04-10 06:17:04 UTC (rev 7252)
@@ -444,7 +444,7 @@
<add-error><fail-message message="No answers were found"/></add-error>
<check-errors/>
</if-empty>
- <set from-field="parameters.answers" field="answers"/>
+ <set field="answers" from-field="parameters.answers"/>
<!-- make sure all required fields were responded to -->
<iterate entry-name="surveyQuestionAndAppl" list-name="surveyQuestionAndApplList">
@@ -489,6 +489,13 @@
<store-value value-name="surveyResponse"/>
<field-to-result field-name="surveyResponse.surveyResponseId" result-name="surveyResponseId"/>
+
+ <!-- if a dataResourceId was passed in use it to set DataResource.relatedDetailId to the surveyResponse.surveyResponseId -->
+ <if-not-empty field-name="parameters.dataResourceId">
+ <entity-one entity-name="DataResource" value-name="dataResource"/>
+ <set field="dataResource.relatedDetailId" from-field="surveyResponse.surveyResponseId"/>
+ <store-value value-name="dataResource"/>
+ </if-not-empty>
<!-- lookup any existing response answers -->
<get-related value-name="surveyResponse" relation-name="SurveyResponseAnswer" list-name="existingAnswers"/>
Modified: trunk/applications/content/servicedef/services_survey.xml
===================================================================
--- trunk/applications/content/servicedef/services_survey.xml 2006-04-10 05:39:15 UTC (rev 7251)
+++ trunk/applications/content/servicedef/services_survey.xml 2006-04-10 06:17:04 UTC (rev 7252)
@@ -261,6 +261,7 @@
<attribute name="answers" type="Map" mode="IN" optional="false" string-map-prefix="answers_"/>
<attribute name="surveyResponseId" type="String" mode="INOUT" optional="true"/>
<attribute name="productStoreSurveyId" type="String" mode="INOUT" optional="true"/>
+ <attribute name="dataResourceId" type="String" mode="IN" optional="true"/>
<override name="surveyId" mode="INOUT" optional="false"/>
</service>
Modified: trunk/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java
===================================================================
--- trunk/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java 2006-04-10 05:39:15 UTC (rev 7251)
+++ trunk/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java 2006-04-10 06:17:04 UTC (rev 7252)
@@ -99,6 +99,8 @@
surveyId = delegator.getNextSeqId("Survey");
survey = delegator.makeValue("Survey", UtilMisc.toMap("surveyName", surveyName));
survey.set("surveyId", surveyId);
+ survey.set("allowMultiple", "Y");
+ survey.set("allowUpdate", "Y");
survey.create();
}
Modified: trunk/applications/content/webapp/content/survey/EditSurveyResponse.ftl
===================================================================
--- trunk/applications/content/webapp/content/survey/EditSurveyResponse.ftl 2006-04-10 05:39:15 UTC (rev 7251)
+++ trunk/applications/content/webapp/content/survey/EditSurveyResponse.ftl 2006-04-10 06:17:04 UTC (rev 7252)
@@ -28,6 +28,9 @@
<#if surveyString?has_content>
<form method="post" enctype="multipart/form-data" action="<@ofbizUrl>updateSurveyResponse</@ofbizUrl>" name="EditSurveyResponseForm" style="margin: 0;">
<div class="tabletext">Party ID: <input type="text" size="15" name="partyId" value="${userLogin.partyId}" class="inputBox"/><a href="javascript:call_fieldlookup2(document.EditSurveyResponseForm.partyId, 'LookupPartyName');"><img src="<@ofbizContentUrl>/images/fieldlookup.gif</@ofbizContentUrl>" width="16" height="16" border="0" alt="Lookup"/></a></div>
+ <#-- pass through the dataResourceId so the response can be associated with it -->
+ <input type="hidden" name="dataResourceId" value="${parameters.dataResourceId}"/>
+ <input type="hidden" name="rootContentId" value="${parameters.rootContentId}"/>
${surveyString}
</form>
<#else>
Modified: trunk/applications/content/widget/SurveyScreens.xml
===================================================================
--- trunk/applications/content/widget/SurveyScreens.xml 2006-04-10 05:39:15 UTC (rev 7251)
+++ trunk/applications/content/widget/SurveyScreens.xml 2006-04-10 06:17:04 UTC (rev 7252)
@@ -227,6 +227,10 @@
<decorator-screen name="CommonSurveyDecorator">
<decorator-section name="body">
<container><link text="${uiLabelMap.SurveyCreateResponse}" target="EditSurveyResponse?surveyId=${surveyId}" style="buttontext"/></container>
+ <section>
+ <condition><not><if-empty field-name="parameters.rootContentId"/></not></condition>
+ <widgets><container><link text="Go Back to CompDoc Root [${parameters.rootContentId}]" target="ViewCompDocInstanceTree?rootContentId=${parameters.rootContentId}" style="buttontext"/></container></widgets>
+ </section>
<container><label style="head1">${uiLabelMap.PageTitleViewSurveyResponses}, ${uiLabelMap.SurveySurveyId}: ${surveyId}</label></container>
<platform-specific><html><html-template location="component://content/webapp/content/survey/ViewSurveyResponses.ftl"/></html></platform-specific>
</decorator-section>
Modified: trunk/applications/content/widget/compdoc/CompDocForms.xml
===================================================================
--- trunk/applications/content/widget/compdoc/CompDocForms.xml 2006-04-10 05:39:15 UTC (rev 7251)
+++ trunk/applications/content/widget/compdoc/CompDocForms.xml 2006-04-10 06:17:04 UTC (rev 7252)
@@ -347,7 +347,7 @@
</field>
<field name="rootContentId"><hidden/></field>
<field name="rootContentRevisionSeqId"><hidden/></field>
- <field name="submitButton" title="Submit" widget-style="smallSubmit"><submit button-type="button"/></field>
+ <field name="submitButton" title="Add" widget-style="smallSubmit"><submit button-type="button"/></field>
</form>
<form name="EditChildCompDoc" default-map-name="contentAssoc" type="single" target="${childCompDocTarget}"
@@ -403,17 +403,21 @@
description="Edit Survey Response" link-style="buttontext" use-when="dataResource!=null && dataResource.get("relatedDetailId")!=null"/>
</lookup>
</field>
- <field name="surveyResponseLink" map-name="dummy" widget-style="buttontext"
+ <field name="addSurveyResponse" map-name="dummy" widget-style="buttontext"
use-when=""DOCUMENT".equals(contentTypeId) && dataResource!=null && dataResource.get("relatedDetailId")==null && templateDataResource!=null && templateDataResource.get("relatedDetailId")!=null">
- <hyperlink description="Create Response (for Survey ${templateDataResource.relatedDetailId})" target="EditSurveyResponse?surveyId=${templateDataResource.relatedDetailId}" also-hidden="false" target-window="_blank"/>
+ <hyperlink description="Create Response (for Survey ${templateDataResource.relatedDetailId})" target="EditSurveyResponse?surveyId=${templateDataResource.relatedDetailId}&dataResourceId=${dataResource.dataResourceId}&rootContentId=${rootContentId}" also-hidden="false" target-window="_blank"/>
</field>
-
+ <field name="updateSurveyResponse" map-name="dummy" widget-style="buttontext"
+ use-when=""DOCUMENT".equals(contentTypeId) && dataResource!=null && dataResource.get("relatedDetailId")!=null && templateDataResource!=null && templateDataResource.get("relatedDetailId")!=null">
+ <hyperlink description="Update Response (for Survey ${templateDataResource.relatedDetailId}, Response ${dataResource.relatedDetailId})" target="EditSurveyResponse?surveyId=${templateDataResource.relatedDetailId}&surveyResponseId=${dataResource.relatedDetailId}&dataResourceId=${dataResource.dataResourceId}&rootContentId=${rootContentId}" also-hidden="false" target-window="_blank"/>
+ </field>
+
<field name="objectInfo" title="Current File Name" map-name="dataResource" widget-style="tabletext"
use-when=""DOCUMENT".equals(contentTypeId) && mimeTypeId!=null && !"application/vnd.ofbiz.survey".equals(mimeTypeId)">
<display also-hidden="false"/>
</field>
- <field name="submitButton" title="Submit" widget-style="smallSubmit"><submit button-type="button"/></field>
+ <field name="submitButton" title="Update" widget-style="smallSubmit"><submit button-type="button"/></field>
</form>
<form name="ViewChildCompDoc" default-map-name="contentAssoc" type="single" target=""
Modified: trunk/applications/content/widget/compdoc/CompDocMenus.xml
===================================================================
--- trunk/applications/content/widget/compdoc/CompDocMenus.xml 2006-04-10 05:39:15 UTC (rev 7251)
+++ trunk/applications/content/widget/compdoc/CompDocMenus.xml 2006-04-10 06:17:04 UTC (rev 7252)
@@ -169,7 +169,7 @@
<menu name="childInstanceLine" default-title-style="tabButton" default-selected-style="tabButtonSelected" default-menu-item-name="content"
orientation="horizontal" menu-width="100%" default-tooltip-style="tabletext" default-widget-style="tabButton"
selected-menuitem-context-field-name="currentMenuItemName" title="" type="simple">
- <menu-item name="edit-inplace" title="${contentName}[${assocRevisionItemView.itemContentId}] - ${instanceDataResource.objectInfo}">
+ <menu-item name="edit-inplace" title="${contentName}[${assocRevisionItemView.itemContentId}] - ${instanceDataResource.objectInfo} ${instanceDataResource.relatedDetailId}">
<condition>
<not><if-empty field-name="assocRevisionItemView"/></not>
</condition>
More information about the Svn
mailing list