001 /** 002 * Copyright 2004-2012 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.clocklog; 017 018 import java.sql.Timestamp; 019 020 import org.kuali.hr.job.Job; 021 import org.kuali.hr.time.task.Task; 022 import org.kuali.hr.time.util.TkConstants; 023 import org.kuali.hr.time.workarea.WorkArea; 024 import org.kuali.rice.kim.api.identity.Person; 025 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase; 026 027 public class ClockLog extends PersistableBusinessObjectBase { 028 029 /** 030 * 031 */ 032 private static final long serialVersionUID = -2499666820628979901L; 033 034 private String tkClockLogId; 035 private String principalId; 036 private Long jobNumber; 037 private Long workArea; 038 private Long task; 039 private String tkWorkAreaId; 040 private String tkTaskId; 041 private Timestamp clockTimestamp; 042 private String clockTimestampTimezone; 043 private String clockAction; 044 private String ipAddress; 045 private String userPrincipalId; 046 private String hrJobId; 047 private Timestamp timestamp; 048 049 private String missedPunchDocumentId; 050 051 private Job job; 052 private WorkArea workAreaObj; 053 private Task taskObj; 054 055 private Person principal; 056 057 public Job getJob() { 058 return job; 059 } 060 061 public void setJob(Job job) { 062 this.job = job; 063 } 064 065 public String getPrincipalId() { 066 return principalId; 067 } 068 069 public void setPrincipalId(String principalId) { 070 this.principalId = principalId; 071 } 072 073 public Long getJobNumber() { 074 return jobNumber; 075 } 076 077 public void setJobNumber(Long jobNumber) { 078 this.jobNumber = jobNumber; 079 } 080 081 public Timestamp getClockTimestamp() { 082 return clockTimestamp; 083 } 084 085 public void setClockTimestamp(Timestamp clockTimestamp) { 086 this.clockTimestamp = clockTimestamp; 087 } 088 089 public String getClockAction() { 090 return clockAction; 091 } 092 093 public void setClockAction(String clockAction) { 094 this.clockAction = clockAction; 095 } 096 097 public String getIpAddress() { 098 return ipAddress; 099 } 100 101 public void setIpAddress(String ipAddress) { 102 this.ipAddress = ipAddress; 103 } 104 105 public String getUserPrincipalId() { 106 return userPrincipalId; 107 } 108 109 public void setUserPrincipalId(String userPrincipalId) { 110 this.userPrincipalId = userPrincipalId; 111 } 112 113 public Timestamp getTimestamp() { 114 return timestamp; 115 } 116 117 public void setTimestamp(Timestamp timestamp) { 118 this.timestamp = timestamp; 119 } 120 121 public String getClockTimestampTimezone() { 122 return clockTimestampTimezone; 123 } 124 125 public void setClockTimestampTimezone(String clockTimestampTimezone) { 126 this.clockTimestampTimezone = clockTimestampTimezone; 127 } 128 129 /** 130 * TODO: Fix this - may need to return multiple actions, depending on how we want the system to work. 131 * @return 132 */ 133 public String getNextValidClockAction() { 134 String ret; 135 136 if (this.getClockAction().equals(TkConstants.CLOCK_IN)) { 137 ret = TkConstants.CLOCK_OUT; 138 } else if (this.getClockAction().equals(TkConstants.CLOCK_OUT)) { 139 ret = TkConstants.CLOCK_IN; 140 } else if (this.getClockAction().equals(TkConstants.LUNCH_IN)) { 141 ret = TkConstants.LUNCH_OUT; 142 } else if (this.getClockAction().equals(TkConstants.LUNCH_OUT)) { 143 ret = TkConstants.LUNCH_IN; 144 } else { 145 ret = TkConstants.CLOCK_IN; 146 } 147 148 return ret; 149 } 150 151 public String getTkClockLogId() { 152 return tkClockLogId; 153 } 154 155 public void setTkClockLogId(String tkClockLogId) { 156 this.tkClockLogId = tkClockLogId; 157 } 158 159 public String getTkWorkAreaId() { 160 return tkWorkAreaId; 161 } 162 163 public void setTkWorkAreaId(String tkWorkAreaId) { 164 this.tkWorkAreaId = tkWorkAreaId; 165 } 166 167 public String getTkTaskId() { 168 return tkTaskId; 169 } 170 171 public void setTkTaskId(String tkTaskId) { 172 this.tkTaskId = tkTaskId; 173 } 174 175 public String getHrJobId() { 176 return hrJobId; 177 } 178 179 public void setHrJobId(String hrJobId) { 180 this.hrJobId = hrJobId; 181 } 182 183 public WorkArea getWorkAreaObj() { 184 return workAreaObj; 185 } 186 187 public void setWorkAreaObj(WorkArea workAreaObj) { 188 this.workAreaObj = workAreaObj; 189 } 190 191 public Task getTaskObj() { 192 return taskObj; 193 } 194 195 public void setTaskObj(Task taskObj) { 196 this.taskObj = taskObj; 197 } 198 199 public void setWorkArea(Long workArea) { 200 this.workArea = workArea; 201 } 202 203 public void setTask(Long task) { 204 this.task = task; 205 } 206 public Long getWorkArea() { 207 return workArea; 208 } 209 public Long getTask() { 210 return task; 211 } 212 213 public Person getPrincipal() { 214 return principal; 215 } 216 217 public void setPrincipal(Person principal) { 218 this.principal = principal; 219 } 220 221 public String getMissedPunchDocumentId() { 222 return missedPunchDocumentId; 223 } 224 225 public void setMissedPunchDocumentId(String missedPunchDocumentId) { 226 this.missedPunchDocumentId = missedPunchDocumentId; 227 } 228 229 }