workflow with approval officially works
This commit is contained in:
parent
a78932b3b2
commit
59afc74303
7 changed files with 15 additions and 54 deletions
|
|
@ -331,14 +331,12 @@ sub addWorkflow {
|
|||
$activity = $workflow->addActivity("WebGUI::Workflow::Activity::RequestApprovalForVersionTag", "pbwfactivity0000000017");
|
||||
$activity->set("title", "Get Approval from Content Managers");
|
||||
$activity->set("groupToApprove", "4");
|
||||
$activity->set("approvalSubject", "Approval Pending");
|
||||
$activity->set("approvalMessage", "A new version tag waits your approval.");
|
||||
$activity->set("message", "A new version tag awaits your approval.");
|
||||
$activity->set("doOnDeny", "pbworkflow000000000006");
|
||||
$activity = $workflow->addActivity("WebGUI::Workflow::Activity::CommitVersionTag", "pbwfactivity0000000016");
|
||||
$activity->set("title", "Commit Assets");
|
||||
$activity = $workflow->addActivity("WebGUI::Workflow::Activity::NotifyAboutVersionTag", "pbwfactivity0000000018");
|
||||
$activity->set("title", "Notify Committer of Approval");
|
||||
$activity->set("subject", "Content Approved");
|
||||
$activity->set("message", "Your version tag was approved.");
|
||||
$activity->set("who", "committer");
|
||||
$workflow = WebGUI::Workflow->create($session, {
|
||||
|
|
@ -351,7 +349,6 @@ sub addWorkflow {
|
|||
$activity->set("title", "Unlock Version Tag");
|
||||
$activity = $workflow->addActivity("WebGUI::Workflow::Activity::NotifyAboutVersionTag", "pbwfactivity0000000020");
|
||||
$activity->set("title", "Notify Committer of Denial");
|
||||
$activity->set("subject", "Content Denied");
|
||||
$activity->set("message", "Your version tag was denied. Please take corrective actions and recommit your changes.");
|
||||
$activity->set("who", "committer");
|
||||
$workflow = WebGUI::Workflow->create($session, {
|
||||
|
|
@ -360,7 +357,7 @@ sub addWorkflow {
|
|||
enabled=>1,
|
||||
isSerial=>1,
|
||||
type=>"None"
|
||||
}, "pbworkflow000000000006");
|
||||
}, "pbworkflow000000000007");
|
||||
$activity = $workflow->addActivity("WebGUI::Workflow::Activity::SendQueuedMailMessages", "pbwfactivity0000000021");
|
||||
$activity->set("title", "Send Queued Messages");
|
||||
WebGUI::Workflow::Cron->create($session, {
|
||||
|
|
|
|||
|
|
@ -96,12 +96,12 @@ sub www_viewInboxMessage {
|
|||
$vars->{'dateStamp'} =$session->datetime->epochToHuman($message->get("dateStamp"));
|
||||
$vars->{'status'} = _status($session)->{$message->get("status")};
|
||||
$vars->{message} = $message->get("message");
|
||||
unless ($vars->{message} =~ /\<div/ig || $vars->{message} =~ /\<br/ig || $vars->{message} =~ /\<p/ig) {
|
||||
$vars->{message} =~ s/\n/\<br\>/g;
|
||||
}
|
||||
unless ($vars->{message} =~ /\<a/ig) {
|
||||
$vars->{message} =~ s/(http\S*)/\<a href=\"$1\"\>$1\<\/a\>/g;
|
||||
}
|
||||
unless ($vars->{message} =~ /\<div/ig || $vars->{message} =~ /\<br/ig || $vars->{message} =~ /\<p/ig) {
|
||||
$vars->{message} =~ s/\n/\<br \/\>\n/g;
|
||||
}
|
||||
}
|
||||
$vars->{'accountOptions'} = WebGUI::Operation::Shared::accountOptions($session);
|
||||
return $session->style->userStyle(WebGUI::Asset::Template->new($session,"PBtmpl0000000000000205")->process($vars));
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ sub www_approveVersionTag {
|
|||
my $instance = $tag->getWorkflowInstance;
|
||||
my $activity = $instance->getNextActivity;
|
||||
return $session->privilege->insufficient() unless ($session->user->isInGroup($activity->get("groupToApprove")));
|
||||
if ($session->form->process("status", "selectBox") eq "approved") {
|
||||
if ($session->form->process("status", "selectBox") eq "approve") {
|
||||
$activity->setApproved($instance);
|
||||
} else {
|
||||
$activity->setDenied($instance);
|
||||
|
|
|
|||
|
|
@ -65,12 +65,6 @@ sub definition {
|
|||
label=>$i18n->get("who to notify"),
|
||||
hoverHelp=>$i18n->get("who to notify help")
|
||||
},
|
||||
subject => {
|
||||
fieldType=>"text",
|
||||
defaultValue=>"",
|
||||
label=>$i18n->get("notify subject"),
|
||||
hoverHelp => $i18n->get("notify subject help")
|
||||
},
|
||||
message => {
|
||||
fieldType=>"textarea",
|
||||
defaultValue => "",
|
||||
|
|
@ -97,8 +91,8 @@ sub execute {
|
|||
my $inbox = WebGUI::Inbox->new($self->session);
|
||||
my $properties = {
|
||||
status=>"completed",
|
||||
subject=>$self->get("subject"),
|
||||
message=>$self->get("message")."\n\n".$versionTag->get("name")."\n\n".$versionTag->get("comments"),
|
||||
subject=>$versionTag->get("name"),
|
||||
message=>$self->get("message")."\n\n".$versionTag->get("comments"),
|
||||
};
|
||||
if ($self->get("who") eq "committer") {
|
||||
$properties->{userId} = $versionTag->get("committedBy");
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ use strict;
|
|||
use base 'WebGUI::Workflow::Activity';
|
||||
use WebGUI::VersionTag;
|
||||
use WebGUI::Inbox;
|
||||
use WebGUI::International;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -60,12 +61,6 @@ sub definition {
|
|||
label=>$i18n->get("group to approve"),
|
||||
hoverHelp=>$i18n->get("group to approve help")
|
||||
},
|
||||
subject => {
|
||||
fieldType=>"text",
|
||||
defaultValue=>"",
|
||||
label=>$i18n->get("approval subject"),
|
||||
hoverHelp => $i18n->get("approval subject help")
|
||||
},
|
||||
message => {
|
||||
fieldType=>"textarea",
|
||||
defaultValue => "",
|
||||
|
|
@ -96,13 +91,14 @@ sub execute {
|
|||
my $self = shift;
|
||||
my $versionTag = shift;
|
||||
my $instance = shift;
|
||||
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=>$self->get("subject"),
|
||||
subject=>$i18n->get("approve/deny").": ".$versionTag->get("name"),
|
||||
message=>join("\n\n",$self->get("message"),
|
||||
$self->session->url->page("op=manageRevisionsInTag;workflowInstanceId=".$instance->getId.";tagId=".$versionTag->getId),
|
||||
$versionTag->get('name'), $versionTag->get("comments")),
|
||||
$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'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -84,36 +84,12 @@ our $I18N = {
|
|||
context => q|hover help for the notify message field|
|
||||
},
|
||||
|
||||
'notify subject' => {
|
||||
message => q|Notification Subject|,
|
||||
lastUpdated => 0,
|
||||
context => q|label in the notify about version tag activity|
|
||||
},
|
||||
|
||||
'notify subject help' => {
|
||||
message => q|Enter the subject line of the approval message.|,
|
||||
lastUpdated => 0,
|
||||
context => q|hover help for the notify subject field|
|
||||
},
|
||||
|
||||
'notify about version tag' => {
|
||||
message => q|Notify About Version Tag|,
|
||||
lastUpdated => 0,
|
||||
context => q|the name of the activity|
|
||||
},
|
||||
|
||||
'approval subject' => {
|
||||
message => q|Approval Subject|,
|
||||
lastUpdated => 0,
|
||||
context => q|label in the request approval for version tag activity|
|
||||
},
|
||||
|
||||
'approval subject help' => {
|
||||
message => q|Enter the subject line of the approval message.|,
|
||||
lastUpdated => 0,
|
||||
context => q|hover help for the approval subject field|
|
||||
},
|
||||
|
||||
'approval message' => {
|
||||
message => q|Approval Message|,
|
||||
lastUpdated => 0,
|
||||
|
|
|
|||
|
|
@ -36,10 +36,8 @@ use WebGUI ();
|
|||
use WebGUI::Utility ();
|
||||
use File::Find ();
|
||||
my @modules = ();
|
||||
##The Automated_Information module includes code that requires that $session be active when it is
|
||||
##called. By preloading it before $session is defined, it causes all of the generated information
|
||||
#to be empty
|
||||
my @excludes = qw(WebGUI::i18n::English::Automated_Information);
|
||||
# these modules should always be skipped
|
||||
my @excludes = qw(WebGUI::i18n::English::Automated_Information WebGUI::PerformanceProfiler);
|
||||
open(FILE,"<".$webguiRoot."/sbin/preload.exclude");
|
||||
while (<FILE>) {
|
||||
chomp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue