diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index e0ef70216..85863b4d0 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -11,8 +11,9 @@ - removed random questions display from Survey Questions Edit template until that feature is added. - fixed #9115: WebGUI::ProfileField->formField doesn't always show the submitted value - - fixed: utf8 issues with Survey should be correct. JSON fields are now - longText instead of longBlob. + - fixed: utf8 issues with Survey should be correct. JSON fields are now longText instead of longBlob. + - fixed #9522: Time tracker does not display + 7.6.9 - fixed: ukplayer example is now loaded with swfobject.js released under the MIT licence, see gotcha's and /extras/ukplayer - fixed #9264: new slideShow.swf uploaded in extras/ukplayer (United Knowledge/Arjan Widlak) diff --git a/lib/WebGUI/Asset/Wobject/TimeTracking.pm b/lib/WebGUI/Asset/Wobject/TimeTracking.pm index b398a922d..3ca4482a3 100644 --- a/lib/WebGUI/Asset/Wobject/TimeTracking.pm +++ b/lib/WebGUI/Asset/Wobject/TimeTracking.pm @@ -832,20 +832,41 @@ sub _buildRow { -name=>"taskEntryId_$rowCount", -value=>$entryId }); - - #Entry Date + + ##Handle cases when a user has been removed from a project. The projectList + ##and taskList hash refs that have been passed in will not contain entries for + ##their old project info + + #Entry Task + tie my %taskHash, "Tie::IxHash"; + if ($projectId) { + if (! exists $projectList->{$projectId}) { + my $projectName = $db->quickScalar('select projectName from TT_projectList where projectId=?',[$projectId]); + $projectList->{$projectId} = $projectName; + } + if (! exists $taskList->{$projectId}) { + %taskHash = $db->buildHash("select taskId, taskName from TT_projectTasks where projectId=?",[$projectId]); + } + else { + %taskHash = %{$taskList->{$projectId}}; + } + #$eh->warn($projectId); + } my $chooseLabel = $i18n->get("Choose One"); + %taskHash = (""=>$chooseLabel,%taskHash); + + #Entry Date $var->{'entry.hours'} = $entry->{hours}; if($reportComplete) { $var->{'form.date'} = $entry->{taskDate}; $var->{'form.project'} = $projectList->{$projectId}; - my $taskHash = $taskList->{$projectId}; - $var->{'form.task'} = $taskHash->{$entry->{taskId}}; + $var->{'form.task'} = $taskHash{$entry->{taskId}}; $var->{'form.hours'} = $var->{'entry.hours'}; $var->{'form.comments'} = $entry->{comments}; - } else { + } + else { tie my %days, "Tie::IxHash"; %days = (""=>$chooseLabel, %{$daysInWeek}); $var->{'form.date'} = WebGUI::Form::selectBox($session,{ @@ -863,15 +884,7 @@ sub _buildRow { -value=>$projectId, -extras=>qq|onchange="changeOptions(this,document.getElementById('$taskId'));" class="pt-select"| }); - - #Entry Task - tie my %taskHash, "Tie::IxHash"; - %taskHash = (""=>$chooseLabel,%taskHash); - if($projectId) { - #$eh->warn($projectId); - %taskHash = %{$taskList->{$projectId}}; - } - + $var->{'form.task'} = WebGUI::Form::selectBox($session,{ -name=>$taskName, -options=>\%taskHash,