Author: hansbak
Date: Sat Aug 30 20:19:51 2008 New Revision: 690628 URL: http://svn.apache.org/viewvc?rev=690628&view=rev Log: allow contacts of the same customer account see each other customer requests Modified: ofbiz/trunk/applications/order/entitydef/entitymodel_view.xml ofbiz/trunk/specialpurpose/mypage/config/MyPageUiLabels.xml ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml Modified: ofbiz/trunk/applications/order/entitydef/entitymodel_view.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/entitydef/entitymodel_view.xml?rev=690628&r1=690627&r2=690628&view=diff ============================================================================== --- ofbiz/trunk/applications/order/entitydef/entitymodel_view.xml (original) +++ ofbiz/trunk/applications/order/entitydef/entitymodel_view.xml Sat Aug 30 20:19:51 2008 @@ -1270,18 +1270,26 @@ <key-map field-name="workEffortId"/> </relation> </view-entity> - <view-entity entity-name="CustRequestInfoAndWorkEffort" + <view-entity entity-name="CustRequestInfoAndWorkEffortAndPartyRel" package-name="org.ofbiz.order.request" title="Customer Request And WorkEffort"> <member-entity entity-alias="CR" entity-name="CustRequest"/> <member-entity entity-alias="CRW" entity-name="CustRequestWorkEffort"/> + <member-entity entity-alias="PR" entity-name="PartyRelationship"/> <alias-all entity-alias="CR"/> <alias-all entity-alias="CRW"> <exclude field="custRequestId"/> </alias-all> + <alias entity-alias="PR" name="partyIdFrom"/> + <alias entity-alias="PR" name="roleTypeIdFrom"/> + <alias entity-alias="PR" name="partyIdTo"/> + <alias entity-alias="PR" name="roleTypeIdTo"/> <view-link entity-alias="CR" rel-entity-alias="CRW" rel-optional="true"> <key-map field-name="custRequestId"/> </view-link> + <view-link entity-alias="CR" rel-entity-alias="PR" rel-optional="true"> + <key-map field-name="fromPartyId" rel-field-name="partyIdTo"/> + </view-link> <relation type="one-nofk" rel-entity-name="WorkEffort"> <key-map field-name="workEffortId"/> </relation> Modified: ofbiz/trunk/specialpurpose/mypage/config/MyPageUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/config/MyPageUiLabels.xml?rev=690628&r1=690627&r2=690628&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/mypage/config/MyPageUiLabels.xml (original) +++ ofbiz/trunk/specialpurpose/mypage/config/MyPageUiLabels.xml Sat Aug 30 20:19:51 2008 @@ -26,6 +26,10 @@ <value xml:lang="en">All Communications</value> <value xml:lang="fr">Toutes les communications</value> </property> + <property key="CommunicationsOfParty"> + <value xml:lang="en">Communications of party</value> + <value xml:lang="fr">Communications de l'acteur</value> + </property> <property key="EmailsFromKnownOrigin"> <value xml:lang="en">Emails from known origin</value> <value xml:lang="fr">Courriel issue d'une origine connue</value> @@ -114,9 +118,8 @@ <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> </property> - <property key="CommunicationsOfParty"> - <value xml:lang="en">Communications of party</value> - <value xml:lang="fr">Communications de l'acteur</value> + <property key="OtherCompanyCustomerRequests"> + <value xml:lang="en">Customer Requests from other contacts of my company</value> </property> <property key="TaskStatus"> <value xml:lang="en">Task Status</value> Modified: ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml?rev=690628&r1=690627&r2=690628&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml (original) +++ ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml Sat Aug 30 20:19:51 2008 @@ -281,7 +281,7 @@ <set field="partyId" from-field="userLogin.partyId"/> <set field="status" from-field="parameters.status" default-value="open"/> <set field="status" value="${bsh:"all".equals(status)?"%":"open"}"/> - <entity-condition list-name="custRequests" entity-name="CustRequestInfoAndWorkEffort"> + <entity-condition list-name="custRequests" entity-name="CustRequestInfoAndWorkEffortAndPartyRel"> <condition-list combine="and"> <condition-expr field-name="fromPartyId" operator="equals" value="${userLogin.partyId}"/> <condition-list combine="or"> @@ -292,13 +292,21 @@ <order-by field-name="+priority"/> <order-by field-name="+custRequestDate"/> </entity-condition> - <entity-condition list-name="custRequestsCompleted" entity-name="CustRequestInfoAndWorkEffort"> + <entity-condition list-name="custRequestsCompleted" entity-name="CustRequestInfoAndWorkEffortAndPartyRel"> <condition-list combine="and"> <condition-expr field-name="fromPartyId" operator="equals" value="${userLogin.partyId}"/> <condition-expr field-name="statusId" operator="equals" value="CRQ_COMPLETED"/> </condition-list> <order-by field-name="custRequestDate"/> </entity-condition> + <script location="component://party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy"/> + <entity-condition list-name="companyCustRequests" entity-name="CustRequestInfoAndWorkEffortAndPartyRel"> + <condition-list combine="and"> + <condition-expr field-name="partyIdFrom" operator="equals" value="${myCompanyId}"/> + <condition-expr field-name="fromPartyId" operator="not-equals" value="${userLogin.partyId}"/> + </condition-list> + <order-by field-name="custRequestDate"/> + </entity-condition> <!-- only list internal notes to the customer do not show the incoming or outgoing emails: will confuse only --> <entity-condition entity-name="CommunicationEventAndRole" list-name="commEvents"> <condition-list combine="and"> @@ -321,15 +329,21 @@ </screenlet> <screenlet title="${uiLabelMap.MyCompletedCustomerRequests}" navigation-form-name="ListCustRequestsCompleted"> <include-form name="ListCustRequestsCompleted" location="component://mypage/widget/MyPageForms.xml"/> - <!-- include-form name="ListCustRequestsCompletedTotal" location="component://mypage/widget/MyPageForms.xml"/--> </screenlet> + <section> + <condition> + <not><if-empty field-name="companyCustRequests"/></not> + </condition> + <widgets> + <screenlet title="${uiLabelMap.OtherCompanyCustomerRequests}" navigation-form-name="ListOtherCompanyRequests"> + <include-form name="ListOtherCompanyRequests" location="component://mypage/widget/MyPageForms.xml"/> + </screenlet> + </widgets> + </section> <screenlet title="${uiLabelMap.CommunicationsOfParty}: ${partyName.firstName} ${partyName.middleName} ${partyName.lastName} ${partyName.groupName} [${partyId}] " - navigation-menu-name="communicationsMenu" navigation-form-name="ListPartyCommEvents" - name="myComms"> - <include-menu name="communicationsMenu" - location="component://mypage/widget/MyPageMenus.xml" /> - <include-form name="ListPartyCommEvents" - location="component://mypage/widget/MyPageForms.xml" /> + navigation-menu-name="communicationsMenu" navigation-form-name="ListPartyCommEvents" name="myComms"> + <include-menu name="communicationsMenu" location="component://mypage/widget/MyPageMenus.xml" /> + <include-form name="ListPartyCommEvents" location="component://mypage/widget/MyPageForms.xml" /> </screenlet> </widgets> </section> Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml?rev=690628&r1=690627&r2=690628&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml (original) +++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml Sat Aug 30 20:19:51 2008 @@ -162,14 +162,12 @@ <form name="ListCustRequestsCompleted" extends="ListCustRequests" list-name="custRequestsCompleted"> <field name="priority"><display/></field> <field name="updateButton"><ignored/></field> - <field name="currentStatusId"><ignored/></field> </form> - <form name="ListCustRequestsCompletedTotal" type="single"> - <actions> - <set field="TotalHoursThisMonth" value="33"/> - </actions> - <field name="TotalHoursThisMonth"><display/></field> + <form name="ListOtherCompanyRequests" extends="ListCustRequestsCompleted" list-name="companyCustRequests"> + <field name="fromPartyId"> + <display-entity entity-name="PartyNameView" key-field-name="partyId" description="${firstName} ${middleName} ${lastName} ${groupName} [${fromPartyId}])"/> + </field> </form> <form name="EditCustRequest" extends="EditCustRequest" extends-resource="component://projectmgr/widget/forms/RequestForms.xml"> Modified: ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml?rev=690628&r1=690627&r2=690628&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml Sat Aug 30 20:19:51 2008 @@ -154,13 +154,29 @@ <field-map field-name="workEffortId" env-name="taskId"/> </entity-and> <first-from-list list-name="custRequests" entry-name="custRequest"/> + <entity-and entity-name="PartyRelationship" list-name="accounts"> + <field-map field-name="roleTypeIdFrom" value="ACCOUNT"/> + <field-map field-name="roleTypeIdTo" value="CONTACT"/> + <field-map field-name="partyIdTo" env-name="custRequest.fromPartyId"/> + </entity-and> + <first-from-list list-name="accounts" entry-name="accountCustReq"/> + <entity-and entity-name="PartyRelationship" list-name="accounts"> + <field-map field-name="roleTypeIdFrom" value="ACCOUNT"/> + <field-map field-name="roleTypeIdTo" value="CONTACT"/> + <field-map field-name="partyIdTo" env-name="parameters.userLogin.partyId"/> + </entity-and> + <first-from-list list-name="accounts" entry-name="accountLogin"/> <if> <condition> <or> <and> - <!-- allow a customer to look at his own tasks related to his own customer requests --> <if-compare field="parameters.mainAction" value="VIEW" operator="equals"/> - <if-compare operator="equals" value="${parameters.userLogin.partyId}" field="custRequest.fromPartyId"/> + <or> + <!-- allow a customer to look at his own tasks related to his own customer requests --> + <if-compare operator="equals" value="${parameters.userLogin.partyId}" field="custRequest.fromPartyId"/> + <!-- allow to view if the logged on party is a contact of the same account as the customer requester --> + <if-compare operator="equals" value="${accountLogin.partyIdFrom}" field="accountCustReq.partyIdFrom"/> + </or> </and> <and> <!-- view a task with a null id is a null operation, so ok... --> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml?rev=690628&r1=690627&r2=690628&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml Sat Aug 30 20:19:51 2008 @@ -195,7 +195,7 @@ <field name="estimatedStartDate" title="${uiLabelMap.CommonFromDate}"><date-find/></field> <field name="find" title="${uiLabelMap.CommonFind}"><submit/></field> </form> - <form name="ListTasks" type="list" separate-columns="true" title="Project List" list-name="listIt" paginate-target="FindTask" + <form name="ListTasks" type="list" separate-columns="true" title="Task List" list-name="listIt" paginate-target="FindTask" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <actions> <service service-name="performFind" result-map-name="result" result-map-list-name="listIt"> |
Free forum by Nabble | Edit this page |