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 this.setBeginTimestamp(lb.getBeginTimestamp());
58 this.setEndTimestamp(lb.getEndTimestamp());
59 }
60
61
62 public String getLmLeaveBlockHistoryId() {
63 return lmLeaveBlockHistoryId;
64 }
65
66 public void setLmLeaveBlockHistoryId(String lmLeaveBlockHistoryId) {
67 this.lmLeaveBlockHistoryId = lmLeaveBlockHistoryId;
68 }
69
70 public String getAction() {
71 return action;
72 }
73
74 public void setAction(String action) {
75 this.action = action;
76 }
77
78 public String getPrincipalIdDeleted() {
79 return principalIdDeleted;
80 }
81
82 public void setPrincipalIdDeleted(String principalIdDeleted) {
83 this.principalIdDeleted = principalIdDeleted;
84 }
85
86 public Timestamp getTimestampDeleted() {
87 return timestampDeleted;
88 }
89
90 public void setTimestampDeleted(Timestamp timestampDeleted) {
91 this.timestampDeleted = timestampDeleted;
92 }
93
94 public String getAssignmentTitle() {
95 StringBuilder b = new StringBuilder();
96 LeaveBlock lb = TkServiceLocator.getLeaveBlockService().getLeaveBlock(super.getLmLeaveBlockId());
97 if(lb != null){
98 if (lb.getWorkArea() != null) {
99 WorkArea wa = TkServiceLocator.getWorkAreaService().getWorkArea(
100 lb.getWorkArea(), TKUtils.getCurrentDate());
101 if (wa != null) {
102 b.append(wa.getDescription());
103 }
104 Task task = TkServiceLocator.getTaskService().getTask(
105 this.getTask(), this.getLeaveDate());
106 if (task != null) {
107
108
109
110 if (!task.getDescription()
111 .equals(TkConstants.TASK_DEFAULT_DESP)) {
112 b.append("-" + task.getDescription());
113 }
114 }
115 }
116 }
117 return b.toString();
118 }
119
120 }