You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2008/07/24 03:01:18 UTC
svn commit: r679258 - in /ofbiz/trunk/specialpurpose/assetmaint:
webapp/assetmaint/WEB-INF/actions/workeffort/EditWorkEfforts.bsh
webapp/assetmaint/WEB-INF/controller.xml widget/CommonScreens.xml
Author: adrianc
Date: Wed Jul 23 18:01:17 2008
New Revision: 679258
URL: http://svn.apache.org/viewvc?rev=679258&view=rev
Log:
Some fixups in Asset Maintenance.
Modified:
ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/workeffort/EditWorkEfforts.bsh
ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/controller.xml
ofbiz/trunk/specialpurpose/assetmaint/widget/CommonScreens.xml
Modified: ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/workeffort/EditWorkEfforts.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/workeffort/EditWorkEfforts.bsh?rev=679258&r1=679257&r2=679258&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/workeffort/EditWorkEfforts.bsh (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/actions/workeffort/EditWorkEfforts.bsh Wed Jul 23 18:01:17 2008
@@ -30,27 +30,18 @@
if (maintHistSeqId == null) {
maintHistSeqId = parameters.get("maintHistSeqId");
- if (maintHistSeqId == null) {
- maintHistSeqId = request.getParameter("maintHistSeqId");
- }
}
if (fixedAssetId == null) {
fixedAssetId = parameters.get("fixedAssetId");
- if (fixedAssetId == null) {
- fixedAssetId = request.getParameter("fixedAssetId");
- }
}
if (workEffortId == null) {
workEffortId = parameters.get("workEffortId");
- if (workEffortId == null) {
- workEffortId = request.getParameter("workEffortId");
- }
}
fixedAssetMaint = null;
workEffort = null;
fixedAsset = null;
-lookupWorkEffortId = null;
+rootWorkEffortId = null;
if (workEffortId != null) {
workEffort = delegator.findByPrimaryKey("WorkEffort", UtilMisc.toMap("workEffortId", workEffortId));
@@ -61,20 +52,23 @@
// If this is a child workeffort, locate the "root" workeffort
parentWorkEffort = EntityUtil.getFirst(delegator.findByAnd("WorkEffortAssoc", UtilMisc.toMap("workEffortIdTo", workEffortId)));
while (parentWorkEffort != null) {
- lookupWorkEffortId = parentWorkEffort.get("workEffortIdFrom");
- parentWorkEffort = EntityUtil.getFirst(delegator.findByAnd("WorkEffortAssoc", UtilMisc.toMap("workEffortIdTo", lookupWorkEffortId)));
+ rootWorkEffortId = parentWorkEffort.get("workEffortIdFrom");
+ parentWorkEffort = EntityUtil.getFirst(delegator.findByAnd("WorkEffortAssoc", UtilMisc.toMap("workEffortIdTo", rootWorkEffortId)));
}
}
}
-if (lookupWorkEffortId == null) {
- lookupWorkEffortId = workEffortId;
+if (rootWorkEffortId == null) {
+ rootWorkEffortId = workEffortId;
}
-if (lookupWorkEffortId != null && fixedAssetId != null) {
- fixedAssetMaint = EntityUtil.getFirst(delegator.findByAnd("FixedAssetMaint", UtilMisc.toMap("fixedAssetId", fixedAssetId , "scheduleWorkEffortId", lookupWorkEffortId)));
+if (rootWorkEffortId != null) {
+ fixedAssetMaint = EntityUtil.getFirst(delegator.findByAnd("FixedAssetMaint", UtilMisc.toMap("scheduleWorkEffortId", rootWorkEffortId)));
if (fixedAssetMaint != null) {
maintHistSeqId = fixedAssetMaint.get("maintHistSeqId");
+ if (fixedAssetId == null) {
+ fixedAssetId = fixedAssetMaint.get("fixedAssetId");
+ }
}
}
Modified: ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/controller.xml?rev=679258&r1=679257&r2=679258&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/webapp/assetmaint/WEB-INF/controller.xml Wed Jul 23 18:01:17 2008
@@ -130,6 +130,7 @@
<!-- end of request mappings -->
<!-- View Mappings -->
+ <view-map name="main" type="screen" page="component://workeffort/widget/WorkEffortScreens.xml#mytasks"/>
<!-- FixedAsset Maintenance screens -->
<view-map name="FindFixedAssetMaints" type="screen" page="component://assetmaint/widget/AssetmaintScreens.xml#FindFixedAssetMaints"/>
Modified: ofbiz/trunk/specialpurpose/assetmaint/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/widget/CommonScreens.xml?rev=679258&r1=679257&r2=679258&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/widget/CommonScreens.xml Wed Jul 23 18:01:17 2008
@@ -91,6 +91,7 @@
<section>
<actions>
<set field="headerItem" value="ListFixedAssets"/>
+ <set field="fixedAssetId" from-field="fixedAsset.fixedAssetId" default-value="${parameters.fixedAssetId}"/>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">