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/12/11 07:47:54 UTC
svn commit: r725597 - in /ofbiz/trunk/applications/party:
data/PartyTypeData.xml entitydef/entitymodel.xml
webapp/partymgr/WEB-INF/controller.xml webapp/partymgr/party/PartyForms.xml
widget/partymgr/PartyMenus.xml widget/partymgr/PartyScreens.xml
Author: hansbak
Date: Wed Dec 10 22:47:51 2008
New Revision: 725597
URL: http://svn.apache.org/viewvc?rev=725597&view=rev
Log:
first version of a party preferences screenlet on the party profile page. ----> load of seed data required
Modified:
ofbiz/trunk/applications/party/data/PartyTypeData.xml
ofbiz/trunk/applications/party/entitydef/entitymodel.xml
ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml
ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml
ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml
ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml
Modified: ofbiz/trunk/applications/party/data/PartyTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/data/PartyTypeData.xml?rev=725597&r1=725596&r2=725597&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/data/PartyTypeData.xml (original)
+++ ofbiz/trunk/applications/party/data/PartyTypeData.xml Wed Dec 10 22:47:51 2008
@@ -397,5 +397,13 @@
<TermType description="Preferred Freight" parentTypeId="PURCHASING" termTypeId="PURCH_FREIGHT"/>
<TermType description="Other" hasTable="N" parentTypeId="" termTypeId="OTHER_TERM"/>
-
+
+ <!-- User preferences data -->
+ <UserPrefGroupType userPrefGroupTypeId="GLOBAL_PREFERENCES" description="Global preferences"/>
+ <UserPreference userLoginId="_NA_" userPrefTypeId="ORGANIZATION_PARTY" userPrefGroupTypeId="GLOBAL_PREFERENCES" userPrefValue="DEFAULT"/>
+
+ <EnumerationType description="Global preferences" enumTypeId="GLOBAL_PREFERENCES" hasTable="N" parentTypeId=""/>
+ <Enumeration description="Organization party" enumCode="" enumId="ORGANIZATION_PARTY" sequenceId="01" enumTypeId="GLOBAL_PREFERENCES"/>
+ <Enumeration description="Visual Theme" enumCode="" enumId="VISUAL_THEME" sequenceId="02" enumTypeId="GLOBAL_PREFERENCES"/>
+
</entity-engine-xml>
Modified: ofbiz/trunk/applications/party/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/entitydef/entitymodel.xml?rev=725597&r1=725596&r2=725597&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/party/entitydef/entitymodel.xml Wed Dec 10 22:47:51 2008
@@ -2627,4 +2627,20 @@
<key-map field-name="partyId"/>
</relation>
</extend-entity>
+ <view-entity entity-name="PartyAcctgAndName"
+ package-name="org.ofbiz.party.party"
+ title="PartyAcctgPreference and PartyNameView Entity">
+ <member-entity entity-alias="PTYACCPREF" entity-name="PartyAcctgPreference"/>
+ <member-entity entity-alias="PTYNVIEW" entity-name="PartyNameView"/>
+ <alias entity-alias="PTYACCPREF" name="partyId" />
+ <alias entity-alias="PTYNVIEW" name="firstName"/>
+ <alias entity-alias="PTYNVIEW" name="middleName"/>
+ <alias entity-alias="PTYNVIEW" name="lastName"/>
+ <alias entity-alias="PTYNVIEW" name="groupName"/>
+ <alias entity-alias="PTYNVIEW" name="partyTypeId"/>
+ <alias entity-alias="PTYNVIEW" name="description"/>
+ <view-link entity-alias="PTYACCPREF" rel-entity-alias="PTYNVIEW">
+ <key-map field-name="partyId"/>
+ </view-link>
+ </view-entity>
</entitymodel>
Modified: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml?rev=725597&r1=725596&r2=725597&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml Wed Dec 10 22:47:51 2008
@@ -1088,7 +1088,19 @@
<security https="true" auth="true"/>
<response name="success" type="view" value="PartyFinancialHistory"/>
<response name="error" type="view" value="viewprofile"/>
- </request-map>
+ </request-map>
+
+ <!-- preferences -->
+ <request-map uri="Preferences">
+ <security https="true" auth="true"/>
+ <response name="success" type="view" value="Preferences"/>
+ </request-map>
+ <request-map uri="updatePreference">
+ <security https="true" auth="true"/>
+ <event type="service" invoke="setUserPreference"/>
+ <response name="success" type="view" value="Preferences"/>
+ <response name="error" type="view" value="Preferences"/>
+ </request-map>
<!-- end of request mappings -->
<!-- View Mappings -->
@@ -1201,5 +1213,6 @@
<view-map name="EditPartyResumes" type="screen" page="component://party/widget/partymgr/PartyScreens.xml#EditPartyResumes"/>
<view-map name="EditEmploymentApps" type="screen" page="component://humanres/widget/EmploymentAppScreens.xml#EditEmploymentApps"/>
<view-map name="PartyFinancialHistory" type="screen" page="component://party/widget/partymgr/PartyScreens.xml#PartyFinancialHistory"/>
+ <view-map name="Preferences" type="screen" page="component://party/widget/partymgr/PartyScreens.xml#Preferences"/>
<!-- end of view mappings -->
</site-conf>
Modified: ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml?rev=725597&r1=725596&r2=725597&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml Wed Dec 10 22:47:51 2008
@@ -928,5 +928,28 @@
<field name="description" title="${uiLabelMap.CommonDescription}" required-field="true"><text/></field>
<field name="save" title="${uiLabelMap.CommonSave}"><submit/></field>
</form>
-
+ <form name="ListPreference" type="list" target="updatePreference?partyId=${partyId}" list-name="userPreferences"
+ odd-row-style="alternate-row" default-table-style="basic-table hover-bar" separate-columns="true" use-row-submit="true" >
+ <row-actions>
+ <service service-name="getUserPreference" result-map-name="values">
+ <field-map field-name="userPrefTypeId" env-name="enumId"/>
+ </service>
+ <set field="partyId" from-field="values.userPrefValue"/>
+ <set field="visualThemeId" from-field="values.userPrefValue"/>
+ </row-actions>
+ <field name="enumId" parameter-name="userPrefTypeId"><hidden value="${enumId}"/></field>
+ <field name="enumTypeId" parameter-name="userPrefGroupTypeId"><hidden value="${enumTypeId}"/></field>
+ <field name="description" title="${uiLabelMap.CommonName}"><display/></field>
+ <field name="partyId" title="${uiLabelMap.CommonValue}" use-when="enumId.equals("ORGANIZATION_PARTY")" parameter-name="userPrefValue" >
+ <drop-down current="selected">
+ <entity-options entity-name="PartyAcctgAndName" description="${firstName} ${lastName} ${groupName}"/>
+ </drop-down>
+ </field>
+ <field name="visualThemeId" title="${uiLabelMap.CommonEmptyHeader}" use-when="enumId.equals("VISUAL_THEME")" parameter-name="userPrefValue">
+ <drop-down current="selected">
+ <entity-options entity-name="VisualTheme" description="${description}"/>
+ </drop-down>
+ </field>
+ <field name="submit" title="${uiLabelMap.CommonUpdate}"><submit/></field>
+ </form>
</forms>
Modified: ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml?rev=725597&r1=725596&r2=725597&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml Wed Dec 10 22:47:51 2008
@@ -25,6 +25,9 @@
<menu-item name="viewprofile" title="${uiLabelMap.PartyProfile}">
<link target="viewprofile?partyId=${partyId}"/>
</menu-item>
+ <menu-item name="preferences" title="${uiLabelMap.CommonPreferences}">
+ <link target="Preferences?partyId=${partyId}"/>
+ </menu-item>
<menu-item name="viewroles" title="${uiLabelMap.PartyRoles}">
<link target="viewroles?partyId=${partyId}"/>
</menu-item>
Modified: ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml?rev=725597&r1=725596&r2=725597&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml Wed Dec 10 22:47:51 2008
@@ -1064,4 +1064,26 @@
</widgets>
</section>
</screen>
+ <screen name="Preferences">
+ <section>
+ <actions>
+ <set field="titleProperty" value="PageTitleViewPartyPreferences"/>
+ <set field="headerItem" value="find"/>
+ <set field="tabButtonItem" value="preferences"/>
+ <set field="partyId" from-field="parameters.partyId"/>
+ <entity-and entity-name="Enumeration" list-name="userPreferences">
+ <field-map field-name="enumTypeId" value="GLOBAL_PREFERENCES"/>
+ </entity-and>
+ </actions>
+ <widgets>
+ <decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
+ <decorator-section name="body">
+ <screenlet title="${uiLabelMap.CommonPreferences}" >
+ <include-form name="ListPreference" location="component://party/webapp/partymgr/party/PartyForms.xml"/>
+ </screenlet>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
</screens>
\ No newline at end of file