Commit c3a25980 authored by Mike Hibler's avatar Mike Hibler

Add MarkDeleted() methods.

parent 4c52c967
......@@ -553,10 +553,10 @@ sub ListAllVersions($$$)
my $clause = "";
if (defined($format) && $format =~ /^([-\w]+)$/) {
$clause .= "and v.format='$1'";
$clause .= "and v.format='$1' ";
}
if (defined($pid) && $pid =~ /^([-\w]+)$/) {
$clause .= "and v.pid='$1'";
$clause .= "and v.pid='$1' ";
}
my $query_result =
......@@ -1766,6 +1766,26 @@ sub MarkUpdate($$;$)
return 0;
}
sub MarkDeleted($;$)
{
my ($self, $stamp) = @_;
my $imageid = $self->imageid();
my $version = $self->version();
if (defined($stamp)) {
$stamp = "FROM_UNIXTIME($stamp)";
} else {
$stamp = "now()";
}
return -1
if (! DBQueryWarn("update image_versions set deleted=$stamp " .
"where imageid='$imageid' and version='$version'"));
return 0;
}
#
# Mark the IMS update time in the record,
#
......
......@@ -666,6 +666,13 @@ sub MarkUpdate($$;$)
return $self->image()->MarkUpdate($user, $stamp);
}
sub MarkDeleted($;$)
{
my ($self, $stamp) = @_;
return $self->image()->MarkDeleted($stamp);
}
#
# Mark the IMS update time in the record,
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment