- fix: deleting workflows did not delete related instances and crons
- Added a "run" link to the scheduler and the running workflows listings to aid in debugging workflow errors. - fix: profile fields not validated by WebGUI::User
This commit is contained in:
parent
7852441151
commit
90cb569bb5
9 changed files with 102 additions and 8 deletions
|
|
@ -3,6 +3,11 @@
|
||||||
Approval for Version Tag workflow activity.
|
Approval for Version Tag workflow activity.
|
||||||
- Updated the hoverhelp to denote that you can use ranges in the WebGUI
|
- Updated the hoverhelp to denote that you can use ranges in the WebGUI
|
||||||
scheduler.
|
scheduler.
|
||||||
|
- fix: deleting workflows did not delete related instances and crons
|
||||||
|
- Added a "run" link to the scheduler and the running workflows listings to
|
||||||
|
aid in debugging workflow errors.
|
||||||
|
- fix: profile fields not validated by WebGUI::User
|
||||||
|
|
||||||
|
|
||||||
7.0.7
|
7.0.7
|
||||||
- rfe: Image Management (funded by Formation Design Systems)
|
- rfe: Image Management (funded by Formation Design Systems)
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ The unique id of an ad space to attach this ad to.
|
||||||
=head3 properties
|
=head3 properties
|
||||||
|
|
||||||
The properties used to create this object. See the set() method for details.
|
The properties used to create this object. See the set() method for details.
|
||||||
|
A hash must be passed into create and a "type" key of either "text", "rich" or "image" is mandatory.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -209,7 +210,7 @@ The hex color to be used to display the border on a text based ad.
|
||||||
|
|
||||||
=head4 textColor
|
=head4 textColor
|
||||||
|
|
||||||
THe hex color to be used to display the text on a test based ad.
|
The hex color to be used to display the text on a test based ad.
|
||||||
|
|
||||||
=head4 backgroundColor
|
=head4 backgroundColor
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,9 @@ sub www_manageCron {
|
||||||
.$session->icon->edit("op=editCronJob;id=".$id)
|
.$session->icon->edit("op=editCronJob;id=".$id)
|
||||||
.'</td><td>'.$title.'</td><td>'.$schedule.'</td><td>'
|
.'</td><td>'.$title.'</td><td>'.$schedule.'</td><td>'
|
||||||
.($enabled ? $i18n->get("enabled") : $i18n->get("disabled"))
|
.($enabled ? $i18n->get("enabled") : $i18n->get("disabled"))
|
||||||
."</td></tr>\n";
|
."</td>";
|
||||||
|
$output .= '<td><a href="'.$session->url->page("op=runCronJob;taskId=".$id).'">'.$i18n->get("run","Workflow").'</a></td>';
|
||||||
|
$output .= "</tr>\n";
|
||||||
}
|
}
|
||||||
$output .= '</table>';
|
$output .= '</table>';
|
||||||
my $ac = WebGUI::AdminConsole->new($session,"cron");
|
my $ac = WebGUI::AdminConsole->new($session,"cron");
|
||||||
|
|
@ -254,7 +256,7 @@ sub www_runCronJob {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
$session->http->setMimeType("text/plain");
|
$session->http->setMimeType("text/plain");
|
||||||
$session->http->setCacheControl("none");
|
$session->http->setCacheControl("none");
|
||||||
unless (isInSubnet($session->env->get("REMOTE_ADDR"), $session->config->get("spectreSubnets"))) {
|
unless (isInSubnet($session->env->get("REMOTE_ADDR"), $session->config->get("spectreSubnets")) || $session->user->isInGroup("3")) {
|
||||||
$session->errorHandler->security("make a Spectre cron job runner request, but we're only allowed to accept requests from ".join(",",@{$session->config->get("spectreSubnets")}).".");
|
$session->errorHandler->security("make a Spectre cron job runner request, but we're only allowed to accept requests from ".join(",",@{$session->config->get("spectreSubnets")}).".");
|
||||||
return "error";
|
return "error";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -370,7 +370,7 @@ sub www_runWorkflow {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
$session->http->setMimeType("text/plain");
|
$session->http->setMimeType("text/plain");
|
||||||
$session->http->setCacheControl("none");
|
$session->http->setCacheControl("none");
|
||||||
unless (isInSubnet($session->env->get("REMOTE_ADDR"), $session->config->get("spectreSubnets"))) {
|
unless (isInSubnet($session->env->get("REMOTE_ADDR"), $session->config->get("spectreSubnets")) || $session->user->isInGroup("3")) {
|
||||||
$session->errorHandler->security("make a Spectre workflow runner request, but we're only allowed to accept requests from ".join(",",@{$session->config->get("spectreSubnets")}).".");
|
$session->errorHandler->security("make a Spectre workflow runner request, but we're only allowed to accept requests from ".join(",",@{$session->config->get("spectreSubnets")}).".");
|
||||||
return "error";
|
return "error";
|
||||||
}
|
}
|
||||||
|
|
@ -407,9 +407,10 @@ sub www_showRunningWorkflows {
|
||||||
.disabled { color: #808000; }
|
.disabled { color: #808000; }
|
||||||
.done { color: #008000; }
|
.done { color: #008000; }
|
||||||
.undefined { color: #800000; }
|
.undefined { color: #800000; }
|
||||||
</style><table width="100%">';
|
</style><table style="width: 100%;">';
|
||||||
my $rs = $session->db->read("select Workflow.title, WorkflowInstance.lastStatus, WorkflowInstance.runningSince, WorkflowInstance.lastUpdate from WorkflowInstance left join Workflow on WorkflowInstance.workflowId=Workflow.workflowId order by WorkflowInstance.runningSince desc");
|
my $isAdmin = $session->user->isInGroup("3");
|
||||||
while (my ($title, $status, $runningSince, $lastUpdate) = $rs->array) {
|
my $rs = $session->db->read("select Workflow.title, WorkflowInstance.lastStatus, WorkflowInstance.runningSince, WorkflowInstance.lastUpdate, WorkflowInstance.instanceId from WorkflowInstance left join Workflow on WorkflowInstance.workflowId=Workflow.workflowId order by WorkflowInstance.runningSince desc");
|
||||||
|
while (my ($title, $status, $runningSince, $lastUpdate, $id) = $rs->array) {
|
||||||
my $class = $status || "complete";
|
my $class = $status || "complete";
|
||||||
$output .= '<tr class="'.$class.'">'
|
$output .= '<tr class="'.$class.'">'
|
||||||
.'<td>'.$title.'</td>'
|
.'<td>'.$title.'</td>'
|
||||||
|
|
@ -419,6 +420,7 @@ sub www_showRunningWorkflows {
|
||||||
.$status.' / '.$session->datetime->epochToHuman($lastUpdate)
|
.$status.' / '.$session->datetime->epochToHuman($lastUpdate)
|
||||||
.'</td>';
|
.'</td>';
|
||||||
}
|
}
|
||||||
|
$output .= '<td><a href="'.$session->url->page("op=runWorkflow;instanceId=".$id).'">'.$i18n->get("run").'</a></td>' if ($isAdmin);
|
||||||
$output .= "</tr>\n";
|
$output .= "</tr>\n";
|
||||||
}
|
}
|
||||||
$output .= '</table>';
|
$output .= '</table>';
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ This package provides URL writing functionality. It is important that all WebGUI
|
||||||
$string = $url->getSiteURL;
|
$string = $url->getSiteURL;
|
||||||
$string = $url->makeCompliant($string);
|
$string = $url->makeCompliant($string);
|
||||||
$string = $url->makeAbsolute($string);
|
$string = $url->makeAbsolute($string);
|
||||||
$string = $url->page($string, $pairs);
|
$string = $url->page($pairs);
|
||||||
$string = $url->unescape($string);
|
$string = $url->unescape($string);
|
||||||
$string = $url->urlize($string);
|
$string = $url->urlize($string);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -439,6 +439,7 @@ sub profileField {
|
||||||
$self = shift;
|
$self = shift;
|
||||||
$fieldName = shift;
|
$fieldName = shift;
|
||||||
$value = shift;
|
$value = shift;
|
||||||
|
die "No such profile field: $fieldName" unless $self->session->db->quickArray("SELECT COUNT(*) FROM userProfileField WHERE fieldName = ?", [$fieldName]);
|
||||||
if (defined $value) {
|
if (defined $value) {
|
||||||
$self->uncache;
|
$self->uncache;
|
||||||
$self->{_profile}{$fieldName} = $value;
|
$self->{_profile}{$fieldName} = $value;
|
||||||
|
|
|
||||||
|
|
@ -228,6 +228,37 @@ sub getActivities {
|
||||||
return \@activities;
|
return \@activities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
=head2 getInstances ( )
|
||||||
|
|
||||||
|
Returns an array reference of the instance objects currently existing for this workflow.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub getInstances {
|
||||||
|
my $self = shift;
|
||||||
|
my @instances = ();
|
||||||
|
my $rs = $self->session->db->read("SELECT instanceId FROM WorkflowInstance WHERE workflowId = ?", [$self->getId]);
|
||||||
|
while (my ($instanceId) = $rs->array) {
|
||||||
|
push(@instances, WebGUI::Workflow::Instance->new($self->session, $instanceId));
|
||||||
|
}
|
||||||
|
return \@instances;
|
||||||
|
}
|
||||||
|
|
||||||
|
=head2 getCrons ( )
|
||||||
|
|
||||||
|
Returns an array reference of the cron objects that trigger this workflow.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub getCrons {
|
||||||
|
my $self = shift;
|
||||||
|
my @crons = ();
|
||||||
|
my $rs = $self->session->db->read("SELECT taskId FROM WorkflowSchedule WHERE workflowId = ?", [$self->getId]);
|
||||||
|
while (my ($taskId) = $rs->array) {
|
||||||
|
push(@crons, WebGUI::Workflow::Cron->new($self->session, $taskId));
|
||||||
|
}
|
||||||
|
return \@crons;
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,12 @@
|
||||||
package WebGUI::i18n::English::Workflow;
|
package WebGUI::i18n::English::Workflow;
|
||||||
|
|
||||||
our $I18N = {
|
our $I18N = {
|
||||||
|
'run' => {
|
||||||
|
message => q|Run|,
|
||||||
|
context => q|Execute a workflow.|,
|
||||||
|
lastUpdated => 0,
|
||||||
|
},
|
||||||
|
|
||||||
'show running workflows' => {
|
'show running workflows' => {
|
||||||
message => q|Show running workflows.|,
|
message => q|Show running workflows.|,
|
||||||
context => q|A label used to get to a display of running workflows.|,
|
context => q|A label used to get to a display of running workflows.|,
|
||||||
|
|
|
||||||
46
t/AdSpace/Ad.t
Normal file
46
t/AdSpace/Ad.t
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
# WebGUI is Copyright 2001-2006 Plain Black Corporation.
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
# Please read the legal notices (docs/legal.txt) and the license
|
||||||
|
# (docs/license.txt) that came with this distribution before using
|
||||||
|
# this software.
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
# http://www.plainblack.com info@plainblack.com
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
use FindBin;
|
||||||
|
use strict;
|
||||||
|
use lib "$FindBin::Bin/../lib";
|
||||||
|
use WebGUI::Test;
|
||||||
|
use WebGUI::Session;
|
||||||
|
use WebGUI::AdSpace;
|
||||||
|
|
||||||
|
#use Test::More tests => 3;
|
||||||
|
use Test::More;
|
||||||
|
|
||||||
|
my $numTests = 1; # increment this value for each test you create
|
||||||
|
++$numTests; ##For conditional testing on module load
|
||||||
|
|
||||||
|
plan tests => $numTests;
|
||||||
|
|
||||||
|
my $loaded = use_ok('WebGUI::AdSpace::Ad');
|
||||||
|
|
||||||
|
my $session = WebGUI::Test->session;
|
||||||
|
my $ad;
|
||||||
|
my $adSpace;
|
||||||
|
|
||||||
|
SKIP: {
|
||||||
|
|
||||||
|
skip "Unable to load WebGUI::AdSpace::Ad", $numTests-1 unless $loaded;
|
||||||
|
$adSpace = WebGUI::AdSpace->create($session, {name=>"Alfred"});
|
||||||
|
$ad=WebGUI::AdSpace::Ad->create($session, $adSpace->getId, {"type", "text"});
|
||||||
|
isa_ok($ad,"WebGUI::AdSpace::Ad","testing create with no properties");
|
||||||
|
}
|
||||||
|
END {
|
||||||
|
if (defined $ad and ref $ad eq 'WebGUI::AdSpace::Ad') {
|
||||||
|
$ad->delete;
|
||||||
|
}
|
||||||
|
if (defined $adSpace and ref $adSpace eq 'WebGUI::AdSpace') {
|
||||||
|
$adSpace->delete;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue