Author: hansbak
Date: Sun Jul 5 03:32:25 2009
New Revision: 791198
URL:
http://svn.apache.org/viewvc?rev=791198&view=revLog:
only hide closed projects, still show completed ones
Modified:
ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy
Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy?rev=791198&r1=791197&r2=791198&view=diff==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListCurrentProjects.groovy Sun Jul 5 03:32:25 2009
@@ -19,21 +19,22 @@
import org.ofbiz.entity.condition.*;
-cond = EntityCondition.makeCondition ("workEffortTypeId", EntityOperator.EQUALS, "PROJECT");
+cond = EntityCondition.makeCondition([
+ EntityCondition.makeCondition ("workEffortTypeId", EntityOperator.EQUALS, "PROJECT"),
+ EntityCondition.makeCondition ("currentStatusId", EntityOperator.NOT_EQUAL, "PRJ_CLOSED")
+ ], EntityJoinOperator.AND);
allProjects = delegator.findList("WorkEffort", cond, (HashSet) ["workEffortId"], ["workEffortName"], null, false);
projects = [];
allProjects.each { project ->
result = dispatcher.runSync("getProject", ["userLogin" : parameters.userLogin, "projectId" : project.workEffortId]);
- if (result.projectInfo) {
- if (!result.projectInfo.currentStatusId.equals("PTS_COMPLETED") && !result.projectInfo.currentStatusId.equals("PTS_CANCELLED") && !result.projectInfo.currentStatusId.equals("PRJ_CLOSED")) {
- resultAssign = delegator.findByAnd("WorkEffortPartyAssignment", ["partyId" : parameters.userLogin.partyId, "workEffortId" : project.workEffortId])
- if (security.hasEntityPermission("PROJECTMGR", "_ADMIN", session)
- || ((security.hasEntityPermission("PROJECTMGR", "_ROLE_ADMIN", session) || security.hasEntityPermission("PROJECTMGR", "_ROLE_VIEW", session)) && resultAssign)) {
- projects.add(result.projectInfo);
- }
- }
- }
+ if (result.projectInfo) {
+ resultAssign = delegator.findByAnd("WorkEffortPartyAssignment", ["partyId" : parameters.userLogin.partyId, "workEffortId" : project.workEffortId])
+ if (security.hasEntityPermission("PROJECTMGR", "_ADMIN", session)
+ || ((security.hasEntityPermission("PROJECTMGR", "_ROLE_ADMIN", session) || security.hasEntityPermission("PROJECTMGR", "_ROLE_VIEW", session)) && resultAssign)) {
+ projects.add(result.projectInfo);
+ }
+ }
}
if (projects) {
context.projects = projects;