Modified: ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml?rev=758522&r1=758521&r2=758522&view=diff ============================================================================== --- ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml (original) +++ ofbiz/trunk/applications/party/widget/partymgr/CommunicationScreens.xml Thu Mar 26 06:06:12 2009 @@ -46,7 +46,7 @@ <include-menu location="component://party/widget/partymgr/PartyMenus.xml" name="ProfileTabBar"/> </widgets> </section> - <include-menu location="component://party/webapp/partymgr/communication/CommMenus.xml" name="CommFindTabBar"/> + <include-menu location="component://party/widget/partymgr/PartyMenus.xml" name="CommFindTabBar"/> <container><label style="h1" text="${uiLabelMap.PartyPendingCommunicationEvents}"/></container> <container><link style="smallSubmit" target="ViewCommunicationEvent?partyId=${partyId}" text="${uiLabelMap.PartyNewCommunication}"/></container> <include-form location="component://party/webapp/partymgr/communication/CommForms.xml" name="ListPendingCommEvents"/> @@ -71,7 +71,12 @@ <set field="partyId" value="${parameters.partyId}"/> <set field="partyIdFrom" value="${parameters.partyIdFrom}" default-value="${parameters.partyId}"/> <set field="partyIdTo" value="${parameters.partyIdTo}" default-value="${parameters.partyId}"/> - <set field="donePage" from-field="parameters.DONE_PAGE" default-value="ListPartyCommEvents?partyId=${partyId}"/> + <entity-condition entity-name="CommunicationEventAndRole" list="commEvents"> + <condition-list combine="and"> + <condition-expr field-name="partyId" operator="equals" value="${partyId}"/> + </condition-list> + <order-by field-name="-entryDate"/> + </entity-condition> </actions> <widgets> <decorator-screen name="CommonCommunicationEventDecorator" location="${parameters.mainDecoratorLocation}"> @@ -137,10 +142,10 @@ <if-service-permission service-name="partyCommunicationEventPermissionCheck" main-action="VIEW"/> </condition> <widgets> - <include-menu location="component://party/webapp/partymgr/communication/CommMenus.xml" name="CommEventTabBar"/> + <include-menu location="component://party/widget/partymgr/PartyMenus.xml" name="CommEventTabBar"/> <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml"> <decorator-section name="menu-bar"> - <include-menu name="CommSubTabBar" location="component://party/webapp/partymgr/communication/CommMenus.xml"/> + <include-menu name="CommSubTabBar" location="component://party/widget/partymgr/PartyMenus.xml"/> </decorator-section> <decorator-section name="search-options"> <include-form location="component://party/webapp/partymgr/communication/CommForms.xml" name="findCommEvents"/> @@ -168,71 +173,79 @@ <entity-one entity-name="CommunicationEvent" value-field="communicationEvent" /> </actions> <widgets> - <decorator-screen name="CommonCommunicationEventDecorator" - location="${parameters.mainDecoratorLocation}"> + <decorator-screen name="Common${parameters.my}CommunicationEventDecorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> - <container style="lefthalf"> - <label style="h1" text="${uiLabelMap.PartyCommEvent}: ${parameters.communicationEventId}"></label> - <include-screen name="commEvent" /> - <section> - <condition> - <not> - <if-empty field="communicationEvent.parentCommEventId" /> - </not> - </condition> - <actions> - <set field="parent" value="${uiLabelMap.CommonParent}"/> - <entity-one entity-name="CommunicationEvent" - value-field="communicationEvent"> - <field-map field-name="communicationEventId" - from-field="communicationEvent.parentCommEventId" /> - </entity-one> - </actions> - <widgets> - <include-screen name="commEvent" /> - </widgets> - </section> - </container> - <container style="righthalf"> - <label style="h1" text="${uiLabelMap.CommonRelatedInformation}" /> - <screenlet title="${uiLabelMap.PartyCommEventRoles}"> - <include-form name="ViewCommRoles" + <include-screen name="commOverview"/> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + <screen name="commOverview"> + <section> + <widgets> + <container style="lefthalf"> + <section> + <widgets> + <label style="h1" text="${uiLabelMap.FormFieldTitle_communicationEventId} ${parameters.communicationEventId}"/> + <include-screen name="commEvent" location="component://party/widget/partymgr/CommunicationScreens.xml"/> + </widgets> + </section> + <section> + <condition> + <not> + <if-empty field="communicationEvent.parentCommEventId" /> + </not> + </condition> + <actions> + <set field="parent" value="${uiLabelMap.CommonParent}"/> + <entity-one entity-name="CommunicationEvent" value-field="communicationEvent"> + <field-map field-name="communicationEventId" from-field="communicationEvent.parentCommEventId" /> + </entity-one> + </actions> + <widgets> + <include-screen name="commEvent" location="component://party/widget/partymgr/CommunicationScreens.xml" /> + </widgets> + </section> + </container> + <container style="righthalf"> + <label style="h1" text="${uiLabelMap.CommonRelatedInformation}" /> + <screenlet title="${uiLabelMap.PartyCommEventRoles}"> + <include-form name="ViewCommRoles" + location="component://party/webapp/partymgr/communication/CommForms.xml" /> + </screenlet> + <screenlet title="${uiLabelMap.PartyCommContent}"> + <include-form name="listCommContent" + location="component://party/webapp/partymgr/communication/CommForms.xml" /> + </screenlet> + <section> + <actions> + <entity-and list="commEvents" entity-name="CommunicationEvent"> + <field-map field-name="parentCommEventId" + from-field="parameters.communicationEventId" /> + </entity-and> + </actions> + <widgets> + <screenlet title="${uiLabelMap.PartyChildCommunicationEvents}"> + <include-form name="ListCommEvents" location="component://party/webapp/partymgr/communication/CommForms.xml" /> </screenlet> - <screenlet title="${uiLabelMap.PartyCommContent}"> - <include-form name="listCommContent" - location="component://party/webapp/partymgr/communication/CommForms.xml" /> + </widgets> + </section> + <section> + <actions> + <set field="entityName" value="CustRequestAndCommEvent" /> + <set field="requestParameters.communicationEventId" + from-field="parameters.communicationEventId" /> + </actions> + <widgets> + <screenlet title="${uiLabelMap.OrderRequestList}"> + <include-form name="ListRequests" + location="component://order/webapp/ordermgr/request/RequestForms.xml" /> </screenlet> - <section> - <actions> - <entity-and list="commEvents" entity-name="CommunicationEvent"> - <field-map field-name="parentCommEventId" - from-field="parameters.communicationEventId" /> - </entity-and> - </actions> - <widgets> - <screenlet title="${uiLabelMap.PartyChildCommunicationEvents}"> - <include-form name="ListCommEvents" - location="component://party/webapp/partymgr/communication/CommForms.xml" /> - </screenlet> - </widgets> - </section> - <section> - <actions> - <set field="entityName" value="CustRequestAndCommEvent" /> - <set field="requestParameters.communicationEventId" - from-field="parameters.communicationEventId" /> - </actions> - <widgets> - <screenlet title="${uiLabelMap.OrderRequestList}"> - <include-form name="ListRequests" - location="component://party/webapp/partymgr/communication/CommForms.xml"/> - </screenlet> - </widgets> - </section> - </container> - </decorator-section> - </decorator-screen> + </widgets> + </section> + </container> </widgets> </section> </screen> @@ -252,11 +265,11 @@ <widgets> <section> <condition> - <and> + <or> <if-compare field="communicationEvent.statusId" operator="equals" value="COM_UNKNOWN_PARTY" /> <if-empty field="communicationEvent.partyIdFrom" /> - </and> + </or> </condition> <widgets> <screenlet> @@ -268,8 +281,6 @@ </container> <include-form name="allocateMsgToPartyForm" location="component://party/webapp/partymgr/communication/CommForms.xml" /> - <include-form name="deleteEmail" - location="component://party/webapp/partymgr/communication/CommForms.xml" /> </screenlet> </widgets> </section> @@ -287,70 +298,151 @@ </widgets> </section> </screen> + <screen name="addAttachmentEmail"> + <section> + <actions> + <entity-condition entity-name="MimeType" list="mimeTypes"> + <order-by field-name="description"/> + <order-by field-name="mimeTypeId"/> + </entity-condition> + <set field="communicationEventId" from-field="parameters.communicationEventId"/> + <set field="communicationEventTypeId" from-field="parameters.communicationEventTypeId"/> + <set field="partyId" from-field="userLogin.partyId"/> + </actions> + <widgets> + <screenlet title="${uiLabelMap.PartyAttachContent}"> + <platform-specific> + <html> + <html-template location="component://party/webapp/partymgr/communication/addAttachFile.ftl"/> + </html> + </platform-specific> + </screenlet> + </widgets> + </section> + </screen> + <screen name="AttachFileList"> + <section> + <actions> + <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/> + <property-map resource="ContentUiLabels" map-name="uiLabelMap" global="true"/> + <entity-and entity-name="CommEventContentAssoc" list="commEventContent"> + <field-map field-name="communicationEventId" from-field="parameters.communicationEventId"/> + </entity-and> + <entity-and entity-name="PartyContent" list="partyContent"> + <field-map field-name="partyId" from-field="userLogin.partyId"/> + </entity-and> + </actions> + <widgets> + <screenlet title="${uiLabelMap.PartyAttachFile}"> + <platform-specific> + <html> + <html-template location="component://party/webapp/partymgr/communication/attachFileList.ftl"/> + </html> + </platform-specific> + </screenlet> + </widgets> + </section> + </screen> <screen name="EditCommunicationEvent"> <section> <actions> <set field="titleProperty" value="PageTitleEditCommunication" /> - <set field="tabButtonItem" value="CommunicationEvent" /> <entity-one entity-name="CommunicationEvent" value-field="communicationEvent" /> + <set field="parameters.communicationEventTypeId" from-field="parameters.communicationEventTypeId" default-value="${communicationEvent.communicationEventTypeId}"/> <script location="component://party/webapp/partymgr/WEB-INF/actions/communication/PrepCommEventReply.groovy"/> <script location="component://party/webapp/partymgr/WEB-INF/actions/communication/PrepCommEventForward.groovy"/> </actions> <widgets> - <decorator-screen name="CommonCommunicationEventDecorator" - location="${parameters.mainDecoratorLocation}"> + <decorator-screen name="Common${parameters.my}CommunicationEventDecorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> <section><!-- Email --> <condition> <or><!-- have for e-mails a special form --> - <if-compare field="parameters.communicationEventTypeId" - operator="equals" value="EMAIL_COMMUNICATION" /> - <if-compare field="parameters.communicationEventTypeId" - operator="equals" value="AUTO_EMAIL_COMM" /> + <if-compare field="parameters.communicationEventTypeId" operator="equals" value="EMAIL_COMMUNICATION" /> + <if-compare field="parameters.communicationEventTypeId" operator="equals" value="AUTO_EMAIL_COMM" /> </or> </condition> <widgets> - <screenlet id="EditCommunicationEventPanel" title="${uiLabelMap.PartyEditCommunicationEvent}" collapsible="true"> - <include-form location="component://party/webapp/partymgr/communication/CommForms.xml" name="NewEmail"/> - </screenlet> + <section> + <condition> + <if-empty field="communicationEvent"/> + </condition> + <widgets> + <screenlet title="${uiLabelMap.PartyCreateAddEmail} ${parameters.communicationEventId}"> + <include-form location="component://party/webapp/partymgr/communication/CommForms.xml" name="EditEmail"/> + </screenlet> + </widgets> + <fail-widgets> + <container style="lefthalf"> + <screenlet title="${uiLabelMap.PartyCreateAddEmail} ${parameters.communicationEventId}"> + <include-form location="component://party/webapp/partymgr/communication/CommForms.xml" name="EditEmail"/> + </screenlet> + </container> + <container style="righthalf"> + <screenlet title="${uiLabelMap.PartyCommEventRoles}"> + <include-form name="ViewCommRoles" location="component://party/webapp/partymgr/communication/CommForms.xml" /> + </screenlet> + <screenlet title="${uiLabelMap.PartyCommEventRoles}"> + <include-form location="component://party/webapp/partymgr/communication/CommForms.xml" name="AddEventRole" /> + </screenlet> + <include-screen name="AttachFileList"/> + <include-screen name="addAttachmentEmail"/> + </container> + </fail-widgets> + </section> + <container style="clear"/> </widgets> </section> <section> <condition><!-- internal note --> - <if-compare field="parameters.communicationEventTypeId" - operator="equals" value="COMMENT_NOTE" /> + <if-compare field="parameters.communicationEventTypeId" operator="equals" value="COMMENT_NOTE" /> </condition> <widgets> - <screenlet id="EditCommunicationEventPanel" title="${uiLabelMap.PartyEditCommunicationEvent}" collapsible="true"> - <include-form location="component://party/webapp/partymgr/communication/CommForms.xml" name="NewInternalNote"/> - </screenlet> + <section> + <condition> + <if-empty field="communicationEvent"/> + </condition> + <widgets> + <screenlet id="EditCommunicationEventPanel" title="${uiLabelMap.PartyEditCommunicationEvent} ${parameters.communicationEventId}"> + <include-form location="component://party/webapp/partymgr/communication/CommForms.xml" name="EditInternalNote"/> + </screenlet> + </widgets> + <fail-widgets> + <container style="lefthalf"> + <screenlet id="EditCommunicationEventPanel" title="${uiLabelMap.PartyEditCommunicationEvent} ${parameters.communicationEventId}"> + <include-form location="component://party/webapp/partymgr/communication/CommForms.xml" name="EditInternalNote"/> + </screenlet> + </container> + <container style="righthalf"> + <screenlet title="${uiLabelMap.PartyCommEventRoles}"> + <include-form name="ListCommRoles" location="component://party/webapp/partymgr/communication/CommForms.xml" /> + </screenlet> + <screenlet title="${uiLabelMap.PartyCommEventRoles}"> + <include-form location="component://party/webapp/partymgr/communication/CommForms.xml" name="AddEventRole" /> + </screenlet> + <include-screen name="AttachFileList"/> + <include-screen name="addAttachmentEmail"/> + </container> + </fail-widgets> + </section> </widgets> </section> <section> <condition><!-- others --> <and> - <if-compare field="parameters.communicationEventTypeId" - operator="not-equals" value="COMMENT_NOTE" /> - <if-compare field="parameters.communicationEventTypeId" - operator="not-equals" value="EMAIL_COMMUNICATION" /> - <if-compare field="parameters.communicationEventTypeId" - operator="not-equals" value="AUTO_EMAIL_COMM" /> + <if-compare field="parameters.communicationEventTypeId" operator="not-equals" value="COMMENT_NOTE" /> + <if-compare field="parameters.communicationEventTypeId" operator="not-equals" value="EMAIL_COMMUNICATION" /> + <if-compare field="parameters.communicationEventTypeId" operator="not-equals" value="AUTO_EMAIL_COMM" /> </and> </condition> <widgets> - <screenlet id="EditCommunicationEventPanel" - title="${uiLabelMap.PartyEditCommunicationEvent}" collapsible="true"> - <include-form - location="component://party/webapp/partymgr/communication/CommForms.xml" - name="EditCommEvent" /> - </screenlet> - <screenlet title="${uiLabelMap.PartyChildCommunicationEvents}" - navigation-form-name="ListChildCommEvents"> - <include-form - location="component://party/webapp/partymgr/communication/CommForms.xml" - name="ListChildCommEvents" /> - </screenlet> - </widgets> + <screenlet id="EditCommunicationEventPanel" title="${uiLabelMap.PartyEditCommunicationEvent} ${parameters.communicationEventId}"> + <include-form name="EditCommEvent" location="component://party/webapp/partymgr/communication/CommForms.xml" /> + </screenlet> + <screenlet title="${uiLabelMap.PartyChildCommunicationEvents}" navigation-form-name="ListChildCommEvents"> + <include-form name="ListChildCommEvents" location="component://party/webapp/partymgr/communication/CommForms.xml"/> + </screenlet> + </widgets> </section> </decorator-section> </decorator-screen> @@ -361,11 +453,10 @@ <section> <actions> <set field="titleProperty" value="PageTitleEditCommunication" /> - <set field="tabButtonItem" value="CommunicationEvent" /> <entity-one entity-name="CommunicationEvent" value-field="communicationEvent"/> </actions> <widgets> - <decorator-screen name="CommonCommunicationEventDecorator" + <decorator-screen name="Common${parameters.my}CommunicationEventDecorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> <screenlet title="${uiLabelMap.PartyEditCustomerRequest}"> @@ -378,7 +469,6 @@ </widgets> </section> </screen> - <screen name="UpdateCommRoles"> <section> <actions> @@ -583,7 +673,6 @@ <section> <actions> <set field="titleProperty" value="PageTitleCommEvents"/> - <set field="headerItem" value="comm"/> <set field="tabButtonItem" value="CommContent"/> <set field="partyId" value="${parameters.partyId}"/> <set default-value="${userLogin.partyId}" field="partyIdFrom" value="${parameters.partyIdFrom}"/> @@ -676,16 +765,31 @@ </section> </screen> + <screen name="PartyCommunicationEvents"> + <section> + <actions> + <set field="titleProperty" value="PageTitleCommEvents"/> + <set field="headerItem" value="mycomm"/> + </actions> + <widgets> + <decorator-screen name="CommonMyCommunicationEventDecorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <include-screen name="MyCommunicationEvents"/> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + <!-- Portlet screens --> - <screen name="Communications"> + <screen name="MyCommunicationEvents"> <section> <actions> <script location="component://common/webcommon/WEB-INF/actions/includes/retrievePortletAttributes.groovy"/> <set field="partyId" from-field="parameters.partyId" default-value="${communicationPartyId}"/> <set field="partyId" from-field="partyId" default-value="${userLogin.partyId}"/> <set field="all" from-field="parameters.all"/> - <entity-condition entity-name="CommunicationEventAndRole" - list="commEvents"> + <entity-condition entity-name="CommunicationEventAndRole" list="commEvents"> <condition-list combine="and"> <condition-expr field-name="statusId" operator="not-equals" value="COM_UNKNOWN_PARTY" /> @@ -698,8 +802,7 @@ </condition-list> <order-by field-name="-datetimeStarted" /> </entity-condition> - <entity-condition entity-name="CommunicationEventAndRole" - list="commEventsUnknown"> + <entity-condition entity-name="CommunicationEventAndRole" list="commEventsUnknown"> <condition-list combine="and"> <condition-expr field-name="statusId" operator="equals" value="COM_UNKNOWN_PARTY" /> @@ -745,7 +848,7 @@ <label style="h2" text="${uiLabelMap.PartyEmailsFromKnownOrigin}"></label> <include-form name="ListPartyCommEvents" location="component://party/webapp/partymgr/communication/CommForms.xml"/> - <section> + <section> <condition> <not> <if-empty field="commEventDraft" /> Modified: ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml?rev=758522&r1=758521&r2=758522&view=diff ============================================================================== --- ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml (original) +++ ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml Thu Mar 26 06:06:12 2009 @@ -20,6 +20,38 @@ <menus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-menu.xsd"> + <menu name="PartyAppBar" title="${uiLabelMap.PartyManagerApplication}" extends="CommonAppBarMenu" extends-resource="component://common/widget/CommonMenus.xml"> + <menu-item name="find" title="${uiLabelMap.PartyParties}"><link target="findparty"/></menu-item> + <menu-item name="mycomm" title="${uiLabelMap.PartyMyCommunications}"><link target="MyCommunicationEvents"/></menu-item> + <menu-item name="comm" title="${uiLabelMap.PartyCommunications}"><link target="FindCommunicationEvents"/></menu-item> + <menu-item name="visits" title="${uiLabelMap.PartyVisits}"><link target="showvisits"/></menu-item> + <menu-item name="classification" title="${uiLabelMap.PartyClassifications}"><link target="showclassgroups"/></menu-item> + <menu-item name="security" title="${uiLabelMap.CommonSecurity}"> + <condition> + <if-has-permission permission="PARTYMGR" action="_VIEW"/> + </condition> + <link target="FindSecurityGroup"/> + </menu-item> + <menu-item name="addrmap" title="${uiLabelMap.PageTitleAddressMatchMap}"><link target="addressMatchMap"/></menu-item> + <menu-item name="partyinv" title="${uiLabelMap.PartyInvitation}"><link target="partyInvitation"/></menu-item> + </menu> + + <menu name="SecurityGroupTabBar" default-menu-item-name="EditSecurityGroup" default-selected-style="selected" + menu-container-style="button-bar tab-bar" type="simple" selected-menuitem-context-field-name="tabButtonItem"> + <menu-item name="EditSecurityGroup" title="${uiLabelMap.PartySecurityGroups}"> + <link target="EditSecurityGroup?groupId=${groupId}"/> + </menu-item> + <menu-item name="EditSecurityGroupPermissions" title="${uiLabelMap.PartyPermissions}"> + <link target="EditSecurityGroupPermissions?groupId=${groupId}"/> + </menu-item> + <menu-item name="EditSecurityGroupUserLogins" title="${uiLabelMap.PartyUserLogins}"> + <link target="EditSecurityGroupUserLogins?groupId=${groupId}"/> + </menu-item> + <menu-item name="EditSecurityGroupProtectedViews" title="${uiLabelMap.PartyProtectedViews}"> + <link target="EditSecurityGroupProtectedViews?groupId=${groupId}"/> + </menu-item> + </menu> + <menu name="ProfileTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml" default-menu-item-name="viewprofile"> <menu-item name="viewprofile" title="${uiLabelMap.PartyProfile}"> @@ -130,18 +162,6 @@ </condition> <link target="/ordermgr/control/checkinits?partyId=${partyId}&externaLoginKey=${externalLoginKey}" url-mode="inter-app"/> </menu-item> - <!-- menu-item name="paymentsSent" title="${uiLabelMap.AccountingPaymentsSent}"> - <condition> - <if-has-permission permission="ACCOUNTING" action="_VIEW"/> - </condition> - <link target="/accounting/control/findPayments?lookupFlag=Y&hideFields=Y&partyIdTo=${partyId}&externaLoginKey=${externalLoginKey}" url-mode="inter-app"/> - </menu-item> - <menu-item name="paymentsReceived" title="${uiLabelMap.AccountingPaymentsReceived}"> - <condition> - <if-has-permission permission="ACCOUNTING" action="_VIEW"/> - </condition> - <link target="/accounting/control/findPayments?lookupFlag=Y&hideFields=Y&partyIdFrom=${partyId}&externaLoginKey=${externalLoginKey}" url-mode="inter-app"/> - </menu-item--> </menu> <menu name="create-new-party" type="simple" menu-container-style="basic-nav"> <menu-item name="create-party-group" title="${uiLabelMap.PartyCreateNewPartyGroup}"> @@ -198,21 +218,27 @@ <condition> <if-has-permission permission="PARTYMGR_CME-EMAIL_CREATE"/> </condition> - <link - target="NewCommunicationEvent?communicationEventTypeId=EMAIL_COMMUNICATION&portalPageId=${parameters.portalPageId}&statusId=COM_PENDING"/> + <link target="NewDraftCommunicationEvent"> + <parameter param-name="communicationEventTypeId" value="EMAIL_COMMUNICATION"/> + <parameter param-name="my" value="My"/> + <parameter param-name="statusId" value="COM_PENDING"/> + </link> </menu-item> <menu-item name="newNote" title="${uiLabelMap.PartyNewInternalNote}"> <condition> <if-has-permission permission="PARTYMGR_CME-NOTE_CREATE"/> </condition> - <link - target="EditCommunicationEvent?communicationEventTypeId=COMMENT_NOTE&portalPageId=${parameters.portalPageId}" /> + <link target="NewDraftCommunicationEvent"> + <parameter param-name="communicationEventTypeId" value="COMMENT_NOTE"/> + <parameter param-name="my" value="My"/> + <parameter param-name="statusId" value="COM_PENDING"/> + </link> </menu-item> <menu-item name="openEvents" title="${uiLabelMap.PartyOpenEvents}"> <condition> <if-compare field="parameters.all" operator="equals" value="true" /> </condition> - <link target="showPortalPage?portalPageId=${parameters.portalPageId}&all=false" /> + <link target="${bsh:session.getAttribute("_LAST_VIEW_NAME_")}?portalPageId=${parameters.portalPageId}&all=false" /> </menu-item> <menu-item name="allOtherEvents" title="${uiLabelMap.PartyAllEvents}"> <condition> @@ -221,8 +247,216 @@ <if-empty field="parameters.all"/> </or> </condition> - <link target="showPortalPage?portalPageId=${parameters.portalPageId}&all=true" /> + <link target="${bsh:session.getAttribute("_LAST_VIEW_NAME_")}?portalPageId=${parameters.portalPageId}&all=true" /> </menu-item> </menu> + <menu name="MyCommSubTabBar" menu-container-style="button-bar button-style-2"> + <actions> + <script location="component://party/webapp/partymgr/WEB-INF/actions/communication/GetMyCommunicationEventRole.groovy"/> + </actions> + <menu-item name="newEmail" title="${uiLabelMap.PartyNewEmail}"> + <condition> + <and> + <if-has-permission permission="PARTYMGR_CME-EMAIL_CREATE"/> + <if-empty field="communicationEvent"/> + </and> + </condition> + <link target="NewDraftCommunicationEvent"> + <parameter param-name="communicationEventTypeId" value="EMAIL_COMMUNICATION"/> + <parameter param-name="my" value="My"/> + <parameter param-name="statusId" value="COM_PENDING"/> + </link> + </menu-item> + <menu-item name="newInternalNote" title="${uiLabelMap.PartyNewInternalNote}"> + <condition> + <and> + <if-has-permission permission="PARTYMGR_CME-NOTE_CREATE"/> + <if-empty field="communicationEvent"/> + </and> + </condition> + <link target="NewDraftCommunicationEvent"> + <parameter param-name="communicationEventTypeId" value="COMMENT_NOTE"/> + <parameter param-name="my" value="My"/> + <parameter param-name="statusId" value="COM_PENDING"/> + </link> + </menu-item> + <menu-item name="reply" title="${uiLabelMap.PartyReply}"> + <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-compare field="communicationEvent.partyIdFrom" operator="not-equals" value="${userLogin.partyId}"/> + <if-has-permission permission="PARTYMGR_CME-EMAIL_UPDATE"/> + <if-has-permission permission="PARTYMGR_CME-NOTE_CREATE"/> + </and> + </condition> + <link target="NewDraftCommunicationEvent"> + <parameter param-name="communicationEventTypeId" value="communicationEvent.communicationEventTypeId"/> + <parameter param-name="parentCommEventId" from-field="parameters.communicationEventId"/> + <parameter param-name="my" value="My"/> + </link> + </menu-item> + <menu-item name="forward" title="${uiLabelMap.PartyForward}"> + <condition> + <and> + <not><if-empty field="communicationEvent"/></not> + <if-compare field="communicationEvent.statusId" operator="not-equals" value="COM_PENDING"/> + <if-has-permission permission="PARTYMGR_CME-EMAIL_UPDATE"/> + <if-has-permission permission="PARTYMGR_CME-NOTE_CREATE"/> + </and> + </condition> + <link target="NewDraftCommunicationEvent"> + <parameter param-name="communicationEventTypeId" value="communicationEvent.communicationEventTypeId"/> + <parameter param-name="originalCommEventId" from-field="parameters.communicationEventId"/> + <parameter param-name="my" value="My"/> + </link> + </menu-item> + <menu-item name="createRequestFromCommEvent" 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"/> + </and> + </condition> + <link target="editRequestFromCommEvent?communicationEventId=${communicationEvent.communicationEventId}&my=${parameters.my}"/> + </menu-item> + <menu-item name="close" title="${uiLabelMap.CommonClose}"> + <condition> + <and> + <not><if-empty field="communicationEvent"/></not> + <if-compare field="myCommunicationEventRole.roleStatusId" operator="equals" value="COM_ROLE_READ"/> + <if-has-permission permission="PARTYMGR_CME-EMAIL_UPDATE"/> + </and> + </condition> + <link target="setCommunicationEventRoleStatus?communicationEventId=${communicationEvent.communicationEventId}&partyId=${myCommunicationEventRole.partyId&roleType=${myCommunicationEventRole.roleTypeId}&statusId=COM_ROLE_COMPLETED"/> + </menu-item> + <menu-item name="delete" title="${uiLabelMap.CommonDelete}"> + <condition> + <and> + <not><if-empty field="communicationEvent"/></not> + <or> + <if-has-permission permission="PARTYMGR_CME-EMAIL_DELETE"/> + <if-has-permission permission="PARTYMGR_ADMIN"/> + </or> + </and> + </condition> + <link target="deleteCommunicationEvent"> + <parameter param-name="communicationEventId" from-field="communicationEvent.communicationEventId"/> + </link> + </menu-item> + </menu> + <menu name="CommEventTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"> + <menu-item name="Find" title="${uiLabelMap.CommonFind}"> + <condition><if-compare field="tabButtonItem" operator="not-equals" value="Find"/></condition> + <link target="FindCommunicationEvents"/> + </menu-item> + <menu-item name="OverView" title="${uiLabelMap.CommonOverview}"> + <condition><not><if-empty field="communicationEvent"/></not></condition> + <link target="ViewCommunicationEvent?communicationEventId=${parameters.communicationEventId}"/> + </menu-item> + <menu-item name="CommunicationEvent" title="${uiLabelMap.PartyCommEvent}"> + <condition><not><if-empty field="communicationEvent"/></not></condition> + <link target="EditCommunicationEvent?communicationEventId=${parameters.communicationEventId}"/> + </menu-item> + <menu-item name="UpdateCommPurposes" title="${uiLabelMap.PartyEventPurpose}"> + <condition><not><if-empty field="communicationEvent"/></not></condition> + <link target="UpdateCommPurposes?communicationEventId=${parameters.communicationEventId}"/> + </menu-item> + <menu-item name="UpdateCommRoles" title="${uiLabelMap.PartyRoles}"> + <condition><not><if-empty field="communicationEvent"/></not></condition> + <link target="UpdateCommRoles?communicationEventId=${parameters.communicationEventId}"/> + </menu-item> + <menu-item name="UpdateCommWorkEfforts" title="${uiLabelMap.PartyCommWorkEfforts}"> + <condition><not><if-empty field="communicationEvent"/></not></condition> + <link target="ListCommWorkEfforts?communicationEventId=${parameters.communicationEventId}"/> + </menu-item> + <menu-item name="CommContent" title="${uiLabelMap.CommonContent}"> + <condition><not><if-empty field="communicationEvent"/></not></condition> + <link target="ListCommContent?communicationEventId=${parameters.communicationEventId}"/> + </menu-item> + <!-- TODO! + <menu-item name="ListCommCustRequests" title="CustRequests"> + <link target="ListCommCustRequests?partyId=${partyId}&communicationEventId=${communicationEventId}"/> + </menu-item> + --> + <menu-item name="ListUnknownPartyComms" title="${uiLabelMap.PartyEmailFromUnknownParties}"> + <link target="listUnknownPartyComms"/> + </menu-item> + </menu> + <menu name="CommFindTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml" + default-menu-item-name="find"> + <menu-item name="find" title="${uiLabelMap.CommonFind}"> + <link target="findCommunications?partyId=${partyId}&communicationEventId=${communicationEventId}" url-mode="intra-app"/> + </menu-item> + <menu-item name="showall" title="${uiLabelMap.CommonShowAll}"> + <link target="listCommunications?partyId=${partyId}&communicationEventId=${communicationEventId}" url-mode="intra-app"/> + </menu-item> + <menu-item name="pending" title="${uiLabelMap.PartyPending}"> + <link target="pendingCommunications?partyId=${partyId}&communicationEventId=${communicationEventId}" url-mode="intra-app"/> + </menu-item> + </menu> + + <menu name="CommSubTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml" + menu-container-style="button-bar button-style-2 no-clear"> + <menu-item name="new" title="${uiLabelMap.PartyNewCommunication}"> + <link target="EditCommunicationEvent"/> + </menu-item> + <menu-item name="newEmail" title="${uiLabelMap.PartyNewEmail}"> + <link target="EditCommunicationEvent?communicationEventTypeId=EMAIL_COMMUNICATION"/> + </menu-item> + <menu-item name="newInternalNote" title="${uiLabelMap.PartyNewInternalNote}"> + <link target="EditCommunicationEvent?communicationEventTypeId=COMMENT_NOTE"/> + </menu-item> + <menu-item name="reply" title="${uiLabelMap.PartyReply}"> + <condition> + <and> + <not><if-empty field="parameters.communicationEventId"/></not> + <not><if-empty field="communicationEvent.partyIdFrom"/></not> + <if-compare field="communicationEvent.partyIdFrom" operator="not-equals" value="${userLogin.partyId}"/> + </and> + </condition> + <link target="EditCommunicationEvent?parentCommEventId=${parameters.communicationEventId}"/> + </menu-item> + <menu-item name="forward" title="${uiLabelMap.PartyForward}"> + <condition> + <and> + <not><if-empty field="parameters.communicationEventId"/></not> + <not><if-empty field="communicationEvent.partyIdFrom"/></not> + <if-compare field="communicationEvent.partyIdFrom" operator="not-equals" value="${userLogin.partyId}"/> + </and> + </condition> + <link target="EditCommunicationEvent?originalCommEventId=${parameters.communicationEventId}"/> + </menu-item> + <menu-item name="createRequestFromCommEvent" title="${uiLabelMap.PartyCreateRequestFromCommEvent}"> + <condition> + <and> + <not><if-empty field="parameters.communicationEventId"/></not> + <not><if-empty field="communicationEvent.partyIdFrom"/></not> + <if-has-permission permission="ORDERMGR_CRQ_CREATE"/> + </and> + </condition> + <link target="editRequestFromCommEvent?communicationEventId=${parameters.communicationEventId}"/> + </menu-item> + <menu-item name="delete" title="${uiLabelMap.CommonDelete}"> + <condition> + <and> + <not><if-empty field="communicationEventRole"/></not> + <or> + <if-has-permission permission="PARTYMGR_CME-EMAIL_DELETE"/> + <if-has-permission permission="PARTYMGR_ADMIN"/> + </or> + </and> + </condition> + <link target="RemoveCommunicationEventRole"> + <parameter param-name="communicationEventId" from-field="parameters.communicationEventId"/> + <parameter param-name="roleTypeId" from-field="communicationEventRole.roleTypeId"/> + <parameter param-name="deleteCommEventIfLast" value="Y"/> + <parameter param-name="delContentDataResource" value="Y"/> + </link> + </menu-item> + </menu> </menus> Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.xml?rev=758522&r1=758521&r2=758522&view=diff ============================================================================== --- ofbiz/trunk/framework/common/config/CommonUiLabels.xml (original) +++ ofbiz/trunk/framework/common/config/CommonUiLabels.xml Thu Mar 26 06:06:12 2009 @@ -8039,6 +8039,9 @@ <value xml:lang="th">à¸à¹à¸à¸«à¸²</value> <value xml:lang="zh">æç´¢</value> </property> + <property key="FormFieldTitle_saveButton"> + <value xml:lang="en">Save</value> + </property> <property key="FormFieldTitle_sendButton"> <value xml:lang="de">Absenden</value> <value xml:lang="en">Send</value> Modified: ofbiz/trunk/framework/common/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/entitydef/entitymodel.xml?rev=758522&r1=758521&r2=758522&view=diff ============================================================================== --- ofbiz/trunk/framework/common/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/framework/common/entitydef/entitymodel.xml Thu Mar 26 06:06:12 2009 @@ -653,6 +653,20 @@ <key-map field-name="securityGroupId" rel-field-name="groupId"/> </relation> </entity> + <view-entity entity-name="PortalPageAndUserLogin" package-name="org.ofbiz.common.portal" + title="PortalPage accessible via security group to a userLogin"> + <member-entity entity-alias="PP" entity-name="PortalPage"/> + <member-entity entity-alias="UG" entity-name="UserLoginSecurityGroup"/> + <alias entity-alias="PP" name="portalPageId"/> + <alias entity-alias="PP" name="securityGroupId"/> + <alias entity-alias="PP" name="parentPortalPageId"/> + <alias entity-alias="UG" name="userLoginId"/> + <alias entity-alias="UG" name="fromDate"/> + <alias entity-alias="UG" name="thruDate"/> + <view-link entity-alias="PP" rel-entity-alias="UG"> + <key-map field-name="securityGroupId" rel-field-name="groupId"/> + </view-link> + </view-entity> <entity entity-name="PortalPageColumn" package-name="org.ofbiz.common.portal" title="Defines a Portal Page"> <field name="portalPageId" type="id-ne"></field> <field name="columnSeqId" type="id-ne"></field> Modified: ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/GetParentPortalPageId.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/GetParentPortalPageId.groovy?rev=758522&r1=758521&r2=758522&view=diff ============================================================================== --- ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/GetParentPortalPageId.groovy (original) +++ ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/GetParentPortalPageId.groovy Thu Mar 26 06:06:12 2009 @@ -20,38 +20,53 @@ import org.ofbiz.entity.*; import org.ofbiz.base.util.*; import org.ofbiz.entity.condition.*; +import org.ofbiz.entity.util.EntityUtil; -// executes only on startup when no parameters.portalPageId is available +// executes only on startup when only the basic parameters.portalPageId (from commonscreens.xml) is available if (userLogin && parameters.parentPortalPageId && !parameters.portalPageId) { - // look for system page according the current securitygroup - //get the security group - userLoginSecurityGroupId = null; - condSec = EntityCondition.makeCondition([ - EntityCondition.makeCondition("groupId", EntityOperator.LIKE, parameters.parentPortalPageId + "%"), - EntityCondition.makeCondition("userLoginId", EntityOperator.EQUALS, userLogin.userLoginId) - ],EntityOperator.AND); - userLoginSecurityGroups = delegator.findList("UserLoginSecurityGroup", condSec, null, null, null, false); - if (UtilValidate.isNotEmpty(userLoginSecurityGroups)) { - userLoginSecurityGroupId = userLoginSecurityGroups.get(0).get("groupId"); - } - //get the portal page - cond1 = EntityCondition.makeCondition([ - EntityCondition.makeCondition("portalPageId", EntityOperator.LIKE, parameters.parentPortalPageId + "%"), - EntityCondition.makeCondition("securityGroupId", EntityOperator.EQUALS, userLoginSecurityGroupId), - EntityCondition.makeCondition("ownerUserLoginId", EntityOperator.EQUALS, "_NA_"), - EntityCondition.makeCondition("parentPortalPageId", EntityOperator.EQUALS, null) - ],EntityOperator.AND); - portalMainPages = delegator.findList("PortalPage", cond1, null, null, null, false); + // look for system page according the current securitygroup + //get the security group + condSec = EntityCondition.makeCondition([ + EntityCondition.makeCondition("portalPageId", EntityOperator.LIKE, parameters.parentPortalPageId + "%"), + EntityCondition.makeCondition("parentPortalPageId", EntityOperator.EQUALS, null), + EntityCondition.makeCondition("userLoginId", EntityOperator.EQUALS, userLogin.userLoginId) + ],EntityOperator.AND); + portalMainPages = EntityUtil.filterByDate(delegator.findList("PortalPageAndUserLogin", condSec, null, null, null, false)); + if (!portalMainPages) { // look for a null securityGroup if not found + condSec = EntityCondition.makeCondition([ + EntityCondition.makeCondition("securityGroupId", EntityOperator.EQUALS, null), + EntityCondition.makeCondition("parentPortalPageId", EntityOperator.EQUALS, null), + EntityCondition.makeCondition("portalPageId", EntityOperator.LIKE, parameters.parentPortalPageId + "%") + ],EntityOperator.AND); + portalMainPages = delegator.findList("PortalPage", condSec, null, null, null, false); + } if (portalMainPages) { - portalPage = portalMainPages.get(0); - if ("_NA_".equals(portalPage.ownerUserLoginId)) { - context.parameters.parentPortalPageId = portalPage.portalPageId; + portalPageId = portalMainPages.get(0).portalPageId; + // check if overridden with a privat page + privatMainPages = delegator.findByAnd("PortalPage", [originalPortalPageId : portalPageId, ownerUserLoginId : userLogin.userLoginId]); + if (privatMainPages) { + context.parameters.portalPageId = privatMainPages.get(0).portalPageId; + } else { + context.parameters.portalPageId = portalPageId; + } + } +} +// Debug.log('======portalPageId: ' + parameters.portalPageId); +if (userLogin && parameters.portalPageId) { + portalPage = delegator.findByPrimaryKey("PortalPage", [portalPageId : parameters.portalPageId]); + if (portalPage) { + if (portalPage.parentPortalPageId) { + context.parameters.parentPortalPageId = portalPage.parentPortalPageId; } else { - context.parameters.parentPortalPageId = portalPage.orginalPortalPageId; - } - context.parameters.portalPageId = portalPage.portalPageId; //make sure we have a starting portalPageId - if (!context.headerItem) { - context.headerItem = portalPage.portalPageId; // and the menu item is highlighted + if ("_NA_".equals(portalPage.ownerUserLoginId)) { + context.parameters.parentPortalPageId = portalPage.portalPageId; + } else { + context.parameters.parentPortalPageId = portalPage.originalPortalPageId; + } } } } +// Debug.log('======parent portalPageId: ' + parameters.parentPortalPageId); +if (!context.headerItem && parameters.portalPageId) { + context.headerItem = parameters.portalPageId; // and the menu item is highlighted +} Modified: ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/ListPortalPages.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/ListPortalPages.groovy?rev=758522&r1=758521&r2=758522&view=diff ============================================================================== --- ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/ListPortalPages.groovy (original) +++ ofbiz/trunk/framework/common/webcommon/WEB-INF/actions/includes/ListPortalPages.groovy Thu Mar 26 06:06:12 2009 @@ -96,12 +96,12 @@ ],EntityOperator.AND); sequenceNums = delegator.findList("PortalPage", sequenceNumCond, null, ["sequenceNum"], null, false); if(sequenceNums){ - parameters.sequenceNumMin = sequenceNums.get(0).sequenceNum; - parameters.sequenceNumMax = sequenceNums.get(sequenceNums.size()-1).sequenceNum; + context.parameters.sequenceNumMin = sequenceNums.get(0).sequenceNum; + context.parameters.sequenceNumMax = sequenceNums.get(sequenceNums.size()-1).sequenceNum; } else{ - parameters.sequenceNumMin = "null"; - parameters.sequenceNumMax = "null"; + context.parameters.sequenceNumMin = "null"; + context.parameters.sequenceNumMax = "null"; } context.portalPages = portalPages; Modified: ofbiz/trunk/framework/common/webcommon/WEB-INF/portal-controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/portal-controller.xml?rev=758522&r1=758521&r2=758522&view=diff ============================================================================== --- ofbiz/trunk/framework/common/webcommon/WEB-INF/portal-controller.xml (original) +++ ofbiz/trunk/framework/common/webcommon/WEB-INF/portal-controller.xml Thu Mar 26 06:06:12 2009 @@ -26,7 +26,7 @@ <!-- Portal requests --> <request-map uri="showPortalPage"> <security https="true" auth="true"/> - <response name="success" type="view" value="showPortalPage" save-last-view="true"/> + <response name="success" type="view" value="showPortalPage" save-home-view="true"/> </request-map> <request-map uri="ManagePortalPages"> <security https="true" auth="true"/> Modified: ofbiz/trunk/framework/example/data/ExamplePortalSeedData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/data/ExamplePortalSeedData.xml?rev=758522&r1=758521&r2=758522&view=diff ============================================================================== --- ofbiz/trunk/framework/example/data/ExamplePortalSeedData.xml (original) +++ ofbiz/trunk/framework/example/data/ExamplePortalSeedData.xml Thu Mar 26 06:06:12 2009 @@ -20,7 +20,7 @@ <entity-engine-xml> <!-- PortalPortlet Seed Data: system pages --> - <PortalPage portalPageId="EXAMPLE" sequenceNum="0" parentPortalPageId="EXAMPLE" portalPageName="Example Portal Page" description="The default example OFBiz portal page" ownerUserLoginId="_NA_"/> + <PortalPage portalPageId="EXAMPLE" sequenceNum="0" portalPageName="Example Portal Page" description="The default example OFBiz portal page" ownerUserLoginId="_NA_"/> <PortalPageColumn portalPageId="EXAMPLE" columnSeqId="00001" columnWidthPercentage="50"/> <PortalPageColumn portalPageId="EXAMPLE" columnSeqId="00002"/><!-- no width in pixels or percent, use the rest of the space available --> Modified: ofbiz/trunk/framework/webapp/dtd/site-conf.xsd URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/dtd/site-conf.xsd?rev=758522&r1=758521&r2=758522&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/dtd/site-conf.xsd (original) +++ ofbiz/trunk/framework/webapp/dtd/site-conf.xsd Thu Mar 26 06:06:12 2009 @@ -245,6 +245,7 @@ <xs:enumeration value="none"/> <xs:enumeration value="view"/> <xs:enumeration value="view-last"><xs:annotation><xs:documentation>Will use the view from the last request unless there is a saved from some previous request (using the save-last-view attribute).</xs:documentation></xs:annotation></xs:enumeration> + <xs:enumeration value="view-home"><xs:annotation><xs:documentation>Will use the view from the last saved 'home' position (using the save-home-view attribute).</xs:documentation></xs:annotation></xs:enumeration> <xs:enumeration value="request"/> <xs:enumeration value="request-redirect"/> <xs:enumeration value="request-redirect-noparam"/> @@ -262,6 +263,24 @@ </xs:restriction> </xs:simpleType> </xs:attribute> + <xs:attribute name="save-current-view" default="false"> + <xs:annotation><xs:documentation>Saves the current request's view for future use, generally with the view-last type of response.</xs:documentation></xs:annotation> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + <xs:attribute name="save-home-view" default="false"> + <xs:annotation><xs:documentation>Saves the current request's view for future use, generally with the view-home type of response.</xs:documentation></xs:annotation> + <xs:simpleType> + <xs:restriction base="xs:token"> + <xs:enumeration value="true"/> + <xs:enumeration value="false"/> + </xs:restriction> + </xs:simpleType> + </xs:attribute> </xs:attributeGroup> <xs:element name="redirect-parameter"> <xs:annotation><xs:documentation>Adds a parameter with the given name to the redirect. Finds value in a request attribute if exists, or a request parameter if no attribute is found.</xs:documentation></xs:annotation> Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java?rev=758522&r1=758521&r2=758522&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/ConfigXMLReader.java Thu Mar 26 06:06:12 2009 @@ -433,6 +433,8 @@ public String type; public String value; public boolean saveLastView = false; + public boolean saveCurrentView = false; + public boolean saveHomeView = false; public Map<String, String> redirectParameterMap = FastMap.newInstance(); public RequestResponse(Element responseElement) { @@ -440,6 +442,8 @@ this.type = responseElement.getAttribute("type"); this.value = responseElement.getAttribute("value"); this.saveLastView = "true".equals(responseElement.getAttribute("save-last-view")); + this.saveCurrentView = "true".equals(responseElement.getAttribute("save-current-view")); + this.saveHomeView = "true".equals(responseElement.getAttribute("save-home-view")); for (Element redirectParameterElement: UtilXml.childElementList(responseElement, "redirect-parameter")) { String from = redirectParameterElement.getAttribute("from"); if (UtilValidate.isEmpty(from)) from = redirectParameterElement.getAttribute("name"); Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=758522&r1=758521&r2=758522&view=diff ============================================================================== --- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original) +++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Thu Mar 26 06:06:12 2009 @@ -464,9 +464,13 @@ // if the request has the save-last-view attribute set, save it now before the view can be rendered or other chain done so that the _LAST* session attributes will represent the previous request if (nextRequestResponse.saveLastView) { + // Debug.log("======save last view: " + session.getAttribute("_LAST_VIEW_NAME_")); session.setAttribute("_SAVED_VIEW_NAME_", session.getAttribute("_LAST_VIEW_NAME_")); session.setAttribute("_SAVED_VIEW_PARAMS_", session.getAttribute("_LAST_VIEW_PARAMS_")); } + String saveName = null; + if (nextRequestResponse.saveCurrentView) { saveName = "SAVED"; } + if (nextRequestResponse.saveHomeView) { saveName = "HOME"; } if (nextRequestResponse != null && "request".equals(nextRequestResponse.type)) { // chained request @@ -506,7 +510,7 @@ // check for an override view, only used if "success" = eventReturn String viewName = (UtilValidate.isNotEmpty(overrideViewUri) && (eventReturn == null || "success".equals(eventReturn))) ? overrideViewUri : nextRequestResponse.value; - renderView(viewName, requestMap.securityExternalView, request, response); + renderView(viewName, requestMap.securityExternalView, request, response, saveName); } else if ("view-last".equals(nextRequestResponse.type)) { if (Debug.verboseOn()) Debug.logVerbose("[RequestHandler.doRequest]: Response is a view." + " sessionId=" + UtilHttp.getSessionId(request), module); @@ -527,8 +531,25 @@ request.setAttribute(urlParamEntry.getKey(), urlParamEntry.getValue()); } } + renderView(viewName, requestMap.securityExternalView, request, response, null); + } else if ("view-home".equals(nextRequestResponse.type)) { + if (Debug.verboseOn()) Debug.logVerbose("[RequestHandler.doRequest]: Response is a view." + " sessionId=" + UtilHttp.getSessionId(request), module); + + // check for an override view, only used if "success" = eventReturn + String viewName = (UtilValidate.isNotEmpty(overrideViewUri) && (eventReturn == null || "success".equals(eventReturn))) ? overrideViewUri : nextRequestResponse.value; - renderView(viewName, requestMap.securityExternalView, request, response); + // as a further override, look for the _HOME session attributes + Map<String, Object> urlParams = null; + if (session.getAttribute("_HOME_VIEW_NAME_") != null) { + viewName = (String) session.getAttribute("_HOME_VIEW_NAME_"); + urlParams = (Map<String, Object>) UtilGenerics.<String, Object>checkMap(session.getAttribute("_HOME_VIEW_PARAMS_")); + } + if (urlParams != null) { + for (Map.Entry<String, Object> urlParamEntry: urlParams.entrySet()) { + request.setAttribute(urlParamEntry.getKey(), urlParamEntry.getValue()); + } + } + renderView(viewName, requestMap.securityExternalView, request, response, null); } else if ("none".equals(nextRequestResponse.type)) { // no view to render (meaning the return was processed by the event) if (Debug.verboseOn()) Debug.logVerbose("[RequestHandler.doRequest]: Response is handled by the event." + " sessionId=" + UtilHttp.getSessionId(request), module); @@ -629,8 +650,7 @@ throw new RequestHandlerException(ise.getMessage(), ise); } } - - private void renderView(String view, boolean allowExtView, HttpServletRequest req, HttpServletResponse resp) throws RequestHandlerException { + private void renderView(String view, boolean allowExtView, HttpServletRequest req, HttpServletResponse resp, String saveName) throws RequestHandlerException { GenericValue userLogin = (GenericValue) req.getSession().getAttribute("userLogin"); GenericDelegator delegator = (GenericDelegator) req.getAttribute("delegator"); // workaraound if we are in the root webapp @@ -664,7 +684,19 @@ UtilMisc.makeMapSerializable(paramMap); req.getSession().setAttribute("_LAST_VIEW_NAME_", view); req.getSession().setAttribute("_LAST_VIEW_PARAMS_", paramMap); - + + if ("SAVED".equals(saveName)) { + //Debug.log("======save current view: " + view); + req.getSession().setAttribute("_SAVED_VIEW_NAME_", view); + req.getSession().setAttribute("_SAVED_VIEW_PARAMS_", paramMap); + } + + if ("HOME".equals(saveName)) { + //Debug.log("======save home view: " + view); + req.getSession().setAttribute("_HOME_VIEW_NAME_", view); + req.getSession().setAttribute("_HOME_VIEW_PARAMS_", paramMap); + } + ConfigXMLReader.ViewMap viewMap = (view == null ? null : getControllerConfig().viewMapMap.get(view)); if (viewMap == null) { throw new RequestHandlerException("No definition found for view with name [" + view + "]"); 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=758522&r1=758521&r2=758522&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml (original) +++ ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml Thu Mar 26 06:06:12 2009 @@ -304,7 +304,6 @@ <view-map name="ListProjects" type="screen" page="component://mypage/widget/MyPageScreens.xml#ListProjects"/> <view-map name="custPreferences" type="screen" page="component://mypage/widget/CommonScreens.xml#custPreferences"/> <view-map name="EditCommunicationEvent" type="screen" page="component://mypage/widget/MyPageScreens.xml#EditCommunicationEvent"/> - <view-map name="addAttachmentEmail" type="screen" page="component://mypage/widget/MyPageScreens.xml#addAttachmentEmail"/> <view-map name="EditCustRequestContent" type="screen" page="component://mypage/widget/MyPageScreens.xml#EditCustRequestContent"/> </site-conf> Modified: ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml?rev=758522&r1=758521&r2=758522&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml (original) +++ ofbiz/trunk/specialpurpose/myportal/config/MyPortalUiLabels.xml Thu Mar 26 06:06:12 2009 @@ -121,12 +121,6 @@ <value xml:lang="it">Nuova utente</value> <value xml:lang="th">ลà¸à¸à¸°à¹à¸à¸µà¸¢à¸ </value> </property> - <property key="MyPortalNoAccess"> - <value xml:lang="en">You do not have access to this information</value> - <value xml:lang="fr">Vous n'avez pas accès à cette information</value> - <value xml:lang="it">Non hai l'accesso a queste informazioni</value> - <value xml:lang="th">à¸à¸¸à¸à¹à¸¡à¹à¸¡à¸µà¸à¹à¸à¸¡à¸¹à¸¥à¸à¸¢à¸¹à¹à¹à¸à¸£à¸°à¸à¸</value> - </property> <property key="MyPortalNoAccess1"> <value xml:lang="en">No Access priviledges has been setup.</value> <value xml:lang="fr">Aucun accès privilégié n'a été paramétré.</value> Modified: ofbiz/trunk/specialpurpose/myportal/data/MyPortalTypeData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/data/MyPortalTypeData.xml?rev=758522&r1=758521&r2=758522&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/myportal/data/MyPortalTypeData.xml (original) +++ ofbiz/trunk/specialpurpose/myportal/data/MyPortalTypeData.xml Thu Mar 26 06:06:12 2009 @@ -28,7 +28,7 @@ <!-- PortalPortlet System provided pages --> <!-- no security group --> - <PortalPage portalPageId="MYPORTAL_NONE" portalPageName="Main" description="The default OFBiz portal page" ownerUserLoginId="_NA_"/><!-- user belonging to no portal security group --> + <PortalPage portalPageId="MYPORTAL_NONE" sequenceNum="0" portalPageName="Main" description="The default OFBiz portal page" ownerUserLoginId="_NA_"/><!-- user belonging to no portal security group --> <PortalPage portalPageId="MYPORTAL_EMPLOYEE" sequenceNum="0" portalPageName="Main" description="The OFBiz My Portal Main page" ownerUserLoginId="_NA_" securityGroupId="MYPORTAL_EMPLOYEE" /> <PortalPage portalPageId="MYPORTAL_EMPLOYEE1" sequenceNum="100" portalPageName="My Profile" description="The OFBiz My Portal Profile page" ownerUserLoginId="_NA_" parentPortalPageId="MYPORTAL_EMPLOYEE"/> @@ -104,7 +104,7 @@ <PortalPagePortlet portalPageId="MYPORTAL_NONE" portalPortletId="party" portletSeqId="00001" columnSeqId="00001" sequenceNum="0" /> <PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE" portalPortletId="listrequestlist" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> - <PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE" portalPortletId="communications" portletSeqId="00001" columnSeqId="00001" sequenceNum="1"/> + <PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE" portalPortletId="MyCommunications" portletSeqId="00001" columnSeqId="00001" sequenceNum="1"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE1" portalPortletId="party" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE1" portalPortletId="contact" portletSeqId="00001" columnSeqId="00001" sequenceNum="1"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE1" portalPortletId="LoyaltyPoints" portletSeqId="00001" columnSeqId="00001" sequenceNum="2"/> @@ -117,14 +117,14 @@ <PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE1" portalPortletId="ShipperAccount" portletSeqId="00001" columnSeqId="00002" sequenceNum="9"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE1" portalPortletId="Notes" portletSeqId="00001" columnSeqId="00002" sequenceNum="10"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE1" portalPortletId="MYTASKSPARTY" portletSeqId="00001" columnSeqId="00002" sequenceNum="11"/> - <PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE2" portalPortletId="communications" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> - <PortletAttribute portalPageId="MYPORTAL_EMPLOYEE2" portalPortletId="communications" portletSeqId="00001" attrName="communicationPartyId" attrValue="Company"/> + <PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE2" portalPortletId="MyCommunications" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> + <PortletAttribute portalPageId="MYPORTAL_EMPLOYEE2" portalPortletId="MyCommunications" portletSeqId="00001" attrName="communicationPartyId" attrValue="Company"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE3" portalPortletId="mycompanycomms" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE4" portalPortletId="mytimesheet" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPLOYEE5" portalPortletId="mytasks" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML" portalPortletId="listrequestlist" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> - <PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML" portalPortletId="communications" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> + <PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML" portalPortletId="MyCommunications" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML1" portalPortletId="party" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML1" portalPortletId="contact" portletSeqId="00001" columnSeqId="00001" sequenceNum="1"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML1" portalPortletId="UserLogin" portletSeqId="00001" columnSeqId="00002" sequenceNum="2"/> @@ -133,8 +133,8 @@ <PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML1" portalPortletId="Content" portletSeqId="00001" columnSeqId="00002" sequenceNum="5"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML1" portalPortletId="Notes" portletSeqId="00001" columnSeqId="00002" sequenceNum="6"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML1" portalPortletId="MYTASKSPARTY" portletSeqId="00001" columnSeqId="00002" sequenceNum="7"/> - <PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML2" portalPortletId="communications" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> - <PortletAttribute portalPageId="MYPORTAL_EMPL-NOEML2" portalPortletId="communications" portletSeqId="00001" attrName="communicationPartyId" attrValue="Company"/> + <PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML2" portalPortletId="MyCommunications" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> + <PortletAttribute portalPageId="MYPORTAL_EMPL-NOEML2" portalPortletId="MyCommunications" portletSeqId="00001" attrName="communicationPartyId" attrValue="Company"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML3" portalPortletId="mycompanycomms" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML4" portalPortletId="mytimesheet" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> <PortalPagePortlet portalPageId="MYPORTAL_EMPL-NOEML5" portalPortletId="mytasks" portletSeqId="00001" columnSeqId="00001" sequenceNum="0"/> |
Free forum by Nabble | Edit this page |