Update of /cvsroot/wtf-tracker/wtf/util
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22723/util
Modified Files:
weekly_status.pl
Log Message:
Addition of support for an Email Team View to Me button on the Team View page
Index: weekly_status.pl
===================================================================
RCS file: /cvsroot/wtf-tracker/wtf/util/weekly_status.pl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** weekly_status.pl 18 Oct 2006 16:52:50 -0000 1.1.1.1
--- weekly_status.pl 28 Nov 2006 21:58:37 -0000 1.2
***************
*** 44,57 ****
$dbh = WTF::DBH->connect();
! my $sth_managers = $dbh->prepare(q{
! SELECT e.id, e.username AS email, e.name AS employee, e.team_id
! FROM employee AS e
! INNER JOIN authz_employee AS ae ON e.id = ae.employee_id
! INNER JOIN authz AS a ON ae.authz_id = a.id
! WHERE a.name = 'weekly_status' AND e.team_id IS NOT NULL AND e.active = 1
! });
# get a date range for the most recent week
! my ( $date_start, $date_end ) = WTF::Utils::date_range( 0, 7 );
my $sender = Mail::Sender->new({
--- 44,66 ----
$dbh = WTF::DBH->connect();
! my $sth_managers = $dbh->prepare(
! q{
! SELECT e.id, e.username AS email, e.name AS employee, e.team_id
! FROM employee AS e
! INNER JOIN authz_employee AS ae ON e.id = ae.employee_id
! INNER JOIN authz AS a ON ae.authz_id = a.id
! } . (
! ($ARGV[3])
! ? q{ WHERE e.id = ? AND e.team_id IS NOT NULL AND e.active = 1 GROUP BY e.id }
! : q{ WHERE a.name = 'weekly_status' AND e.team_id IS NOT NULL AND e.active = 1 }
! )
! );
# get a date range for the most recent week
! my ( $date_start, $date_end ) = WTF::Utils::date_range(
! 0, 7,
! ($ARGV[1]) ? $ARGV[1] : undef,
! ($ARGV[2]) ? $ARGV[2] : undef,
! );
my $sender = Mail::Sender->new({
***************
*** 61,65 ****
});
! $sth_managers->execute();
while ( my $manager = $sth_managers->fetchrow_hashref() ) {
my $report = "WTF: Weekly Team Status Report\n";
--- 70,80 ----
});
! if ($ARGV[3]) {
! $sth_managers->execute( $ARGV[3] );
! }
! else {
! $sth_managers->execute();
! }
!
while ( my $manager = $sth_managers->fetchrow_hashref() ) {
my $report = "WTF: Weekly Team Status Report\n";
***************
*** 107,110 ****
--- 122,127 ----
for my $note ( @{ $employee->{'note_content'} } ) {
$report .= ' ' . $note->{'work_day'} . "\n";
+ $note->{'notes'} =~ s|<br\s*/>|\n|msg;
+ $note->{'notes'} =~ s| | |g;
$note->{'notes'} =~ s/\n/\n /msg;
$note->{'notes'} =~ s/[\s\r\n]+$//msg;
***************
*** 120,124 ****
'msg' => $report,
'subject' => "WTF Weekly Status Report: $date_start through $date_end",
! 'to' => ( $ARGV[0] and $ARGV[0] eq 'DEVEL' ) ? EMAIL_ADMIN : $manager->{'email'},
});
--- 137,141 ----
'msg' => $report,
'subject' => "WTF Weekly Status Report: $date_start through $date_end",
! 'to' => ( $ARGV[0] and $ARGV[0] eq 'DEVEL' and not $ARGV[3] ) ? EMAIL_ADMIN : $manager->{'email'},
});
|