Author: erwan
Date: Wed Jan 25 20:53:48 2012 New Revision: 1235939 URL: http://svn.apache.org/viewvc?rev=1235939&view=rev Log: OFBIZ-4670 - Projectmgr Service corrections: Task status evaluation, getProjectHours by parties, errors messages - A patch from Olivier Heintz Modified: ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.xml ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml Modified: ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.xml?rev=1235939&r1=1235938&r2=1235939&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.xml Wed Jan 25 20:53:48 2012 @@ -1027,7 +1027,11 @@ <value xml:lang="nl">Taak ${parameters.workEffortId} werd niet gevonden</value> <value xml:lang="zh">ä»»å¡ï¼${parameters.workEffortId}没ææ¾å°</value> </property> - <property key="ProjectMgrErrorTaskStatusWrong"> + <property key="ProjectMgrErrorTaskStatusWrongToBeComplete"> + <value xml:lang="en">Status of Task : ${parameters.workEffortId} is not correct, status cannot change to complete</value> + <value xml:lang="fr">Le status de la tâche : ${parameters.workEffortId} n'est pas correct, il ne peut pas être passé à Terminé</value> + </property> + <property key="ProjectMgrErrorTaskStatusWrongNoRequestAdded"> <value xml:lang="de">Aufgabe: ${parameters.workEffortId} wird nicht bearbeitet, es kann keine Anfrage hinzugefügt werden</value> <value xml:lang="en">Task: ${parameters.workEffortId} is not in progress, no request can be added</value> <value xml:lang="fr">Tâche : ${parameters.workEffortId} n'est pas en cours, aucune demande ne peut être ajoutée</value> Modified: ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml?rev=1235939&r1=1235938&r2=1235939&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml Wed Jan 25 20:53:48 2012 @@ -367,6 +367,7 @@ under the License. <alias entity-alias="WET" field="workEffortId" name="taskId" group-by="true"/> <alias entity-alias="TE" name="timeEntryId" group-by="true"/> <alias entity-alias="TE" name="hours" group-by="true"/> + <alias entity-alias="TE" name="hoursPartyId" field="partyId" group-by="true"/> <alias entity-alias="TE" name="invoiceId" group-by="true"/> <alias entity-alias="PR" name="partyId" group-by="true"/> <alias entity-alias="PR" name="percentageUsed" function="max"/> @@ -406,6 +407,7 @@ under the License. <alias entity-alias="PPAH" name="projectId" group-by="true"/> <alias entity-alias="PPAH" name="phaseId" group-by="true"/> <alias entity-alias="PPAH" name="taskId" group-by="true"/> + <alias entity-alias="PPAH" name="hoursPartyId" group-by="true"/> <alias entity-alias="PPAH" name="invoiceId" group-by="true"/> <alias entity-alias="PPAH" name="totalOriginalHours" field="hours" function="sum"/> <alias name="totalRatedHours" function="sum"> @@ -431,6 +433,7 @@ under the License. <alias entity-alias="PPAH" name="projectId" group-by="true"/> <alias entity-alias="PPAH" name="phaseId" group-by="true"/> <alias entity-alias="PPAH" name="taskId" group-by="true"/> + <alias entity-alias="PPAH" name="hoursPartyId" group-by="true"/> <alias entity-alias="PPAH" name="invoiceId" group-by="true"/> <alias entity-alias="PPAH" name="totalOriginalHours" field="hours" function="sum"/> 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=1235939&r1=1235938&r2=1235939&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Wed Jan 25 20:53:48 2012 @@ -718,32 +718,6 @@ <set field="highInfo.emailAddress" from-field="emailAddress.infoString"/> </if-not-empty> - <!-- translate squenceId back into statusId --> - <entity-and entity-name="StatusItem" list="statusses"> - <field-map field-name="sequenceId" from-field="highInfo.sequenceId"/> - <field-map field-name="statusTypeId" value="PROJECT_TASK_STATUS"/> - </entity-and> - <first-from-list entry="status" list="statusses"/> - <set field="highInfo.currentStatusId" from-field="status.statusId"/> - - <!-- make sure these statusvalues do not influence the total status if there are other active ones --> - <if> - <condition> - <and> - <or> - <if-compare field="highInfo.currentStatusId" value="PTS_COMPLETED" operator="equals"/> - <if-compare field="highInfo.currentStatusId" value="PTS_ON_HOLD" operator="equals"/> - <if-compare field="highInfo.currentStatusId" value="PTS_CANCELLED" operator="equals"/> - </or> - <not> - <if-empty field="allTaskStatus"/> - </not> - </and> - </condition> - <then> - <set field="highInfo.currentStatusId" value="PTS_CREATED_IP"/> - </then> - </if> <!-- closed overrules everything --> <if-compare field="project.currentStatusId" value="PRJ_CLOSED" operator="equals"> <set field="highInfo.currentStatusId" value="PRJ_CLOSED"/> @@ -786,33 +760,6 @@ <!-- merge estimated and actual dates --> <call-simple-method method-name="createDates"/> - <!-- translate sequenceId back into statusId --> - <entity-and entity-name="StatusItem" list="statusses"> - <field-map field-name="sequenceId" from-field="highInfo.sequenceId"/> - <field-map field-name="statusTypeId" value="PROJECT_TASK_STATUS"/> - </entity-and> - <first-from-list entry="status" list="statusses"/> - <clear-field field="highInfo.sequenceId"/> - <set field="highInfo.currentStatusId" from-field="status.statusId"/> - - <!-- however the status 'completed' can only be 'completed' when all related tasks are completed --> - <if> - <condition> - <and> - <or> - <if-compare field="highInfo.currentStatusId" value="PTS_COMPLETED" operator="equals"/> - <if-compare field="highInfo.currentStatusId" value="PTS_ON_HOLD" operator="equals"/> - </or> - <not> - <if-empty field="allTaskStatus"/> - </not> - </and> - </condition> - <then> - <set field="highInfo.currentStatusId" value="PTS_CREATED_IP"/> - </then> - </if> - <field-to-list field="highInfo" list="phaseList"/> </iterate> </if-not-empty> @@ -837,9 +784,9 @@ <iterate entry="lowInfo" list="tasks"> <set field="highInfo.phaseName" from-field="lowInfo.phaseName"/> <set field="highInfo.phaseSeqNum" from-field="lowInfo.phaseSeqNum"/> + <set field="highInfo.taskId" from-field="lowInfo.workEffortId"/> <call-simple-method method-name="combineInfo"/> <clear-field field="highInfo.sequenceId"/> - <set field="highInfo.currentStatusId" from-field="lowInfo.currentStatusId"/> <call-simple-method method-name="createDates"/> <set field="highInfo.workEffortId" from-field="lowInfo.workEffortId"/> <set field="highInfo.workEffortName" from-field="lowInfo.workEffortName"/> @@ -1106,6 +1053,7 @@ <set field="highInfo.actualCompletionDate" from-field="summaryInfo.actualCompletionDate"/> <set field="highInfo.priority" from-field="summaryInfo.priority"/> <set field="highInfo.plannedHours" from-field="summaryInfo.plannedHours"/> + <!-- <log level="info" message="projectId=${highInfo.projectId} phaseId=${highInfo.phaseId} taskId=${highInfo.taskId} highInfo.plannedHours=${highInfo.plannedHours}"/>--> <!-- update actual start date by the min date form sub tasks associated TimeEntries (if before actualStartDate field) --> <entity-condition entity-name="ProjectPhaseTaskActualEntrySumView" list="summaryEntriesInfos"> @@ -1173,6 +1121,7 @@ <condition-expr field-name="projectId" from-field="highInfo.projectId" ignore-if-empty="true"/> <condition-expr field-name="phaseId" from-field="highInfo.phaseId" ignore-if-empty="true"/> <condition-expr field-name="taskId" from-field="highInfo.taskId" ignore-if-empty="true"/> + <condition-expr field-name="hoursPartyId" from-field="parameters.hoursPartyId" ignore-if-empty="true"/> </condition-list> <select-field field-name="totalOriginalHours"/> </entity-condition> @@ -1187,6 +1136,7 @@ <condition-expr field-name="projectId" from-field="highInfo.projectId" ignore-if-empty="true"/> <condition-expr field-name="phaseId" from-field="highInfo.phaseId" ignore-if-empty="true"/> <condition-expr field-name="taskId" from-field="highInfo.taskId" ignore-if-empty="true"/> + <condition-expr field-name="hoursPartyId" from-field="parameters.hoursPartyId" ignore-if-empty="true"/> </condition-list> <select-field field-name="totalOriginalHours"/> <select-field field-name="totalRatedHours"/> @@ -1228,6 +1178,7 @@ <condition-expr field-name="projectId" from-field="highInfo.projectId" ignore-if-empty="true"/> <condition-expr field-name="phaseId" from-field="highInfo.phaseId" ignore-if-empty="true"/> <condition-expr field-name="taskId" from-field="highInfo.taskId" ignore-if-empty="true"/> + <condition-expr field-name="hoursPartyId" from-field="parameters.hoursPartyId" ignore-if-empty="true"/> <condition-expr field-name="invoiceId" from-field="nullField"/> </condition-list> <select-field field-name="totalOriginalHours"/> @@ -1240,6 +1191,7 @@ <condition-expr field-name="projectId" from-field="highInfo.projectId" ignore-if-empty="true"/> <condition-expr field-name="phaseId" from-field="highInfo.phaseId" ignore-if-empty="true"/> <condition-expr field-name="taskId" from-field="highInfo.taskId" ignore-if-empty="true"/> + <condition-expr field-name="hoursPartyId" from-field="parameters.hoursPartyId" ignore-if-empty="true"/> <condition-expr field-name="invoiceId" from-field="nullField"/> </condition-list> <select-field field-name="totalOriginalHours"/> @@ -1438,14 +1390,16 @@ </if-empty> </if-not-empty> <!-- get role for this party in this project --> - <entity-and entity-name="ProjectPartyAndPhaseAndTask" list="taskRoles" filter-by-date="true"> - <field-map field-name="partyId" from-field="parameters.partyId"/> - <field-map field-name="workEffortId" from-field="parameters.workEffortId"/> - </entity-and> - <first-from-list entry="taskRole" list="taskRoles"/> - <set field="parameters.roleTypeId" from-field="taskRole.roleTypeId"/> - <set field="parameters.statusId" value="PAS_ASSIGNED"/> - <call-simple-method method-name="assignPartyToWorkEffort" xml-resource="component://workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml"/> + <if-empty field="parameters.roleTypeId"> + <entity-and entity-name="ProjectPartyAndPhaseAndTask" list="taskRoles" filter-by-date="true"> + <field-map field-name="partyId" from-field="parameters.partyId"/> + <field-map field-name="workEffortId" from-field="parameters.workEffortId"/> + </entity-and> + <first-from-list entry="taskRole" list="taskRoles"/> + <set field="parameters.roleTypeId" from-field="taskRole.roleTypeId"/> + <set field="parameters.statusId" value="PAS_ASSIGNED"/> + <call-simple-method method-name="assignPartyToWorkEffort" xml-resource="component://workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml"/> + </if-empty> <call-simple-method method-name="createTimeEntry" xml-resource="component://workeffort/script/org/ofbiz/workeffort/timesheet/TimesheetServices.xml"/> </simple-method> Modified: ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml?rev=1235939&r1=1235938&r2=1235939&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml Wed Jan 25 20:53:48 2012 @@ -67,20 +67,20 @@ <simple-method method-name="acceptRequestAndConnectToTask" short-description="Accept a customer request and connect to an existing task"> <entity-one entity-name="WorkEffort" value-field="workEffort"/> <if-empty field="workEffort"> - <add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorTaskNotFound"/></add-error> + <add-error><fail-property resource="ProjectMgrUiLabels" property="ProjectMgrErrorTaskNotFound"/></add-error> </if-empty> <if-compare field="workEffort.currentStatusId" value="PTS_CREATED" operator="not-equals"> - <add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorTaskStatusWrong"/></add-error> + <add-error><fail-property resource="ProjectMgrUiLabels" property="ProjectMgrErrorTaskStatusWrongNoRequestAdded"/></add-error> </if-compare> <entity-one entity-name="CustRequest" value-field="custRequest"/> <if-empty field="custRequest"> - <add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorRequestNotFound"/></add-error> + <add-error><fail-property resource="ProjectMgrUiLabels" property="ProjectMgrErrorRequestNotFound"/></add-error> </if-empty> <if-compare field="custRequest.statusId" value="CRQ_ACCEPTED" operator="not-equals"> <entity-one entity-name="StatusItem" value-field="status"> <field-map field-name="statusId" value="custRequest.statusId"/> </entity-one> - <add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorRequestStatusWrong"/></add-error> + <add-error><fail-property resource="ProjectMgrUiLabels" property="ProjectMgrErrorRequestStatusWrong"/></add-error> </if-compare> <check-errors/> <set field="updCust.statusId" value="CRQ_REVIEWED"/> @@ -92,10 +92,10 @@ <simple-method method-name="setTaskStatusToComplete" short-description="Set the task status to complete, if resources assigned that status will also be set to complete"> <entity-one entity-name="WorkEffort" value-field="workEffort"/> <if-empty field="workEffort"> - <add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorTaskNotFound"/></add-error> + <add-error><fail-property resource="ProjectMgrUiLabels" property="ProjectMgrErrorTaskNotFound"/></add-error> </if-empty> <if-compare field="workEffort.currentStatusId" value="PTS_CREATED" operator="not-equals"> - <add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorTaskStatusWrong"/></add-error> + <add-error><fail-property resource="ProjectMgrUiLabels" property="ProjectMgrErrorTaskStatusWrongToBeComplete"/></add-error> </if-compare> <check-errors/> <entity-and entity-name="WorkEffortPartyAssignment" list="assigns" filter-by-date="true"> |
Free forum by Nabble | Edit this page |