Author: hansbak
Date: Mon Jan 7 23:33:08 2008 New Revision: 609895 URL: http://svn.apache.org/viewvc?rev=609895&view=rev Log: fixed a number of errors, simplified the weeklytimesheet retrieval bsh, fixed some problem with the timesheet main option Modified: ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml Modified: ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties?rev=609895&r1=609894&r2=609895&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties (original) +++ ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties Mon Jan 7 23:33:08 2008 @@ -155,3 +155,4 @@ ProjectMgrCreateTaskFromRequest=Create Task From Request ProjectMgrProjectAndPhaseName=Project and Phase Name ProjectMgrCustRequestWorkEffort=CustRequest WorkEffort +ProjectMgrViewPermissionError=You need at least PROJECTMGR_READ permission to view this screen. \ No newline at end of file Modified: ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml?rev=609895&r1=609894&r2=609895&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Mon Jan 7 23:33:08 2008 @@ -184,15 +184,14 @@ </simple-method> <simple-method method-name="updateTimeEntryByWorkeffort" short-description="Update workeffort by workeffort and timesheetId "> - <log level="always" message="=====start:==rateType: ${parameters.rateTypeId}"></log> + <entity-one entity-name="Timesheet" value-name="timesheet"/> + <field-to-result field-name="parameters.timesheetId" result-name="timesheetId"/> <if-empty field-name="parameters.workEffortId"> <return/> </if-empty> <if-compare field-name="parameters.workEffortId" operator="equals" value="Totals"> <return/> </if-compare> - <entity-one entity-name="Timesheet" value-name="timesheet"/> - <field-to-result field-name="parameters.timesheetId" result-name="timesheetId"/> <entity-and entity-name="ProjectAndPhaseAndTask" list-name="projects"> <field-map field-name="workEffortId" env-name="parameters.workEffortId"/> @@ -900,7 +899,6 @@ <call-service service-name="deleteTimeEntry" in-map-name="teDelMap"/> <else> <clear-field field-name="teUpdMap"/> - <log level="always" message="=====updtimeentry: ${parameters.rateTypeId}"></log> <set field="teUpdMap.hours" from-field="hours"/> <set field="teUpdMap.timeEntryId" from-field="timeEntry.timeEntryId"/> <set field="teUpdMap.rateTypeId" from-field="parameters.rateTypeId"/> Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh?rev=609895&r1=609894&r2=609895&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh Mon Jan 7 23:33:08 2008 @@ -43,6 +43,7 @@ // show the requested timesheet, otherwise the current , if not exist create timesheet = null; timesheetId = parameters.get("timesheetId"); +Debug.logInfo("====editweek: " + partyId + " timesheetId: " + timesheetId, ""); if (timesheetId != null) { timesheet = delegator.findByPrimaryKey("Timesheet", UtilMisc.toMap("timesheetId", timesheetId)); partyId = timesheet.getString("partyId"); // use the party from this timesheet @@ -85,7 +86,6 @@ pHours = 0.00; timeEntry = null; lastTimeEntry = null; -lastWorkEffortId = null; // retrieve work effort data when the workeffortId has changed. void retrieveWorkEffortData() { @@ -133,7 +133,7 @@ entry = FastMap.newInstance(); } -timeEntries = timesheet.getRelated("TimeEntry", UtilMisc.toList("workEffortId", "fromDate")); +timeEntries = timesheet.getRelated("TimeEntry", UtilMisc.toList("workEffortId", "rateTypeId", "fromDate")); te = timeEntries.iterator(); while(te.hasNext()) { // only fill lastTimeEntry when not the first time @@ -142,7 +142,14 @@ } timeEntry = te.next(); - if (lastWorkEffortId != null && !lastWorkEffortId.equals(timeEntry.getString("workEffortId"))) { + // set the rate type to default if missing + if (timeEntry.getString("rateTypeId") == null) { + timeEntry.put("rateTypeId", context.get("defaultRateTypeId")); + } + Debug.logInfo("bsh: workeffort:" + timeEntry.getString("workEffortId") + " ratetype: " + timeEntry.getString("rateTypeId"), "" ); + if (lastTimeEntry != null && + (!lastTimeEntry.getString("workEffortId").equals(timeEntry.getString("workEffortId")) || + !lastTimeEntry.getString("rateTypeId").equals(timeEntry.getString("rateTypeId")))) { retrieveWorkEffortData(); } @@ -163,7 +170,7 @@ lastWorkEffortId = timeEntry.getString("workEffortId"); } -if (lastWorkEffortId != null) { +if (lastTimeEntry != null) { lastTimeEntry = timeEntry; retrieveWorkEffortData(); } @@ -176,7 +183,7 @@ } // add the totals line if at least one entry -if (lastWorkEffortId != null) { +if (lastTimeEntry != null) { entry = UtilMisc.toMap("timesheetId", timesheet.get("timesheetId")); entry.put("0", day0Total); entry.put("1", day1Total); Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml?rev=609895&r1=609894&r2=609895&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml Mon Jan 7 23:33:08 2008 @@ -392,12 +392,18 @@ <response name="success" type="view" value="EditTimeEntries"/> <response name="error" type="view" value="EditTimeEntries"/> </request-map> - <request-map uri="updateMyTimesheet"> - <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="updateMyTimesheet"> + <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="updateTimesheet"> + <security https="true" auth="true"/> + <event type="service-multi" invoke="updateTimeEntryByWorkeffort"/> + <response name="success" type="view" value="Timesheet"/> + <response name="error" type="view" value="Timesheet"/> + </request-map> <request-map uri="updateTimeEntry"> <security https="true" auth="true"/> <event type="service" invoke="updateTimeEntry"/> @@ -425,12 +431,6 @@ <event type="service" invoke="createTimesheets"/> <response name="success" type="view" value="FindTimeSheet"/> <response name="error" type="view" value="FindTimeSheet"/> - </request-map> - <request-map uri="updateTimeSheet"> - <security https="true" auth="true"/> - <event type="service" invoke="updateTimesheet"/> - <response name="success" type="view" value="EditTimeSheet"/> - <response name="error" type="view" value="EditTimeSheet"/> </request-map> <request-map uri="deleteTimeSheet"> <security https="true" auth="true"/> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml?rev=609895&r1=609894&r2=609895&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml Mon Jan 7 23:33:08 2008 @@ -69,7 +69,7 @@ <decorator-section-include name="body"/> </widgets> <fail-widgets> - <label style="head3">${uiLabelMap.WorkEffortViewPermissionError}</label> + <label style="head3">${uiLabelMap.ProjectMgrViewPermissionError}</label> </fail-widgets> </section> </decorator-section> @@ -110,7 +110,7 @@ <decorator-section-include name="body"/> </widgets> <fail-widgets> - <label style="head3">${uiLabelMap.WorkEffortViewPermissionError}</label> + <label style="head3">${uiLabelMap.ProjectMgrViewPermissionError}</label> </fail-widgets> </section> </decorator-section> @@ -162,7 +162,7 @@ <decorator-section-include name="body"/> </widgets> <fail-widgets> - <label style="head3">${uiLabelMap.WorkEffortViewPermissionError}</label> + <label style="head3">${uiLabelMap.ProjectMgrViewPermissionError}</label> </fail-widgets> </section> </decorator-section> @@ -183,7 +183,7 @@ <decorator-section-include name="body"/> </widgets> <fail-widgets> - <label style="head3">${uiLabelMap.WorkEffortViewPermissionError}</label> + <label style="head3">${uiLabelMap.ProjectMgrViewPermissionError}</label> </fail-widgets> </section> </decorator-section> @@ -209,7 +209,7 @@ <decorator-section-include name="body"/> </widgets> <fail-widgets> - <label style="head3">${uiLabelMap.WorkEffortViewPermissionError}</label> + <label style="head3">${uiLabelMap.ProjectMgrViewPermissionError}</label> </fail-widgets> </section> </decorator-section> @@ -250,7 +250,7 @@ <decorator-section-include name="body"/> </widgets> <fail-widgets> - <label style="head3">${uiLabelMap.WorkEffortViewPermissionError}</label> + <label style="head3">${uiLabelMap.ProjectMgrViewPermissionError}</label> </fail-widgets> </section> </decorator-section> @@ -275,7 +275,7 @@ <decorator-section-include name="body"/> </widgets> <fail-widgets> - <label style="head3">${uiLabelMap.WorkEffortViewPermissionError}</label> + <label style="head3">${uiLabelMap.ProjectMgrViewPermissionError}</label> </fail-widgets> </section> </decorator-section> @@ -313,7 +313,7 @@ <decorator-section-include name="body"/> </widgets> <fail-widgets> - <label style="head3">${uiLabelMap.WorkEffortViewPermissionError}</label> + <label style="head3">${uiLabelMap.ProjectMgrViewPermissionError}</label> </fail-widgets> </section> </decorator-section> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml?rev=609895&r1=609894&r2=609895&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml Mon Jan 7 23:33:08 2008 @@ -20,8 +20,8 @@ <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd"> <form name="EditWeekTimesheet" type="multi" list-name="timeEntries" use-row-submit="true" - separate-columns="true" target="updateMyTimesheet"> - <field name="timesheetId"><hidden/></field> + separate-columns="true" target="update${my}Timesheet"> + <field name="timesheetId"><hidden value="${parameters.timesheetId}"/></field> <field name="roleTypeId"><hidden/></field> <field name="fromDate"><hidden/></field> <field name="workEffortId" title="${uiLabelMap.ProjectMgrTaskName}"> |
Free forum by Nabble | Edit this page |