From 8c0a4fe0e8780ea319deadf36ac423d4ff66618c Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sat, 13 May 2006 05:09:52 +0000 Subject: [PATCH] indenting and help for edit task template variables --- lib/WebGUI/Asset/Wobject/ProjectManager.pm | 126 +++++++++--------- lib/WebGUI/Help/Asset_ProjectManager.pm | 12 ++ .../i18n/English/Asset_ProjectManager.pm | 64 ++++++++- 3 files changed, 134 insertions(+), 68 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/ProjectManager.pm b/lib/WebGUI/Asset/Wobject/ProjectManager.pm index 077ee2560..a2ee7b8e8 100644 --- a/lib/WebGUI/Asset/Wobject/ProjectManager.pm +++ b/lib/WebGUI/Asset/Wobject/ProjectManager.pm @@ -830,61 +830,60 @@ sub www_viewProject { my $origDepFieldId = $origDepField."_formId"; my $origEndField = "orig_end_$id"; my $origEndFieldId = $origEndField."_formId"; - + $hash->{'task.start'} = WebGUI::Form::text($session,{ - -name=>"start_$id", - -value=>$startDate, - -size=>"10", - -maxlength=>"10", - -extras=>qq|onfocus="doCalendar(this.id);" class="taskdate" onblur="adjustTaskTimeFromDate(this,document.getElementById('$endId'),document.getElementById('$durId'),this,false,document.getElementById('$predId'),document.getElementById('$origStartFieldId'),document.getElementById('$origEndFieldId'),$seq);"| - }); - + -name=>"start_$id", + -value=>$startDate, + -size=>"10", + -maxlength=>"10", + -extras=>qq|onfocus="doCalendar(this.id);" class="taskdate" onblur="adjustTaskTimeFromDate(this,document.getElementById('$endId'),document.getElementById('$durId'),this,false,document.getElementById('$predId'),document.getElementById('$origStartFieldId'),document.getElementById('$origEndFieldId'),$seq);"| + }); + $hash->{'task.start'} .= WebGUI::Form::hidden($session,{ - -name=>$origStartField, - -value=>$startDate, - -extras=>qq|id="$origStartFieldId"| - }); - - + -name=>$origStartField, + -value=>$startDate, + -extras=>qq|id="$origStartFieldId"| + }); + $hash->{'task.dependants'} = WebGUI::Form::integer($session,{ - -name=>"dependants_$id", - -value=>$row->{dependants} || "", - -defaultValue=>"", - -extras=>qq|class="taskdependant" onchange="validateDependant(this,document.getElementById('$origDepFieldId'),'$seq',document.getElementById('$startId'),document.getElementById('$endId'),document.getElementById('$durId'),false,document.getElementById('$origStartFieldId'),document.getElementById('$origEndFieldId'));"| - }); + -name=>"dependants_$id", + -value=>$row->{dependants} || "", + -defaultValue=>"", + -extras=>qq|class="taskdependant" onchange="validateDependant(this,document.getElementById('$origDepFieldId'),'$seq',document.getElementById('$startId'),document.getElementById('$endId'),document.getElementById('$durId'),false,document.getElementById('$origStartFieldId'),document.getElementById('$origEndFieldId'));"| + }); $hash->{'task.dependants'} .= WebGUI::Form::hidden($session,{ - -name=>$origDepField, - -value=>$row->{dependants}, - -extras=>qq|id="$origDepFieldId"| - }); - + -name=>$origDepField, + -value=>$row->{dependants}, + -extras=>qq|id="$origDepFieldId"| + }); + $hash->{'task.end'} = WebGUI::Form::text($session,{ - -name=>"end_$id", - -value=>$endDate, - -size=>"10", - -maxlength=>"10", - -extras=>qq|class="taskdate" onfocus="doCalendar(this.id);" onblur="adjustTaskTimeFromDate(document.getElementById('$startId'),this,document.getElementById('$durId'),this,false,document.getElementById('$predId'),document.getElementById('$origStartFieldId'),document.getElementById('$origEndFieldId'),$seq);"| - }); - + -name=>"end_$id", + -value=>$endDate, + -size=>"10", + -maxlength=>"10", + -extras=>qq|class="taskdate" onfocus="doCalendar(this.id);" onblur="adjustTaskTimeFromDate(document.getElementById('$startId'),this,document.getElementById('$durId'),this,false,document.getElementById('$predId'),document.getElementById('$origStartFieldId'),document.getElementById('$origEndFieldId'),$seq);"| + }); + $hash->{'task.end'} .= WebGUI::Form::hidden($session,{ - -name=>$origEndField, - -value=>$endDate, - -extras=>qq|id="$origEndFieldId"| - }); + -name=>$origEndField, + -value=>$endDate, + -extras=>qq|id="$origEndFieldId"| + }); #Don't display uneditable fields if the task is a milestone. if($isMilestone) { - $hash->{'task.duration'} = $row->{duration}; + $hash->{'task.duration'} = $row->{duration}; $hash->{'task.duration'} .= WebGUI::Form::hidden($session,{ - -name=>"duration_$id", - -value=>$duration, - -extras=>qq|id="$durId"| - }); + -name=>"duration_$id", + -value=>$duration, + -extras=>qq|id="$durId"| + }); } else { $hash->{'task.duration'} = WebGUI::Form::float($session,{ - -name=>"duration_$id", - -value=>$duration, - -extras=>qq|class="taskduration" onchange="adjustTaskTimeFromDuration(document.getElementById('$startId'),document.getElementById('$endId'),this,false,document.getElementById('$predId'),document.getElementById('$origStartFieldId'),document.getElementById('$origEndFieldId'),$seq);" | - }); + -name=>"duration_$id", + -value=>$duration, + -extras=>qq|class="taskduration" onchange="adjustTaskTimeFromDuration(document.getElementById('$startId'),document.getElementById('$endId'),this,false,document.getElementById('$predId'),document.getElementById('$origStartFieldId'),document.getElementById('$origEndFieldId'),$seq);" | + }); } } else { @@ -910,28 +909,27 @@ sub www_viewProject { if($canEdit) { #Build Form for submitting on the fly updates $var->{'form.header'} = WebGUI::Form::formHeader($session,{ - action=>$self->getUrl, - extras=>q|name="editAll"| - }); + action=>$self->getUrl, + extras=>q|name="editAll"| + }); $var->{'form.header'} .= WebGUI::Form::hidden($session, { - -name=>"func", - -value=>"saveExistingTasks" - }); + -name=>"func", + -value=>"saveExistingTasks" + }); $var->{'form.header'} .= WebGUI::Form::hidden($session, { - -name=>"projectId", - -value=>$projectId - }); - $var->{'form.footer'} = WebGUI::Form::formFooter($session); - $var->{'project.canEdit'} = "true"; - $var->{'task.resources.label'} = $i18n->get("task resources label"); - $var->{'task.resources.url'} = $self->getUrl("func=manageResources"); - + -name=>"projectId", + -value=>$projectId + }); + $var->{'form.footer'} = WebGUI::Form::formFooter($session); + $var->{'project.canEdit'} = "true"; + $var->{'task.resources.label'} = $i18n->get("task resources label"); + $var->{'task.resources.url'} = $self->getUrl("func=manageResources"); } if($canAddTask) { - $var->{'task.add.label'} = $i18n->get("add task label"); - $var->{'task.add.url'} = $self->getUrl("func=editTask;projectId=$projectId;taskId=new"); - $var->{'task.canAdd'} = "true"; + $var->{'task.add.label'} = $i18n->get("add task label"); + $var->{'task.add.url'} = $self->getUrl("func=editTask;projectId=$projectId;taskId=new"); + $var->{'task.canAdd'} = "true"; } @@ -950,9 +948,9 @@ sub www_viewProject { sub www_drawGanttChart { my $self = shift; my $var = {}; - #Set Method Helpers - my ($session,$privilege,$form,$db,$dt,$i18n,$user) = $self->setSessionVars; - my $config = $session->config; + #Set Method Helpers + my ($session,$privilege,$form,$db,$dt,$i18n,$user) = $self->setSessionVars; + my $config = $session->config; my $style = $session->style; my $eh = $session->errorHandler; diff --git a/lib/WebGUI/Help/Asset_ProjectManager.pm b/lib/WebGUI/Help/Asset_ProjectManager.pm index c3af6e04c..f73b574bf 100644 --- a/lib/WebGUI/Help/Asset_ProjectManager.pm +++ b/lib/WebGUI/Help/Asset_ProjectManager.pm @@ -89,6 +89,18 @@ our $HELP = { ], }, + 'task edit template' => { + title => 'edit task template vars title', + body => 'edit task template vars body', + fields => [ ], + related => [ + { + tag => 'project manager add/edit', + namespace => 'Asset_ProjectManager', + }, + ], + }, + }; 1; ##All perl modules must return true diff --git a/lib/WebGUI/i18n/English/Asset_ProjectManager.pm b/lib/WebGUI/i18n/English/Asset_ProjectManager.pm index 0db395c22..9c38deea3 100644 --- a/lib/WebGUI/i18n/English/Asset_ProjectManager.pm +++ b/lib/WebGUI/i18n/English/Asset_ProjectManager.pm @@ -356,13 +356,69 @@ our $I18N = { lastUpdated => 0 }, - '' => { - message => q||, + 'edit task template vars title' => { + message => q|Edit Task Template Variables|, lastUpdated => 0 }, - '' => { - message => q||, + 'edit task template vars body' => { + message => q|

The Edit Task template has these template variables

+

! : This variable is required for the Data Form to function correctly.

+ +

form.header !
+Code to setup the Edit Task form. Leaving out this variable will prevent the form +from working. +

+ +

form.name !
+Form element for the user to enter/edit the name of the task. +

+ +

form.duration !
+Form element for the duration of the task. +

+ +

form.duration.units !
+Form element for the units of duration for the task. +

+ +

form.start !
+Form element for the starting date for the task. +

+ +

form.end !
+Form element for the ending date for the task. +

+ +

form.dependants !
+Form element for something I really don't understand. +

+ +

form.resource !
+Form element for selecting a user to accomplish this task. +

+ +

form.milestone !
+Form element for setting this task to be a milestone in the project. +

+ +

form.percentComplete !
+Form element for entering in how much of the project has been completed, as a percentage. +

+ +

form.save !
+A button to save data entered into the form. +

+ +

form.footer !
+Code to end the form. +

+ +

extras !
+The URL to the Extras directory. +

+ +|, lastUpdated => 0 },