svn commit: r696159 - in /ofbiz/trunk/specialpurpose/mypage: ./ data/ script/org/ofbiz/mypage/ servicedef/ templates/ templates/email/ webapp/mypage/WEB-INF/ widget/

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

svn commit: r696159 - in /ofbiz/trunk/specialpurpose/mypage: ./ data/ script/org/ofbiz/mypage/ servicedef/ templates/ templates/email/ webapp/mypage/WEB-INF/ widget/

hansbak-2
Author: hansbak
Date: Tue Sep 16 22:45:33 2008
New Revision: 696159

URL: http://svn.apache.org/viewvc?rev=696159&view=rev
Log:
send the customer notifications about changes in the customer request

Added:
    ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/MyPageServices.xml   (with props)
    ofbiz/trunk/specialpurpose/mypage/servicedef/
    ofbiz/trunk/specialpurpose/mypage/servicedef/secas.xml   (with props)
    ofbiz/trunk/specialpurpose/mypage/servicedef/services.xml   (with props)
    ofbiz/trunk/specialpurpose/mypage/templates/
    ofbiz/trunk/specialpurpose/mypage/templates/email/
    ofbiz/trunk/specialpurpose/mypage/templates/email/CompletedCustRequestNotification.ftl   (with props)
    ofbiz/trunk/specialpurpose/mypage/templates/email/CreateCustRequestNotification.ftl   (with props)
Modified:
    ofbiz/trunk/specialpurpose/mypage/data/MyPageDemoData.xml
    ofbiz/trunk/specialpurpose/mypage/data/MyPageTypeData.xml
    ofbiz/trunk/specialpurpose/mypage/ofbiz-component.xml
    ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/Events.xml
    ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml
    ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml
    ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml
    ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml

Modified: ofbiz/trunk/specialpurpose/mypage/data/MyPageDemoData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/data/MyPageDemoData.xml?rev=696159&r1=696158&r2=696159&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/data/MyPageDemoData.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/data/MyPageDemoData.xml Tue Sep 16 22:45:33 2008
@@ -53,7 +53,7 @@
     <UserLoginSecurityGroup groupId="MYPAGE_EMPLOYEE" userLoginId="admin" fromDate="2000-01-01 00:00:00.0"/>
     <UserLoginSecurityGroup groupId="MYPAGE_EMPLOYEE" userLoginId="demoadmin" fromDate="2000-01-01 00:00:00.0"/>
     
-    
-    
+    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_CUST_CONFIRM" bodyScreenLocation="component://mypage/widget/MyPageScreens.xml#CompletedCustRequestNotification" subject="OFBiz - Your Request Is Complete[${custRequestId}]" fromAddress="[hidden email]"/>
+    <ProductStoreEmailSetting productStoreId="9000" emailType="PRDS_CUST_CREATED" bodyScreenLocation="component://mypage/widget/MyPageScreens.xml#CreateCustRequestNotification" subject="OFBiz - Your Request Is Created[${custRequestId}]" fromAddress="[hidden email]"/>
     
 </entity-engine-xml>

Modified: ofbiz/trunk/specialpurpose/mypage/data/MyPageTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/data/MyPageTypeData.xml?rev=696159&r1=696158&r2=696159&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/data/MyPageTypeData.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/data/MyPageTypeData.xml Tue Sep 16 22:45:33 2008
@@ -27,7 +27,12 @@
     <UserPreference userLoginId="_NA_" userPrefGroupId="MyPage" userPrefTypeId="myCommunications" userPrefValue="Y"/>
     <UserPreference userLoginId="_NA_" userPrefGroupId="MyPage" userPrefTypeId="otherCommunications" userPrefValue="Y"/>
     <UserPreference userLoginId="_NA_" userPrefGroupId="MyPage" userPrefTypeId="myCompanyComms" userPrefValue="Y"/>
-
+    <UserPreference userLoginId="_NA_" userPrefGroupId="MyPage" userPrefTypeId="sendCustRequestEmail" userPrefValue="Y"/>
+    
     <RoleType description="Email Administrator" hasTable="N" parentTypeId="PERSON_ROLE" roleTypeId="EMAIL_ADMIN"/>
 
