001 /** 002 * Copyright 2004-2013 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.hr.time.base.web; 017 018 import java.util.ArrayList; 019 import java.util.Date; 020 import java.util.HashMap; 021 import java.util.HashSet; 022 import java.util.LinkedList; 023 import java.util.List; 024 import java.util.Map; 025 import java.util.Set; 026 027 import org.kuali.hr.time.calendar.CalendarEntries; 028 import org.kuali.hr.time.roles.TkUserRoles; 029 import org.kuali.rice.krad.util.GlobalVariables; 030 031 public class ApprovalForm extends TkCommonCalendarForm { 032 public static final String ORDER_BY_PRINCIPAL = "principalName"; 033 public static final String ORDER_BY_DOCID = "documentId"; 034 public static final String ORDER_BY_STATUS = "Status"; 035 public static final String ORDER_BY_WORKAREA = "WorkArea"; 036 037 private static final long serialVersionUID = -173408280988754540L; 038 039 private String hrPyCalendarEntriesId; 040 private String hrPyCalendarId; 041 private String name; 042 private List<String> payCalendarGroups = new LinkedList<String>(); 043 private String selectedPayCalendarGroup; 044 private String selectedDept; 045 private String selectedWorkArea; 046 private Date payBeginDate; 047 private Date payEndDate; 048 private String payBeginDateForSearch; 049 private String payEndDateForSearch; 050 private String roleName; 051 052 053 054 private CalendarEntries payCalendarEntries; 055 private Long workArea = null; 056 private Set<Long> deptWorkareas = new HashSet<Long>(); 057 private String documentId; 058 private String employeeWorkArea; 059 private List<String> assignmentPrincipalIds = new LinkedList<String>(); 060 private Set<String> principalIds = new HashSet<String>(); 061 private Map<Long,String> workAreaDescr = new HashMap<Long,String>(); 062 063 /** 064 * Used for ajax dynamic row updating 065 */ 066 private String outputString; 067 068 private String searchField; 069 private String searchTerm; 070 071 private int rowsToShow = 50; 072 private int rowsInTotal; 073 074 private boolean ascending = true; 075 private String sortField; 076 private String pageId; 077 078 private boolean ajaxCall = false; 079 080 private Boolean testSelected = Boolean.FALSE; 081 082 private String prevPayCalendarId = null; 083 private String nextPayCalendarId = null; 084 085 private List<String> departments = new ArrayList<String>(); 086 private Integer resultSize = 0; 087 private List<String> searchResultList = new LinkedList<String>(); 088 089 private String calNav = null; 090 091 public String getRoleName() { 092 return roleName; 093 } 094 095 public void setRoleName(String roleName) { 096 this.roleName = roleName; 097 } 098 099 public String getCalNav() { 100 return calNav; 101 } 102 103 public void setCalNav(String calNav) { 104 this.calNav = calNav; 105 } 106 107 public String getHrPyCalendarEntriesId() { 108 return hrPyCalendarEntriesId; 109 } 110 111 public void setHrPyCalendarEntriesId(String hrPyCalendarEntriesId) { 112 this.hrPyCalendarEntriesId = hrPyCalendarEntriesId; 113 } 114 115 public String getHrPyCalendarId() { 116 return hrPyCalendarId; 117 } 118 119 public void setHrPyCalendarId(String hrPyCalendarId) { 120 this.hrPyCalendarId = hrPyCalendarId; 121 } 122 123 /** 124 * Gets the name of the user that this row represents. 125 * 126 * @return String representing the users name. 127 */ 128 public String getName() { 129 return name; 130 } 131 132 public void setName(String name) { 133 this.name = name; 134 } 135 136 public void setPayBeginDate(Date payBeginDate) { 137 this.payBeginDate = payBeginDate; 138 } 139 140 public Date getPayBeginDate() { 141 return payBeginDate; 142 } 143 144 public void setPayEndDate(Date payEndDate) { 145 this.payEndDate = payEndDate; 146 } 147 148 public Date getPayEndDate() { 149 return payEndDate; 150 } 151 152 public CalendarEntries getPayCalendarEntries() { 153 return payCalendarEntries; 154 } 155 156 public void setPayCalendarEntries(CalendarEntries payCalendarEntries) { 157 this.payCalendarEntries = payCalendarEntries; 158 } 159 160 public String getDocumentId() { 161 return documentId; 162 } 163 164 public void setDocumentId(String documentId) { 165 this.documentId = documentId; 166 } 167 168 public String getOutputString() { 169 return outputString; 170 } 171 172 public void setOutputString(String outputString) { 173 this.outputString = outputString; 174 } 175 176 public String getSearchField() { 177 return searchField; 178 } 179 180 public void setSearchField(String searchField) { 181 this.searchField = searchField; 182 } 183 184 public String getSearchTerm() { 185 return searchTerm; 186 } 187 188 public void setSearchTerm(String searchTerm) { 189 this.searchTerm = searchTerm; 190 } 191 192 public int getRowsToShow() { 193 return rowsToShow; 194 } 195 196 public void setRowsToShow(int rowsToShow) { 197 this.rowsToShow = rowsToShow; 198 } 199 200 public boolean isAscending() { 201 return ascending; 202 } 203 204 public void setAscending(boolean ascending) { 205 this.ascending = ascending; 206 } 207 208 public String getSortField() { 209 return sortField; 210 } 211 212 public void setSortField(String sortField) { 213 this.sortField = sortField; 214 } 215 216 public String getPageId() { 217 return pageId; 218 } 219 220 public void setPageId(String pageId) { 221 this.pageId = pageId; 222 } 223 224 public boolean isAjaxCall() { 225 return ajaxCall; 226 } 227 228 public void setAjaxCall(boolean ajaxCall) { 229 this.ajaxCall = ajaxCall; 230 } 231 232 public List<String> getPayCalendarGroups() { 233 return payCalendarGroups; 234 } 235 236 public void setPayCalendarGroups(List<String> payCalendarGroups) { 237 this.payCalendarGroups = payCalendarGroups; 238 } 239 240 public int getRowsInTotal() { 241 return rowsInTotal; 242 } 243 244 public void setRowsInTotal(int rowsInTotal) { 245 this.rowsInTotal = rowsInTotal; 246 } 247 248 /** 249 * Provides a set of WorkArea numbers that the current approver has 250 * dominion over. 251 * 252 * @return A Set of Longs representing work areas. 253 */ 254 public Set<Long> getApproverWorkAreas() { 255 return TkUserRoles.getUserRoles(GlobalVariables.getUserSession().getPrincipalId()).getApproverWorkAreas(); 256 } 257 258 public Long getWorkArea() { 259 return workArea; 260 } 261 262 public void setWorkArea(Long workArea) { 263 this.workArea = workArea; 264 } 265 266 public String getSelectedPayCalendarGroup() { 267 return selectedPayCalendarGroup; 268 } 269 270 public void setSelectedPayCalendarGroup(String selectedPayCalendarGroup) { 271 this.selectedPayCalendarGroup = selectedPayCalendarGroup; 272 } 273 274 public String getEmployeeWorkArea() { 275 return employeeWorkArea; 276 } 277 278 public void setEmployeeWorkArea(String employeeWorkArea) { 279 this.employeeWorkArea = employeeWorkArea; 280 } 281 282 public Boolean getTestSelected() { 283 return testSelected; 284 } 285 286 public void setTestSelected(Boolean testSelected) { 287 this.testSelected = testSelected; 288 } 289 290 public String getPrevPayCalendarId() { 291 return prevPayCalendarId; 292 } 293 294 public void setPrevPayCalendarId(String prevPayCalendarId) { 295 this.prevPayCalendarId = prevPayCalendarId; 296 } 297 298 public String getNextPayCalendarId() { 299 return nextPayCalendarId; 300 } 301 302 public void setNextPayCalendarId(String nextPayCalendarId) { 303 this.nextPayCalendarId = nextPayCalendarId; 304 } 305 306 public String getSelectedDept() { 307 return selectedDept; 308 } 309 310 public void setSelectedDept(String selectedDept) { 311 this.selectedDept = selectedDept; 312 } 313 314 public List<String> getDepartments() { 315 return departments; 316 } 317 318 public void setDepartments(List<String> departments) { 319 this.departments = departments; 320 } 321 322 public Set<Long> getDeptWorkareas() { 323 return deptWorkareas; 324 } 325 326 public void setDeptWorkareas(Set<Long> deptWorkareas) { 327 this.deptWorkareas = deptWorkareas; 328 } 329 330 public List<String> getAssignmentPrincipalIds() { 331 return assignmentPrincipalIds; 332 } 333 334 public void setAssignmentPrincipalIds(List<String> assignmentPrincipalIds) { 335 this.assignmentPrincipalIds = assignmentPrincipalIds; 336 } 337 338 public int getResultSize() { 339 return resultSize; 340 } 341 342 public void setResultSize(Integer resultSize) { 343 this.resultSize = resultSize; 344 } 345 346 public String getSelectedWorkArea() { 347 return selectedWorkArea; 348 } 349 350 public void setSelectedWorkArea(String selectedWorkArea) { 351 this.selectedWorkArea = selectedWorkArea; 352 } 353 354 public List<String> getSearchResultList() { 355 return searchResultList; 356 } 357 358 public void setSearchResultList(List<String> searchResultList) { 359 this.searchResultList = searchResultList; 360 } 361 362 public String getPayBeginDateForSearch() { 363 return payBeginDateForSearch; 364 } 365 366 public void setPayBeginDateForSearch(String payBeginDateForSearch) { 367 this.payBeginDateForSearch = payBeginDateForSearch; 368 } 369 370 public String getPayEndDateForSearch() { 371 return payEndDateForSearch; 372 } 373 374 public void setPayEndDateForSearch(String payEndDateForSearch) { 375 this.payEndDateForSearch = payEndDateForSearch; 376 } 377 378 public Set<String> getPrincipalIds() { 379 return principalIds; 380 } 381 382 public void setPrincipalIds(Set<String> principalIds) { 383 this.principalIds = principalIds; 384 } 385 386 public Map<Long,String> getWorkAreaDescr() { 387 return workAreaDescr; 388 } 389 390 public void setWorkAreaDescr(Map<Long,String> workAreaDescr) { 391 this.workAreaDescr = workAreaDescr; 392 } 393 394 }