001 /**
002 * Copyright 2004-2013 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.timeblock;
017
018 import java.sql.Timestamp;
019 import java.util.ArrayList;
020 import java.util.List;
021
022 import org.kuali.hr.time.service.base.TkServiceLocator;
023 import org.kuali.rice.kim.api.identity.Person;
024
025 public class TimeBlockHistory extends TimeBlock {
026
027 /**
028 *
029 */
030 private static final long serialVersionUID = 3943771766084238699L;
031
032 private String tkTimeBlockHistoryId = null;
033 private String actionHistory;
034 private String modifiedByPrincipalId;
035 private Timestamp timestampModified;
036 private transient Person principal;
037 private transient Person userPrincipal;
038 private List<TimeBlockHistoryDetail> timeBlockHistoryDetails = new ArrayList<TimeBlockHistoryDetail>();
039
040 public TimeBlockHistory() {
041 }
042
043 public TimeBlockHistory(TimeBlock tb) {
044 this.setTkTimeBlockId(tb.getTkTimeBlockId());
045 this.setDocumentId(tb.getDocumentId());
046 this.setJobNumber(tb.getJobNumber());
047 this.setWorkArea(tb.getWorkArea());
048 this.setTask(tb.getTask());
049 this.setEarnCode(tb.getEarnCode());
050 this.setBeginTimestamp(tb.getBeginTimestamp());
051 this.setEndTimestamp(tb.getEndTimestamp());
052 this.setClockLogCreated(tb.getClockLogCreated());
053 this.setHours(tb.getHours());
054 this.setUserPrincipalId(tb.getUserPrincipalId());
055 this.setPrincipalId(tb.getPrincipalId());
056 this.setTimestamp(tb.getTimestamp());
057 this.setBeginTimestampTimezone(tb.getBeginTimestampTimezone());
058 this.setEndTimestampTimezone(tb.getEndTimestampTimezone());
059 // add time block history details for this time block history
060 TkServiceLocator.getTimeBlockHistoryService().addTimeBlockHistoryDetails(this, tb);
061 }
062
063
064 public String getTkTimeBlockHistoryId() {
065 return tkTimeBlockHistoryId;
066 }
067 public void setTkTimeBlockHistoryId(String tkTimeBlockHistoryId) {
068 this.tkTimeBlockHistoryId = tkTimeBlockHistoryId;
069 }
070 public String getActionHistory() {
071 return actionHistory;
072 }
073 public void setActionHistory(String actionHistory) {
074 this.actionHistory = actionHistory;
075 }
076 public String getModifiedByPrincipalId() {
077 return modifiedByPrincipalId;
078 }
079 public void setModifiedByPrincipalId(String modifiedByPrincipalId) {
080 this.modifiedByPrincipalId = modifiedByPrincipalId;
081 }
082
083 public Timestamp getTimestampModified() {
084 return timestampModified;
085 }
086
087 public void setTimestampModified(Timestamp timestampModified) {
088 this.timestampModified = timestampModified;
089 }
090
091 public Person getPrincipal() {
092 return principal;
093 }
094
095 public void setPrincipal(Person principal) {
096 this.principal = principal;
097 }
098
099 public Person getUserPrincipal() {
100 return userPrincipal;
101 }
102
103 public void setUserPrincipal(Person userPrincipal) {
104 this.userPrincipal = userPrincipal;
105 }
106
107 public List<TimeBlockHistoryDetail> getTimeBlockHistoryDetails() {
108 return timeBlockHistoryDetails;
109 }
110
111 public void setTimeBlockHistoryDetails(List<TimeBlockHistoryDetail> timeBlockHistoryDetails) {
112 this.timeBlockHistoryDetails = timeBlockHistoryDetails;
113 }
114 }