+    <!-- ProductStoreEmailSetting for send auto email to customer when CustRequest completed -->
+    <Enumeration description="Customer Request Created" enumCode="CUST_CREATED" enumId="PRDS_CUST_CREATED" sequenceId="17" enumTypeId="PRDS_EMAIL"/>
+    <Enumeration description="Customer Request Completed" enumCode="CUST_COMPLETE" enumId="PRDS_CUST_CONFIRM" sequenceId="18" enumTypeId="PRDS_EMAIL"/>
+    
 </entity-engine-xml>

Modified: ofbiz/trunk/specialpurpose/mypage/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/ofbiz-component.xml?rev=696159&r1=696158&r2=696159&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/ofbiz-component.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/ofbiz-component.xml Tue Sep 16 22:45:33 2008
@@ -29,6 +29,9 @@
     <entity-resource type="data" reader-name="seed" loader="main" location="data/MyPageSecurityData.xml"/>
     <entity-resource type="data" reader-name="demo" loader="main" location="data/MyPageDemoData.xml"/>
     
+    <service-resource type="model" loader="main" location="servicedef/services.xml"/>
+    <service-resource type="eca" loader="main" location="servicedef/secas.xml"/>
+    
     <webapp name="mypage"
         title="MyPage"
         server="default-server"

Modified: ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/Events.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/Events.xml?rev=696159&r1=696158&r2=696159&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/Events.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/Events.xml Tue Sep 16 22:45:33 2008
@@ -57,6 +57,19 @@
  in-map-name="inMap" />
  </simple-method>
 
+    <simple-method method-name="updateCustPreferences" short-description="Update the customer preferences">
+        <if-compare operator="equals" value="Y" field="parameters.sendCustRequestEmail">
+            <set field="parameters.userPrefMap.sendCustRequestEmail" value="Y" />
+            <else>
+                <set field="parameters.userPrefMap.sendCustRequestEmail" value="N" />
+            </else>
+        </if-compare>
+        <set-service-fields service-name="setUserPreferenceGroup"
+                map-name="parameters" to-map-name="inMap" />
+        <call-service service-name="setUserPreferenceGroup"
+                in-map-name="inMap" />
+    </simple-method>
+    
  <simple-method method-name="setCommEventToRead"
  short-description="">
  <entity-one entity-name="CommunicationEventRole"

