[WTF CVS] wtf/lib/WTF/Pages Input.pm,1.7,1.8 Reports.pm,1.11,1.12
Brought to you by:
gryphonshafer
From: Gryphon S. <gry...@us...> - 2006-12-03 23:03:52
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Pages In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24976/lib/WTF/Pages Modified Files: Input.pm Reports.pm Log Message: Additional data exposure in the Activity Summary screen Index: Reports.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Reports.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Reports.pm 3 Dec 2006 00:42:09 -0000 1.11 --- Reports.pm 3 Dec 2006 23:03:43 -0000 1.12 *************** *** 331,337 **** ); ! $tmpl_obj->param( ! 'activity_months' => $activity_months, ! 'activities' => WTF::Utils::indent( $sth->{'activities'}->fetchall_arrayref({}), 'parent_id', --- 331,338 ---- ); ! if ( exists $activity_months->[0]{'datestamp'} ) { ! my @alloc_days; ! ! my $activities = WTF::Utils::indent( $sth->{'activities'}->fetchall_arrayref({}), 'parent_id', *************** *** 357,363 **** $row->{'average'} = int( $row->{'average'} * 100 ) / 100; $row->{'alloc'} = int( $row->{'employees'} * $row->{'days'} * $row->{'average'} ) / 100; }, ! ), ! ) if ( exists $activity_months->[0]{'datestamp'} ); return $tmpl_obj->output(); --- 358,393 ---- $row->{'average'} = int( $row->{'average'} * 100 ) / 100; $row->{'alloc'} = int( $row->{'employees'} * $row->{'days'} * $row->{'average'} ) / 100; + + push @alloc_days, $row->{'alloc'}; }, ! ); ! ! my $total_alloc_days; ! $total_alloc_days += $_ for (@alloc_days); ! my $avg_alloc_days = int( @alloc_days / $total_alloc_days * 100 ) / 100; ! ! $sth->{'activity_summary_totals'}->execute( $month . '-01', $month . '-01' ) or die $dbh->errstr(); ! my ( $total_emp, $total_emp_days, $total_avg ) = $sth->{'activity_summary_totals'}->fetchrow_array(); ! $sth->{'activity_summary_totals'}->finish(); ! ! $sth->{'activity_summary_vacation_sick'}->execute( $month . '-01', $month . '-01' ) ! or die $dbh->errstr(); ! my ( $vacation, $sick ) = $sth->{'activity_summary_vacation_sick'}->fetchrow_array(); ! $sth->{'activity_summary_vacation_sick'}->finish(); ! ! $tmpl_obj->param( ! 'activity_months' => $activity_months, ! 'total_emp' => $total_emp, ! 'total_emp_days' => $total_emp_days, ! 'total_avg' => $total_avg, ! 'total_alloc_days' => $total_alloc_days, ! 'vacation' => $vacation, ! 'sick' => $sick, ! 'activities' => [ map { ! $_->{'alloc_percent'} = int( $_->{'alloc'} / $total_alloc_days * 100 ); ! $_; ! } @{$activities} ], ! ); ! } return $tmpl_obj->output(); Index: Input.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Input.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Input.pm 2 Dec 2006 00:25:46 -0000 1.7 --- Input.pm 3 Dec 2006 23:03:43 -0000 1.8 *************** *** 219,223 **** # build a simple data structure with the activity parameter data my @activity_input = ! map { [ substr( $_, 9 ), $req->param($_) ] } grep { substr( $_, 0, 9 ) eq 'activity_' } keys %{ $req->param() }; --- 219,224 ---- # build a simple data structure with the activity parameter data my @activity_input = ! grep { $_->[1] > 0 } ! map { [ substr( $_, 9 ), $req->param($_) || 0 ] } grep { substr( $_, 0, 9 ) eq 'activity_' } keys %{ $req->param() }; |