svn commit: r685473 - in /ofbiz/trunk/specialpurpose: mypage/widget/CommonScreens.xml mypage/widget/MyPageForms.xml projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml

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

svn commit: r685473 - in /ofbiz/trunk/specialpurpose: mypage/widget/CommonScreens.xml mypage/widget/MyPageForms.xml projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml

hansbak-2
Author: hansbak
Date: Wed Aug 13 00:41:28 2008
New Revision: 685473

URL: http://svn.apache.org/viewvc?rev=685473&view=rev
Log:
allow a customer to look at his requests and related project tasks.

Modified:
    ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml
    ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml
    ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml

Modified: ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml?rev=685473&r1=685472&r2=685473&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/widget/CommonScreens.xml Wed Aug 13 00:41:28 2008
@@ -142,6 +142,32 @@
     <screen name="main">
         <section>
             <actions>
+                <entity-one entity-name="PartyRole" value-name="isEmployee">
+                    <field-map field-name="partyId" env-name="userLogin.partyId" />
+                    <field-map field-name="roleTypeId" value="EMPLOYEE" />
+                </entity-one>
+            </actions>
+            <widgets>
+                <section>
+                    <condition>
+                        <not>
+                            <if-empty field-name="isEmployee" />
+                        </not>
+                    </condition>
+                    <widgets>
+                        <include-screen name="mainEmployee" />
+                    </widgets>
+                    <fail-widgets>
+                        <include-screen name="mainNotEmployee" />
+                    </fail-widgets>
+                </section>
+            </widgets>
+        </section>
+    </screen>
+    
+    <screen name="mainEmployee">
+        <section>
+            <actions>
                 <set field="headerItem" value="main" />
                 <set field="parameters.donePage" value="main"/>
                 <!-- refresh every 3 minutes -->
@@ -234,6 +260,26 @@
             </widgets>
         </section>
     </screen>
+    <screen name="mainNotEmployee">
+        <section>
+            <actions>
+                <entity-and list-name="custRequests" entity-name="WorkEffortCustRequestView">
+                    <field-map field-name="fromPartyId" env-name="userLogin.partyId"/>
+                    <order-by field-name="createdDate"/>
+                </entity-and>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator"
+                    location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <screenlet title="${uiLabelMap.OrderRequestList}" navigation-form-name="ListRequestList" >
+                            <include-form name="ListCustRequests" location="component://mypage/widget/MyPageForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
     <screen name="preferences">
         <section>
             <actions>

Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml?rev=685473&r1=685472&r2=685473&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml Wed Aug 13 00:41:28 2008
@@ -126,4 +126,22 @@
             <hyperlink target="/projectmgr/control/taskView?workEffortId=${workEffortId}" description="${workEffortName} [${workEffortId}]" target-type="inter-app"/>
         </field>
     </form>
+    <form name="ListCustRequests" type="list" list-name="custRequests" odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
+        <row-actions>
+            <service service-name="getProjectTask" result-map-name="taskResult">
+                <field-map field-name="taskId" env-name="workEffortId"/>
+            </service>
+            <set field="task" from-field="taskResult.taskInfo"/>
+        </row-actions>
+        <field name="custRequestName"><hyperlink description="${custRequestName} [${custRequestId}]" target="ViewRequest?custRequestId=${custRequestId}"/></field>
+        <field name="description" title="${uiLabelMap.CommonDescription}"><display/></field>
+        <field name="createdDate" title="Date"><display type="date"/></field>
+        <field name="statusId"><display-entity entity-name="StatusItem" description="${description}"/></field>
+        <field name="task.plannedStartDate"><display type="date"/></field>
+        <field name="task.plannedEndDate"><display type="date"/></field>
+        <field name="task.actualStartDate"><display type="date"/></field>
+        <field name="task.actualEndDate"><display type="date"/></field>
+        <field name="task.plannedHours"><display/></field>
+        <field name="task.actualHours"><display/></field>
+    </form>
 </forms>
\ No newline at end of file

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=685473&r1=685472&r2=685473&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml Wed Aug 13 00:41:28 2008
@@ -150,10 +150,19 @@
             <set field="partyId" from-field="parameters.userLogin.partyId"/>
             <!--log level="info" message="======ProjectMGR Security=====  action: ${parameters.mainAction} object: ${sec_object} Id: ${parameters.taskId} PhaseId:  ${parameters.workEffortParentId} resourceDescription: ${parameters.resourceDescription}"/-->
             <call-simple-method method-name="checkProjectMembership"/>
+            <entity-and list-name="custRequests" entity-name="WorkEffortCustRequestView">
+                <field-map field-name="workEffortId" env-name="parameters.taskId"/>
+            </entity-and>
+            <first-from-list list-name="custRequests" entry-name="custRequest"/>
             <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"/>
+                        </and>
+                        <and>
                             <!-- view a task with a null id is a null operation, so ok... -->
                             <if-empty field="parameters.taskId"/>
                             <if-empty field="parameters.workEffortId"/>