[WTF CVS] wtf/lib/WTF/Pages Reports.pm,1.10,1.11
Brought to you by:
gryphonshafer
From: Gryphon S. <gry...@us...> - 2006-12-03 00:42:13
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Pages In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28396/lib/WTF/Pages Modified Files: Reports.pm Log Message: Added Activity Summary recording to show up in the Team View summary table so that managers can nag subordinates when they don't enter Activity Summary data. (I'm a bad, bad man.) Index: Reports.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Reports.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Reports.pm 3 Dec 2006 00:06:29 -0000 1.10 --- Reports.pm 3 Dec 2006 00:42:09 -0000 1.11 *************** *** 125,132 **** DISTINCT IF ( n.work_day BETWEEN ? AND ?, n.work_day, NULL ) ORDER BY n.work_day SEPARATOR "|" ! ) AS note_work_days FROM employee AS e LEFT OUTER JOIN work AS w ON e.id = w.employee_id LEFT OUTER JOIN notes AS n ON e.id = n.employee_id WHERE e.team_id IN ( } . join( ',', @{$summary_team_ids} ) . q{ ) AND e.active = 1 GROUP BY e.id --- 125,137 ---- DISTINCT IF ( n.work_day BETWEEN ? AND ?, n.work_day, NULL ) ORDER BY n.work_day SEPARATOR "|" ! ) AS note_work_days, ! GROUP_CONCAT( ! DISTINCT IF ( s.work_day BETWEEN ? AND ?, s.work_day, NULL ) ! ORDER BY s.work_day SEPARATOR "|" ! ) AS summary_work_days FROM employee AS e LEFT OUTER JOIN work AS w ON e.id = w.employee_id LEFT OUTER JOIN notes AS n ON e.id = n.employee_id + LEFT OUTER JOIN summary AS s ON e.id = s.employee_id WHERE e.team_id IN ( } . join( ',', @{$summary_team_ids} ) . q{ ) AND e.active = 1 GROUP BY e.id *************** *** 136,139 **** --- 141,145 ---- $date_start, $date_end, $date_start, $date_end, + $date_start, $date_end, ) or die $dbh->errstr(); *************** *** 162,176 **** # result is a template-ready data structure, booleans for work and notes my $team_summary = [ map { ! my ( $work, $notes ) = ( $_->{'work_work_days'} || '', $_->{'note_work_days'} || '' ); $_->{'days'} = [ map { ! my $work_b = ( index( $work, $_->{'date'} ) > -1 ) ? 1 : 0; ! my $notes_b = ( index( $notes, $_->{'date'} ) > -1 ) ? 1 : 0; { 'work' => $work_b, 'notes' => $notes_b, 'weekend' => $_->{'weekend'}, ! 'empty' => ( not ( $work_b or $notes_b or $_->{'weekend'} ) ) ? 1 : 0, } } @dates --- 168,193 ---- # result is a template-ready data structure, booleans for work and notes my $team_summary = [ map { ! my ( $work, $notes, $summary ) = ( ! $_->{'work_work_days'} || '', ! $_->{'note_work_days'} || '', ! $_->{'summary_work_days'} || '', ! ); $_->{'days'} = [ map { ! my $date = $_->{'date'}; ! my ( $work_b, $notes_b, $summary_b ) = map { ! ( index( $_, $date ) > -1 ) ? 1 : 0 ! } ( $work, $notes, $summary ); ! ! #my $work_b = ( index( $work, $_->{'date'} ) > -1 ) ? 1 : 0; ! #my $notes_b = ( index( $notes, $_->{'date'} ) > -1 ) ? 1 : 0; ! #my $summary_b = ( index( $summary, $_->{'date'} ) > -1 ) ? 1 : 0; { 'work' => $work_b, 'notes' => $notes_b, + 'summary' => $summary_b, 'weekend' => $_->{'weekend'}, ! 'empty' => ( not ( $work_b or $notes_b or $summary_b or $_->{'weekend'} ) ) ? 1 : 0, } } @dates |