Added Changes to allow start/end times to be set for version tags

This commit is contained in:
Frank Dillon 2008-05-31 01:12:38 +00:00
parent b54007ad46
commit 9d7adffefc

View file

@ -162,6 +162,14 @@ The ID of the group that's allowed to use this tag. Defaults to the turn admin o
The epoch date the tag was committed. The epoch date the tag was committed.
=head4 startTime
The time that this version tag should be committed
=head4 endTime
The time that this version tag should no longer be available.
=head3 creationDate =head3 creationDate
The epoch date the tag was created. The epoch date the tag was created.
@ -478,14 +486,39 @@ The ID of the group that's allowed to use this tag. Defaults to the turn admin o
Some text about this version tag, what it's for, why it was committed, why it was denied, why it was approved, etc. Some text about this version tag, what it's for, why it was committed, why it was denied, why it was approved, etc.
=head4 startTime
The time that a version tag should start displaying on the website
=head4 endTime
The time that a version tag shoudl stop displaying on the website.
=cut =cut
sub set { sub set {
my $self = shift; my $self = shift;
my $properties = shift; my $properties = shift;
$self->{_data}{name} = $properties->{name} || $self->{_data}{name} || $self->session->user->username." / ".$self->session->datetime->epochToHuman()." (Autotag)";
$self->{_data}{workflowId} = $properties->{workflowId} || $self->{_data}{workflowId} || $self->session->setting->get("defaultVersionTagWorkflow"); my $now = $self->session->datetime->time();
$self->{_data}{groupToUse} = $properties->{groupToUse} || $self->{_data}{groupToUse} || "12"; my $startTime = WebGUI::DateTime->new($self->session,$now)->toDatabase;
my $endTime = WebGUI::DateTime->new($self->session,'2036-01-01 00:00:00')->toDatabase;
$self->{_data}{'name' } = $properties->{name} || $self->{_data}{name} || $self->session->user->username." / ".$self->session->datetime->epochToHuman()." (Autotag)";
$self->{_data}{'workflowId'} = $properties->{workflowId} || $self->{_data}{workflowId} || $self->session->setting->get("defaultVersionTagWorkflow");
$self->{_data}{'groupToUse'} = $properties->{groupToUse} || $self->{_data}{groupToUse} || "12";
#This is necessary for upgrade prior to 7.5.11 in order to ensure that this field exists.
#The if() blocks should be removd once the next branch point is reached.
my $assetVersionTagDesc = $self->session->db->buildHashRef('describe assetVersionTag');
if(grep { $_ =~ /^startTime/ } keys %{$assetVersionTagDesc}) {
#If startTime is there, so is endTime. No need for the additional check.
$self->{_data}{'startTime' } = $properties->{startTime} || $self->{_data}{startTime} || $startTime;
$self->{_data}{'endTime' } = $properties->{endTime} || $self->{_data}{endTime} || $endTime;
}
else {
$self->session->errorHandler->warn("Didn't find startTime");
}
if (exists $properties->{comments}) { if (exists $properties->{comments}) {
$self->{_data}{comments}=$self->session->datetime->epochToHuman.' - '.$self->session->user->username $self->{_data}{comments}=$self->session->datetime->epochToHuman.' - '.$self->session->user->username
."\n" ."\n"