001 /* 002 * Copyright 2011 The Kuali Foundation. 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.kfs.module.bc.document.web.struts; 017 018 import java.util.List; 019 import java.util.Map; 020 021 import javax.servlet.http.HttpServletRequest; 022 023 import org.kuali.kfs.module.bc.BCConstants; 024 import org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionAppointmentFunding; 025 import org.kuali.kfs.module.bc.businessobject.SalarySettingExpansion; 026 import org.kuali.kfs.module.bc.document.authorization.BudgetConstructionDocumentAuthorizer; 027 import org.kuali.kfs.sys.KfsAuthorizationConstants; 028 import org.kuali.kfs.sys.ObjectUtil; 029 030 031 public class QuickSalarySettingForm extends SalarySettingBaseForm { 032 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(QuickSalarySettingForm.class); 033 034 private SalarySettingExpansion salarySettingExpansion; 035 private boolean refreshPositionBeforeSalarySetting; 036 private boolean refreshIncumbentBeforeSalarySetting; 037 038 /** 039 * Constructs a QuickSalarySettingForm.java. 040 */ 041 public QuickSalarySettingForm() { 042 super(); 043 this.setSalarySettingExpansion(new SalarySettingExpansion()); 044 } 045 046 /** 047 * @see org.kuali.rice.kns.web.struts.form.KualiForm#populate(javax.servlet.http.HttpServletRequest) 048 */ 049 @Override 050 public void populate(HttpServletRequest request) { 051 super.populate(request); 052 053 this.populateBCAFLines(); 054 055 } 056 057 /** 058 * get the key map for the salary setting expension 059 * 060 * @return the key map for the salary setting expension 061 */ 062 @Override 063 public Map<String, Object> getKeyMapOfSalarySettingItem() { 064 return ObjectUtil.buildPropertyMap(this, SalarySettingExpansion.getPrimaryKeyFields()); 065 } 066 067 /** 068 * @see org.kuali.kfs.module.bc.document.web.struts.SalarySettingForm#getAppointmentFundings() 069 */ 070 @Override 071 public List<PendingBudgetConstructionAppointmentFunding> getAppointmentFundings() { 072 return this.getSalarySettingExpansion().getPendingBudgetConstructionAppointmentFunding(); 073 } 074 075 /** 076 * @see org.kuali.kfs.module.bc.document.web.struts.SalarySettingBaseForm#getRefreshCallerName() 077 */ 078 @Override 079 public String getRefreshCallerName() { 080 return BCConstants.QUICK_SALARY_SETTING_REFRESH_CALLER; 081 } 082 083 /** 084 * Gets the salarySettingExpansion attribute. 085 * 086 * @return Returns the salarySettingExpansion. 087 */ 088 public SalarySettingExpansion getSalarySettingExpansion() { 089 return salarySettingExpansion; 090 } 091 092 /** 093 * Sets the salarySettingExpansion attribute value. 094 * 095 * @param salarySettingExpansion The salarySettingExpansion to set. 096 */ 097 public void setSalarySettingExpansion(SalarySettingExpansion salarySettingExpansion) { 098 this.salarySettingExpansion = salarySettingExpansion; 099 } 100 101 /** 102 * Gets the refreshPositionBeforeSalarySetting attribute. 103 * 104 * @return Returns the refreshPositionBeforeSalarySetting. 105 */ 106 public boolean isRefreshPositionBeforeSalarySetting() { 107 return refreshPositionBeforeSalarySetting; 108 } 109 110 /** 111 * Sets the refreshPositionBeforeSalarySetting attribute value. 112 * 113 * @param refreshPositionBeforeSalarySetting The refreshPositionBeforeSalarySetting to set. 114 */ 115 public void setRefreshPositionBeforeSalarySetting(boolean refreshPositionBeforeSalarySetting) { 116 this.refreshPositionBeforeSalarySetting = refreshPositionBeforeSalarySetting; 117 } 118 119 /** 120 * Gets the refreshIncumbentBeforeSalarySetting attribute. 121 * 122 * @return Returns the refreshIncumbentBeforeSalarySetting. 123 */ 124 public boolean isRefreshIncumbentBeforeSalarySetting() { 125 return refreshIncumbentBeforeSalarySetting; 126 } 127 128 /** 129 * Sets the refreshIncumbentBeforeSalarySetting attribute value. 130 * 131 * @param refreshIncumbentBeforeSalarySetting The refreshIncumbentBeforeSalarySetting to set. 132 */ 133 public void setRefreshIncumbentBeforeSalarySetting(boolean refreshIncumbentBeforeSalarySetting) { 134 this.refreshIncumbentBeforeSalarySetting = refreshIncumbentBeforeSalarySetting; 135 } 136 137 /** 138 * @see org.kuali.kfs.module.bc.document.web.struts.SalarySettingBaseForm#isBudgetByAccountMode() 139 */ 140 @Override 141 public boolean isBudgetByAccountMode() { 142 return true; 143 } 144 145 /** 146 * Gets the viewOnlyEntry attribute. In the quick salary setting context viewOnlyEntry checks the system view only and account 147 * access. Both system view only and full entry can both exist (be true), it just means that the user would have edit access if 148 * the system was not in view only mode. These facts are used to determine the effective viewOnlyEntry value 149 * 150 * @return Returns the viewOnlyEntry. 151 */ 152 @Override 153 public boolean isViewOnlyEntry() { 154 return super.isViewOnlyEntry() || !isEditAllowed(); 155 } 156 157 }