a bunch of bug fixes and tweaks related to workflow/versioning

This commit is contained in:
JT Smith 2006-03-23 16:56:08 +00:00
parent f73b2996da
commit 985417afd3
9 changed files with 38 additions and 9 deletions

View file

@ -39,9 +39,24 @@ addNavigationMimeType();
addIndexes();
addDatabaseCache();
updateHelpTemplate();
fixImportNodePrivileges();
finish($session); # this line required
#-------------------------------------------------
sub fixImportNodePrivileges {
print "\tFixing the privileges of all the content in the import node.\n";
my $importNode = WebGUI::Asset->getImportNode($session);
$importNode->update({groupIdView=>'7', groupIdEdit=>'12'});
my $prepared = $session->db->prepare("update assetData set groupIdView='7', groupIdEdit='12' where assetId=?");
my $rs = $session->db->read("select assetId from asset where lineage like ?",[$importNode->get("lineage").'%']);
while (my ($id) = $rs->array) {
$prepared->execute([$id]);
}
my $root = WebGUI::Asset->getRoot($session);
$root->update({groupIdView=>'7'});
}
#-------------------------------------------------
sub convertMessageLogToInbox {
print "\tConverting message log to inbox.\n";

View file

@ -374,7 +374,7 @@ sub workerResponse {
} elsif ($response->is_redirect) {
$self->debug("Response for $instanceId was redirected.");
} elsif ($response->is_error) {
$self->debug("Response for $instanceId had a communications error.");
$self->debug("Response for $instanceId had a communications error. ".$response->error_as_HTML);
$kernel->yield("suspendInstance",$instanceId)
# we should probably log something
}

View file

@ -270,7 +270,7 @@ Verifies proper inputs in the Asset Tree and saves them. Returns ManageAssets me
sub www_editBranchSave {
my $self = shift;
return $self->session->privilege->insufficient() unless ($self->canEdit && WebGUI::Grouping::isInGroup('4'));
return $self->session->privilege->insufficient() unless ($self->canEdit && $self->session->user->isInGroup('4'));
my %data;
$data{isHidden} = $self->session->form->yesNo("isHidden") if ($self->session->form->yesNo("change_isHidden"));
$data{newWindow} = $self->session->form->yesNo("newWindow") if ($self->session->form->yesNo("change_newWindow"));

View file

@ -258,7 +258,7 @@ Shows a list of the revisions for this asset.
sub www_manageRevisions {
my $self = shift;
my $ac = WebGUI::AdminConsole->new($self->session,"versions");
return $self->session->privilege->insufficient() unless ($self->session->user->isInGroup(3));
return $self->session->privilege->insufficient() unless ($self->canEdit);
my $i18n = WebGUI::International->new($self->session,"Asset");
my $output = '<table width=100% class="content">
<tr><th></th><th>Revision Date</th><th>Revised By</th><th>Tag Name</th></tr> ';

View file

@ -106,8 +106,9 @@ sub process {
icon=>$session->config->get("extrasURL").'/adminConsole/small/versionTags.gif'
});
}
my $rs = $session->db->read("select tagId, name from assetVersionTag where isCommitted=0 and isLocked=0 order by name");
while (my ($id, $name) = $rs->array) {
my $rs = $session->db->read("select tagId, name, groupToUse from assetVersionTag where isCommitted=0 and isLocked=0 order by name");
while (my ($id, $name, $group) = $rs->array) {
next unless $session->user->isInGroup($group);
push(@tags, {
url=>$session->url->page("op=setWorkingVersionTag;backToSite=1;tagId=".$id),
title=>($id eq $workingId) ? '<span style="color: #000080;">* '.$name.'</span>' : $name,

View file

@ -49,7 +49,11 @@ sub www_addWorkflow {
);
my %options = ();
foreach my $object (keys %{$session->config->get("workflowActivities")}) {
$options{$object} = $object;
if ($object eq "None") {
$options{$object} = $i18n->get("no object");
} else {
$options{$object} = $object;
}
}
$f->selectBox(
name=>"type",

View file

@ -340,11 +340,11 @@ sub set {
$self->{_data}{workflowId} = $properties->{workflowId} || $self->{_data}{workflowId} || $self->session->setting->get("defaultVersionTagWorkflow");
$self->{_data}{groupToUse} = $properties->{groupToUse} || $self->{_data}{groupToUse} || "12";
if (exists $properties->{comments}) {
$self->{_data}{comments}=$self->{_data}{comments}
.$self->session->datetime->epochToHuman.' - '.$self->session->user->username
$self->{_data}{comments}=$self->session->datetime->epochToHuman.' - '.$self->session->user->username
."\n"
.$properties->{comments}
."\n\n";
."\n\n"
.$self->{_data}{comments};
}
$self->session->db->setRow("assetVersionTag","tagId",$self->{_data});
}

View file

@ -69,6 +69,7 @@ See WebGUI::Workflow::Activity::execute() for details.
sub execute {
my $self = shift;
my $start = time();
foreach my $id (@{WebGUI::Mail::Send->getMessageIdsInQueue($self->session)}) {
my $message = WebGUI::Mail::Send->retrieve($self->session, $id);
if (defined $message) {
@ -77,6 +78,8 @@ sub execute {
$message->queue;
}
}
# just in case there are a lot of messages, we should release after a minutes worth of sending
last if (time() > $start + 60);
}
return $self->COMPLETE;
}

View file

@ -1,6 +1,12 @@
package WebGUI::i18n::English::Workflow;
our $I18N = {
'no object' => {
message => q|No Object|,
context => q|used when selecting an object type to be passed through a workflow|,
lastUpdated => 0,
},
'confirm delete activity' => {
message => q|Are you certain you wish to delete this activity from this workflow?|,
context => q|prompt the user before deleting an activity from a workflow|,