From 121455ee70ec44f801d1c497fafcc33ee5b6579b Mon Sep 17 00:00:00 2001 From: JT Smith Date: Tue, 14 Feb 2006 17:20:11 +0000 Subject: [PATCH] some bug fixes --- lib/WebGUI/Form/Workflow.pm | 2 +- lib/WebGUI/Operation/Cron.pm | 10 +++++----- lib/WebGUI/Workflow.pm | 1 + lib/WebGUI/Workflow/Cron.pm | 5 +++++ lib/WebGUI/i18n/English/Workflow_Cron.pm | 18 +++++++++++++++--- 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/lib/WebGUI/Form/Workflow.pm b/lib/WebGUI/Form/Workflow.pm index 4d0a75f97..ae08f5705 100644 --- a/lib/WebGUI/Form/Workflow.pm +++ b/lib/WebGUI/Form/Workflow.pm @@ -123,7 +123,7 @@ Adds code to the subtext field of the form so that buttons for managing or editi sub setManageIcons { my $self = shift; - my $returnUrl = ";proceed=goBackToPage;returnUrl=".$self->session->url->escape($self->session->asset->getUrl); + my $returnUrl = ";proceed=goBackToPage;returnUrl=".$self->session->url->escape($self->session->asset->getUrl) if $self->session->asset; my $buttons = $self->session->icon->edit("op=editWorkflow".$returnUrl); $buttons .= $self->session->icon->manage("op=manageWorkflows".$returnUrl); $self->set("subtext",$buttons . $self->get("subtext")); diff --git a/lib/WebGUI/Operation/Cron.pm b/lib/WebGUI/Operation/Cron.pm index 11d3a6d5e..b8e525580 100644 --- a/lib/WebGUI/Operation/Cron.pm +++ b/lib/WebGUI/Operation/Cron.pm @@ -83,8 +83,8 @@ sub www_editCronJob { name=>"enabled", value=>$value, defaultValue=>0, - label=>$i18n->get("enabled"), - hoverHelp=>$i18n->get("enabled help") + label=>$i18n->get("is enabled"), + hoverHelp=>$i18n->get("is enabled help") ); my $value = $cron->get("runOnce") if defined $cron; $f->yesNo( @@ -171,14 +171,14 @@ sub www_manageCron { my $session = shift; return $session->privilege->adminOnly() unless ($session->user->isInGroup(3)); my $i18n = WebGUI::International->new($session, "Workflow_Cron"); - my $output = ''; - my $rs = $session->db->read("select taskId, title, concat(minuteOfHour, hourOfDay, dayOfMonth, monthOfYear, dayOfWeek), enabled from WorkflowSchedule"); + my $output = '
'; + my $rs = $session->db->read("select taskId, title, concat(minuteOfHour, ' ', hourOfDay, ' ', dayOfMonth, ' ', monthOfYear, ' ', dayOfWeek), enabled from WorkflowSchedule"); while (my ($id, $title, $schedule, $enabled) = $rs->array) { $output .= '\n"; } $output .= '
' .$session->icon->delete("op=deleteCronJob;id=".$id, undef, $i18n->get("are you sure you want to delete this scheduled task")) .$session->icon->edit("op=editCronJob;id=".$id) .''.$title.''.$schedule.'' - .($enabled ? "X" : "") + .($enabled ? $i18n->get("enabled") : $i18n->get("disabled")) ."
'; diff --git a/lib/WebGUI/Workflow.pm b/lib/WebGUI/Workflow.pm index caeefeffc..aef3fcdce 100644 --- a/lib/WebGUI/Workflow.pm +++ b/lib/WebGUI/Workflow.pm @@ -201,6 +201,7 @@ If specified this will limit the list to a certain type of workflow based upon t =cut sub getList { + my $class = shift; my $session = shift; my $type = shift; my $sql = "select workflowId, title from Workflow"; diff --git a/lib/WebGUI/Workflow/Cron.pm b/lib/WebGUI/Workflow/Cron.pm index 4a80ef9ae..9b0ee8596 100644 --- a/lib/WebGUI/Workflow/Cron.pm +++ b/lib/WebGUI/Workflow/Cron.pm @@ -225,6 +225,10 @@ The parameters to be passed into the constructor. Note that the system will alwa An integer between 1 and 3 that will represent what priority the workflow will run, 1 being highest and 3 being lowest. Defaults to 2. +=head4 title + +A human readable label. + =cut sub set { @@ -240,6 +244,7 @@ sub set { } elsif ($properties->{runOnce} == 0) { $self->{_data}{runOnce} = 0; } + $self->{_data}{title} = $properties->{title} || $self->{_data}{title} || "Untitled"; $self->{_data}{priority} = $properties->{priority} || $self->{_data}{priority} || 2; $self->{_data}{minuteOfHour} = $properties->{minuteOfHour} || $self->{_data}{minuteOfHour} || 0; $self->{_data}{hourOfDay} = $properties->{hourOfDay} || $self->{_data}{hourOfDay} || "*"; diff --git a/lib/WebGUI/i18n/English/Workflow_Cron.pm b/lib/WebGUI/i18n/English/Workflow_Cron.pm index f73cde6dd..d1ddf097e 100644 --- a/lib/WebGUI/i18n/English/Workflow_Cron.pm +++ b/lib/WebGUI/i18n/English/Workflow_Cron.pm @@ -73,14 +73,14 @@ our $I18N = { lastUpdated => 0, }, - 'enabled help' => { + 'is enabled help' => { message => q|If this is set to yes, then the workflow will be kicked off at the scheduled time.|, context => q|the hover help for the enabled field|, lastUpdated => 0, }, - 'enabled' => { - message => q|Enabled?|, + 'is enabled' => { + message => q|Is Enabled?|, context => q|Yes or no question asking the user if this cron job is enabled.|, lastUpdated => 0, }, @@ -139,6 +139,18 @@ our $I18N = { lastUpdated => 0, }, + 'enabled' => { + message => q|Enabled|, + context => q|A label to indicate that the cron job is ready to run.|, + lastUpdated => 0, + }, + + 'disabled' => { + message => q|Disabled|, + context => q|A label to indicate that the cron job is not ready to run.|, + lastUpdated => 0, + }, + 'topicName' => { message => q|Scheduler|, context => q|The title of the cron/scheduler interface.|,