Author: hansbak
Date: Mon May 18 10:07:51 2009 New Revision: 775883 URL: http://svn.apache.org/viewvc?rev=775883&view=rev Log: added a function to check for the presence of a companent, make the projectmanager custrequest creation working using the commevent as the data, added some allow-html= safe flags Modified: ofbiz/trunk/applications/order/servicedef/services_request.xml ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/communication/GetMyCommunicationEventRole.groovy ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml ofbiz/trunk/specialpurpose/projectmgr/widget/forms/RequestForms.xml Modified: ofbiz/trunk/applications/order/servicedef/services_request.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_request.xml?rev=775883&r1=775882&r2=775883&view=diff ============================================================================== --- ofbiz/trunk/applications/order/servicedef/services_request.xml (original) +++ ofbiz/trunk/applications/order/servicedef/services_request.xml Mon May 18 10:07:51 2009 @@ -43,6 +43,7 @@ <attribute name="fromPartyId" type="String" mode="IN" optional="false"/> <auto-attributes include="all" mode="IN" entity-name="CustRequestItem" optional="true"/> <override name="custRequestName" allow-html="safe"/> + <override name="story" allow-html="safe"/> </service> <service name="updateCustRequest" engine="simple" default-entity-name="CustRequest" location="component://order/script/org/ofbiz/order/request/CustRequestServices.xml" invoke="updateCustRequest" auth="true"> Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java?rev=775883&r1=775882&r2=775883&view=diff ============================================================================== --- ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java (original) +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java Mon May 18 10:07:51 2009 @@ -1109,6 +1109,7 @@ Debug.logInfo("-- Number of parts : " + wrapper.getMainPartCount(), module); Debug.logInfo("-- Number of attachments : " + wrapper.getAttachmentIndexes().size(), module); Debug.logInfo("-- Message ID : " + wrapper.getMessageId(), module); + Debug.logInfo("-- CommunicationEventId : " + context.get("communicationEventId"), module); Debug.logInfo("### MESSAGE ###\n\n" + wrapper.getMessageBody(), module); Modified: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/communication/GetMyCommunicationEventRole.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/communication/GetMyCommunicationEventRole.groovy?rev=775883&r1=775882&r2=775883&view=diff ============================================================================== --- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/communication/GetMyCommunicationEventRole.groovy (original) +++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/communication/GetMyCommunicationEventRole.groovy Mon May 18 10:07:51 2009 @@ -19,6 +19,7 @@ import org.ofbiz.base.util.*; import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.base.component.ComponentConfig; if (parameters.communicationEventId) { communicationEventRoles = delegator.findByAnd("CommunicationEventAndRole", @@ -35,4 +36,6 @@ if (communicationEventRoles) { context.myCommunicationEventRole = communicationEventRoles.get(0); } + + context.projectMgrExists = ComponentConfig.componentExists("projectmgr"); } \ No newline at end of file Modified: ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml?rev=775883&r1=775882&r2=775883&view=diff ============================================================================== --- ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml (original) +++ ofbiz/trunk/applications/party/webapp/partymgr/communication/CommForms.xml Mon May 18 10:07:51 2009 @@ -292,7 +292,7 @@ <field name="subject"><display/></field> <field map-name="subjectMap" name="eventNote" title="${uiLabelMap.CommonNote}"><display/></field> <field name="contentMimeTypeId" use-when=""my"==void"><display/></field> - <field name="content" title="${uiLabelMap.CommonContent}"><textarea cols="60" rows="10" read-only="true"/></field> + <field name="content" title="${uiLabelMap.CommonContent}" encode-output="false"><textarea cols="60" rows="10" read-only="true"/></field> <sort-order> <field-group collapsible="false" initially-collapsed="false"> Modified: ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml?rev=775883&r1=775882&r2=775883&view=diff ============================================================================== --- ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml (original) +++ ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml Mon May 18 10:07:51 2009 @@ -423,6 +423,7 @@ <not><if-empty field="communicationEvent.partyIdFrom"/></not> <if-compare field="communicationEvent.statusId" operator="not-equals" value="COM_PENDING"/> <if-has-permission permission="ORDERMGR_CRQ_CREATE"/> + <if-compare field="projectMgrExists" operator="equals" value="false"/> </and> </condition> <link target="editRequestFromCommEvent"> @@ -430,6 +431,21 @@ <parameter param-name="my" from-field="parameters.my"/> </link> </menu-item> + <menu-item name="createRequestFromCommEvent1" title="${uiLabelMap.PartyCreateRequestFromCommEvent}"> + <condition> + <and> + <not><if-empty field="communicationEvent"/></not> + <not><if-empty field="communicationEvent.partyIdFrom"/></not> + <if-compare field="communicationEvent.statusId" operator="not-equals" value="COM_PENDING"/> + <if-has-permission permission="ORDERMGR_CRQ_CREATE"/> + <if-compare field="projectMgrExists" operator="equals" value="true"/> + </and> + </condition> + <link target="/projectmgr/control/newrequest" url-mode="inter-app"> + <parameter param-name="communicationEventId" from-field="communicationEvent.communicationEventId"/> + <parameter param-name="my" from-field="parameters.my"/> + </link> + </menu-item> <menu-item name="close" title="${uiLabelMap.CommonClose}"> <condition> <and> Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java?rev=775883&r1=775882&r2=775883&view=diff ============================================================================== --- ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java (original) +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java Mon May 18 10:07:51 2009 @@ -86,6 +86,15 @@ return componentConfig; } + public static Boolean componentExists(String componentName) { + ComponentConfig componentConfig = componentConfigs.get(componentName); + if (componentConfig == null) { + return Boolean.FALSE; + } else { + return Boolean.TRUE; + } + } + public static Collection<ComponentConfig> getAllComponents() { Collection<ComponentConfig> values = componentConfigs.values(); if (values != null) { Modified: ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml?rev=775883&r1=775882&r2=775883&view=diff ============================================================================== --- ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml (original) +++ ofbiz/trunk/framework/common/script/org/ofbiz/common/email/EmailServices.xml Mon May 18 10:07:51 2009 @@ -22,12 +22,24 @@ xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd"> <simple-method method-name="sendMailFromTemplateSetting" short-description="Send Mail from Email Template Setting"> <!-- if partyIdTo provided but no emailAddress, get it from the partyContactMech --> + <if-empty field="parameters.sendTo"> + <if-empty field="parameters.partyIdTo"> + <log level="error" message="PartyId or SendTo should be specified!"></log> + <add-error><fail-message message="PartyId or Email Address (sendTo) should be specified!"/></add-error> + <check-errors/> + </if-empty> + </if-empty> <if-not-empty field="parameters.partyIdTo"> <if-empty field="parameters.sendTo"> <set field="getEmail.partyId" from-field="parameters.partyIdTo"/> <call-service service-name="getPartyEmail" in-map-name="getEmail"> <result-to-field result-name="emailAddress" field="parameters.sendTo"/> </call-service> + <if-empty field="parameters.sendTo"> + <log level="error" message="PartyId: ${parameters.partyIdTo} has no valid email address!"></log> + <add-error><fail-message message="PartyId: ${parameters.partyIdTo} has no valid email address!"/></add-error> + <check-errors/> + </if-empty> </if-empty> </if-not-empty> <entity-one entity-name="EmailTemplateSetting" value-field="emailTemplateSetting"/> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml?rev=775883&r1=775882&r2=775883&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml Mon May 18 10:07:51 2009 @@ -55,7 +55,9 @@ <set field="custRequestId" from-field="parameters.custRequestId"/> <entity-one entity-name="CustRequest" value-field="custRequest"/> - + <!-- if to be generated from a communicationEventId --> + <entity-one entity-name="CommunicationEvent" value-field="communicationEvent"/> + <set field="fromPartyId" from-field="communicationEvent.partyIdFrom"/> <set field="statusId" from-field="custRequest.statusId"/> <entity-one entity-name="StatusItem" value-field="currentStatus"/> </actions> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/RequestForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/RequestForms.xml?rev=775883&r1=775882&r2=775883&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/RequestForms.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/RequestForms.xml Mon May 18 10:07:51 2009 @@ -30,7 +30,8 @@ </form> <form name="EditCustRequest" type="single" target="updaterequest" title="Request" default-map-name="custRequest" extends="EditSmallCustRequest" extends-resource="component://order/webapp/ordermgr/request/RequestForms.xml"> - <field name="description" parameter-name="story" use-when="custRequest==null"><textarea cols="60" rows="12"/></field> + <field name="custRequestName"><text default-value="${communicationEvent.subject}"/></field> + <field name="description" parameter-name="story" use-when="custRequest==null" encode-output="false"><textarea cols="60" rows="12" default-value="${communicationEvent.content}"/></field> <field name="workEffortName"><hidden value="${custRequestName}"/></field> <field name="workEffortId"><hidden value="${custRequestId}"/></field> <field name="statusId"><hidden value="PAS_ASSIGNED"/></field> |
Free forum by Nabble | Edit this page |