svn commit: r671349 - in /ofbiz/trunk/specialpurpose/assetmaint: entitydef/entitygroup.xml entitydef/entitymodel.xml script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml

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

svn commit: r671349 - in /ofbiz/trunk/specialpurpose/assetmaint: entitydef/entitygroup.xml entitydef/entitymodel.xml script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml

adrianc
Author: adrianc
Date: Tue Jun 24 14:26:22 2008
New Revision: 671349

URL: http://svn.apache.org/viewvc?rev=671349&view=rev
Log:
Asset Maintenance new feature - parties who are assigned to a fixed asset in one of the asset manager roles are automatically assigned to new fixed asset maintenances for that fixed asset.

Modified:
    ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitygroup.xml
    ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitymodel.xml
    ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml

Modified: ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitygroup.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitygroup.xml?rev=671349&r1=671348&r2=671349&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitygroup.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitygroup.xml Tue Jun 24 14:26:22 2008
@@ -26,6 +26,7 @@
   <!-- ========================================================= -->
 
     <entity-group group="org.ofbiz" entity="FixedAssetAndIdent" />    
+    <entity-group group="org.ofbiz" entity="PartyFixedAssetAssignAndRole" />    
     <entity-group group="org.ofbiz" entity="FixedAssetMaintWorkEffort" />
     <entity-group group="org.ofbiz" entity="WorkEffortAndTimeEntry" />
     <entity-group group="org.ofbiz" entity="FixedAssetMaintWorkEffortAndPartyAssignment" />

Modified: ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitymodel.xml?rev=671349&r1=671348&r2=671349&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitymodel.xml Tue Jun 24 14:26:22 2008
@@ -38,6 +38,16 @@
             <key-map field-name="fixedAssetId"/>
         </view-link>
     </view-entity>
+    <view-entity entity-name="PartyFixedAssetAssignAndRole" package-name="org.ofbiz.assetmaint"
+        title="PartyFixedAssetAssignment and RoleType View Entity">
+        <member-entity entity-alias="PFA" entity-name="PartyFixedAssetAssignment"/>
+        <member-entity entity-alias="RT" entity-name="RoleType"/>
+        <alias-all entity-alias="PFA"/>
+        <alias-all entity-alias="RT"/>
+        <view-link entity-alias="PFA" rel-entity-alias="RT">
+            <key-map field-name="roleTypeId"/>
+        </view-link>
+    </view-entity>
     <view-entity entity-name="FixedAssetMaintWorkEffort" package-name="org.ofbiz.assetmaint"
         title="FixedAssetMaint and WorkEffort View Entity">
         <member-entity entity-alias="FA" entity-name="FixedAsset"/>

Modified: ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml?rev=671349&r1=671348&r2=671349&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml Tue Jun 24 14:26:22 2008
@@ -45,11 +45,39 @@
         <set-service-fields map-name="parameters" service-name="updateWorkEffort" to-map-name="updateWorkEffortCtx"/>
         <!-- Maintenance WorkEffort entity -->
         <property-to-field field-name="workEffortNameText" resource="AssetMaintUiLabels" property="FixedAssetMaintWorkEffortName"/>
-        <set value="${workEffortNameText} #${updateWorkEffortCtx.fixedAssetId}" field="updateWorkEffortCtx.workEffortName"/>
+        <set value="${workEffortNameText} ${updateWorkEffortCtx.fixedAssetId}" field="updateWorkEffortCtx.workEffortName"/>
         <set field="maintTypeLookup.productMaintTypeId" from-field="findAssetMaint.productMaintTypeId"/>
         <find-by-primary-key entity-name="ProductMaintType" map-name="maintTypeLookup" value-name="maintType"/>
         <set field="updateWorkEffortCtx.description" from-field="maintType.description"/>
         <call-service service-name="updateWorkEffort" in-map-name="updateWorkEffortCtx"/>
+        <check-errors/>
+        <!-- Assign fixed asset parties to workeffort -->
+        <set field="workEffortId" from-field="findAssetMaint.scheduleWorkEffortId"/>
+        <call-simple-method method-name="assignFixedAssetPartiesToWorkEffort"/>
+    </simple-method>
+
+    <simple-method method-name="assignFixedAssetPartiesToWorkEffort" login-required="true"
+        short-description="Assign Fixed Asset Parties to a Work Effort">
+        <if-empty field="fixedAssetId">
+            <set field="fixedAssetId" from-field="parameters.fixedAssetId"/>
+        </if-empty>
+        <if-empty field="workEffortId">
+            <set field="workEffortId" from-field="parameters.workEffortId"/>
+        </if-empty>
+        <entity-condition list-name="assignedParties" entity-name="PartyFixedAssetAssignAndRole" filter-by-date="true">
+            <condition-list>
+                <condition-expr field-name="fixedAssetId" env-name="fixedAssetId"/>
+                <condition-expr field-name="parentTypeId" value="FAM_ASSIGNEE"/>
+            </condition-list>
+        </entity-condition>
+        <iterate list-name="assignedParties" entry-name="assignedParty">
+            <set field="assignPartyCtx.partyId" from-field="assignedParty.partyId"/>
+            <set field="assignPartyCtx.roleTypeId" from-field="assignedParty.roleTypeId"/>
+            <set field="assignPartyCtx.workEffortId" from-field="workEffortId"/>
+            <set field="assignPartyCtx.statusId" value="PRTYASGN_ASSIGNED"/>
+            <call-service service-name="assignPartyToWorkEffort" in-map-name="assignPartyCtx"/>
+            <check-errors/>
+        </iterate>
     </simple-method>
 
     <simple-method method-name="updateFixedAssetMaintAndWorkEffort" login-required="true"