svn commit: r674700 - in /ofbiz/trunk/specialpurpose/mypage: webapp/mypage/WEB-INF/controller.xml widget/MyPageForms.xml widget/MyPageMenus.xml widget/MyPageScreens.xml

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

svn commit: r674700 - in /ofbiz/trunk/specialpurpose/mypage: webapp/mypage/WEB-INF/controller.xml widget/MyPageForms.xml widget/MyPageMenus.xml widget/MyPageScreens.xml

hansbak-2
Author: hansbak
Date: Mon Jul  7 18:37:49 2008
New Revision: 674700

URL: http://svn.apache.org/viewvc?rev=674700&view=rev
Log:
make mypage screens properly work when the buttons are activated

Modified:
    ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml
    ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml
    ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml

Modified: ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml?rev=674700&r1=674699&r2=674700&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml Mon Jul  7 18:37:49 2008
@@ -30,44 +30,93 @@
         <response name="success" type="view" value="main"/>
     </request-map>
 
+    <!-- TIMESHEET -->
+    <request-map uri="myTimesheet">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="myTimesheet"/>
+    </request-map>
     <request-map uri="updateTimesheet">
         <security https="true" auth="true"/>
         <event type="service-multi" invoke="updateTimeEntryByWorkeffort"/>
         <response name="success" type="view" value="main"/>
         <response name="error" type="view" value="main"/>
     </request-map>
-    
-    <request-map uri="StatusToComplete">
+    <request-map uri="updateTimesheetKey">
+        <security https="true" auth="true"/>
+        <event type="service-multi" invoke="updateTimeEntryByWorkeffort"/>
+        <response name="success" type="view" value="myTimesheet"/>
+        <response name="error" type="view" value="myTimesheet"/>
+    </request-map>
+    <request-map uri="statusToComplete">
         <security https="true" auth="true"/>
         <event type="service" invoke="updateTimesheet"/>
         <response name="success" type="view" value="main"/>
         <response name="error" type="view" value="main"/>
     </request-map>
-
+    <request-map uri="statusToCompleteKey">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="updateTimesheet"/>
+        <response name="success" type="view" value="myTimesheet"/>
+        <response name="error" type="view" value="myTimesheet"/>
+    </request-map>
+    
+    <!-- MY TASKS -->
+    <request-map uri="myTasks">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="myTasks"/>
+    </request-map>
     <request-map uri="updateTaskAssigment">
         <security https="true" auth="true"/>
         <event type="service" invoke="updateTaskAssigment"/>
         <response name="success" type="view" value="main"/>
         <response name="error" type="view" value="main"/>
     </request-map>
-    
+    <request-map uri="updateTaskAssigmentKey">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="updateTaskAssigment"/>
+        <response name="success" type="view" value="myTasks"/>
+        <response name="error" type="view" value="myTasks"/>
+    </request-map>
+
+    <!-- COMPANY COMMUNICATION -->    
+    <request-map uri="myCompanyComms">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="myCompanyComms"/>
+    </request-map>
     <request-map uri="newEvent">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="newEvent"/>
     </request-map>
-
     <request-map uri="createEvent">
         <security https="true" auth="true"/>
         <event type="service" invoke="createWorkEffort"/>
         <response name="success" type="view" value="main"/>
         <response name="error" type="view" value="newEvent"/>
     </request-map>
+    <request-map uri="createEventKey">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createWorkEffort"/>
+        <response name="success" type="view" value="myCompanyComms"/>
+        <response name="error" type="view" value="newEvent"/>
+    </request-map>
     <request-map uri="deleteEvent">
         <security https="true" auth="true"/>
         <event type="service" invoke="deleteWorkEffort"/>
         <response name="success" type="view" value="main"/>
         <response name="error" type="view" value="main"/>
     </request-map>
+    <request-map uri="deleteEventKey">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="deleteWorkEffort"/>
+        <response name="success" type="view" value="myCompanyComms"/>
+        <response name="error" type="view" value="myCompanyComms"/>
+    </request-map>
+    
+    <!-- MY COMMUNICATIONS -->
+    <request-map uri="myCommunications">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="myCommunications"/>
+    </request-map>
     <request-map uri="createCommunicationEvent">
         <security https="true" auth="true"/>
         <event type="service" invoke="createCommunicationEvent"/>
@@ -80,36 +129,24 @@
         <response name="success" type="view" value="main"/>
         <response name="error" type="view" value="main"/>
     </request-map>
+    
+    <!-- PREFERENCES -->
     <request-map uri="preferences">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="preferences"/>
     </request-map>
-    <request-map uri="myTasks">
-        <security https="true" auth="true"/>
-        <response name="success" type="view" value="myTasks"/>
-    </request-map>
-    <request-map uri="myTimesheet">
-        <security https="true" auth="true"/>
-        <response name="success" type="view" value="myTimesheet"/>
-    </request-map>
-    <request-map uri="myCommunications">
-        <security https="true" auth="true"/>
-        <response name="success" type="view" value="myCommunications"/>
-    </request-map>
-    <request-map uri="otherCommunications">
-        <security https="true" auth="true"/>
-        <response name="success" type="view" value="otherCommunications"/>
-    </request-map>
-    <request-map uri="myCompanyComms">
-        <security https="true" auth="true"/>
-        <response name="success" type="view" value="myCompanyComms"/>
-    </request-map>
     <request-map uri="updatePreferences">
         <security https="true" auth="true"/>
         <event invoke="updatePreferences" path="org/ofbiz/mypage/Events.xml" type="simple"/>
         <response name="success" type="view" value="main"/>
         <response name="error" type="view" value="preferences"/>
     </request-map>
+    
+    <!-- OTHER COMMUNICATIONS -->
+    <request-map uri="otherCommunications">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="otherCommunications"/>
+    </request-map>
 
     <view-map name="main" type="screen" page="component://mypage/widget/CommonScreens.xml#main"/>
     <view-map name="preferences" type="screen" page="component://mypage/widget/CommonScreens.xml#preferences"/>

Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml?rev=674700&r1=674699&r2=674700&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageForms.xml Mon Jul  7 18:37:49 2008
@@ -22,13 +22,19 @@
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
 
     <form name="MyTasks" extends="MyTasks" extends-resource="component://projectmgr/widget/forms/TaskForms.xml">
+        <alt-target use-when="!headerItem.equals(&quot;main&quot;)" target="updateTaskAssigmentKey"/>
         <field name="workEffortName" title="${uiLabelMap.ProjectMgrTaskName}" widget-style="buttontext">
             <hyperlink also-hidden="false" description="${workEffortName}" target="/projectmgr/control/taskView?workEffortId=${workEffortId}" target-type="inter-app" target-window="_BLANK"/>
         </field>
         <field name="projectName" title="${uiLabelMap.ProjectMgrProjectName}"><hyperlink target="/projectmgr/control/projectView?projectId=${resultProject.projectId}"  target-type="inter-app" target-window="_BLANK" description="${resultProject.projectName}"/></field>
+        <field use-when="!headerItem.equals(&quot;main&quot;)" name="remove" title="${uiLabelMap.CommonRemove}"><hyperlink target="updateTaskAssigmentKey?workEffortId=${workEffortId}&amp;partyId=${partyId}&amp;roleTypeId=${roleTypeId}&amp;fromDate=${fromDate}&amp;statusId=PAS_ENDED" description="${uiLabelMap.CommonRemove}"/></field>
+        <field use-when="headerItem.equals(&quot;main&quot;)" name="remove" title="${uiLabelMap.CommonRemove}"><hyperlink target="updateTaskAssigment?workEffortId=${workEffortId}&amp;partyId=${partyId}&amp;roleTypeId=${roleTypeId}&amp;fromDate=${fromDate}&amp;statusId=PAS_ENDED" description="${uiLabelMap.CommonRemove}"/></field>
+        <field use-when="!headerItem.equals(&quot;main&quot;)" name="toComplete" title="${uiLabelMap.CommonStatustoComplete}"><hyperlink target="updateTaskAssigmentKey?workEffortId=${workEffortId}&amp;partyId=${partyId}&amp;roleTypeId=${roleTypeId}&amp;fromDate=${fromDate}&amp;statusId=PAS_COMPLETED" description="${uiLabelMap.CommonStatustoComplete}"/></field>
+        <field use-when="headerItem.equals(&quot;main&quot;)" name="toComplete" title="${uiLabelMap.CommonStatustoComplete}"><hyperlink target="updateTaskAssigment?workEffortId=${workEffortId}&amp;partyId=${partyId}&amp;roleTypeId=${roleTypeId}&amp;fromDate=${fromDate}&amp;statusId=PAS_COMPLETED" description="${uiLabelMap.CommonStatustoComplete}"/></field>
     </form>
     
     <form name="EditWeekTimesheet" extends="EditWeekTimesheet" extends-resource="component://projectmgr/widget/forms/TimeSheetForms.xml">