Added: ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/MyPageServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/MyPageServices.xml?rev=696159&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/MyPageServices.xml (added)
+++ ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/MyPageServices.xml Tue Sep 16 22:45:33 2008
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
+
+    <simple-method method-name="sendEmailToCustomer" short-description="Send Mail When Customer Request is created or commpleted.">
+        <entity-one entity-name="CustRequest" value-name="custReq">
+            <field-map field-name="custRequestId" env-name="parameters.custRequestId"/>
+        </entity-one>
+        <if>
+            <condition>
+                <if-compare field="custReq.statusId" value="CRQ_COMPLETED" operator="equals"></if-compare>
+            </condition>
+            <then>
+                <if-not-empty field="custReq.fromPartyId">
+                    <entity-and entity-name="PartyAndUserLogin" list-name="partyUserLogin">
+                        <field-map field-name="partyId" env-name="custReq.fromPartyId"/>
+                    </entity-and>
+                    <first-from-list entry-name="partyUserLogin" list-name="partyUserLogin"/>
+                    <entity-one entity-name="UserPreference" value-name="userPref">
+                        <field-map field-name="userLoginId" value="${partyUserLogin.userLoginId}"/>
+                        <field-map field-name="userPrefTypeId" value="sendCustRequestEmail"/>
+                    </entity-one>
+                    <if-empty field="userPref.userPrefValue">
+                        <!-- set send customer requst email field to default-->
+                        <set field="setUserPref.userPrefMap.sendCustRequestEmail" value="Y"/>
+                        <set field="setUserPref.userLoginId" from-field="partyUserLogin.userLoginId"/>
+                        <set field="setUserPref.userPrefGroupId" value="MyPage"/>
+                        <call-service service-name="setUserPreferenceGroup" in-map-name="setUserPref"/>
+                    </if-empty>
+                    <!-- if customer want to send email notification when customer request completed then send email-->
+                    <if>
+                        <condition>
+                            <or>
+                                <if-compare field="userPref.userPrefValue" value="Y" operator="equals"/>
+                                <if-empty field="userPref.userPrefValue"></if-empty>
+                            </or>
+                        </condition>
+                        <then>
+                            <entity-and entity-name="ProductStoreEmailSetting" list-name="storeEmail">
+                                <field-map field-name="emailType" value="PRDS_CUST_CONFIRM"/>
+                            </entity-and>
+                            <first-from-list entry-name="storeEmail" list-name="storeEmail"/>
+                            <set field="statusCustReq" value="COMPLETED"/>                                    
+                        </then>
+                    </if>
+                </if-not-empty>                
+            </then>
+            <else-if>
+                <condition>
+                    <if-compare field="custReq.statusId" value="CRQ_ACCEPTED" operator="equals"></if-compare>
+                </condition>
+                <then>
+                    <entity-and entity-name="ProductStoreEmailSetting" list-name="storeEmail">
+                        <field-map field-name="emailType" value="PRDS_CUST_CREATED"/>
+                    </entity-and>
+                    <first-from-list entry-name="storeEmail" list-name="storeEmail"/>
+                    <set field="statusCustReq" value="ACCEPTED"/>
+                </then>
+            </else-if>
+        </if>
+        <!-- Send Email to Customer when Customer Request is Completed or Created-->
+        <if>
+            <condition>
+                <or>
+                    <if-compare field="statusCustReq" value="COMPLETED" operator="equals"/>
+                    <if-compare field="statusCustReq" value="ACCEPTED" operator="equals"/>
+                </or>
+            </condition>
+            <then>
+                <if-not-empty field="storeEmail.bodyScreenLocation">
+                    <entity-one entity-name="Person" value-name="person">
+                        <field-map field-name="partyId" env-name="custReq.fromPartyId"/>
+                    </entity-one>
+                    <set field="getPartyEmail.partyId" from-field="custReq.fromPartyId"/>
+                    <call-service service-name="getPartyEmail" in-map-name="getPartyEmail">
+                     <result-to-field result-name="emailAddress" field-name="emailParams.sendTo"/>
+                    </call-service>
+                    <set field="bodyParameters.person" from-field="person"/>
+                    <set field="bodyParameters.custRequestId" from-field="parameters.custRequestId"/>
+                    <set field="bodyParameters.partyId" from-field="custReq.fromPartyId"/>
+                    <set field="emailParams.bodyParameters" from-field="bodyParameters"/>
+                    <set field="emailParams.subject" from-field="storeEmail.subject"/>
+                    <set field="emailParams.sendFrom" from-field="storeEmail.fromAddress"/>
+                    <set field="emailParams.sendCc" from-field="storeEmail.ccAddress"/>
+                    <set field="emailParams.sendBcc" from-field="storeEmail.bccAddress"/>
+                    <set field="emailParams.contentType" value="text/html"/>
+                    <set field="emailParams.bodyScreenUri" from-field="storeEmail.bodyScreenLocation"/>
+                    <set field="emailParams.webSiteId" from-field="webSite.webSiteId"/>
+                    <call-service service-name="sendMailFromScreen" in-map-name="emailParams"/>
+                </if-not-empty>
+            </then>
+        </if>
+    </simple-method>
+</simple-methods>
\ No newline at end of file

Propchange: ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/MyPageServices.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/MyPageServices.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/MyPageServices.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/specialpurpose/mypage/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/servicedef/secas.xml?rev=696159&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/servicedef/secas.xml (added)
+++ ofbiz/trunk/specialpurpose/mypage/servicedef/secas.xml Tue Sep 16 22:45:33 2008
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
+        <eca service="updateCustRequest" event="commit">
+                <condition field-name="oldStatusId" operator="not-equals" value="CRQ_COMPLETED"/>
+                <condition field-name="statusId" operator="equals" value="CRQ_COMPLETED"/>
+                <action service="sendEmailToCustomer" mode="sync"/>
+        </eca>
+        <eca service="createCustRequestStatus" event="commit">
+                <condition field-name="statusId" operator="is-not-empty"/>
+                <condition field-name="statusId" operator="equals" value="CRQ_ACCEPTED"/>
+                <action service="sendEmailToCustomer" mode="sync"/>
+        </eca>
+</service-eca>

Propchange: ofbiz/trunk/specialpurpose/mypage/servicedef/secas.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/mypage/servicedef/secas.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/specialpurpose/mypage/servicedef/secas.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/specialpurpose/mypage/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/servicedef/services.xml?rev=696159&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/servicedef/services.xml (added)
+++ ofbiz/trunk/specialpurpose/mypage/servicedef/services.xml Tue Sep 16 22:45:33 2008
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
+    <description>Project Manager service definitions.</description>
+
+    <service name="sendEmailToCustomer" engine="simple"  auth="true" default-entity-name="CustRequest"
+        location="org/ofbiz/mypage/MyPageServices.xml" invoke="sendEmailToCustomer">
+        <description>Send email to customer when customer request is Completed or Created. </description>
+        <attribute name="custRequestId" type="String" mode="IN"/>
+        <auto-attributes mode="IN" include="pk" optional="false"/>
+        <auto-attributes include="nonpk" mode="OUT" optional="true"/>
+    </service>
+    
+</services>

Propchange: ofbiz/trunk/specialpurpose/mypage/servicedef/services.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/mypage/servicedef/services.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/specialpurpose/mypage/servicedef/services.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/specialpurpose/mypage/templates/email/CompletedCustRequestNotification.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/templates/email/CompletedCustRequestNotification.ftl?rev=696159&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/templates/email/CompletedCustRequestNotification.ftl (added)
+++ ofbiz/trunk/specialpurpose/mypage/templates/email/CompletedCustRequestNotification.ftl Tue Sep 16 22:45:33 2008
@@ -0,0 +1,31 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <title>${title}</title>
+        <link rel="stylesheet" href="${baseUrl?if_exists}/images/maincss.css" type="text/css"/>
+    </head>
+    <body>
+        <h1>${title}</h1>
+        <p>Hello ${person.firstName?if_exists} ${person.lastName?if_exists},</p>
+        <p>Your Customer Request[${custRequestId}] has been completed.</p>
+    </body>
+</html>

Propchange: ofbiz/trunk/specialpurpose/mypage/templates/email/CompletedCustRequestNotification.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/mypage/templates/email/CompletedCustRequestNotification.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/specialpurpose/mypage/templates/email/CompletedCustRequestNotification.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: ofbiz/trunk/specialpurpose/mypage/templates/email/CreateCustRequestNotification.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/templates/email/CreateCustRequestNotification.ftl?rev=696159&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/templates/email/CreateCustRequestNotification.ftl (added)
+++ ofbiz/trunk/specialpurpose/mypage/templates/email/CreateCustRequestNotification.ftl Tue Sep 16 22:45:33 2008
@@ -0,0 +1,31 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <title>${title}</title>
+        <link rel="stylesheet" href="${baseUrl?if_exists}/images/maincss.css" type="text/css"/>
+    </head>
+    <body>
+        <h1>${title}</h1>
+        <p>Hello ${person.firstName?if_exists} ${person.lastName?if_exists},</p>
+        <p>Your Customer Request[${custRequestId}] has been created successfully.</p>
+    </body>
+</html>

Propchange: ofbiz/trunk/specialpurpose/mypage/templates/email/CreateCustRequestNotification.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/mypage/templates/email/CreateCustRequestNotification.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/specialpurpose/mypage/templates/email/CreateCustRequestNotification.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml?rev=696159&r1=696158&r2=696159&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml Tue Sep 16 22:45:33 2008
@@ -136,6 +136,16 @@
         <response name="success" type="view" value="main"/>
         <response name="error" type="view" value="preferences"/>
     </request-map>
+    <request-map uri="custPreferences">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="custPreferences"/>
+    </request-map>
+    <request-map uri="updateCustPreferences">
+        <security https="true" auth="true"/>
+        <event invoke="updateCustPreferences" path="org/ofbiz/mypage/Events.xml" type="simple"/>
+        <response name="success" type="view" value="main"/>
+        <response name="error" type="view" value="custPreferences"/>
+    </request-map>
     
     <!-- OTHER COMMUNICATIONS -->
     <request-map uri="otherCommunications">
@@ -217,4 +227,5 @@
     <view-map name="ViewRequest" type="screen" page="component://projectmgr/widget/RequestScreens.xml#ViewRequest"/>
     <view-map name="EditRequest" type="screen" page="component://mypage/widget/MyPageScreens.xml#EditRequest"/>
     <view-map name="ListInvoices" type="screen" page="component://mypage/widget/MyPageScreens.xml#ListInvoices"/>
+    <view-map name="custPreferences" type="screen" page="component://mypage/widget/CommonScreens.xml#custPreferences"/>
 </site-conf>

Modified: ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml?rev=696159&r1=696158&r2=696159&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml Tue Sep 16 22:45:33 2008
@@ -321,6 +321,9 @@
                     </condition-list>
                     <order-by field-name="-datetimeStarted" />
                 </entity-condition>
+                <service service-name="getUserPreferenceGroup" result-map-name="preferences">
+                    <field-map field-name="userPrefGroupId" value="MyPage" />
+                </service>
             </actions>
             <widgets>
                 <screenlet title="${uiLabelMap.MyOpenCustomerRequests}" navigation-form-name="ListCustRequests" >
@@ -481,6 +484,26 @@
             </widgets>
         </section>
     </screen>
+    <screen name="custPreferences">
+        <section>
+            <actions>
+                <set field="headerItem" value="custPreferences"/>
+                <service service-name="getUserPreferenceGroup"
+                        result-map-name="preferences">
+                        <field-map field-name="userPrefGroupId" value="MyPage" />
+                    </service>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                        <decorator-section name="body">
+                                <screenlet title="${uiLabelMap.CommonPreferences}">
+                                        <include-form name="custPreferences" location="component://mypage/widget/MyPageForms.xml"/>
+                                    </screenlet>
+                            </decorator-section>
+                    </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>
 
 

Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml?rev=696159&r1=696158&r2=696159&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml Tue Sep 16 22:45:33 2008
@@ -90,6 +90,12 @@
         <field name="updateButton"><submit/></field>
     </form>
     
+    <form name="custPreferences" type="single" target="updateCustPreferences" default-map-name="preferences.userPrefMap">
+        <field name="userPrefGroupId"><hidden value="MyPage"/></field>
+        <field name="sendCustRequestEmail" title="Send Email To Every Customer Request Change"><check/></field>
+        <field name="updateButton"><submit/></field>
+    </form>
+    
     <form name="ListPartyCommEvents" extends="ListCommEvents" extends-resource="component://party/webapp/partymgr/communication/CommForms.xml" type="list">
         <row-actions>
             <set field="toComplete" value="${bsh:&quot;COM_ROLE_READ&quot;.equals(roleStatusId)?&quot;->Complete&quot;:&quot;&quot;}"/>

Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml?rev=696159&r1=696158&r2=696159&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml Tue Sep 16 22:45:33 2008
@@ -105,6 +105,12 @@
             </condition>
             <link target="preferences"/>
         </menu-item>
+        <menu-item name="custPreferences" title="${uiLabelMap.CommonPreferences}" align-style="opposed">
+            <condition>
+                <if-has-permission permission="MYPAGE_CUSTOMER"/>
+            </condition>
+            <link target="custPreferences"/>
+        </menu-item>
     </menu>    
     
     <menu name="MyCompanyCommsMenu">

Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml?rev=696159&r1=696158&r2=696159&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml Tue Sep 16 22:45:33 2008
@@ -492,4 +492,24 @@
             </widgets>
         </section>
     </screen>
+    <screen name="CreateCustRequestNotification">
+        <section>
+            <actions>
+                <set field="title" value="Customer Request Creation Notification Mail #${custRequestId}"/>
+            </actions>
+            <widgets>
+                <platform-specific><html><html-template location="component://mypage/templates/email/CreateCustRequestNotification.ftl"/></html></platform-specific>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="CompletedCustRequestNotification">
+        <section>
+            <actions>
+                <set field="title" value="Customer Request Completed Notification Mail #${custRequestId}"/>
+            </actions>
+            <widgets>
+                <platform-specific><html><html-template location="component://mypage/templates/email/CompletedCustRequestNotification.ftl"/></html></platform-specific>
+            </widgets>
+        </section>
+    </screen>
 </screens>