📄 findactivitiesbyname.bsh
字号:
/* * Copyright (C) 2006 Open Source Strategies, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *//* Copyright (c) 2005-2006 Open Source Strategies, Inc. *//* This script simply finds activities by workEffortName from parameter, it is used by findActivities */import org.ofbiz.base.util.*;import org.ofbiz.entity.condition.*;workEffortName = parameters.get("workEffortName");completedActivitiesOrderBy = parameters.get("completedActivitiesOrderBy");if (completedActivitiesOrderBy == null) completedActivitiesOrderBy = "actualStartDate";if (workEffortName != null) { searchCondition = new EntityExpr("workEffortName", true, EntityOperator.LIKE, "%" + workEffortName + "%", true); // TODO: re-factor this into UtilActivity as a central place of workefforts which are considered "Activities" (or into seed data?) // screen out unwanted workefforts such as BOM steps (yes, those are workefforts too...) allowableWorkEffortConditions = new EntityConditionList( UtilMisc.toList(new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "EVENT"), new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "TASK")), EntityOperator.OR); allSearchConditions = new EntityConditionList(UtilMisc.toList(searchCondition, allowableWorkEffortConditions), EntityOperator.AND); fieldsToSelect = UtilMisc.toList("workEffortId", "workEffortName", "workEffortTypeId", "workEffortPurposeTypeId", "currentStatusId"); fieldsToSelect.add("actualStartDate"); fieldsToSelect.add("actualCompletionDate"); // this may have to be expanded later if we mean to only show activities of this user and hence search on distinct // activities in WorkEffortPartyAssign. See findParties... scripts for examples. activities = delegator.findByCondition("WorkEffort", allSearchConditions, fieldsToSelect, UtilMisc.toList(completedActivitiesOrderBy)); context.put("completedActivities", activities); // since this is a find script, we need to put the search parameters in a map for use by the form header-links context.put("activityValueParams", "workEffortName=" + workEffortName);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -