You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2008/07/06 17:52:46 UTC
svn commit: r674308 - in /ofbiz/trunk/specialpurpose/mypage: ./ config/
data/ script/org/ofbiz/mypage/ webapp/mypage/WEB-INF/ widget/
Author: hansbak
Date: Sun Jul 6 08:52:46 2008
New Revision: 674308
URL: http://svn.apache.org/viewvc?rev=674308&view=rev
Log:
make it possible to edit other parties email for a company for example within mypage
Added:
ofbiz/trunk/specialpurpose/mypage/data/MyPageDemoData.xml (with props)
Modified:
ofbiz/trunk/specialpurpose/mypage/config/MyPageUiLabels.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/config/MyPageUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/config/MyPageUiLabels.xml?rev=674308&r1=674307&r2=674308&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/config/MyPageUiLabels.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/config/MyPageUiLabels.xml Sun Jul 6 08:52:46 2008
@@ -18,6 +18,9 @@
under the License.
-->
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <property key="MyCommunications">
+ <value xml:lang="en">My Communications</value>
+ </property>
<property key="MyProfile">
<value xml:lang="en">My Profile</value>
<value xml:lang="fr">Mon Profil</value>
@@ -26,4 +29,10 @@
<value xml:lang="en">New Message</value>
<value xml:lang="fr">Nouveau message</value>
</property>
+ <property key="OtherCommunications">
+ <value xml:lang="en">Other Communications</value>
+ </property>
+ <property key="OtherCommunicationsOfParty">
+ <value xml:lang="en">Other Communications of party</value>
+ </property>
</resource>
Added: ofbiz/trunk/specialpurpose/mypage/data/MyPageDemoData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/data/MyPageDemoData.xml?rev=674308&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/data/MyPageDemoData.xml (added)
+++ ofbiz/trunk/specialpurpose/mypage/data/MyPageDemoData.xml Sun Jul 6 08:52:46 2008
@@ -0,0 +1,26 @@
+<?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.
+-->
+<entity-engine-xml>
+
+ <!-- allow admin to read company communications -->
+ <PartyRole partyId="admin" roleTypeId="EMAIL_ADMIN"/>
+ <PartyRelationship partyIdFrom="admin" roleTypeIdFrom="EMAIL_ADMIN" partyIdTo="Company" roleTypeIdTo="_NA_" fromDate="2000-01-01 00:00:00"/>
+
+</entity-engine-xml>
Propchange: ofbiz/trunk/specialpurpose/mypage/data/MyPageDemoData.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ofbiz/trunk/specialpurpose/mypage/data/MyPageDemoData.xml
------------------------------------------------------------------------------
svn:keywords = "Date Rev Author URL Id"
Propchange: ofbiz/trunk/specialpurpose/mypage/data/MyPageDemoData.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: ofbiz/trunk/specialpurpose/mypage/data/MyPageTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/data/MyPageTypeData.xml?rev=674308&r1=674307&r2=674308&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/data/MyPageTypeData.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/data/MyPageTypeData.xml Sun Jul 6 08:52:46 2008
@@ -25,6 +25,9 @@
<UserPreference userLoginId="_NA_" userPrefGroupId="MyPage" userPrefTypeId="myTasks" userPrefValue="Y"/>
<UserPreference userLoginId="_NA_" userPrefGroupId="MyPage" userPrefTypeId="myTimesheet" userPrefValue="Y"/>
<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"/>
+ <RoleType description="Email Administrator" hasTable="N" parentTypeId="PERSON_ROLE" roleTypeId="EMAIL_ADMIN"/>
+
</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=674308&r1=674307&r2=674308&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/ofbiz-component.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/ofbiz-component.xml Sun Jul 6 08:52:46 2008
@@ -26,6 +26,7 @@
<classpath type="dir" location="script"/>
<entity-resource type="data" reader-name="seed" loader="main" location="data/MyPageTypeData.xml"/>
+ <entity-resource type="data" reader-name="demo" loader="main" location="data/MyPageDemoData.xml"/>
<webapp name="mypage"
title="MyPage"
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=674308&r1=674307&r2=674308&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/Events.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/script/org/ofbiz/mypage/Events.xml Sun Jul 6 08:52:46 2008
@@ -45,6 +45,12 @@
<set field="parameters.userPrefMap.myCommunications" value="N" />
</else>
</if-compare>
+ <if-compare operator="equals" value="Y" field="parameters.otherCommunications">
+ <set field="parameters.userPrefMap.otherCommunications" value="Y" />
+ <else>
+ <set field="parameters.userPrefMap.otherCommunications" value="N" />
+ </else>
+ </if-compare>
<set-service-fields service-name="setUserPreferenceGroup"
map-name="parameters" to-map-name="inMap" />
<call-service service-name="setUserPreferenceGroup"
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=674308&r1=674307&r2=674308&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml Sun Jul 6 08:52:46 2008
@@ -96,6 +96,10 @@
<security https="true" auth="true"/>
<response name="success" type="view" value="myCommunications"/>
</request-map>
+ <request-map uri="otherCommunications">
+ <security https="true" auth="true"/>
+ <response name="success" type="view" value="otherCommunications"/>
+ </request-map>
<request-map uri="myCompanyComms">
<security https="true" auth="true"/>
<response name="success" type="view" value="myCompanyComms"/>
@@ -111,6 +115,7 @@
<view-map name="preferences" type="screen" page="component://mypage/widget/CommonScreens.xml#preferences"/>
<view-map name="myTasks" type="screen" page="component://mypage/widget/CommonScreens.xml#MyTasks"/>
<view-map name="myCommunications" type="screen" page="component://mypage/widget/CommonScreens.xml#MyCommunications"/>
+ <view-map name="otherCommunications" type="screen" page="component://mypage/widget/CommonScreens.xml#OtherCommunications"/>
<view-map name="myCompanyComms" type="screen" page="component://mypage/widget/CommonScreens.xml#MyCompanyComms"/>
<view-map name="myTimesheet" type="screen" page="component://mypage/widget/CommonScreens.xml#MyTimesheet"/>
<view-map name="newEvent" type="screen" page="component://mypage/widget/MyPageScreens.xml#newEvent"/>
Modified: ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml?rev=674308&r1=674307&r2=674308&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml Sun Jul 6 08:52:46 2008
@@ -239,6 +239,16 @@
</section>
<section>
<condition>
+ <if-compare field-name="preferences.userPrefMap.otherCommunications"
+ operator="equals" value="Y" />
+ </condition>
+ <widgets>
+ <include-screen name="OtherCommunications"
+ location="component://mypage/widget/MyPageScreens.xml" />
+ </widgets>
+ </section>
+ <section>
+ <condition>
<if-compare field-name="preferences.userPrefMap.myCompanyComms"
operator="equals" value="Y" />
</condition>
@@ -324,6 +334,22 @@
</widgets>
</section>
</screen>
+ <screen name="OtherCommunications">
+ <section>
+ <actions>
+ <set field="headerItem" value="otherCommunications" />
+ </actions>
+ <widgets>
+ <decorator-screen name="main-decorator"
+ location="${parameters.mainDecoratorLocation}">
+ <decorator-section name="body">
+ <include-screen name="OtherCommunications"
+ location="component://mypage/widget/MyPageScreens.xml" />
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
<screen name="MyCompanyComms">
<section>
<actions>
Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml?rev=674308&r1=674307&r2=674308&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml Sun Jul 6 08:52:46 2008
@@ -78,6 +78,7 @@
<field name="myTimesheet"><check/></field>
<field name="myTasks"><check/></field>
<field name="myCommunications"><check/></field>
+ <field name="otherCommunications"><check/></field>
<field name="updateButton"><submit/></field>
</form>
</forms>
\ No newline at end of file
Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml?rev=674308&r1=674307&r2=674308&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml Sun Jul 6 08:52:46 2008
@@ -42,6 +42,15 @@
</condition>
<link target="myCommunications"/>
</menu-item>
+ <menu-item name="otherCommunications" title="${uiLabelMap.OtherCommunications}">
+ <condition>
+ <and>
+ <not><if-empty field-name="userLogin"/></not>
+ <if-compare field-name="preferences.userPrefMap.otherCommunications" operator="not-equals" value="Y"/>
+ </and>
+ </condition>
+ <link target="otherCommunications"/>
+ </menu-item>
<menu-item name="myCompanyComms" title="${uiLabelMap.MyCompanyComms}">
<condition>
<and>
@@ -94,15 +103,15 @@
</menu>
<menu name="MyCommunicationsMenu">
- <menu-item name="newEmail" title="${uiLabelMap.PartyNewEmail}"><link target="newEmail"/></menu-item>
- <menu-item name="newNote" title="${uiLabelMap.PartyNewInternalNote}"><link target="newInternalNote"/></menu-item>
+ <menu-item name="newEmail" title="${uiLabelMap.PartyNewEmail}"><link target="newEmail?partyIdFrom=${partyId}"/></menu-item>
+ <menu-item name="newNote" title="${uiLabelMap.PartyNewInternalNote}"><link target="newInternalNote?partyIdFrom=${partyId}"/></menu-item>
</menu>
- <menu name="MyTasksMenu">
+ <menu name="MyTasksMenu" type="simple" menu-container-style="button-bar button-style-2" default-selected-style="selected" selected-menuitem-context-field-name="tabButtonItem">
<menu-item name="myTasks" title="myTasks"><link target="/projectmgr/control/MyTasks" url-mode="inter-app"/></menu-item>
</menu>
- <menu name="MyTimesheetMenu" extends="TimesheetBar" extends-resource="component://projectmgr/widget/Menus.xml">
+ <menu name="MyTimesheetMenu" extends="TimesheetBar" extends-resource="component://projectmgr/widget/Menus.xml" type="simple" menu-container-style="button-bar button-style-2" default-selected-style="selected" selected-menuitem-context-field-name="tabButtonItem">
<menu-item name="myTime" title="myTime"><link target="/projectmgr/control/MyTimesheet" url-mode="inter-app"/></menu-item>
</menu>
Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml?rev=674308&r1=674307&r2=674308&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml Sun Jul 6 08:52:46 2008
@@ -114,52 +114,54 @@
</widgets>
</section>
</screen>
-
-
- <screen name="MyCommunications">
- <section>
- <actions>
- <set field="partyId" from-field="userLogin.partyId"/>
- </actions>
- <widgets>
- <screenlet title="MyCommunications" navigation-menu-name="MyCommunicationsMenu" navigation-form-name="ListPartyCommEvents" name="comms">
- <include-menu name="MyCommunicationsMenu" location="component://mypage/widget/MyPageMenus.xml"/>
- <include-form name="ListPartyCommEvents" location="component://party/webapp/partymgr/communication/CommForms.xml"/>
- </screenlet>
- <!--container style="righthalf">
- <screenlet title="Pending outgoing">
- <include-form name="ListPendingCommEvents" location="component://party/webapp/partymgr/communication/CommForms.xml"/>
- </screenlet>
- </container>
- <container style="clear"/-->
- </widgets>
- </section>
- </screen>
-
- <screen name="MyCompanyComms1">
- <section>
- <actions>
- <set field="partyId" from-field="userLogin.partyId"/>
- </actions>
- <widgets>
- <screenlet tab-menu-name="Company messages" name="companyMessages" collapsible="true">
- <container style="lefthalf">
- <screenlet title="Incoming communications" navigation-menu-name="MessageMenu">
- <include-menu name="MessageMenu" location="component://mypage/widget/MyPageMenus.xml"/>
- <include-form name="ListPartyCommEvents" location="component://party/webapp/partymgr/communication/CommForms.xml"/>
- </screenlet>
- </container>
- <container style="righthalf">
- <screenlet title="Pending outgoing">
- <include-form name="ListPendingCommEvents" location="component://party/webapp/partymgr/communication/CommForms.xml"/>
- </screenlet>
- </container>
- <container style="clear"/>
- </screenlet>
- </widgets>
- </section>
- </screen>
-
+ <screen name="MyCommunications">
+ <section>
+ <actions>
+ <set field="partyId" from-field="userLogin.partyId" />
+ </actions>
+ <widgets>
+ <screenlet title="${uiLabelMap.MyCommunications}" navigation-menu-name="MyCommunicationsMenu"
+ navigation-form-name="ListPartyCommEvents" name="comms">
+ <include-menu name="MyCommunicationsMenu"
+ location="component://mypage/widget/MyPageMenus.xml" />
+ <include-form name="ListPartyCommEvents"
+ location="component://party/webapp/partymgr/communication/CommForms.xml" />
+ </screenlet>
+ </widgets>
+ </section>
+ </screen>
+ <screen name="OtherCommunications">
+ <section>
+ <actions>
+ <entity-and list-name="emailOwners" entity-name="PartyRelationship" filter-by-date="true">
+ <field-map field-name="partyIdFrom" value="${userLogin.partyId}" />
+ <field-map field-name="roleTypeIdFrom" value="EMAIL_ADMIN" />
+ </entity-and>
+ </actions>
+ <widgets>
+ <iterate-section entry-name="emailOwner" list-name="emailOwners">
+ <section>
+ <actions>
+ <set field="partyId" from-field="emailOwner.partyIdTo" />
+ <entity-one entity-name="PartyNameView" value-name="partyName">
+ <field-map field-name="partyId" env-name="partyId"/>
+ </entity-one>
+ </actions>
+ <widgets>
+ <screenlet title="${uiLabelMap.OtherCommunicationsOfParty}: ${partyName.firstName} ${partyName.middleName} ${partyName.lastName} ${partyName.groupName} [${partyId}] "
+ navigation-menu-name="MyCommunicationsMenu"
+ navigation-form-name="ListPartyCommEvents" name="comms">
+ <include-menu name="MyCommunicationsMenu"
+ location="component://mypage/widget/MyPageMenus.xml" />
+ <include-form name="ListPartyCommEvents"
+ location="component://party/webapp/partymgr/communication/CommForms.xml" />
+ </screenlet>
+ </widgets>
+ </section>
+ </iterate-section>
+ </widgets>
+ </section>
+ </screen>
</screens>