- Added a --skipDelete option to upgrade.pl
- rfe: Approvers don't need to approve own changes fixed a rare bug that could occur in archiving old threads
This commit is contained in:
parent
8ec18c957f
commit
61b70325f2
4 changed files with 37 additions and 18 deletions
|
|
@ -73,6 +73,7 @@ sub execute {
|
|||
my $a = $self->session->db->read("select assetId from asset where className='WebGUI::Asset::Wobject::Collaboration'");
|
||||
while (my ($assetId) = $a->array) {
|
||||
my $cs = WebGUI::Asset->new($self->session, $assetId, "WebGUI::Asset::Wobject::Collaboration");
|
||||
next unless defined $cs;
|
||||
my $archiveDate = $epoch - $cs->get("archiveAfter");
|
||||
my $sql = "select asset.assetId, assetData.revisionDate from Post left join asset on asset.assetId=Post.assetId
|
||||
left join assetData on Post.assetId=assetData.assetId and Post.revisionDate=assetData.revisionDate
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ use base 'WebGUI::Workflow::Activity';
|
|||
use WebGUI::VersionTag;
|
||||
use WebGUI::Inbox;
|
||||
use WebGUI::International;
|
||||
use WebGUI::User;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -94,17 +95,22 @@ sub execute {
|
|||
my $i18n = WebGUI::International->new($self->session, "VersionTag");
|
||||
my $inbox = WebGUI::Inbox->new($self->session);
|
||||
if ($instance->getScratch("status") eq "") {
|
||||
my $message = $inbox->addMessage({
|
||||
subject=>$i18n->get("approve/deny").": ".$versionTag->get("name"),
|
||||
message=>join("\n\n",$self->get("message"),
|
||||
$self->session->url->getSiteURL().$self->session->url->page("op=manageRevisionsInTag;workflowInstanceId=".$instance->getId.";tagId=".$versionTag->getId),
|
||||
$versionTag->get("comments")),
|
||||
groupId=>$self->get("groupToApprove"),
|
||||
status=>'pending'
|
||||
});
|
||||
$instance->setScratch("messageId",$message->getId);
|
||||
$instance->setScratch("status","notified");
|
||||
return $self->WAITING;
|
||||
my $u = WebGUI::User->new($self->session, $versionTag->get("committedBy"));
|
||||
if ($u->isInGroup($self->get("groupToApprove"))) {
|
||||
return $self->COMPLETE;
|
||||
} else {
|
||||
my $message = $inbox->addMessage({
|
||||
subject=>$i18n->get("approve/deny").": ".$versionTag->get("name"),
|
||||
message=>join("\n\n",$self->get("message"),
|
||||
$self->session->url->getSiteURL().$self->session->url->page("op=manageRevisionsInTag;workflowInstanceId=".$instance->getId.";tagId=".$versionTag->getId),
|
||||
$versionTag->get("comments")),
|
||||
groupId=>$self->get("groupToApprove"),
|
||||
status=>'pending'
|
||||
});
|
||||
$instance->setScratch("status","notified");
|
||||
$instance->setScratch("messageId",$message->getId);
|
||||
return $self->WAITING;
|
||||
}
|
||||
} elsif ($instance->getScratch("status") eq "denied") {
|
||||
my $message = $inbox->getMessage($instance->getScratch("messageId"));
|
||||
$message->setCompleted;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue