1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.lm.leaveblock;
17
18 import java.sql.Timestamp;
19
20 import org.kuali.hr.time.service.base.TkServiceLocator;
21 import org.kuali.hr.time.task.Task;
22 import org.kuali.hr.time.util.TKUtils;
23 import org.kuali.hr.time.util.TkConstants;
24 import org.kuali.hr.time.workarea.WorkArea;
25
26 public class LeaveBlockHistory extends LeaveBlock {
27
28
29
30
31 private static final long serialVersionUID = 1L;
32 private String lmLeaveBlockHistoryId;
33 private String action;
34 private String principalIdDeleted;
35 private Timestamp timestampDeleted;
36
37 public LeaveBlockHistory() {
38 }
39
40 public LeaveBlockHistory(LeaveBlock lb) {
41 this.setLmLeaveBlockId(lb.getLmLeaveBlockId());
42 this.setDocumentId(lb.getDocumentId());
43 this.setAccrualCategory(lb.getAccrualCategory());
44 this.setAccrualGenerated(lb.getAccrualGenerated());
45 this.setApplyToYtdUsed(lb.getApplyToYtdUsed());
46 this.setDescription(lb.getDescription());
47 this.setLeaveAmount(lb.getLeaveAmount());
48 this.setEarnCode(lb.getEarnCode());
49 this.setLeaveDate(lb.getLeaveDate());
50 this.setPrincipalId(lb.getPrincipalId());
51
52 this.setRequestStatus(lb.getRequestStatus());
53 this.setTimestamp(lb.getTimestamp());
54 this.setTkAssignmentId(lb.getTkAssignmentId());
55 this.setScheduleTimeOffId(lb.getScheduleTimeOffId());
56 this.setLeaveBlockType(lb.getLeaveBlockType());
57
58 }
59
60
61 public String getLmLeaveBlockHistoryId() {
62 return lmLeaveBlockHistoryId;
63 }
64
65 public void setLmLeaveBlockHistoryId(String lmLeaveBlockHistoryId) {
66 this.lmLeaveBlockHistoryId = lmLeaveBlockHistoryId;
67 }
68
69 public String getAction() {
70 return action;
71 }
72
73 public void setAction(String action) {
74 this.action = action;
75 }
76
77 public String getPrincipalIdDeleted() {
78 return principalIdDeleted;
79 }
80
81 public void setPrincipalIdDeleted(String principalIdDeleted) {
82 this.principalIdDeleted = principalIdDeleted;
83 }
84
85 public Timestamp getTimestampDeleted() {
86 return timestampDeleted;
87 }
88
89 public void setTimestampDeleted(Timestamp timestampDeleted) {
90 this.timestampDeleted = timestampDeleted;
91 }
92
93 public String getAssignmentTitle() {
94 StringBuilder b = new StringBuilder();
95 LeaveBlock lb = TkServiceLocator.getLeaveBlockService().getLeaveBlock(super.getLmLeaveBlockId());
96 if(lb != null){
97 if (lb.getWorkArea() != null) {
98 WorkArea wa = TkServiceLocator.getWorkAreaService().getWorkArea(
99 lb.getWorkArea(), TKUtils.getCurrentDate());
100 if (wa != null) {
101 b.append(wa.getDescription());
102 }
103 Task task = TkServiceLocator.getTaskService().getTask(
104 this.getTask(), this.getLeaveDate());
105 if (task != null) {
106
107
108
109 if (!task.getDescription()
110 .equals(TkConstants.TASK_DEFAULT_DESP)) {
111 b.append("-" + task.getDescription());
112 }
113 }
114 }
115 }
116 return b.toString();
117 }
118
119 }