+        <alt-target use-when="!headerItem.equals(&quot;main&quot;)" target="updateTimesheetKey"/>
         <field name="workEffortId" title="${uiLabelMap.ProjectMgrTaskName}">
             <drop-down allow-empty="true">
                 <entity-options entity-name="ProjectPartyAndPhaseAndTask" description="${workEffortName} -- ${phaseName} -- ${projectName}">
@@ -56,6 +62,7 @@
                 <order-by field-name="actualStartDate"/>
             </entity-condition>
         </actions>
+        <alt-target use-when="!headerItem.equals(&quot;main&quot;)" target="deleteEventKey"/>
         <field name="workEffortId"><hidden/></field>
         <field name="workEffortName" title="${uiLabelMap.WorkEffortEventName}"><display/></field>
         <field name="description" title="${uiLabelMap.CommonDescription}"><display/></field>
@@ -64,6 +71,7 @@
     </form>
     
     <form name="newEvent" type="single" target="createEvent">
+        <alt-target use-when="!headerItem.equals(&quot;main&quot;)" target="createEventKey"/>
         <field name="workEffortTypeId"><hidden value="COMPANY_EVENT"/></field>
         <field name="currentStatusId"><hidden value="_NA_"/></field>
         <field name="workEffortName" title="${uiLabelMap.WorkEffortEventName}"><text/></field>
@@ -74,11 +82,11 @@
 
     <form name="preferences" type="single" target="updatePreferences" default-map-name="preferences.userPrefMap">
         <field name="userPrefGroupId"><hidden value="MyPage"/></field>
-        <field name="myCompanyComms"><check/></field>
-        <field name="myTimesheet"><check/></field>
-        <field name="myTasks"><check/></field>
         <field name="myCommunications"><check/></field>
         <field name="otherCommunications"><check/></field>
+        <field name="myCompanyComms"><check/></field>
+        <field name="myTasks"><check/></field>
+        <field name="myTimesheet"><check/></field>
         <field name="updateButton"><submit/></field>
     </form>
 </forms>
\ No newline at end of file

Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml?rev=674700&r1=674699&r2=674700&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageMenus.xml Mon Jul  7 18:37:49 2008
@@ -99,7 +99,14 @@
     </menu>    
     
     <menu name="MyCompanyCommsMenu">
-        <menu-item name="newEvent" title="${uiLabelMap.WorkEffortNewEvent}"><link target="newEvent"/></menu-item>
+        <menu-item name="newEventKey" title="${uiLabelMap.WorkEffortNewEvent}">
+            <condition><if-compare field-name="headerItem" operator="not-equals" value="main"/></condition>
+            <link target="newEvent?Key=Y"/>
+        </menu-item>
+        <menu-item name="newEvent" title="${uiLabelMap.WorkEffortNewEvent}">
+            <condition><if-compare field-name="headerItem" operator="equals" value="main"/></condition>
+            <link target="newEvent"/>
+        </menu-item>
     </menu>    
     
     <menu name="MyCommunicationsMenu">
@@ -111,7 +118,25 @@
         <menu-item name="myTasks" title="myTasks"><link target="/projectmgr/control/MyTasks" url-mode="inter-app"/></menu-item>
     </menu>
     
-    <menu name="MyTimesheetMenu" extends="TimesheetBar" extends-resource="component://projectmgr/widget/Menus.xml" type="simple" menu-container-style="button-bar button-style-2" default-selected-style="selected" selected-menuitem-context-field-name="tabButtonItem">
+    <menu name="MyTimesheetMenu">
+        <menu-item name="setToComplete" title="${uiLabelMap.CommonStatustoComplete}">
+            <condition>
+                <and>
+                    <if-compare field-name="timesheet.statusId" operator="equals" value="TIMESHEET_IN_PROCESS"/>
+                    <if-compare field-name="headerItem" operator="equals" value="main"/>
+                </and>
+            </condition>
+            <link target="statusToComplete?timesheetId=${timesheet.timesheetId}&amp;statusId=TIMESHEET_COMPLETED"/>
+        </menu-item>
+        <menu-item name="setToCompleteKey" title="${uiLabelMap.CommonStatustoComplete}">
+            <condition>
+                <and>
+                    <if-compare field-name="timesheet.statusId" operator="equals" value="TIMESHEET_IN_PROCESS"/>
+                    <if-compare field-name="headerItem" operator="not-equals" value="main"/>
+                </and>
+            </condition>
+            <link target="statusToCompleteKey?timesheetId=${timesheet.timesheetId}&amp;statusId=TIMESHEET_COMPLETED"/>
+        </menu-item>
         <menu-item name="myTime" title="myTime"><link target="/projectmgr/control/MyTimesheet" url-mode="inter-app"/></menu-item>
     </menu>
     

Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml?rev=674700&r1=674699&r2=674700&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml Mon Jul  7 18:37:49 2008
@@ -20,19 +20,43 @@
 
 <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
-    <screen name="newEvent">
-        <section>
-            <widgets>
-                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
-                    <decorator-section name="body">
-                        <screenlet>
-                            <include-form name="newEvent" location="component://mypage/widget/MyPageForms.xml"/>
-                        </screenlet>
-                    </decorator-section>
-                </decorator-screen>
-            </widgets>
-        </section>
-    </screen>
+ <screen name="newEvent">
+ <section>
+ <widgets>
+                <section>
+                    <condition>
+                        <if-empty field-name="parameters.Key" />
+                    </condition>
+                    <actions>
+                        <set field="headerItem" value="main" />
+                    </actions>
+                    <widgets />
+                </section>
+                <section>
+                    <condition>
+                        <not><if-empty field-name="parameters.Key" /></not>
+                    </condition>
+                    <actions>
+                        <set field="headerItem" value="myCompanyComms" />
+                    </actions>
+                    <widgets />
+                </section>
+ <section>
+ <widgets>
+ <decorator-screen name="main-decorator"
+ location="${parameters.mainDecoratorLocation}">
+ <decorator-section name="body">
+ <screenlet>
+ <include-form name="newEvent"
+ location="component://mypage/widget/MyPageForms.xml" />
+ </screenlet>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </widgets>
+ </section>
+ </screen>
     <screen name="MyTimesheet">
         <section>
             <actions>
@@ -168,7 +192,7 @@
             </actions>
             <widgets>
                 <screenlet title="${uiLabelMap.MyCommunications}" navigation-menu-name="MyCommunicationsMenu"
-                    navigation-form-name="ListPartyCommEvents" name="comms">
+                    navigation-form-name="ListPartyCommEvents" name="myComms">
                     <include-menu name="MyCommunicationsMenu"
                         location="component://mypage/widget/MyPageMenus.xml" />
                     <include-form name="ListPartyCommEvents"
@@ -197,7 +221,7 @@
                         <widgets>
                             <screenlet title="${uiLabelMap.OtherCommunicationsOfParty}: ${partyName.firstName} ${partyName.middleName} ${partyName.lastName} ${partyName.groupName} [${partyId}] "
                                 navigation-menu-name="MyCommunicationsMenu"
-                                navigation-form-name="ListPartyCommEvents" name="comms">
+                                navigation-form-name="ListPartyCommEvents" name="otherComms">
                                 <include-menu name="MyCommunicationsMenu"
                                     location="component://mypage/widget/MyPageMenus.xml" />
                                 <include-form name="ListPartyCommEvents"