01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.chart.lookup;
17:
18: import org.kuali.core.bo.BusinessObject;
19: import org.kuali.core.lookup.KualiLookupableHelperServiceImpl;
20: import org.kuali.core.util.GlobalVariables;
21: import org.kuali.module.chart.bo.Account;
22: import org.kuali.module.chart.bo.ChartUser;
23:
24: /**
25: * This class overrids the base getActionUrls method
26: */
27: public class KualiAccountLookupableHelperServiceImpl extends
28: KualiLookupableHelperServiceImpl {
29: /**
30: * If the account is not closed or the user is an Administrator the "edit" link is added The "copy" link is added for Accounts
31: *
32: * @returns links to edit and copy maintenance action for the current maintenance record.
33: */
34: @Override
35: public String getActionUrls(BusinessObject bo) {
36: StringBuffer actions = new StringBuffer();
37: Account theAccount = (Account) bo;
38: ChartUser user = (ChartUser) GlobalVariables.getUserSession()
39: .getUniversalUser().getModuleUser(ChartUser.MODULE_ID);
40: if (!theAccount.isAccountClosedIndicator()
41: || user.isAdministratorUser()) {
42: actions.append(getMaintenanceUrl(bo, "edit"));
43: } else {
44: actions.append(" ");
45: }
46: actions.append(" ");
47: actions.append(getMaintenanceUrl(bo, "copy"));
48: return actions.toString();
49: }
50: }
|