View Javadoc

1   /**
2    * Copyright 2004-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
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.hr.time.base.web;
17  
18  import java.util.ArrayList;
19  import java.util.Date;
20  import java.util.HashMap;
21  import java.util.HashSet;
22  import java.util.LinkedList;
23  import java.util.List;
24  import java.util.Map;
25  import java.util.Set;
26  
27  import org.kuali.hr.time.calendar.CalendarEntries;
28  import org.kuali.hr.time.roles.TkUserRoles;
29  import org.kuali.rice.krad.util.GlobalVariables;
30  
31  public class ApprovalForm extends TkCommonCalendarForm {
32  	public static final String ORDER_BY_PRINCIPAL = "principalName";
33      public static final String ORDER_BY_DOCID = "documentId";
34      public static final String ORDER_BY_STATUS = "Status";
35      public static final String ORDER_BY_WORKAREA = "WorkArea";
36  
37      private static final long serialVersionUID = -173408280988754540L;
38  
39      private String hrPyCalendarEntriesId;
40      private String hrPyCalendarId;
41      private String name;
42      private List<String> payCalendarGroups = new LinkedList<String>();
43      private String selectedPayCalendarGroup;
44      private String selectedDept;
45      private String selectedWorkArea;
46      private Date payBeginDate;
47      private Date payEndDate;
48      private String payBeginDateForSearch;
49      private String payEndDateForSearch;
50      private String roleName;
51  
52  	
53      private CalendarEntries payCalendarEntries;
54      private Long workArea = null;
55      private Set<Long> deptWorkareas = new HashSet<Long>();
56      private String documentId;
57      private String employeeWorkArea;
58      private List<String> assignmentPrincipalIds = new LinkedList<String>();    
59      private Set<String> principalIds = new HashSet<String>();    
60      private Map<Long,String> workAreaDescr = new HashMap<Long,String>();
61  
62  	/**
63       * Used for ajax dynamic row updating
64       */
65      private String outputString;
66  
67      private String searchField;
68      private String searchTerm;
69  
70      private int rowsToShow = 50;
71      private int rowsInTotal;
72      private String sortField;
73      private boolean ascending = true;
74      private boolean ajaxCall = false;
75  
76      private Boolean testSelected = Boolean.FALSE;
77  
78      private String prevPayCalendarId = null;
79      private String nextPayCalendarId = null;
80  
81      private List<String> departments = new ArrayList<String>();
82      private Integer resultSize = 0;
83      private List<String> searchResultList = new LinkedList<String>();
84  
85      private String calNav = null;
86  
87      public String getRoleName() {
88  		return roleName;
89  	}
90  
91  	public void setRoleName(String roleName) {
92  		this.roleName = roleName;
93  	}
94  	
95      public String getCalNav() {
96          return calNav;
97      }
98  
99      public void setCalNav(String calNav) {
100         this.calNav = calNav;
101     }
102 
103     public String getHrPyCalendarEntriesId() {
104         return hrPyCalendarEntriesId;
105     }
106 
107     public void setHrPyCalendarEntriesId(String hrPyCalendarEntriesId) {
108         this.hrPyCalendarEntriesId = hrPyCalendarEntriesId;
109     }
110 
111     public String getHrPyCalendarId() {
112         return hrPyCalendarId;
113     }
114 
115     public void setHrPyCalendarId(String hrPyCalendarId) {
116         this.hrPyCalendarId = hrPyCalendarId;
117     }
118 
119     /**
120      * Gets the name of the user that this row represents.
121      *
122      * @return String representing the users name.
123      */
124     public String getName() {
125         return name;
126     }
127 
128     public void setName(String name) {
129         this.name = name;
130     }
131 
132     public void setPayBeginDate(Date payBeginDate) {
133         this.payBeginDate = payBeginDate;
134     }
135 
136     public Date getPayBeginDate() {
137         return payBeginDate;
138     }
139 
140     public void setPayEndDate(Date payEndDate) {
141         this.payEndDate = payEndDate;
142     }
143 
144     public Date getPayEndDate() {
145         return payEndDate;
146     }
147 
148     public CalendarEntries getPayCalendarEntries() {
149 		return payCalendarEntries;
150 	}
151 
152 	public void setPayCalendarEntries(CalendarEntries payCalendarEntries) {
153 		this.payCalendarEntries = payCalendarEntries;
154 	}
155 
156     public String getDocumentId() {
157         return documentId;
158     }
159 
160     public void setDocumentId(String documentId) {
161         this.documentId = documentId;
162     }
163 
164     public String getOutputString() {
165         return outputString;
166     }
167 
168     public void setOutputString(String outputString) {
169         this.outputString = outputString;
170     }
171 
172     public String getSearchField() {
173         return searchField;
174     }
175 
176     public void setSearchField(String searchField) {
177         this.searchField = searchField;
178     }
179 
180     public String getSearchTerm() {
181         return searchTerm;
182     }
183 
184     public void setSearchTerm(String searchTerm) {
185         this.searchTerm = searchTerm;
186     }
187 
188     public int getRowsToShow() {
189         return rowsToShow;
190     }
191 
192     public void setRowsToShow(int rowsToShow) {
193         this.rowsToShow = rowsToShow;
194     }
195 
196     public boolean isAscending() {
197         return ascending;
198     }
199 
200     public void setAscending(boolean ascending) {
201         this.ascending = ascending;
202     }
203 
204     public String getSortField() {
205         return sortField;
206     }
207 
208     public void setSortField(String sortField) {
209         this.sortField = sortField;
210     }
211 
212     public boolean isAjaxCall() {
213         return ajaxCall;
214     }
215 
216     public void setAjaxCall(boolean ajaxCall) {
217         this.ajaxCall = ajaxCall;
218     }
219 
220     public List<String> getPayCalendarGroups() {
221         return payCalendarGroups;
222     }
223 
224     public void setPayCalendarGroups(List<String> payCalendarGroups) {
225         this.payCalendarGroups = payCalendarGroups;
226     }
227 
228     public int getRowsInTotal() {
229         return rowsInTotal;
230     }
231 
232     public void setRowsInTotal(int rowsInTotal) {
233         this.rowsInTotal = rowsInTotal;
234     }
235 
236     /**
237      * Provides a set of WorkArea numbers that the current approver has
238      * dominion over.
239      *
240      * @return A Set of Longs representing work areas.
241      */
242     public Set<Long> getApproverWorkAreas() {
243         return TkUserRoles.getUserRoles(GlobalVariables.getUserSession().getPrincipalId()).getApproverWorkAreas();
244     }
245 
246     public Long getWorkArea() {
247         return workArea;
248     }
249 
250     public void setWorkArea(Long workArea) {
251         this.workArea = workArea;
252     }
253 
254     public String getSelectedPayCalendarGroup() {
255         return selectedPayCalendarGroup;
256     }
257 
258     public void setSelectedPayCalendarGroup(String selectedPayCalendarGroup) {
259         this.selectedPayCalendarGroup = selectedPayCalendarGroup;
260     }
261 
262     public String getEmployeeWorkArea() {
263         return employeeWorkArea;
264     }
265 
266     public void setEmployeeWorkArea(String employeeWorkArea) {
267         this.employeeWorkArea = employeeWorkArea;
268     }
269 
270     public Boolean getTestSelected() {
271         return testSelected;
272     }
273 
274     public void setTestSelected(Boolean testSelected) {
275         this.testSelected = testSelected;
276     }
277 
278     public String getPrevPayCalendarId() {
279         return prevPayCalendarId;
280     }
281 
282     public void setPrevPayCalendarId(String prevPayCalendarId) {
283         this.prevPayCalendarId = prevPayCalendarId;
284     }
285 
286     public String getNextPayCalendarId() {
287         return nextPayCalendarId;
288     }
289 
290     public void setNextPayCalendarId(String nextPayCalendarId) {
291         this.nextPayCalendarId = nextPayCalendarId;
292     }
293 
294     public String getSelectedDept() {
295         return selectedDept;
296     }
297 
298     public void setSelectedDept(String selectedDept) {
299         this.selectedDept = selectedDept;
300     }
301 
302     public List<String> getDepartments() {
303         return departments;
304     }
305 
306     public void setDepartments(List<String> departments) {
307         this.departments = departments;
308     }
309 
310     public Set<Long> getDeptWorkareas() {
311         return deptWorkareas;
312     }
313 
314     public void setDeptWorkareas(Set<Long> deptWorkareas) {
315         this.deptWorkareas = deptWorkareas;
316     }
317 
318     public List<String> getAssignmentPrincipalIds() {
319         return assignmentPrincipalIds;
320     }
321 
322     public void setAssignmentPrincipalIds(List<String> assignmentPrincipalIds) {
323         this.assignmentPrincipalIds = assignmentPrincipalIds;
324     }
325 
326     public int getResultSize() {
327         return resultSize;
328     }
329 
330     public void setResultSize(Integer resultSize) {
331         this.resultSize = resultSize;
332     }
333 
334     public String getSelectedWorkArea() {
335         return selectedWorkArea;
336     }
337 
338     public void setSelectedWorkArea(String selectedWorkArea) {
339         this.selectedWorkArea = selectedWorkArea;
340     }
341 
342     public List<String> getSearchResultList() {
343         return searchResultList;
344     }
345 
346     public void setSearchResultList(List<String> searchResultList) {
347         this.searchResultList = searchResultList;
348     }
349 
350     public String getPayBeginDateForSearch() {
351         return payBeginDateForSearch;
352     }
353 
354     public void setPayBeginDateForSearch(String payBeginDateForSearch) {
355         this.payBeginDateForSearch = payBeginDateForSearch;
356     }
357 
358     public String getPayEndDateForSearch() {
359         return payEndDateForSearch;
360     }
361 
362     public void setPayEndDateForSearch(String payEndDateForSearch) {
363         this.payEndDateForSearch = payEndDateForSearch;
364     }
365 
366     public Set<String> getPrincipalIds() {
367 		return principalIds;
368 	}
369 
370 	public void setPrincipalIds(Set<String> principalIds) {
371 		this.principalIds = principalIds;
372 	}
373 
374 	public Map<Long,String> getWorkAreaDescr() {
375 		return workAreaDescr;
376 	}
377 
378 	public void setWorkAreaDescr(Map<Long,String> workAreaDescr) {
379 		this.workAreaDescr = workAreaDescr;
380 	}
381 
382 }