Author: hansbak
Date: Sun Dec 9 00:06:00 2007 New Revision: 602651 URL: http://svn.apache.org/viewvc?rev=602651&view=rev Log: rewritten timesheet maintenance screens to allow the weekly input to tasks of projects the login ID is member of. Added: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh (with props) Modified: ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitygroup.xml ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml ofbiz/trunk/specialpurpose/projectmgr/widget/TimeSheetScreens.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=602651&r1=602650&r2=602651&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties (original) +++ ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties Sun Dec 9 00:06:00 2007 @@ -34,6 +34,7 @@ PageTitleAddTaskNotes=Add Task Notes PageTitleAddTimeEntry=Add Time Entry PageTitleDependencies=Task dependencies +PageTitleEditCurrentTimesheet=Edit current timesheet PageTitleEditProject=Edit Project PageTitleEditPhase=Edit Phase PageTitleEditSkill=Edit Skill @@ -48,6 +49,7 @@ PageTitleListPartyAssigns=Party Assigns PageTitleListProjectNotes=List Project Notes PageTitleListTaskNotes=List Task Notes +PageTitleMyTimesheets=My timesheet list PageTitleProjectInformation=Project Information PageTitleTasksAfter=Tasks to be executed after the current task PageTitleTasksBefore=Tasks to be executed before the current task Modified: ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitygroup.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitygroup.xml?rev=602651&r1=602650&r2=602651&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitygroup.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitygroup.xml Sun Dec 9 00:06:00 2007 @@ -26,5 +26,7 @@ <!-- ========================================================= --> <entity-group group="org.ofbiz" entity="ProjectPartyAndPhaseAndTask"/> - <entity-group group="org.ofbiz" entity="ProjectAndPhaseAndTask"/> + <entity-group group="org.ofbiz" entity="ProjectAndPhaseAndTask"/> + <entity-group group="org.ofbiz" entity="TimesheetAndTimeEntry"/> + </entitygroup> Modified: ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml?rev=602651&r1=602650&r2=602651&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml Sun Dec 9 00:06:00 2007 @@ -88,4 +88,41 @@ <key-map field-name="workEffortId"/> </relation> </view-entity> + + <view-entity entity-name="TimesheetAndTimeEntry" + package-name="org.ofbiz.workeffort.project" + title="Time entry for Timesheets, time entries always have a timesheet and are always for one day only and recording the hours for one person which is defined on the timesheet. A timesheet will always have at least one time entry."> + <member-entity entity-alias="TS" entity-name="Timesheet"/> + <member-entity entity-alias="TE" entity-name="TimeEntry"/> + <alias-all entity-alias="TS"> + <exclude field="clientPartyId"/> + <exclude field="comments"/> + </alias-all> + <alias-all entity-alias="TE"> + <exclude field="partyId"/> + <exclude field="thruDate"/> + <exclude field="fromDate"/> + <exclude field="comments"/> + </alias-all> + <alias entity-alias="TE" field="fromDate" name="activityDate"/> + <alias entity-alias="TE" field="comments" name="entryComments"/> + <alias entity-alias="TS" field="comments" name="sheetComments"/> + <view-link entity-alias="TS" rel-entity-alias="TE" rel-optional="true"> + <key-map field-name="timesheetId"/> + </view-link> + <relation type="one" rel-entity-name="WorkEffort"> + <key-map field-name="workEffortId"/> + </relation> + <relation type="one" rel-entity-name="Invoice"> + <key-map field-name="invoiceId"/> + </relation> + <relation type="one" rel-entity-name="InvoiceItem"> + <key-map field-name="invoiceId"/> + <key-map field-name="invoiceItemSeqId"/> + </relation> + <relation type="one" rel-entity-name="RateType"> + <key-map field-name="rateTypeId"/> + </relation> + </view-entity> + </entitymodel> 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=602651&r1=602650&r2=602651&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Sun Dec 9 00:06:00 2007 @@ -20,7 +20,74 @@ <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd"> + + <simple-method method-name="updateTimeEntryByWorkeffort" short-description="Update workeffort by workeffort and 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"/> + + <entity-and entity-name="ProjectAndPhaseAndTask" list-name="projects"> + <field-map field-name="workEffortId" env-name="parameters.workEffortId"/> + </entity-and> + <if-not-empty field-name="project"> + <first-from-list entry-name="projects" list-name="project"/> + </if-not-empty> + + <get-related value-name="timesheet" relation-name="TimeEntry" list-name="timeEntries"/> + + <!-- update existing entries --> + <set field="hours" value="0" type="Double"/> + <if-not-empty field-name="timeEntries"> + <iterate entry-name="timeEntry" list-name="timeEntries"> + <if-compare-field field-name="timeEntry.workEffortId" operator="equals" to-field-name="parameters.workEffortId"> + <!-- check if the entry does not contain any hours, then delete --> + <if-empty field-name="timeEntry.hours"> + <set from-field="timeEntry.timeEntryId" field="teDelMap.timeEntryId"/> + <call-service service-name="deleteTimeEntry" in-map-name="teDelMap"/> + <else> + <!-- translate the date into the daynumber --> + <call-class-method class-name="org.ofbiz.base.util.UtilDateTime" method-name="getIntervalInDays" ret-field-name="dayNumber"> + <field field-name="timesheet.fromDate" type="java.sql.Timestamp"/> + <field field-name="timeEntry.fromDate" type="java.sql.Timestamp"/> + </call-class-method> + <!-- get the related field --> + <if-not-empty field-name="parameters.hoursDay${dayNumber}"> + <set field="hours" from-field="parameters.hoursDay${dayNumber}"/> + <else> + <set field="hours" value="0"/> + </else> + </if-not-empty> + <set field="parameters.hoursDay${dayNumber}" value="-1"/> + <call-simple-method method-name="updateTimeEntry"/> + </else> + </if-empty> + </if-compare-field> + </iterate> + </if-not-empty> + + <!-- process not yet done fields --> + <loop count="7" field="dayNr"> + <if-not-empty field-name="parameters.hoursDay${dayNr}"> + <set field="hours" from-field="parameters.hoursDay${dayNr}"/> + <else> + <set field="hours" value="0"/> + </else> + </if-not-empty> + <set field="hours" from-field="parameters.hoursDay${dayNr}"/> + <call-class-method class-name="org.ofbiz.base.util.UtilDateTime" method-name="addDaysToTimestamp" ret-field-name="fromDate"> + <field field-name="timesheet.fromDate" type="java.sql.Timestamp"/> + <field field-name="dayNr" type="int"/> + </call-class-method> + <call-simple-method method-name="updateTimeEntry"/> + </loop> + + </simple-method> + <simple-method method-name="getProject" short-description="get Project information" login-required="true"> <!-- get the phase seq id --> <if-empty field-name="parameters.projectId"> @@ -321,7 +388,7 @@ <!-- input is 'lowInfo' map output is 'highInfo map --> <!-- hoursPartyId: if provided only the hours of that party --> - <!-- add the estimated hours together --> + <!-- add the planned hours together --> <get-related value-name="lowInfo" relation-name="WorkEffortSkillStandard" list-name="estimates"/> <iterate entry-name="estimate" list-name="estimates"> <if-not-empty field-name="estimate.estimatedDuration"> @@ -336,13 +403,14 @@ <get-related value-name="lowInfo" relation-name="TimeEntry" list-name="actuals"/> <iterate entry-name="actual" list-name="actuals"> <if-not-empty field-name="actual.hours"> + <get-related-one value-name="actual" relation-name="Timesheet" to-value-name="timesheet"/> <if> <condition> <or> <if-empty field-name="hoursPartyId"/> <and> <not><if-empty field-name="hoursPartyId"/></not> - <if-compare-field field-name="actuals.partyId" operator="equals" to-field-name="hoursPartyId"/> + <if-compare-field field-name="timeSheet.partyId" operator="equals" to-field-name="hoursPartyId"/> </and> </or> </condition> @@ -375,4 +443,31 @@ </else> </if-not-empty> </simple-method> + + <simple-method method-name="updateTimeEntry" short-description=""> + <if-compare field-name="hours" value="-1" operator="equals"> + <return/> + </if-compare> + <if-not-empty field-name="timeEntry.timeEntryId"> + <if-compare field-name="hours" operator="equals" value="0"> + <set field="teDelMap.timeEntryId" from-field="timeEntry.timeEntryId"/> + <call-service service-name="deleteTimeEntry" in-map-name="teDelMap"/> + <else> + <clear-field field-name="teUpdMap"/> + <set field="teUpdMap.hours" from-field="hours"/> + <set field="teUpdMap.timeEntryId" from-field="timeEntry.timeEntryId"/> + <call-service service-name="updateTimeEntry" in-map-name="teUpdMap"/> + </else> + </if-compare> + <else> + <if-compare field-name="hours" operator="not-equals" value="0"> + <set-service-fields service-name="createTimeEntry" map-name="parameters" to-map-name="teCreMap"/> + <set field="teCreMap.hours" from-field="hours"/> + <set field="teCreMap.fromDate" from-field="fromDate"/> + <call-service service-name="createTimeEntry" in-map-name="teCreMap"/> + </if-compare> + </else> + </if-not-empty> + </simple-method> + </simple-methods> Modified: ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml?rev=602651&r1=602650&r2=602651&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml Sun Dec 9 00:06:00 2007 @@ -22,6 +22,20 @@ xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd"> <description>Project Manager service definitions.</description> + <service name="updateTimeEntryByWorkeffort" engine="simple" + location="org/ofbiz/project/ProjectServices.xml" invoke="updateTimeEntryByWorkeffort"> + <description>Update workeffort by workeffort and timesheetId </description> + <attribute name="timesheetId" type="String" mode="IN" optional="false"/> + <attribute name="workEffortId" type="String" mode="IN" optional="true"/><!-- when empty will be ignored --> + <attribute name="hoursDay0" type="Double" mode="IN" optional="true"/> + <attribute name="hoursDay1" type="Double" mode="IN" optional="true"/> + <attribute name="hoursDay2" type="Double" mode="IN" optional="true"/> + <attribute name="hoursDay3" type="Double" mode="IN" optional="true"/> + <attribute name="hoursDay4" type="Double" mode="IN" optional="true"/> + <attribute name="hoursDay5" type="Double" mode="IN" optional="true"/> + <attribute name="hoursDay6" type="Double" mode="IN" optional="true"/> + </service> + <service name="getProject" engine="simple" location="org/ofbiz/project/ProjectServices.xml" invoke="getProject"> <description>Get project information and realated phase and task info.</description> Added: 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=602651&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh (added) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh Sun Dec 9 00:06:00 2007 @@ -0,0 +1,167 @@ +/* +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.*; +import java.lang.*; +import org.ofbiz.base.util.*; +import org.ofbiz.entity.*; +import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilValidate; +import org.ofbiz.base.util.UtilDateTime; +import org.ofbiz.entity.util.*; +import org.ofbiz.entity.condition.*; +import java.sql.Timestamp; +import javolution.util.FastList; +import javolution.util.FastMap; + +timesheetId = parameters.get("timesheetId"); +userLogin = parameters.get("userLogin"); +delegator = parameters.get("delegator"); +locale = parameters.get("locale"); +timeZone = parameters.get("timeZone"); + +// show the requested timesheet, otherwise the current , if not exist create +timesheet = null; +if (timesheetId != null) { + timesheet = delegator.findByPrimaryKey("Timesheet", UtilMisc.toMap("timesheetId", timesheetId)); + } else { + start = UtilDateTime.getWeekStart(UtilDateTime.nowTimestamp()); + timesheets = delegator.findByAnd("Timesheet", + UtilMisc.toMap("partyId", userLogin.getString("partyId"), "fromDate", start)); + if (!UtilValidate.isEmpty(timesheets)) { + timesheet = timesheets.get(0); + } else { + result = dispatcher.runSync("createTimesheetForThisWeek", + UtilMisc.toMap("userLogin", userLogin, "partyId", userLogin.getString("partyId"))); + timesheet = delegator.findByPrimaryKey("Timesheet", UtilMisc.toMap("timesheetId", result.get("timesheetId"))); + } +} + +context.put("timesheet", timesheet); +context.put("weekNumber", UtilDateTime.weekNumber(timesheet.getTimestamp("fromDate"))); + +entries = new LinkedList(); +timeEntries = timesheet.getRelated("TimeEntry", UtilMisc.toList("workEffortId", "fromDate")); +te = timeEntries.iterator(); +lastWorkEffortId = null; +entry = FastMap.newInstance(); +taskTotal = 0.00; +day0Total = 0.00; day1Total=0.00;day2Total=0.00; day3Total=0.00;day4Total=0.00;day5Total=0.00;day6Total=0.00; +pHours = 0.00; +timeEntry = null; +while(te.hasNext()) { + timeEntry = te.next(); + + if (lastWorkEffortId != null && !lastWorkEffortId.equals(timeEntry.getString("workEffortId"))) { + entry.put("total", taskTotal); + // get the planned number of hours + plannedHours = timeEntry.getRelatedOne("WorkEffort").getRelated("WorkEffortSkillStandard"); + ph = plannedHours.iterator(); + pHours = 0.00; + while(ph.hasNext()) { + plannedHour = ph.next(); + if (plannedHour.get("estimatedDuration") != null) { + pHours += plannedHour.get("estimatedDuration"); + } + } + entry.put("plannedHours", pHours); + entries.add(entry); + taskTotal = 0.00; + entry = UtilMisc.toMap("timesheetId", timesheet.get("timesheetId")); + } + if (UtilValidate.isNotEmpty(timeEntry.get("workEffortId"))) { + workEffort = timeEntry.getRelatedOne("WorkEffort"); + entry.put("workEffortId", workEffort.getString("workEffortId")); + entry.put("workEffortName", workEffort.getString("workEffortName")); + } + entry.put("timesheetId", timesheet.get("timesheetId")); + if (timeEntry.get("hours") != null) { + dayNumber = (timeEntry.get("fromDate").getTime() - timesheet.getTimestamp("fromDate").getTime()) / (24*60*60*1000); + hours = timeEntry.getDouble("hours").doubleValue(); + entry.put(String.valueOf(dayNumber), hours); + if (dayNumber == 0) day0Total += hours; + if (dayNumber == 1) day1Total += hours; + if (dayNumber == 2) day2Total += hours; + if (dayNumber == 3) day3Total += hours; + if (dayNumber == 4) day4Total += hours; + if (dayNumber == 5) day5Total += hours; + if (dayNumber == 6) day6Total += hours; + taskTotal += hours; + } + lastWorkEffortId = timeEntry.getString("workEffortId"); +} +if (lastWorkEffortId != null) { + plannedHours = timeEntry.getRelatedOne("WorkEffort").getRelated("WorkEffortSkillStandard"); + ph = plannedHours.iterator(); + pHours = 0.00; + while(ph.hasNext()) { + plannedHour = ph.next(); + if (plannedHour.get("estimatedDuration") != null) { + pHours += plannedHour.get("estimatedDuration"); + } + } + entry.put("plannedHours", pHours); + entry.put("total", taskTotal); + entries.add(entry); + } +for (c=0; c < 3; c++) { // add 5 empty lines + entries.add(UtilMisc.toMap("timesheetId", timesheet.get("timesheetId"))); +} +if (lastWorkEffortId != null) { + entry = UtilMisc.toMap("timesheetId", timesheet.get("timesheetId")); + entry.put("0", day0Total); + entry.put("1", day1Total); + entry.put("2", day2Total); + entry.put("3", day3Total); + entry.put("4", day4Total); + entry.put("5", day5Total); + entry.put("6", day6Total); + entry.put("workEffortId", "Totals"); + entry.put("total", day0Total+day1Total+day2Total+day3Total+day4Total+day5Total+day6Total); + Debug.logInfo("=====" + entry, ""); + entries.add(entry); +} +context.put("timeEntries", entries); + + +timesheetsDb = delegator.findByAnd("Timesheet", + UtilMisc.toMap("partyId", userLogin.getString("partyId")), + UtilMisc.toList("fromDate DESC")); +timesheets = new LinkedList(); +ts = timesheetsDb.iterator(); +while(ts.hasNext()) { + timesheetDb = ts.next(); + timesheet = FastMap.newInstance(); + timesheet.putAll(timesheetDb); + entries = timesheetDb.getRelated("TimeEntry"); + te = entries.iterator(); + hours = 0.00; + while(te.hasNext()) { + timeEntry = te.next(); + if (timeEntry.get("hours") != null) { + hours += timeEntry.getDouble("hours").doubleValue(); + } + } + timesheet.put("weekNumber", UtilDateTime.weekNumber(timesheetDb.getTimestamp("fromDate"))); + timesheet.put("hours", hours); + timesheets.add(timesheet); +} +context.put("timesheets", timesheets); + Propchange: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh ------------------------------------------------------------------------------ svn:mime-type = text/plain 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=602651&r1=602650&r2=602651&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml Sun Dec 9 00:06:00 2007 @@ -294,12 +294,18 @@ <response name="success" type="view" value="EditTimeEntries"/> <response name="error" type="view" value="EditTimeEntries"/> </request-map> - <request-map uri="updateTimeEntry"> - <security https="true" auth="true"/> - <event type="service" invoke="updateTimeEntry"/> - <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="MyTimesheets"/> + <response name="error" type="view" value="MyTimesheets"/> + </request-map> + <request-map uri="updateTimeEntry"> + <security https="true" auth="true"/> + <event type="service" invoke="updateTimeEntry"/> + <response name="success" type="view" value="EditTimeEntries"/> + <response name="error" type="view" value="EditTimeEntries"/> + </request-map> <request-map uri="deleteTimeEntry"> <security https="true" auth="true"/> <event type="service" invoke="deleteTimeEntry"/> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml?rev=602651&r1=602650&r2=602651&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml Sun Dec 9 00:06:00 2007 @@ -154,41 +154,65 @@ </widgets> </section> </screen> - <screen name="CommonTimesheetDecorator"> - <section> - <actions> - <set field="headerItem" value="timesheet"/> - <set field="timesheetId" from-field="parameters.timesheetId"/> - <entity-one entity-name="Timesheet" value-name="timesheet"/> - </actions> - <widgets> - <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> - <decorator-section name="body"> - <section> - <condition> - <if-has-permission permission="WORKEFFORTMGR" action="_VIEW"/> - </condition> - <widgets> - <section> - <condition><not><if-empty field-name="timesheetId"/></not></condition> - <widgets> - <include-menu name="TimesheetTabBar" location="component://projectmgr/widget/Menus.xml"/> - <container><label style="head1">${uiLabelMap.TimesheetTimesheetId}: ${timesheetId}</label></container> - </widgets> - </section> - - <decorator-section-include name="body"/> - </widgets> - <fail-widgets> - <label style="head3">${uiLabelMap.WorkEffortViewPermissionError}</label> - </fail-widgets> - </section> - </decorator-section> - </decorator-screen> - </widgets> - </section> - </screen> - + <screen name="CommonTimesheetDecorator"> + <section> + <actions> + <set field="headerItem" value="timesheet"/> + <set field="timesheetId" from-field="parameters.timesheetId"/> + <entity-one entity-name="Timesheet" value-name="timesheet"/> + </actions> + <widgets> + <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <section> + <condition> + <if-has-permission permission="WORKEFFORTMGR" action="_VIEW"/> + </condition> + <widgets> + <section> + <condition><not><if-empty field-name="timesheetId"/></not></condition> + <widgets> + <include-menu name="TimesheetTabBar" location="component://projectmgr/widget/Menus.xml"/> + <container><label style="head1">${uiLabelMap.TimesheetTimesheetId}: ${timesheetId}</label></container> + </widgets> + </section> + + <decorator-section-include name="body"/> + </widgets> + <fail-widgets> + <label style="head3">${uiLabelMap.WorkEffortViewPermissionError}</label> + </fail-widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + <screen name="CommonMyTimeDecorator"> + <section> + <actions> + <set field="headerItem" value="mytime"/> + </actions> + <widgets> + <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <section> + <condition> + <if-has-permission permission="WORKEFFORTMGR" action="_VIEW"/> + </condition> + <widgets> + <decorator-section-include name="body"/> + </widgets> + <fail-widgets> + <label style="head3">${uiLabelMap.WorkEffortViewPermissionError}</label> + </fail-widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + <screen name="CommonCalendarDecorator"> <section> <actions> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/TimeSheetScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/TimeSheetScreens.xml?rev=602651&r1=602650&r2=602651&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/TimeSheetScreens.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/TimeSheetScreens.xml Sun Dec 9 00:06:00 2007 @@ -19,7 +19,7 @@ --> <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd"> + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd"> <screen name="FindTimeSheet"> <section> <actions> @@ -45,19 +45,19 @@ </widgets> </section> </screen> - <screen name="EditTimeSheet"> - <section> - <actions> - <set field="titleProperty" value="PageTitleFindTimesheet"/> - <set field="headerItem" value="timesheet"/> - <set field="tabButtonItem" value="edittimesheet"/> - <set field="labelTitleProperty" value="PageTitleAddTimesheet"/> - <entity-one entity-name="Timesheet" value-name="timesheet"/> - </actions> - <widgets> - <decorator-screen name="CommonTimesheetDecorator" location="${parameters.mainDecoratorLocation}"> - <decorator-section name="body"> - <section> + <screen name="EditTimeSheet1"> + <section> + <actions> + <set field="titleProperty" value="PageTitleFindTimesheet"/> + <set field="headerItem" value="timesheet"/> + <set field="tabButtonItem" value="edittimesheet"/> + <set field="labelTitleProperty" value="PageTitleAddTimesheet"/> + <entity-one entity-name="Timesheet" value-name="timesheet"/> + </actions> + <widgets> + <decorator-screen name="CommonTimesheetDecorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <section> <widgets> <container style="screenlet"> <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleEditTimesheet} # ${timesheet.timesheetId}</label></container> @@ -65,13 +65,45 @@ <include-form name="EditTimesheet" location="component://workeffort/widget/TimesheetForms.xml"/> </container> </container> - </widgets> - </section> - </decorator-section> - </decorator-screen> - </widgets> - </section> - </screen> + </widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + <screen name="MyTimesheets"> + <section> + <actions> + <set field="titleProperty" value="PageTitleFindTimesheet"/> + <set field="tabButtonItem" value="edittimesheet"/> + <set field="labelTitleProperty" value="PageTitleAddTimesheet"/> + <script location="component://projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh"/> + </actions> + <widgets> + <decorator-screen name="CommonMyTimeDecorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <section> + <widgets> + <container style="screenlet"> + <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleEditCurrentTimesheet} # ${timesheet.timesheetId} week: ${weekNumber}</label></container> + <container style="screenlet-body"> + <include-form name="EditWeekTimesheet" location="component://projectmgr/widget/forms/TimeSheetForms.xml"/> + </container> + </container> + <container style="screenlet"> + <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleMyTimesheets} # ${timesheet.timesheetId}</label></container> + <container style="screenlet-body"> + <include-form name="ListTimeSheets" location="component://projectmgr/widget/forms/TimeSheetForms.xml"/> + </container> + </container> + </widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> <screen name="EditTimeSheetEntries"> <section> <actions> @@ -98,96 +130,6 @@ <include-form name="AddTimesheetEntry" location="component://projectmgr/widget/forms/TimeSheetForms.xml"/> </container> </container> - </decorator-section> - </decorator-screen> - </widgets> - </section> - </screen> - <screen name="MyTimesheets"> - <section> - <actions> - <set field="headerItem" value="mytime"/> - <set field="titleProperty" value="WorkEffortMyTimesheets"/> - - <set field="queryString" from-field="result.queryString"/> - <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/> - <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="10"/> - <entity-condition entity-name="Timesheet" list-name="currentTimesheetList"> - <condition-list combine="and"> - <condition-expr field-name="partyId" env-name="userLogin.partyId"/> - <condition-expr field-name="fromDate" operator="less-equals" env-name="nowTimestamp"/> - <condition-list combine="or"> - <condition-expr field-name="thruDate" operator="greater-equals" env-name="nowTimestamp"/> - <condition-expr field-name="thruDate" env-name="null"/> - </condition-list> - </condition-list> - </entity-condition> - </actions> - <widgets> - <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> - <decorator-section name="body"> - <container><label text="${uiLabelMap.WorkEffortMyCurrentTimesheets}" style="head2"/></container> - <container> - <link text="${uiLabelMap.PageTitleCreateWeekTimesheet}" target="createTimesheetForThisWeek?partyId=${userLogin.partyId}" style="buttontext"/> - <link text="${uiLabelMap.TimesheetCreate}" target="EditTimesheet?partyId=${userLogin.partyId}" style="buttontext"/> - </container> - <iterate-section entry-name="currentTimesheet" list-name="currentTimesheetList"> - <section> - <actions> - <entity-condition entity-name="TimeEntry" list-name="currentTimeEntryList"> - <condition-list combine="and"> - <condition-expr field-name="partyId" env-name="userLogin.partyId"/> - <condition-expr field-name="timesheetId" env-name="currentTimesheet.timesheetId"/> - </condition-list> - </entity-condition> - </actions> - <widgets> - <container> - <label style="tableheadtext" text="${uiLabelMap.Timesheet}: ${currentTimesheet.fromDate} ${uiLabelMap.CommonThru} ${currentTimesheet.thruDate} ${currentTimesheet.comments}"/> - <link target="EditTimesheet?timesheetId=${currentTimesheet.timesheetId}" text="${currentTimesheet.timesheetId}" style="buttontext"></link> - </container> - <iterate-section entry-name="currentTimeEntry" list-name="currentTimeEntryList"> - <section> - <actions> - <entity-one entity-name="RateType" value-name="currentRateType" auto-field-map="false"> - <field-map field-name="rateTypeId" env-name="currentTimeEntry.rateTypeId"/> - </entity-one> - </actions> - <widgets> - <container> - <label style="tabletext" text="${uiLabelMap.TimesheetTimeEntry} ${uiLabelMap.CommonFor} ${currentTimeEntry.fromDate} "/> - <label style="tableheadtext" text="${currentTimeEntry.hours} ${uiLabelMap.TimesheetHours} "/> - <label style="tabletext" text="${currentTimeEntry.comments} [${currentRateType.description}]"/> - <section> - <condition><not><if-empty field-name="currentTimeEntry.workEffortId"/></not></condition> - <widgets><link target="WorkEffortSummary?workEffortId=${currentTimeEntry.workEffortId}" text="${uiLabelMap.WorkEffortWorkEffort}: ${currentTimeEntry.workEffortId}" style="linktext"/></widgets> - </section> - </container> - </widgets> - </section> - </iterate-section> - <section> - <condition><if-compare-field field-name="parameters.showQuickEntry" operator="equals" to-field-name="currentTimesheet.timesheetId"/></condition> - <widgets> - <include-form name="QuickCreateTimeEntry" location="component://projectmgr/widget/forms/TimeSheetForms.xml"/> - </widgets> - <fail-widgets> - <container> - <link target="MyTimesheets?showQuickEntry=${currentTimesheet.timesheetId}" text="${uiLabelMap.TimesheetQuickTimeEntry}" style="buttontext"></link> - <link target="EditTimesheetEntries?timesheetId=${currentTimesheet.timesheetId}" text="${uiLabelMap.TimesheetTimeEntries}" style="buttontext"></link> - </container> - </fail-widgets> - </section> - </widgets> - </section> - </iterate-section> - - <!-- createQuickTimeEntry --> - - <container><label text="${uiLabelMap.WorkEffortMyRates}" style="head2"/></container> - <include-form name="ListMyRates" location="component://workeffort/widget/TimesheetForms.xml"/> - <container><label text="${uiLabelMap.WorkEffortMyTimesheets}" style="head2"/></container> - <include-form name="ListMyTimesheets" location="component://workeffort/widget/TimesheetForms.xml"/> </decorator-section> </decorator-screen> </widgets> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml?rev=602651&r1=602650&r2=602651&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml Sun Dec 9 00:06:00 2007 @@ -19,22 +19,57 @@ --> <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> + <field name="workEffortId" title="${uiLabelMap.ProjectMgrTaskName}"> + <drop-down allow-empty="true"> + <entity-options entity-name="ProjectAndPhaseAndTask" description="${workEffortName} -- ${phaseName} -- ${projectName}"> + <entity-order-by field-name="projectName"/> + <entity-order-by field-name="phaseName"/> + <entity-order-by field-name="workEffortName"/> + </entity-options> + </drop-down> + </field> + <field name="0" parameter-name="hoursDay0" title="Sun"><text size="5"/></field> + <field name="1" parameter-name="hoursDay1" title="Mon"><text size="5"/></field> + <field name="2" parameter-name="hoursDay2" title="Tue"><text size="5"/></field> + <field name="3" parameter-name="hoursDay3" title="Wen"><text size="5"/></field> + <field name="4" parameter-name="hoursDay4" title="Thu"><text size="5"/></field> + <field name="5" parameter-name="hoursDay5" title="Fri"><text size="5"/></field> + <field name="6" parameter-name="hoursDay6" title="Sat"><text size="5"/></field> + <field name="total" title="Act Total"><display/></field> + <field name="plannedHours" title="Plan.Hrs"><display/></field> + <field name="update"><submit button-type="button"/></field> + <field name="_rowSubmit"><hidden value="Y"/></field> + </form> - <form name="ListFindTimeSheet" type="list" list-name="timeSheetList" paginate-target="FindTimeSheet"> - <field name="timesheetId" title="${uiLabelMap.TimesheetTimesheetId}" widget-style="buttontext"> - <hyperlink also-hidden="false" description="${timesheetId}" target="EditTimeSheet?timesheetId=${timesheetId}"/> - </field> - <field name="partyId" title="${uiLabelMap.PartyParty}"><display/></field> - <field name="clientPartyId" title="${uiLabelMap.FormFieldTitle_clientPartyId}"><display/></field> - <field name="fromDate" title="${uiLabelMap.CommonFromDate}"><display/></field> - <field name="thruDate" title="${uiLabelMap.CommonThruDate}"><display/></field> - <field name="comments" title="${uiLabelMap.CommonComments}"><display/></field> - <field name="deleteLink" title="${uiLabelMap.CommonDelete}" widget-style="buttontext"> - <hyperlink target="deleteTimeSheet?timesheetId=${timesheetId}&findAll=Y" - description="${uiLabelMap.CommonDelete}" also-hidden="false"/> - </field> + <form name="ListTimeSheets" type="list" list-name="timesheets" paginate-target="EditTimesheet"> + <field name="timesheetId" title="${uiLabelMap.TimesheetTimesheetId}" widget-style="buttontext"> + <hyperlink also-hidden="false" description="${timesheetId}" target="MyTimesheets?timesheetId=${timesheetId}"/> + </field> + <field name="weekNumber"><display/></field> + <field name="statusId"><display-entity entity-name="StatusItem" description="${description}"/></field> + <field name="fromDate" title="${uiLabelMap.CommonFromDate}"><display type="date"/></field> + <field name="thruDate" title="${uiLabelMap.CommonThruDate}"><display type="date"/></field> + <field name="hours"><display/></field> + <field name="comments" title="${uiLabelMap.CommonComments}"><display/></field> + </form> + <form name="ListFindTimeSheet" type="list" list-name="timeSheetList" paginate-target="FindTimeSheet"> + <field name="timesheetId" title="${uiLabelMap.TimesheetTimesheetId}" widget-style="buttontext"> + <hyperlink also-hidden="false" description="${timesheetId}" target="EditTimeSheet?timesheetId=${timesheetId}"/> + </field> + <field name="partyId" title="${uiLabelMap.PartyParty}"><display/></field> + <field name="clientPartyId" title="${uiLabelMap.FormFieldTitle_clientPartyId}"><display/></field> + <field name="fromDate" title="${uiLabelMap.CommonFromDate}"><display/></field> + <field name="thruDate" title="${uiLabelMap.CommonThruDate}"><display/></field> + <field name="comments" title="${uiLabelMap.CommonComments}"><display/></field> + <field name="deleteLink" title="${uiLabelMap.CommonDelete}" widget-style="buttontext"> + <hyperlink target="deleteTimeSheet?timesheetId=${timesheetId}&findAll=Y" + description="${uiLabelMap.CommonDelete}" also-hidden="false"/> + </field> </form> - + <form name="AddTimesheetEntry" type="single" target="createTimesheetEntry" title=""> <auto-fields-service service-name="createTimeEntry"/> |
Free forum by Nabble | Edit this page |