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.lm.approval.web;
17  
18  import java.util.ArrayList;
19  import java.util.Date;
20  import java.util.List;
21  
22  import org.kuali.hr.time.approval.web.ApprovalLeaveSummaryRow;
23  import org.kuali.hr.time.base.web.ApprovalForm;
24  
25  public class LeaveApprovalActionForm extends ApprovalForm {
26  	
27  	private static final long serialVersionUID = 1L;
28  	
29  	private List<ApprovalLeaveSummaryRow> leaveApprovalRows;
30  	private List<Date> leaveCalendarDates = new ArrayList<Date>();
31  	
32  	public List<ApprovalLeaveSummaryRow> getLeaveApprovalRows() {
33  		return leaveApprovalRows;
34  	}
35  	public void setLeaveApprovalRows(List<ApprovalLeaveSummaryRow> leaveApprovalRows) {
36  		this.leaveApprovalRows = leaveApprovalRows;
37  	}
38  	public List<Date> getLeaveCalendarDates() {
39  		return leaveCalendarDates;
40  	}
41  	public void setLeaveCalendarDates(List<Date> leaveCalendarDates) {
42  		this.leaveCalendarDates = leaveCalendarDates;
43  	}
44  	
45  	public boolean isAnyApprovalRowApprovable() {
46  		boolean isAnyApprovalRowApprovable = false;
47  		
48  		if (leaveApprovalRows != null) {
49  			for (ApprovalLeaveSummaryRow approvalRow : leaveApprovalRows) {
50  				if (approvalRow.isApprovable()) {
51  					isAnyApprovalRowApprovable = true;
52  					break;
53  				}
54  			}
55  		}
56  		
57  		return isAnyApprovalRowApprovable;
58  	}
59  	
60  	
61  }