wtf-tracker-cvs Mailing List for Work Tracking Facilitator (Page 4)
Brought to you by:
gryphonshafer
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(8) |
Nov
(33) |
Dec
(50) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(17) |
Feb
|
Mar
(19) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Gryphon S. <gry...@us...> - 2006-12-02 22:29:17
|
Update of /cvsroot/wtf-tracker/wtf/db In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8298 Removed Files: add.sql Log Message: Removing the old style SQL update/alter files in favor of a single, clean create file --- add.sql DELETED --- |
From: Gryphon S. <gry...@us...> - 2006-12-02 22:28:43
|
Update of /cvsroot/wtf-tracker/wtf/db In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv7941 Removed Files: next_rel_001.sql next_rel_002.sql next_rel_003.sql next_rel_004.sql Log Message: Removing the old style SQL update/alter files in favor of a single, clean create file --- next_rel_004.sql DELETED --- --- next_rel_002.sql DELETED --- --- next_rel_003.sql DELETED --- --- next_rel_001.sql DELETED --- |
From: Gryphon S. <gry...@us...> - 2006-12-02 00:25:49
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Pages In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv13271/lib/WTF/Pages Modified Files: Input.pm Log Message: Added an if conditional to avoid getting a scalar undef warning Index: Input.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Input.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Input.pm 2 Dec 2006 00:09:09 -0000 1.6 --- Input.pm 2 Dec 2006 00:25:46 -0000 1.7 *************** *** 133,137 **** $sick = $_->[1]; ! $activity_data{ $_->[2] } = $_->[3]; } $sth->{'activity_data'}->finish(); --- 133,137 ---- $sick = $_->[1]; ! $activity_data{ $_->[2] } = $_->[3] if ( $_->[2] ); } $sth->{'activity_data'}->finish(); |
From: Gryphon S. <gry...@us...> - 2006-12-02 00:09:14
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6361/lib/WTF Modified Files: Config.pm Data.pm Pages.pm SQL.pm Utils.pm Log Message: Random bits of changes here and there, mostly code clean-up but a few bits of refactoring (globally) based on a code review in prep for v1.02 build and release Index: SQL.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/SQL.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SQL.pm 28 Nov 2006 18:47:50 -0000 1.7 --- SQL.pm 2 Dec 2006 00:09:09 -0000 1.8 *************** *** 1,4 **** package WTF::SQL; ! our $VERSION = 1.01; use strict; use warnings; --- 1,4 ---- package WTF::SQL; ! our $VERSION = 1.02; use strict; use warnings; *************** *** 34,38 **** SELECT a.id AS authz_id, ! IF(ae.authz_id IS NULL, 0, 1) AS has_authz FROM authz AS a LEFT OUTER JOIN authz_employee AS ae --- 34,38 ---- SELECT a.id AS authz_id, ! IF( ae.authz_id IS NULL, 0, 1 ) AS has_authz FROM authz AS a LEFT OUTER JOIN authz_employee AS ae *************** *** 43,47 **** 'authz_ins' => q{ ! INSERT INTO authz_employee (employee_id, authz_id) VALUES (?, ?) }, --- 43,47 ---- 'authz_ins' => q{ ! INSERT INTO authz_employee ( employee_id, authz_id ) VALUES ( ?, ? ) }, *************** *** 102,106 **** SELECT work_day AS date, content AS notes, ! DATE_FORMAT(work_day, "%W, %M %e, %Y") AS work_day FROM notes WHERE employee_id = ? AND work_day BETWEEN ? AND ? --- 102,106 ---- SELECT work_day AS date, content AS notes, ! DATE_FORMAT( work_day, "%W, %M %e, %Y" ) AS work_day FROM notes WHERE employee_id = ? AND work_day BETWEEN ? AND ? *************** *** 109,113 **** 'notes_insup' => q{ ! INSERT INTO notes (employee_id, work_day, content) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE employee_id = ?, work_day = ?, content = ? }, --- 109,113 ---- 'notes_insup' => q{ ! INSERT INTO notes ( employee_id, work_day, content ) VALUES ( ?, ?, ? ) ON DUPLICATE KEY UPDATE employee_id = ?, work_day = ?, content = ? }, *************** *** 130,134 **** w.work_day, IF( c.name IS NULL AND w.hours IS NOT NULL, 'Non-Project Task', c.name ) AS codeline, ! IF( p.name IS NULL AND w.hours IS NOT NULL, t.name, CONCAT( p.name, ' (', t.name, ')' ) ) AS project, IF( p.bug IS NULL AND w.hours IS NOT NULL, 'NPT', p.bug ) AS bug, w.hours --- 130,138 ---- w.work_day, IF( c.name IS NULL AND w.hours IS NOT NULL, 'Non-Project Task', c.name ) AS codeline, ! IF( ! p.name IS NULL AND w.hours IS NOT NULL, ! t.name, ! CONCAT( p.name, ' (', t.name, ')' ) ! ) AS project, IF( p.bug IS NULL AND w.hours IS NOT NULL, 'NPT', p.bug ) AS bug, w.hours *************** *** 136,140 **** LEFT JOIN work AS w ON e.id = w.employee_id AND ! (w.work_day IS NULL OR w.work_day BETWEEN ? AND ?) LEFT JOIN project AS p ON w.project_id = p.id LEFT JOIN task AS t ON w.task_id = t.id --- 140,144 ---- LEFT JOIN work AS w ON e.id = w.employee_id AND ! ( w.work_day IS NULL OR w.work_day BETWEEN ? AND ? ) LEFT JOIN project AS p ON w.project_id = p.id LEFT JOIN task AS t ON w.task_id = t.id *************** *** 177,182 **** 'work_insup' => q{ ! INSERT INTO work (employee_id, work_day, project_id, task_id, hours, entered) ! VALUES (?, ?, ?, ?, ?, NOW()) ON DUPLICATE KEY UPDATE employee_id = ?, work_day = ?, project_id = ?, task_id = ?, hours = ?, entered = NOW() --- 181,186 ---- 'work_insup' => q{ ! INSERT INTO work ( employee_id, work_day, project_id, task_id, hours, entered ) ! VALUES ( ?, ?, ?, ?, ?, NOW() ) ON DUPLICATE KEY UPDATE employee_id = ?, work_day = ?, project_id = ?, task_id = ?, hours = ?, entered = NOW() *************** *** 201,205 **** p.id, p.name AS project, p.bug, COUNT(w.id) AS work_count, SUM(w.hours) AS hours_sum, ! COUNT(DISTINCT w.employee_id) AS employees_count, MIN(w.work_day) AS min_work_day, MAX(w.work_day) AS max_work_day FROM codeline AS c --- 205,209 ---- p.id, p.name AS project, p.bug, COUNT(w.id) AS work_count, SUM(w.hours) AS hours_sum, ! COUNT( DISTINCT w.employee_id ) AS employees_count, MIN(w.work_day) AS min_work_day, MAX(w.work_day) AS max_work_day FROM codeline AS c *************** *** 240,244 **** SELECT t.name AS task, SUM(w.hours) AS hours, ! COUNT(DISTINCT w.employee_id) AS employees, COUNT(w.id) AS entries FROM work AS w --- 244,248 ---- SELECT t.name AS task, SUM(w.hours) AS hours, ! COUNT( DISTINCT w.employee_id ) AS employees, COUNT(w.id) AS entries FROM work AS w *************** *** 369,373 **** =head1 VERSION ! This document describes WTF::SQL version 1.01 =head1 SYNOPSIS --- 373,377 ---- =head1 VERSION ! This document describes WTF::SQL version 1.02 =head1 SYNOPSIS Index: Pages.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Pages.pm 20 Nov 2006 02:53:07 -0000 1.4 --- Pages.pm 2 Dec 2006 00:09:09 -0000 1.5 *************** *** 1,4 **** package WTF::Pages; ! our $VERSION = 1.01; use strict; use warnings; --- 1,4 ---- package WTF::Pages; ! our $VERSION = 1.02; use strict; use warnings; *************** *** 21,45 **** # the subclass to handle page generation DISPATCH_TABLE => { ! '/input' => [ 'Input', 'screen_input' ], ! '/input/projects' => [ 'Input', 'screen_input_projects' ], ! '/input/tasks' => [ 'Input', 'screen_input_tasks' ], ! '/input/tracking' => [ 'Input', 'screen_input_tracking' ], ! '/input/timesheet' => [ 'Input', 'action_input_save_timesheet' ], ! '/reports/myweekly' => [ 'Reports', 'screen_reports_myweekly' ], ! '/reports/team' => [ 'Reports', 'screen_reports_team_view' ], ! '/reports/projects' => [ 'Reports', 'screen_reports_projects_list' ], ! '/reports/project' => [ 'Reports', 'screen_reports_project_view' ], ! '/reports/activity' => [ 'Reports', 'screen_activity_summary' ], ! '/admin/authz' => [ 'Admin', 'screen_admin_authz' ], ! '/admin/newauthzs' => [ 'Admin', 'action_admin_save_new_authzs' ], ! '/admin/update' => [ 'Admin', 'action_admin_update' ], ! '/admin/users' => [ 'Admin', 'screen_admin_users' ], ! '/admin/saveusers' => [ 'Admin', 'action_admin_save_users' ], ! '/admin/taskarea' => [ 'Admin', 'screen_admin_task_area' ], ! '/admin/savetarea' => [ 'Admin', 'action_admin_save_task_area' ], ! '/admin/loginas' => [ 'Admin', 'action_login_as' ], ! '/admin/revert' => [ 'Admin', 'action_revert_to_self' ], ! '/admin/tables' => [ 'Admin', 'screen_table_data' ], ! '/admin/tablesave' => [ 'Admin', 'action_save_table_data' ], }, }; --- 21,45 ---- # the subclass to handle page generation DISPATCH_TABLE => { ! '/input' => [ 'Input', 'screen_input' ], ! '/input/projects' => [ 'Input', 'screen_projects' ], ! '/input/tasks' => [ 'Input', 'screen_tasks' ], ! '/input/tracking' => [ 'Input', 'screen_tracking' ], ! '/input/timesheet' => [ 'Input', 'action_save_timesheet' ], ! '/reports/myweekly' => [ 'Reports', 'screen_myweekly' ], ! '/reports/team' => [ 'Reports', 'screen_team_view' ], ! '/reports/projects' => [ 'Reports', 'screen_projects_list' ], ! '/reports/project' => [ 'Reports', 'screen_project_view' ], ! '/reports/activity' => [ 'Reports', 'screen_activity_summary' ], ! '/admin/authz' => [ 'Admin', 'screen_authz' ], ! '/admin/newauthzs' => [ 'Admin', 'action_save_new_authzs' ], ! '/admin/update' => [ 'Admin', 'action_update' ], ! '/admin/users' => [ 'Admin', 'screen_users' ], ! '/admin/saveusers' => [ 'Admin', 'action_save_users' ], ! '/admin/taskarea' => [ 'Admin', 'screen_task_area' ], ! '/admin/savetarea' => [ 'Admin', 'action_save_task_area' ], ! '/admin/loginas' => [ 'Admin', 'action_login_as' ], ! '/admin/revert' => [ 'Admin', 'action_revert_to_self' ], ! '/admin/tables' => [ 'Admin', 'screen_table_data' ], ! '/admin/tablesave' => [ 'Admin', 'action_save_table_data' ], }, }; *************** *** 90,94 **** =head1 VERSION ! This document describes WTF::Pages version 1.01 =head1 SYNOPSIS --- 90,94 ---- =head1 VERSION ! This document describes WTF::Pages version 1.02 =head1 SYNOPSIS Index: Data.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Data.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Data.pm 27 Oct 2006 22:34:51 -0000 1.3 --- Data.pm 2 Dec 2006 00:09:09 -0000 1.4 *************** *** 120,124 **** =head1 VERSION ! This document describes WTF::Data version 1.01 =head1 SYNOPSIS --- 120,124 ---- =head1 VERSION ! This document describes WTF::Data version 1.02 =head1 SYNOPSIS *************** *** 263,271 **** =back - =head1 KNOWN ISSUES - - There have been occational problems with notes not displaying correctly. These - bugs have been fixed and verified, but there may be some left to be discovered. - =head1 COPYRIGHT, LICENSE, AND DISCLAIMER OF WARRANTY --- 263,266 ---- Index: Config.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Config.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Config.pm 28 Nov 2006 18:54:13 -0000 1.2 --- Config.pm 2 Dec 2006 00:09:09 -0000 1.3 *************** *** 1,4 **** package WTF::Config; ! our $VERSION = 1.01; use strict; use warnings; --- 1,4 ---- package WTF::Config; ! our $VERSION = 1.02; use strict; use warnings; *************** *** 72,76 **** 'email' => { 'wtf' => 'wt...@ex...', ! 'admin' => 'gsh...@ex...', 'server' => 'mail.example.com', }, --- 72,76 ---- 'email' => { 'wtf' => 'wt...@ex...', ! 'admin' => 'ad...@ex...', 'server' => 'mail.example.com', }, *************** *** 95,99 **** =head1 VERSION ! This document describes WTF::Config version 1.01 =head1 SYNOPSIS --- 95,99 ---- =head1 VERSION ! This document describes WTF::Config version 1.02 =head1 SYNOPSIS *************** *** 137,144 **** =back - =head1 KNOWN ISSUES - - No bugs have been reported. - =head1 COPYRIGHT, LICENSE, AND DISCLAIMER OF WARRANTY --- 137,140 ---- Index: Utils.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Utils.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Utils.pm 27 Oct 2006 22:34:51 -0000 1.3 --- Utils.pm 2 Dec 2006 00:09:09 -0000 1.4 *************** *** 224,227 **** --- 224,281 ---- } + sub indent { + my ( $table_data, $indent_key, $function ) = @_; + return $table_data if ( not $indent_key ); + my ( $indent, @rows, @last_ids, @seen_ids ) = ( 0 ); + + for ( @{$table_data} ) { + push @seen_ids, $_->{'id'} || 0; + my $id = $_->{$indent_key}; + + # if there's no indent key, then the item should have no intent + if ( not $_->{$indent_key} or not grep { $_ == $id } @seen_ids ) { + $indent = 0; + @last_ids = (); + } + + # increment the items indent if the indent key is not the same + # as the previous parent_id + elsif ( + @rows and + $_->{$indent_key} != ( $last_ids[-1] || -1 ) + ) { + + # this id is in the id stack, so decrement indent and + # pop ids off the stack until a match or at empty + if ( grep { $_ == $id } @last_ids ) { + do { + $indent--; + pop @last_ids; + } while ( $last_ids[-1] ne $id and @last_ids ); + } + + # this is an id that's not in the stack, so increment indent + # and push the id onto the stack + else { + $indent++; + push @last_ids, $_->{$indent_key}; + } + } + $_->{'indent'} = $indent; + + # "group" denotes that the item is unselectable by the user, that the + # item is a group name, not a task name + $rows[-1]->{'group'} = 1 if ( + @rows and defined $_->{$indent_key} and + $_->{$indent_key} == ( $rows[-1]->{'id'} || -1 ) + ); + + $function->($_) if ( $function and ref($function) eq 'CODE' ); + push @rows, $_; + } + + return \@rows; + } + 1; __END__ *************** *** 263,266 **** --- 317,326 ---- ); + my @indented_data = @{ WTF::Utils::indent( + $sth->{'data'}->fetchall_arrayref({}), + 'parent_id', + \&function, + ); + =head1 DESCRIPTION *************** *** 573,576 **** --- 633,670 ---- any HTML markup in the note content. + =head2 indent() + + This function requires a reference to a data structure similar to what would + be returned from a "$sth->fetchall_arrayref({})" call. It also requires a + "indent key" (a column within each row that is typically a foreign key to + the primary key of the same table). + + my @indented_data = @{ WTF::Utils::indent( + $sth->{'data'}->fetchall_arrayref({}), + 'parent_id', + ); + + The function returns a reference to an array that is structurally similar to + the "$sth->fetchall_arrayref({})" input, but each row will contain an + additional key called "indent" that will contain an integer starting at 0 + indicating how many indent levels at which the particular row should be + displayed. Each row may also contain a "group" key containing a boolean that + indicates whether the row is a group, meaning that it has items "below" it + that are children. + + The function will optionally take a third argument, which is a reference to + a function that will run against each row on that row's data after the + indent level is assigned. The anonymous function will get passed a reference + to the row of data (a reference to a hash). + + my @indented_data = @{ WTF::Utils::indent( + $sth->{'data'}->fetchall_arrayref({}), + 'parent_id', + sub { + my ($row) = @_; + $row->{'indent_plus_five'} = $row->{'indent'} + 5; + }, + ); + =head1 DEPENDENCIES |
From: Gryphon S. <gry...@us...> - 2006-12-02 00:09:14
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Pages In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6361/lib/WTF/Pages Modified Files: Admin.pm Input.pm Reports.pm Log Message: Random bits of changes here and there, mostly code clean-up but a few bits of refactoring (globally) based on a code review in prep for v1.02 build and release Index: Reports.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Reports.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Reports.pm 28 Nov 2006 21:58:37 -0000 1.8 --- Reports.pm 2 Dec 2006 00:09:09 -0000 1.9 *************** *** 1,8 **** package WTF::Pages::Reports; ! our $VERSION = 1.01; use strict; use warnings; use base 'WTF::Pages'; ! use Apache2::Const; use Spreadsheet::WriteExcel; use Time::Local 'timelocal'; --- 1,8 ---- package WTF::Pages::Reports; ! our $VERSION = 1.02; use strict; use warnings; use base 'WTF::Pages'; ! use Apache2::Const -compile => 'REDIRECT'; use Spreadsheet::WriteExcel; use Time::Local 'timelocal'; *************** *** 22,26 **** my $sth = WTF::SQL->sth(); ! sub screen_reports_myweekly { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); --- 22,26 ---- my $sth = WTF::SQL->sth(); ! sub screen_myweekly { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); *************** *** 43,47 **** } ! sub screen_reports_team_view { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); --- 43,47 ---- } ! sub screen_team_view { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); *************** *** 76,79 **** --- 76,85 ---- ); } + + # explicitly return nothing here because xls_team_view_build() + # calls WTF::Utils::make_excel_workbook() which in turn writes + # the Excel binary output directly to where it needs to go; given + # that we don't need to re-render the current web page, we should + # stop immediately after this line return; } *************** *** 142,146 **** } ( $date_start, $date_end ); ! # for each day inclusively between the start and end stamps... my @dates; for ( my $time = $date_start_stamp; $time < $date_end_stamp + 86_400; $time += 86_400 ) { --- 148,152 ---- } ( $date_start, $date_end ); ! # for each day inclusively between the start and end stamps... (86_400 = 1 day) my @dates; for ( my $time = $date_start_stamp; $time < $date_end_stamp + 86_400; $time += 86_400 ) { *************** *** 160,165 **** $_->{'days'} = [ map { ! my $work_b = ( $work =~ /$_->{'date'}/ ) ? 1 : 0; ! my $notes_b = ( $notes =~ /$_->{'date'}/ ) ? 1 : 0; { 'work' => $work_b, --- 166,171 ---- $_->{'days'} = [ map { ! my $work_b = ( index( $work, $_->{'date'} ) > -1 ) ? 1 : 0; ! my $notes_b = ( index( $notes, $_->{'date'} ) > -1 ) ? 1 : 0; { 'work' => $work_b, *************** *** 177,183 **** my $team_summary_dates = [ map { $_->{'date'} =~ s/^\d{4}-//; $_ } @dates ]; ! # trim summary data if the range is too big for nice display my $summary_truncated = 0; ! if ( @{ $team_summary_dates } > 14 ) { splice( @{$team_summary_dates}, 0, @{$team_summary_dates} - 14 ); splice( @{ $_->{'days'} }, 0, @{ $_->{'days'} } - 14 ) for ( @{$team_summary} ); --- 183,189 ---- my $team_summary_dates = [ map { $_->{'date'} =~ s/^\d{4}-//; $_ } @dates ]; ! # trim summary data if the range is too big (longer than 2 weeks) for nice display my $summary_truncated = 0; ! if ( @{ $team_summary_dates } > 14 ) { # 14 days = 2 weeks splice( @{$team_summary_dates}, 0, @{$team_summary_dates} - 14 ); splice( @{ $_->{'days'} }, 0, @{ $_->{'days'} } - 14 ) for ( @{$team_summary} ); *************** *** 210,214 **** } ! sub screen_reports_projects_list { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); --- 216,220 ---- } ! sub screen_projects_list { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); *************** *** 240,244 **** } ! sub screen_reports_project_view { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); --- 246,250 ---- } ! sub screen_project_view { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); *************** *** 298,350 **** $sth->{'activities'}->execute() or die $dbh->errstr(); - my ( $indent, $last_activity_id, $total_alloc, @activities ) = ( 0, 0, 0 ); - while ( $_ = $sth->{'activities'}->fetchrow_hashref() ) { - - # if the parent_id doesn't exist or if it does but it's not the same - # as the last saved parent_id, then the item is a "root" activity and should - # have no indent - if ( not $_->{'parent_id'} or $_->{'parent_id'} != $last_activity_id ) { - $indent = 0; - $last_activity_id = $_->{'id'}; - } - - # if the parent_id exists and isn't the same as the previous parent_id, - # then it's a sub-activity and should get indented - elsif ( - @activities and - $_->{'parent_id'} != ( $activities[-1]->{'parent_id'} || -1 ) - ) { - $indent++; - } - $_->{'indent'} = $indent; - - # "group" denotes that the item is unselectable by the user, that the - # item is a group name, not an activity name - $activities[-1]->{'group'} = 1 if ( - @activities and defined $_->{'parent_id'} and - $_->{'parent_id'} == ( $activities[-1]->{'id'} || -1 ) - ); - - # add activity summary report data - $sth->{'activity_summary'}->execute( - $month . '-01', - $month . '-01', - $_->{'id'}, - ) or die $dbh->errstr(); - ( - $_->{'employees'}, - $_->{'days'}, - $_->{'average'}, - ) = $sth->{'activity_summary'}->fetchrow_array(); - - $_->{'employees'} ||= 0; - $_->{'days'} ||= 0; - $_->{'average'} ||= 0; - - $_->{'average'} = int( $_->{'average'} * 100 ) / 100; - $_->{'alloc'} = int( $_->{'employees'} * $_->{'days'} * $_->{'average'} ) / 100; - - push @activities, $_; - } my $tmpl_obj = $self->setup_tmpl('reports/activity.tmpl'); --- 304,307 ---- *************** *** 353,357 **** 'nav_bar' => WTF::Utils::nav_bar_data( $r, 'activity' ), 'activity_months' => $activity_months, ! 'activities' => \@activities, ); --- 310,339 ---- 'nav_bar' => WTF::Utils::nav_bar_data( $r, 'activity' ), 'activity_months' => $activity_months, ! 'activities' => WTF::Utils::indent( ! $sth->{'activities'}->fetchall_arrayref({}), ! 'parent_id', ! sub { ! my ($row) = @_; ! ! # add activity summary report data ! $sth->{'activity_summary'}->execute( ! $month . '-01', ! $month . '-01', ! $row->{'id'}, ! ) or die $dbh->errstr(); ! ( ! $row->{'employees'}, ! $row->{'days'}, ! $row->{'average'}, ! ) = $sth->{'activity_summary'}->fetchrow_array(); ! ! $row->{'employees'} ||= 0; ! $row->{'days'} ||= 0; ! $row->{'average'} ||= 0; ! ! $row->{'average'} = int( $row->{'average'} * 100 ) / 100; ! $row->{'alloc'} = int( $row->{'employees'} * $row->{'days'} * $row->{'average'} ) / 100; ! }, ! ), ); *************** *** 438,445 **** # loop, incrementing $range[0] by a week until it passes the end range point while ( $range[0] < $range[1] ) { ! my @date_start = (localtime( $range[0] - (localtime( $range[0] ))[6] * 86_400 ))[ 3 .. 6 ]; # 86_400 == 1 day ! my @date_end = (localtime( $range[0] - (localtime( $range[0] ))[6] * 86_400 + 518_400 ))[ 3 .. 6 ]; # 518_400 == 6 days ! my $date_start = sprintf( "%4d-%02d-%02d", $date_start[2] + 1900, $date_start[1] + 1, $date_start[0] ); ! my $date_end = sprintf( "%4d-%02d-%02d", $date_end[2] + 1900, $date_end[1] + 1, $date_end[0] ); $worksheet = $workbook->add_worksheet("Week of $date_start"); --- 420,433 ---- # loop, incrementing $range[0] by a week until it passes the end range point while ( $range[0] < $range[1] ) { ! my @date_start = ! (localtime( $range[0] - (localtime( $range[0] ))[6] * 86_400 ))[ 3 .. 6 ]; ! # 86_400 = 1 day ! my @date_end = ! (localtime( $range[0] - (localtime( $range[0] ))[6] * 86_400 + 518_400 ))[ 3 .. 6 ]; ! # 518_400 = 6 days ! my $date_start = ! sprintf( "%4d-%02d-%02d", $date_start[2] + 1900, $date_start[1] + 1, $date_start[0] ); ! my $date_end = ! sprintf( "%4d-%02d-%02d", $date_end[2] + 1900, $date_end[1] + 1, $date_end[0] ); $worksheet = $workbook->add_worksheet("Week of $date_start"); *************** *** 463,467 **** $sth->{'project_xls_data_subselect'}->execute( $id, $date_start, $date_end ) or die $dbh->errstr(); ! my $eids = join(', ', map { $_->[0] } @{ $sth->{'project_xls_data_subselect'}->fetchall_arrayref() } ) || ''; if ( length $eids > 0 ) { --- 451,457 ---- $sth->{'project_xls_data_subselect'}->execute( $id, $date_start, $date_end ) or die $dbh->errstr(); ! my $eids = join( ', ', ! map { $_->[0] } @{ $sth->{'project_xls_data_subselect'}->fetchall_arrayref() } ! ) || ''; if ( length $eids > 0 ) { *************** *** 492,500 **** $row = 5; ! my $last_area = ''; # take the XLS date from the query above, tree it based on employee, # then map through it to convert it into an array reference with ! # and array reference suitable for direct insert into the XLS # via a write_row() and a scalar with area name so that we can # add company functional area title headers into the worksheet --- 482,490 ---- $row = 5; ! my $last_area = q(); # take the XLS date from the query above, tree it based on employee, # then map through it to convert it into an array reference with ! # an array reference suitable for direct insert into the XLS # via a write_row() and a scalar with area name so that we can # add company functional area title headers into the worksheet *************** *** 542,546 **** =head1 VERSION ! This document describes WTF::Pages::Reports version 1.01 =head1 SYNOPSIS --- 532,536 ---- =head1 VERSION ! This document describes WTF::Pages::Reports version 1.02 =head1 SYNOPSIS *************** *** 570,574 **** return; ! =head2 screen_reports_myweekly() This is a page generation method that generates the --- 560,564 ---- return; ! =head2 screen_myweekly() This is a page generation method that generates the *************** *** 577,581 **** This page allows users to view entered time and notes data for a given week. ! =head2 screen_reports_team_view() This is a page generation method that generates the --- 567,571 ---- This page allows users to view entered time and notes data for a given week. ! =head2 screen_team_view() This is a page generation method that generates the *************** *** 586,591 **** From this page, users can also download detailed team data in a Microsoft Excel (XLS) file handled by "xls_team_view_build()". ! =head2 screen_reports_projects_list() This is a page generation method that generates the --- 576,585 ---- From this page, users can also download detailed team data in a Microsoft Excel (XLS) file handled by "xls_team_view_build()". + There's also a summary table at the top of the page that spans the date + range, limited to 14 days (2 weeks) anchored at the end of the range if the + range is greater than 14 days. The summary table shows who has put what data + into the application over the date range. ! =head2 screen_projects_list() This is a page generation method that generates the *************** *** 598,602 **** "screen_reports_project_view()". ! =head2 screen_reports_project_view() This is a page generation method that generates the --- 592,596 ---- "screen_reports_project_view()". ! =head2 screen_project_view() This is a page generation method that generates the *************** *** 608,611 **** --- 602,613 ---- file handled by "xls_project_view_build()". + =head2 screen_activity_summary() + + This is a page generation method that generates the "Activity Summary" page + using the "reports/activity_summary.tmpl" HTML::Template template. + This page displays summary data about general employee activities as defined + in the activity database table. This page displays monthly summary + statistics. + =head2 xls_team_view_build() *************** *** 651,661 **** WTF::Pages::Reports is a subclass of WTF::Pages. - =head1 KNOWN ISSUES - - The method names in this module date to before the dispatch table in WTF::Pages - could handle multiple subroutines with the same name across two or more - subclasses. Consequently, the method names herein have "reports" in them when - in some cases that's redudant and annoying. - =head1 COPYRIGHT, LICENSE, AND DISCLAIMER OF WARRANTY --- 653,656 ---- Index: Admin.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Admin.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Admin.pm 28 Nov 2006 18:47:50 -0000 1.5 --- Admin.pm 2 Dec 2006 00:09:09 -0000 1.6 *************** *** 4,8 **** use warnings; use base 'WTF::Pages'; ! use Apache2::Const; use Apache2::Cookie; use WTF::DBH; --- 4,8 ---- use warnings; use base 'WTF::Pages'; ! use Apache2::Const -compile => 'REDIRECT'; use Apache2::Cookie; use WTF::DBH; *************** *** 13,16 **** --- 13,20 ---- ROOT_URL => WTF::Config->get( 'links', 'root_url' ), UPDATE => WTF::Config->get( 'update' ), + + # the DATA_TABLES constant is used in the screen_table_data() and + # action_save_table_data() methods and describes how these lookup tables + # are designed and how administrators should interact with them DATA_TABLES => [ { *************** *** 61,65 **** my $sth = WTF::SQL->sth(); ! sub screen_admin_authz { my ( $self, $r ) = @_; my $tmpl_obj = $self->setup_tmpl('admin/authz.tmpl'); --- 65,69 ---- my $sth = WTF::SQL->sth(); ! sub screen_authz { my ( $self, $r ) = @_; my $tmpl_obj = $self->setup_tmpl('admin/authz.tmpl'); *************** *** 104,108 **** } ! sub action_admin_save_new_authzs { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); --- 108,112 ---- } ! sub action_save_new_authzs { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); *************** *** 136,140 **** } ! sub action_admin_update { my ( $self, $r ) = @_; system(UPDATE); --- 140,144 ---- } ! sub action_update { my ( $self, $r ) = @_; system(UPDATE); *************** *** 143,147 **** } ! sub screen_admin_users { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); --- 147,151 ---- } ! sub screen_users { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); *************** *** 199,203 **** } ! sub action_admin_save_users { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); --- 203,207 ---- } ! sub action_save_users { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); *************** *** 219,223 **** } ! sub screen_admin_task_area { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); --- 223,227 ---- } ! sub screen_task_area { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); *************** *** 227,264 **** $sth->{'ta_areas' }->execute() or die $dbh->errstr(); ! my ( $indent, @tasks ) = ( 0 ); ! while ( $_ = $sth->{'all_tasks'}->fetchrow_hashref() ) { ! ! # if there's no task_id, then the item should have no intent ! unless ( $_->{'task_id'} ) { ! $indent = 0; ! } ! ! # increment the items indent if the task_id is not the same as the ! # previous task_id ! elsif ( ! @tasks and ! $_->{'task_id'} != ( $tasks[-1]->{'task_id'} || -1 ) ! ) { ! $indent++; ! } ! $_->{'indent'} = $indent; ! ! # "group" denotes that the item is unselectable by the user, that the ! # item is a group name, not a task name ! $tasks[-1]->{'group'} = 1 if ( ! @tasks and defined $_->{'task_id'} and ! $_->{'task_id'} == ( $tasks[-1]->{'id'} || -1 ) ! ); ! ! $sth->{'ta_area_ids'}->execute( $_->{'id'}, $_->{'id'} ) or die $dbh->errstr(); ! $_->{'t_areas'} = $sth->{'ta_area_ids'}->fetchall_arrayref({}); ! ! push @tasks, $_; ! } - # setup $task_lists and append into each element therein all the areas - # from the "ta_areas" query - my $task_lists = WTF::Utils::tree_data( \@tasks, 'project_type', 'tasks' ); my $areas = $sth->{'ta_areas'}->fetchall_arrayref({}); $_->{'areas'} = $areas for ( @{$task_lists}); --- 231,248 ---- $sth->{'ta_areas' }->execute() or die $dbh->errstr(); ! my $task_lists = WTF::Utils::tree_data( ! WTF::Utils::indent( ! $sth->{'all_tasks'}->fetchall_arrayref({}), ! 'task_id', ! sub { ! my ($row) = @_; ! $sth->{'ta_area_ids'}->execute( $row->{'id'}, $row->{'id'} ) or die $dbh->errstr(); ! $row->{'t_areas'} = $sth->{'ta_area_ids'}->fetchall_arrayref({}); ! }, ! ), ! 'project_type', ! 'tasks', ! ); my $areas = $sth->{'ta_areas'}->fetchall_arrayref({}); $_->{'areas'} = $areas for ( @{$task_lists}); *************** *** 273,277 **** } ! sub action_admin_save_task_area { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); --- 257,261 ---- } ! sub action_save_task_area { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); *************** *** 334,338 **** --- 318,327 ---- my $tmpl_obj = $self->setup_tmpl('admin/table_data.tmpl'); + # declaring an empty scalar that will eventually contain a reference to + # an element (which is itself a hash reference) of the DATA_TABLES array my $table; + + # the @tables array will be sent to the XHTML template to populate the + # select drop-down list of tables that an administrator can edit my @tables = map { # set selected to true for the appropriate table requested by the user *************** *** 356,412 **** } $table ||= DATA_TABLES->[0]; my $sql_sth = 'table_data_' . $table->{'table'}; $sth->{$sql_sth}->execute() or die $dbh->errstr(); my $table_data = $sth->{$sql_sth}->fetchall_arrayref({}); ! ! if ( $table->{'has_parent_id'} ) { ! my ( $indent, @rows, @last_ids ) = ( 0 ); ! for ( @{$table_data} ) { ! ! # if there's no parent_id, then the item should have no intent ! unless ( $_->{'parent_id'} ) { ! $indent = 0; ! @last_ids = (); ! } ! ! # increment the items indent if the parent_id is not the same as the ! # previous parent_id ! elsif ( ! @rows and ! $_->{'parent_id'} != ( $last_ids[-1] || -1 ) ! ) { ! my $id = $_->{'parent_id'}; ! ! # this id seen before and in id stack, so decrement indent and ! # pop ids off the stack until a match or at empty ! if ( grep { $_ == $id } @last_ids ) { ! do { ! $indent--; ! pop @last_ids; ! } while ( $last_ids[-1] ne $id and @last_ids ); ! } ! ! # this is an id that's not in the stack, so increment indent ! # and push the id onto the stack ! else { ! $indent++; ! push @last_ids, $_->{'parent_id'}; ! } ! } ! $_->{'indent'} = $indent; ! ! # "group" denotes that the item is unselectable by the user, that the ! # item is a group name, not a task name ! $rows[-1]->{'group'} = 1 if ( ! $table->{'has_groups'} and ! @rows and defined $_->{'parent_id'} and ! $_->{'parent_id'} == ( $rows[-1]->{'id'} || -1 ) ! ); ! ! push @rows, $_; ! } ! $table_data = \@rows; ! } $tmpl_obj->param( --- 345,358 ---- } + # if there isn't a specified table the user wants to edit, then default to + # the first table in the DATA_TABLES array constant $table ||= DATA_TABLES->[0]; + + # for the table name, execute the prepare_cached query for table data and + # return all its data into $table_data my $sql_sth = 'table_data_' . $table->{'table'}; $sth->{$sql_sth}->execute() or die $dbh->errstr(); my $table_data = $sth->{$sql_sth}->fetchall_arrayref({}); ! $table_data = WTF::Utils::indent( $table_data, 'parent_id' ) if ( $table->{'has_parent_id'} ); $tmpl_obj->param( *************** *** 421,424 **** --- 367,371 ---- 'has_project' => $table->{'has_project'}, 'has_ordering' => $table->{'has_ordering'}, + 'has_groups' => $table->{'has_groups'}, 'show_save' => ( $table->{'has_active'} or $table->{'has_project'} ) ? 1 : 0, ); *************** *** 464,489 **** $dbh->do( 'UPDATE ' . $table->{'table'} . ' SET ' . join( ', ', grep { defined } ( ! ( $table->{'has_active'} ) ? 'active = 0' : undef, ( $table->{'has_project'} ) ? 'project = 0' : undef, ) ) ) or die $dbh->errstr(); - if ( $table->{'has_active'} ) { - $dbh->do( - 'UPDATE ' . $table->{'table'} . ' SET active = 1 WHERE id IN ( ' . join( ', ', - map { substr( $_, 7 ) } grep { substr( $_, 0, 7 ) eq 'active_' } $req->param() ) . ')' - ) or die $dbh->errstr(); - } ! if ( $table->{'has_project'} ) { ! $dbh->do( ! 'UPDATE ' . $table->{'table'} . ' SET project = 1 WHERE id IN ( ' . join( ', ', ! map { substr( $_, 8 ) } grep { substr( $_, 0, 8 ) eq 'project_' } $req->param() ) . ')' ! ) or die $dbh->errstr(); ! } } ! # inserting a new record into the table ! elsif ( $req->param('id') < 1 ) { # setup an array of column names we're going to use in our query; --- 411,438 ---- $dbh->do( 'UPDATE ' . $table->{'table'} . ' SET ' . join( ', ', grep { defined } ( ! ( $table->{'has_active' } ) ? 'active = 0' : undef, ( $table->{'has_project'} ) ? 'project = 0' : undef, ) ) ) or die $dbh->errstr(); ! my $update = sub { ! my ($name) = @_; ! my $length = length($name) + 1; ! ! if ( $table->{ 'has_' . $name } ) { ! $dbh->do( ! 'UPDATE ' . $table->{'table'} . ' SET ' . $name . ' = 1 WHERE id IN ( ' . join( ', ', ! map { substr( $_, $length ) } grep { substr( $_, 0, $length ) eq $name . '_' } $req->param() ) . ')' ! ) or die $dbh->errstr(); ! } ! }; ! ! $update->('active'); ! $update->('project'); } ! # inserting or updating a record in the table ! else { # setup an array of column names we're going to use in our query; *************** *** 491,561 **** # table definition structure my @columns = ( 'name', grep { defined } ( ! ( $table->{'has_parent_id'} ) ? $table->{'table'} . '_id' : undef, ! ( $table->{'has_ordering'} ) ? 'ordering' : undef, ( $table->{'has_description'} ) ? 'description' : undef, ) ); - - my $sth = $dbh->prepare( - 'INSERT INTO ' . $table->{'table'} . ' ( ' . - join( ', ', @columns ) . ' ) VALUES ( ' . join( ', ', ('?') x @columns ) . ' )' - ) or die $dbh->errstr(); - - # set parent_id and description for SQL insert based on what the - # Javascript sends into this method - my $pid = ( - not defined $req->param('pid') or - lc( $req->param('pid') ) eq 'null' - ) ? undef : $req->param('pid'); - my $description = ( - not defined $req->param('description') or - length( $req->param('description') ) == 0 - ) ? undef : $req->param('description'); ! # execute the query, grepping-out input values for columns that ! # don't exist ! $sth->execute( grep { $_ ne '-1' } ( $req->param('name'), - ( $table->{'has_parent_id'} ) ? $pid : -1, - ( $table->{'has_ordering'} ) ? $req->param('ordering') : -1, - ( $table->{'has_description'} ) ? $description : -1, - ) ) or die $dbh->errstr(); - } - - # updating an existing record in the table - elsif ( $req->param('id') > 0 ) { - - # setup an array of column names we're going to use in our query; - # "name" is always going to exist, the rest come from the - # table definition structure - my @columns = ( 'name = ?', grep { defined } ( - ( $table->{'has_parent_id'} ) ? $table->{'table'} . '_id = ?' : undef, - ( $table->{'has_ordering'} ) ? 'ordering = ?' : undef, - ( $table->{'has_description'} ) ? 'description = ?' : undef, - ) ); ! my $sth = $dbh->prepare( ! 'UPDATE ' . $table->{'table'} . ' SET ' . join( ', ', @columns ) . ' WHERE id = ?' ! ) or die $dbh->errstr(); ! # set parent_id and description for SQL insert based on what the ! # Javascript sends into this method ! my $pid = ( ! not defined $req->param('pid') or ! lc( $req->param('pid') ) eq 'null' ! ) ? undef : $req->param('pid'); ! my $description = ( ! not defined $req->param('description') or ! length( $req->param('description') ) == 0 ! ) ? undef : $req->param('description'); ! # execute the query, grepping-out input values for columns that ! # don't exist ! $sth->execute( grep { $_ ne '-1' } ( ! $req->param('name'), ! ( $table->{'has_parent_id'} ) ? $pid : -1, ! ( $table->{'has_ordering'} ) ? $req->param('ordering') : -1, ! ( $table->{'has_description'} ) ? $description : -1, ! $req->param('id'), ! ) ) or die $dbh->errstr(); } --- 440,483 ---- # table definition structure my @columns = ( 'name', grep { defined } ( ! ( $table->{'has_parent_id' } ) ? $table->{'table'} . '_id' : undef, ! ( $table->{'has_ordering' } ) ? 'ordering' : undef, ( $table->{'has_description'} ) ? 'description' : undef, ) ); ! # set name, parent_id, ordering, and description parameters for SQL ! # insert based on what the Javascript sends into this method, ! # grepping-out input values for columns that don't exist ! my @sql_params = grep { not defined $_ or $_ ne '-1' } ( $req->param('name'), ! ( not $table->{'has_parent_id'} ) ? -1 : ( ! not defined $req->param('pid') or ! lc( $req->param('pid') ) eq 'null' ! ) ? undef : $req->param('pid'), ! ! ( $table->{'has_ordering'} ) ? $req->param('ordering') : -1, ! ( not $table->{'has_description'} ) ? -1 : ( ! not defined $req->param('description') ! or length( $req->param('description') ) == 0 ! ) ? undef : $req->param('description'), ! ); ! # inserting a new record into the table ! if ( $req->param('id') < 1 ) { ! my $sth = $dbh->prepare( ! 'INSERT INTO ' . $table->{'table'} . ' ( ' . ! join( ', ', @columns ) . ' ) VALUES ( ' . join( ', ', ('?') x @columns ) . ' )' ! ) or die $dbh->errstr(); ! $sth->execute(@sql_params) or die $dbh->errstr(); ! } ! ! # updating an existing record in the table ! elsif ( $req->param('id') > 0 ) { ! my $sth = $dbh->prepare( ! 'UPDATE ' . $table->{'table'} . ' SET ' . join( ' = ?, ', @columns ) . ' = ? WHERE id = ?' ! ) or die $dbh->errstr(); ! $sth->execute( @sql_params, $req->param('id') ) or die $dbh->errstr(); ! } } *************** *** 599,603 **** my $req = WTF::Utils::get_req($r); ! =head2 screen_admin_authz() This is a page generation method that generates the --- 521,525 ---- my $req = WTF::Utils::get_req($r); ! =head2 screen_authz() This is a page generation method that generates the *************** *** 607,621 **** privileges to specific features. ! =head2 action_admin_save_new_authz() This action method saves changes to the administrate authorization privileges made by authorized users under "screen_admin_authz()". ! =head2 action_admin_update() This action method makes a system call to execute the database synchronization script to synchronize the local WTF database with the Bugzilla database. ! =head2 screen_admin_users() This is a page generation method that generates the --- 529,543 ---- privileges to specific features. ! =head2 action_save_new_authz() This action method saves changes to the administrate authorization privileges made by authorized users under "screen_admin_authz()". ! =head2 action_update() This action method makes a system call to execute the database synchronization script to synchronize the local WTF database with the Bugzilla database. ! =head2 screen_users() This is a page generation method that generates the *************** *** 625,634 **** accounts regarding active states, functional areas, and team assignments. ! =head2 action_admin_save_users() This action method saves changes to the employee user accounts made by authorized users under "screen_admin_users()". ! =head2 screen_admin_task_area() This is a page generation method that generates the --- 547,556 ---- accounts regarding active states, functional areas, and team assignments. ! =head2 action_save_users() This action method saves changes to the employee user accounts made by authorized users under "screen_admin_users()". ! =head2 screen_task_area() This is a page generation method that generates the *************** *** 639,643 **** functional areas. ! =head2 action_admin_save_task_area() This action method saves changes to the selection of project and non-project --- 561,565 ---- functional areas. ! =head2 action_save_task_area() This action method saves changes to the selection of project and non-project *************** *** 663,666 **** --- 585,603 ---- logged in as him or herself. + =head2 screen_table_data() + + This is a page generation method that generates the "Administrate Table" + page using the "admin/table_data.tmpl" HTML::Template template. + This page allows authorized users to view and edit the data in the + application's various look-up tables. This method is somewhat generic, + allowing for control of data across a small series of lookup tables with + different designs. + + =head2 action_save_table_data() + + This action method is called from a form submitted from a page generated by + the "screen_table_data()" method. It supports UPDATEs and INSERTs against + look-up tables within the application's database. + =head1 DEPENDENCIES *************** *** 683,693 **** WTF::Pages::Admin is a subclass of WTF::Pages. - =head1 KNOWN ISSUES - - The method names in this module date to before the dispatch table in WTF::Pages - could handle multiple subroutines with the same name across two or more - subclasses. Consequently, the method names herein all have "_admin_" in them, - and that's somewhat redudant and annoying. - =head1 COPYRIGHT, LICENSE, AND DISCLAIMER OF WARRANTY --- 620,623 ---- Index: Input.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Input.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Input.pm 18 Nov 2006 21:15:23 -0000 1.5 --- Input.pm 2 Dec 2006 00:09:09 -0000 1.6 *************** *** 1,8 **** package WTF::Pages::Input; ! our $VERSION = 1.01; use strict; use warnings; use base 'WTF::Pages'; ! use Apache2::Const; use WTF::DBH; use WTF::SQL; --- 1,8 ---- package WTF::Pages::Input; ! our $VERSION = 1.02; use strict; use warnings; use base 'WTF::Pages'; ! use Apache2::Const -compile => 'REDIRECT'; use WTF::DBH; use WTF::SQL; *************** *** 30,34 **** } ! sub screen_input_projects { my ( $self, $r ) = @_; my $tmpl_obj = $self->setup_tmpl('input/projects.tmpl'); --- 30,34 ---- } ! sub screen_projects { my ( $self, $r ) = @_; my $tmpl_obj = $self->setup_tmpl('input/projects.tmpl'); *************** *** 63,67 **** } ! sub screen_input_tasks { my ( $self, $r ) = @_; my $tmpl_obj = $self->setup_tmpl('input/tasks.tmpl'); --- 63,67 ---- } ! sub screen_tasks { my ( $self, $r ) = @_; my $tmpl_obj = $self->setup_tmpl('input/tasks.tmpl'); *************** *** 74,111 **** } - my ( $indent, $last_task_id, @tasks ) = ( 0, 0 ); - for ( @{$tasks_from_db} ) { - - # if the task_id doesn't exist or if it does but it's not the same - # as the last saved task_id, then the item is a "root" task and should - # have no indent - if ( not $_->{'task_id'} or $_->{'task_id'} != $last_task_id ) { - $indent = 0; - $last_task_id = $_->{'id'}; - } - - # if the task_id exists and isn't the same as the previous task_id, - # then it's a sub-task and should get indented - elsif ( - @tasks and - $_->{'task_id'} != ( $tasks[-1]->{'task_id'} || -1 ) - ) { - $indent++; - } - $_->{'indent'} = $indent; - - # "group" denotes that the item is unselectable by the user, that the - # item is a group name, not a task name - $tasks[-1]->{'group'} = 1 if ( - @tasks and defined $_->{'task_id'} and - $_->{'task_id'} == ( $tasks[-1]->{'id'} || -1 ) - ); - push @tasks, $_; - - } - $tmpl_obj->param( 'title' => 'Project Tasks', ! 'task_lists' => WTF::Utils::tree_data( \@tasks, 'project_type', 'tasks' ), ); --- 74,83 ---- } $tmpl_obj->param( 'title' => 'Project Tasks', ! 'task_lists' => WTF::Utils::tree_data( ! WTF::Utils::indent( $tasks_from_db, 'task_id' ), ! 'project_type', 'tasks' ! ), ); *************** *** 113,117 **** } ! sub screen_input_tracking { my ( $self, $r ) = @_; my $tmpl_obj = $self->setup_tmpl('input/tracking.tmpl'); --- 85,89 ---- } ! sub screen_tracking { my ( $self, $r ) = @_; my $tmpl_obj = $self->setup_tmpl('input/tracking.tmpl'); *************** *** 165,200 **** $sth->{'activity_data'}->finish(); - my ( $indent, $last_activity_id, @activities ) = ( 0, 0 ); - while ( $_ = $sth->{'activities'}->fetchrow_hashref() ) { - - # if the parent_id doesn't exist or if it does but it's not the same - # as the last saved parent_id, then the item is a "root" activity and should - # have no indent - if ( not $_->{'parent_id'} or $_->{'parent_id'} != $last_activity_id ) { - $indent = 0; - $last_activity_id = $_->{'id'}; - } - - # if the parent_id exists and isn't the same as the previous parent_id, - # then it's a sub-activity and should get indented - elsif ( - @activities and - $_->{'parent_id'} != ( $activities[-1]->{'parent_id'} || -1 ) - ) { - $indent++; - } - $_->{'indent'} = $indent; - - # "group" denotes that the item is unselectable by the user, that the - # item is a group name, not an activity name - $activities[-1]->{'group'} = 1 if ( - @activities and defined $_->{'parent_id'} and - $_->{'parent_id'} == ( $activities[-1]->{'id'} || -1 ) - ); - - $_->{'percent'} = $activity_data{ $_->{'id'} }; - push @activities, $_; - } - $tmpl_obj->param( 'title' => 'Daily Timesheet', --- 137,140 ---- *************** *** 203,209 **** 'data' => $sth->{'work_sel'}->fetchall_arrayref({}), 'notes' => scalar( $sth->{'notes_sel'}->fetchrow_array() ) || undef, - 'activities' => \@activities, 'vacation' => $vacation, 'sick' => $sick, ); $sth->{'notes_sel'}->finish(); --- 143,156 ---- 'data' => $sth->{'work_sel'}->fetchall_arrayref({}), 'notes' => scalar( $sth->{'notes_sel'}->fetchrow_array() ) || undef, 'vacation' => $vacation, 'sick' => $sick, + 'activities' => WTF::Utils::indent( + $sth->{'activities'}->fetchall_arrayref({}), + 'parent_id', + sub { + my ($row) = @_; + $row->{'percent'} = $activity_data{ $row->{'id'} }; + }, + ), ); $sth->{'notes_sel'}->finish(); *************** *** 212,216 **** } ! sub action_input_save_timesheet { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); --- 159,163 ---- } ! sub action_save_timesheet { my ( $self, $r ) = @_; my $req = WTF::Utils::get_req($r); *************** *** 283,293 **** @activity_input > 0 ) { ! ! my $vacation = ( ! defined $req->param('vacation') and $req->param('vacation') eq 'on' ! ) ? 1 : 0; ! my $sick = ( ! defined $req->param('sick') and $req->param('sick') eq 'on' ! ) ? 1 : 0; $sth->{'summary_ins'}->execute( --- 230,236 ---- @activity_input > 0 ) { ! my ( $vacation, $sick ) = map { ! ( defined $req->param($_) and $req->param($_) eq 'on' ) ? 1 : 0 ! } qw( vacation sick ); $sth->{'summary_ins'}->execute( *************** *** 332,336 **** =head1 VERSION ! This document describes WTF::Pages::Input version 1.01 =head1 SYNOPSIS --- 275,279 ---- =head1 VERSION ! This document describes WTF::Pages::Input version 1.02 =head1 SYNOPSIS *************** *** 362,366 **** tasks, and tracking sub-pages. ! =head2 screen_input_projects() This is a page generation method that generates the --- 305,309 ---- tasks, and tracking sub-pages. ! =head2 screen_projects() This is a page generation method that generates the *************** *** 371,375 **** log time. ! =head2 screen_input_tasks() This is a page generation method that generates the --- 314,318 ---- log time. ! =head2 screen_tasks() This is a page generation method that generates the *************** *** 379,383 **** allowing the user to select a task in which to log time. ! =head2 screen_input_tracking() This is a page generation method that generates the --- 322,326 ---- allowing the user to select a task in which to log time. ! =head2 screen_tracking() This is a page generation method that generates the *************** *** 388,395 **** majority of functionality on this page is handled by Javascript. ! =head2 action_input_save_timesheet() This action method saves changes to daily time and notes data submitted by ! users from the "Daily Timesheet" page under "screen_input_tracking()". =head1 DEPENDENCIES --- 331,338 ---- majority of functionality on this page is handled by Javascript. ! =head2 action_save_timesheet() This action method saves changes to daily time and notes data submitted by ! users from the "Daily Timesheet" page under "screen_tracking()". =head1 DEPENDENCIES *************** *** 413,423 **** WTF::Pages::Input is a subclass of WTF::Pages. - =head1 KNOWN ISSUES - - The method names in this module date to before the dispatch table in WTF::Pages - could handle multiple subroutines with the same name across two or more - subclasses. Consequently, the method names herein have "input" in them when - in some cases that's redudant and annoying. - =head1 COPYRIGHT, LICENSE, AND DISCLAIMER OF WARRANTY --- 356,359 ---- |
From: Gryphon S. <gry...@us...> - 2006-12-02 00:09:13
|
Update of /cvsroot/wtf-tracker/wtf/static In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6361/static Modified Files: general.css tracking.js Log Message: Random bits of changes here and there, mostly code clean-up but a few bits of refactoring (globally) based on a code review in prep for v1.02 build and release Index: general.css =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/static/general.css,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** general.css 20 Nov 2006 02:53:07 -0000 1.10 --- general.css 2 Dec 2006 00:09:09 -0000 1.11 *************** *** 59,80 **** } - table.layout_only th, - table.layout_only td { - font-size: 10pt; - } - - span.login_as { - font-weight: normal; - font-size: 8pt; - } - - span.login_as a { - text-decoration: none; - } - - span.login_as a:hover { - text-decoration: underline; - } - /* Navigation Bar (and similar menues) */ --- 59,62 ---- *************** *** 99,102 **** --- 81,90 ---- } + /* required hack for Mozilla on Linux to make "Administrate Users" page */ + /* link menu's <sup> text fit */ + p.link_menu a { + padding-top: 5px; + } + div#nav_bar p.nav_bar a:hover, p.link_menu a:hover { *************** *** 106,122 **** div#nav_bar p.nav_bar a.current_page, ! p.link_menu a.current_page { ! background-color: #ffcccc; ! color: #000000; ! } ! div#nav_bar p.nav_bar a.current_page:hover, p.link_menu a.current_page:hover { background-color: #ffcccc; color: #000000; - } - - div#nav_bar p.nav_bar a.current_page, - p.link_menu a.current_page { cursor: default; } --- 94,102 ---- div#nav_bar p.nav_bar a.current_page, ! p.link_menu a.current_page, div#nav_bar p.nav_bar a.current_page:hover, p.link_menu a.current_page:hover { background-color: #ffcccc; color: #000000; cursor: default; } *************** *** 136,139 **** --- 116,134 ---- } + /* "Login As" Links */ + + span.login_as { + font-weight: normal; + font-size: 8pt; + } + + span.login_as a { + text-decoration: none; + } + + span.login_as a:hover { + text-decoration: underline; + } + /* Open Projects codeline headers */ *************** *** 339,347 **** } ! td.hours { ! width: 40px; ! text-align: right; ! } ! td.bugid { width: 40px; --- 334,338 ---- } ! td.hours, td.bugid { width: 40px; *************** *** 390,391 **** --- 381,387 ---- color: #000000; } + + table.layout_only th, + table.layout_only td { + font-size: 10pt; + } Index: tracking.js =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/static/tracking.js,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tracking.js 28 Nov 2006 18:47:50 -0000 1.8 --- tracking.js 2 Dec 2006 00:09:09 -0000 1.9 *************** *** 25,29 **** } else { ! calc_activity_total( document.tracking, true ); } } --- 25,29 ---- } else { ! calcActivityTotal( document.tracking, true ); } } *************** *** 35,41 **** var skipFormDoubleSubmit = false; function cloneObj(obj) { - // this function clones a simple data-housing object - for ( var i in obj ) { this[i] = obj[i]; --- 35,40 ---- var skipFormDoubleSubmit = false; + // this function clones a simple data-housing object function cloneObj(obj) { for ( var i in obj ) { this[i] = obj[i]; *************** *** 43,50 **** } function resizeIframesHeight() { - // for use only on the home page; used to resize the iframes automatically - // on page resize; different heights based on browser type - var myHeight = 0; if ( self.innerHeight ) { --- 42,48 ---- } + // for use only on the home page; used to resize the iframes automatically + // on page resize; different heights based on browser type function resizeIframesHeight() { var myHeight = 0; if ( self.innerHeight ) { *************** *** 72,80 **** } function tabularHoverInit() { - // "interactive table" hack for IE because IE doesn't handle :hover CSS - // properly; this function will look for tables with appropriate class - // names and force-add mouse over and mouse out activated changes to the CSS - var tables = document.getElementsByTagName("table"); for ( var t = 0; t < tables.length; t++ ) { --- 70,77 ---- } + // "interactive table" hack for IE because IE doesn't handle :hover CSS + // properly; this function will look for tables with appropriate class + // names and force-add mouse over and mouse out activated changes to the CSS function tabularHoverInit() { var tables = document.getElementsByTagName("table"); for ( var t = 0; t < tables.length; t++ ) { *************** *** 121,127 **** var trackingChange = false; function interactiveSelect( tableRow, id, name, bug, isProject ) { - // called when user clicks on a table row on the home page - var selectedObj = ( bug > 0 ) ? selectedProject : selectedTask; --- 118,123 ---- var trackingChange = false; + // called when user clicks on a table row on the home page function interactiveSelect( tableRow, id, name, bug, isProject ) { var selectedObj = ( bug > 0 ) ? selectedProject : selectedTask; *************** *** 131,134 **** --- 127,131 ---- if ( tableRow == selectedObj.tableRow ) { + // this should eventually become a "clear()" method or similar... selectedObj.tableRow = undefined; selectedObj.id = undefined; *************** *** 156,159 **** --- 153,157 ---- if ( objects[i].tableRow ) objects[i].tableRow.className = ( document.all ) ? "deselected" : ""; + // this should eventually become a "clear()" method or similar... objects[i].tableRow = undefined; objects[i].id = undefined; *************** *** 247,251 **** tdSummary.appendChild( document.createTextNode( ! ( taskObj.isProject == 1 ) ? projectObj.name + " (" + taskObj.name + ")" : taskObj.name + " (Non-Project Task)" ) ); tdBugId.appendChild( document.createTextNode( --- 245,251 ---- tdSummary.appendChild( document.createTextNode( ! ( taskObj.isProject == 1 ) ! ? projectObj.name + " (" + taskObj.name + ")" ! : taskObj.name + " (Non-Project Task)" ) ); tdBugId.appendChild( document.createTextNode( *************** *** 296,302 **** } function sumTrackingHours() { - // calculate and display the total hours tracked in the tracking table - var totalHours = 0; for ( var i in trackingItems ) totalHours += parseFloat( trackingItems[i].hours ); --- 296,301 ---- } + // calculate and display the total hours tracked in the tracking table function sumTrackingHours() { var totalHours = 0; for ( var i in trackingItems ) totalHours += parseFloat( trackingItems[i].hours ); *************** *** 383,390 **** } function createTrackingItems() { - // this function gets run on page load of the tracking table iframe; it - // populates the table with data previously stored in the database try { if ( ! tbcTrackingItems ) return; --- 382,391 ---- } + // this function gets run on page load of the tracking table iframe; it + // populates the table with data previously stored in the database function createTrackingItems() { + // check (without throwing any errors/warnings) to see if + // tbcTrackingItems exists and has some value try { if ( ! tbcTrackingItems ) return; *************** *** 448,455 **** } ! function calc_activity_total( theForm, skipTracking ) { var total = 0; for ( var i in theForm.elements ) { ! if ( theForm.elements[i].type == 'text' ) { var item = parseInt( theForm.elements[i].value ); if ( isNaN(item) || item < 0 ) item = 0; --- 449,461 ---- } ! // calculate and display in the appropriate total area on the tracking form ! // the total activity percentage ! function calcActivityTotal( theForm, skipTracking ) { var total = 0; + + // loop through the elements of the incoming form, and for each text input + // element, parse an integer value out of it, and add that to "total" for ( var i in theForm.elements ) { ! if ( theForm.elements[i].type == "text" ) { var item = parseInt( theForm.elements[i].value ); if ( isNaN(item) || item < 0 ) item = 0; *************** *** 468,472 **** document.getElementById("activity_total").firstChild.nodeValue = "0%"; ! if ( theBox.name == "vacation" && theBox.form.sick.checked ) theBox.form.sick.checked = false; if ( theBox.name == "sick" && theBox.form.vacation.checked ) theBox.form.vacation.checked = false; } --- 474,478 ---- document.getElementById("activity_total").firstChild.nodeValue = "0%"; ! if ( theBox.name == "vacation" && theBox.form.sick.checked ) theBox.form.sick.checked = false; if ( theBox.name == "sick" && theBox.form.vacation.checked ) theBox.form.vacation.checked = false; } *************** *** 474,478 **** // activate all the activity entry form inputs activityCheckboxInputDeactivation(false); ! calc_activity_total( theBox.form ); } trackingChange = true; --- 480,484 ---- // activate all the activity entry form inputs activityCheckboxInputDeactivation(false); ! calcActivityTotal( theBox.form ); } trackingChange = true; *************** *** 494,501 **** // to open a codeline... if (codelineStyle.display == "none") { ! document.getElementById(codeline_id_link).className = 'codeline_current'; // Internet Explorer requires display="block" whereas all good browsers understand "table" ! codelineStyle.display = ( window.ActiveXObject ) ? "block" : "table"; } --- 500,507 ---- // to open a codeline... if (codelineStyle.display == "none") { ! document.getElementById(codeline_id_link).className = "codeline_current"; // Internet Explorer requires display="block" whereas all good browsers understand "table" ! codelineStyle.display = ( document.all ) ? "block" : "table"; } *************** *** 509,512 **** --- 515,522 ---- var skipEditTableDataFunction = false; + // based on a click in a table or on a button on the "Administrate Table Data" + // page, provide a confirm()-based interface for the user to add/edit column + // data; do some very basic checking on the data, clean it, encode it, and + // ship it to the server application by way of GET URL function editTableData( url, table, id, name, ordering, parentId, description ) { if (skipEditTableDataFunction) { |
From: Gryphon S. <gry...@us...> - 2006-12-02 00:09:13
|
Update of /cvsroot/wtf-tracker/wtf In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6361 Modified Files: httpd.conf Log Message: Random bits of changes here and there, mostly code clean-up but a few bits of refactoring (globally) based on a code review in prep for v1.02 build and release Index: httpd.conf =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/httpd.conf,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** httpd.conf 28 Nov 2006 18:48:56 -0000 1.4 --- httpd.conf 2 Dec 2006 00:09:09 -0000 1.5 *************** *** 1,4 **** # Apache2/mod_perl2 configuration file for WTF ! # version 1.01 # preload and cache CPAN modules --- 1,4 ---- # Apache2/mod_perl2 configuration file for WTF ! # Version 1.02 # preload and cache CPAN modules |
From: Gryphon S. <gry...@us...> - 2006-12-02 00:09:13
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Apache In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6361/lib/WTF/Apache Modified Files: Authen.pm Authz.pm Response.pm Log Message: Random bits of changes here and there, mostly code clean-up but a few bits of refactoring (globally) based on a code review in prep for v1.02 build and release Index: Authz.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Apache/Authz.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Authz.pm 20 Nov 2006 02:53:07 -0000 1.4 --- Authz.pm 2 Dec 2006 00:09:09 -0000 1.5 *************** *** 1,4 **** package WTF::Apache::Authz; ! our $VERSION = 1.01; use strict; use warnings; --- 1,4 ---- package WTF::Apache::Authz; ! our $VERSION = 1.02; use strict; use warnings; *************** *** 61,65 **** =head1 VERSION ! This document describes WTF::Apache::Authz version 1.01 =head1 DESCRIPTION --- 61,65 ---- =head1 VERSION ! This document describes WTF::Apache::Authz version 1.02 =head1 DESCRIPTION Index: Authen.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Apache/Authen.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Authen.pm 27 Oct 2006 22:34:51 -0000 1.2 --- Authen.pm 2 Dec 2006 00:09:09 -0000 1.3 *************** *** 1,4 **** package WTF::Apache::Authen; ! our $VERSION = 1.01; use strict; use warnings; --- 1,4 ---- package WTF::Apache::Authen; ! our $VERSION = 1.02; use strict; use warnings; *************** *** 68,72 **** $sth->{'authz'}->execute($id) or die $dbh->errstr(); if ( grep { $_->[0] eq 'login_as' } @{ $sth->{'authz'}->fetchall_arrayref() } ) { - $r->pnotes( 'real_user_id' => $id ); --- 68,71 ---- *************** *** 82,88 **** } ! $r->pnotes( 'user_id' => $id ); ! $r->pnotes( 'user_name' => $user_name ); ! $r->pnotes( 'is_admin' => $is_admin ); return Apache2::Const::OK; --- 81,89 ---- } ! $r->pnotes( $_->[0] => $_->[1] ) for ( ! [ 'user_id', $id ], ! [ 'user_name', $user_name ], ! [ 'is_admin', $is_admin ], ! ); return Apache2::Const::OK; *************** *** 105,109 **** =head1 VERSION ! This document describes WTF::Apache::Authen version 1.01 =head1 DESCRIPTION --- 106,110 ---- =head1 VERSION ! This document describes WTF::Apache::Authen version 1.02 =head1 DESCRIPTION *************** *** 114,118 **** On successful login, the function will update the user's last login date/time ! in the database and will set "$r->pnotes" with: =over --- 115,121 ---- On successful login, the function will update the user's last login date/time ! in the database, set a simple boolean session cookie ("authen") so that on ! subsequent requests the application won't update the user's last login in the ! database, and will set "$r->pnotes" with: =over *************** *** 122,125 **** --- 125,133 ---- The database row ID for the user. + =item * username + + The user account name of the current user, typically (and assumed to be for + the purposes of this application) an email address. + =item * user_name *************** *** 134,137 **** --- 142,169 ---- =back + In addition, and to support the "Login As..." functionality, the handler + will check the "login_as" cookie for a value. If there's a value, that + value is a valid user ID number of a person who reports up to the current + user, and the current user has the "login_as" authorization, the handler + will make changes to "$r->pnotes" as follows: + + =over + + =item * real_user_id + + This value will be added, and it will contain the real user ID number + for the current user. When the user desires to revert to his own + account, this data will be used to allow the revertion. + + =item * username + + This value will change to the username (email address) of the user the + current user wishes to become. + + =back + + Additionally, the "user_id", "user_name", and "is_admin" records in pnotes + will be set to the desired "login_as" user rather than the current user. + =head1 CONFIGURATION AND ENVIRONMENT Index: Response.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Apache/Response.pm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Response.pm 18 Oct 2006 16:52:50 -0000 1.1.1.1 --- Response.pm 2 Dec 2006 00:09:09 -0000 1.2 *************** *** 1,4 **** package WTF::Apache::Response; ! our $VERSION = 1.01; use strict; use warnings; --- 1,4 ---- package WTF::Apache::Response; ! our $VERSION = 1.02; use strict; use warnings; *************** *** 23,27 **** =head1 VERSION ! This document describes WTF::Apache::Response version 1.01 =head1 DESCRIPTION --- 23,27 ---- =head1 VERSION ! This document describes WTF::Apache::Response version 1.02 =head1 DESCRIPTION |
From: Gryphon S. <gry...@us...> - 2006-12-02 00:09:13
|
Update of /cvsroot/wtf-tracker/wtf/templates/pages/input In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6361/templates/pages/input Modified Files: tracking.tmpl Log Message: Random bits of changes here and there, mostly code clean-up but a few bits of refactoring (globally) based on a code review in prep for v1.02 build and release Index: tracking.tmpl =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/templates/pages/input/tracking.tmpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tracking.tmpl 7 Nov 2006 16:42:46 -0000 1.2 --- tracking.tmpl 2 Dec 2006 00:09:09 -0000 1.3 *************** *** 82,86 **** <input type="input" style="width: 25px; text-align: right" name="activity_<tmpl_var name="id">" ! value="<tmpl_if name="percent"><tmpl_var name="percent"><tmpl_else>0</tmpl_if>" />% --- 82,86 ---- <input type="input" style="width: 25px; text-align: right" name="activity_<tmpl_var name="id">" ! value="<tmpl_if name="percent"><tmpl_var name="percent"><tmpl_else>0</tmpl_if>" />% |
From: Gryphon S. <gry...@us...> - 2006-12-02 00:09:13
|
Update of /cvsroot/wtf-tracker/wtf/templates/pages/admin In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6361/templates/pages/admin Modified Files: table_data.tmpl Log Message: Random bits of changes here and there, mostly code clean-up but a few bits of refactoring (globally) based on a code review in prep for v1.02 build and release Index: table_data.tmpl =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/templates/pages/admin/table_data.tmpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** table_data.tmpl 28 Nov 2006 18:47:50 -0000 1.3 --- table_data.tmpl 2 Dec 2006 00:09:09 -0000 1.4 *************** *** 34,38 **** </tr> <tmpl_loop name="table_data"> ! <tr<tmpl_if name="group"> class="group"</tmpl_if> root_url">/save/admin/tablesave', '<tmpl_var name="table">', --- 34,38 ---- </tr> <tmpl_loop name="table_data"> ! <tr root_url">/save/admin/tablesave', '<tmpl_var name="table">', *************** *** 58,62 **** -1 </tmpl_if> ! )"> <tmpl_if name="has_ordering"> <td align="right"><tmpl_var name="ordering"></td> --- 58,68 ---- -1 </tmpl_if> ! )" ! <tmpl_if name="has_groups"> ! <tmpl_if name="group"> ! class="group" ! </tmpl_if> ! </tmpl_if> ! > <tmpl_if name="has_ordering"> <td align="right"><tmpl_var name="ordering"></td> |
From: Gryphon S. <gry...@us...> - 2006-12-02 00:09:13
|
Update of /cvsroot/wtf-tracker/wtf/util In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6361/util Modified Files: weekly_status.pl Log Message: Random bits of changes here and there, mostly code clean-up but a few bits of refactoring (globally) based on a code review in prep for v1.02 build and release Index: weekly_status.pl =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/util/weekly_status.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** weekly_status.pl 28 Nov 2006 21:58:37 -0000 1.2 --- weekly_status.pl 2 Dec 2006 00:09:09 -0000 1.3 *************** *** 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; --- 122,133 ---- for my $note ( @{ $employee->{'note_content'} } ) { $report .= ' ' . $note->{'work_day'} . "\n"; ! ! # The following four lines are "dehtmlizing" based on ! # WTF::Utils::htmlize_notes() $note->{'notes'} =~ s| | |g; + $note->{'notes'} =~ s|<br\s*/>\n*|\n|msg; + $note->{'notes'} =~ s|<|<|msg; + $note->{'notes'} =~ s|>|>|msg; + $note->{'notes'} =~ s/\n/\n /msg; $note->{'notes'} =~ s/[\s\r\n]+$//msg; *************** *** 159,162 **** --- 165,171 ---- ./util/weekly_status.pl DEVEL # run in development enviornment + # run in development enviornment, specifying a date range and a user id + ./util/weekly_status.pl DEVEL 2006-10-25 2006-10-31 77 + =head1 DESCRIPTION *************** *** 172,175 **** --- 181,190 ---- and send all the emails to the administrator. + By adding on two date ranges and a user ID, the script emails a report based + on the date range to the user specified, provided that user has the appropriate + authorization. + + ./util/weekly_status.pl DEVEL 2006-10-25 2006-10-31 77 + =head1 DEPENDENCIES |
From: Gryphon S. <gry...@us...> - 2006-11-28 21:58:43
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Pages In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22723/lib/WTF/Pages Modified Files: Reports.pm Log Message: Addition of support for an Email Team View to Me button on the Team View page Index: Reports.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Reports.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Reports.pm 20 Nov 2006 02:54:58 -0000 1.7 --- Reports.pm 28 Nov 2006 21:58:37 -0000 1.8 *************** *** 13,17 **** use WTF::Utils; ! use constant ROOT_URL => WTF::Config->get( 'links', 'root_url' ); # setup database and SQL statement handles --- 13,20 ---- use WTF::Utils; ! use constant { ! ROOT_URL => WTF::Config->get( 'links', 'root_url' ), ! EMAIL_SCRIPT => WTF::Config->get('weekly_status'), ! }; # setup database and SQL statement handles *************** *** 52,74 **** ); ! # if the user selected a download, then build and return the XLS file ! if ( defined $req->param('download') and $req->param('download') == 1 ) { ! if ( defined $req->param('team') and $req->param('team') eq 'extended' ) { ! # user requested an extended team report ! xls_team_view_build( ! $r, 'extended_team.xls', 'Extended Team', ! $date_start, $date_end, ! WTF::Utils::generate_team_ids( $r->pnotes('user_id') ), ! ); } ! else { ! # user requested a local team report ! xls_team_view_build( ! $r, 'team.xls', 'Team View', ! $date_start, $date_end, ! WTF::Utils::my_team_id( $r->pnotes('user_id') ), ! ); } - return; } --- 55,86 ---- ); ! # check to see if there's a special action we should perform ! if ( defined $req->param('special_action') ) { ! ! # if the user selected a download, then build and return the XLS file ! if ( $req->param('special_action') eq 'download' ) { ! if ( defined $req->param('team') and $req->param('team') eq 'extended' ) { ! # user requested an extended team report ! xls_team_view_build( ! $r, 'extended_team.xls', 'Extended Team', ! $date_start, $date_end, ! WTF::Utils::generate_team_ids( $r->pnotes('user_id') ), ! ); ! } ! else { ! # user requested a local team report ! xls_team_view_build( ! $r, 'team.xls', 'Team View', ! $date_start, $date_end, ! WTF::Utils::my_team_id( $r->pnotes('user_id') ), ! ); ! } ! return; } ! ! # if the user selected to get an email, send it to them ! elsif ( $req->param('special_action') eq 'email' ) { ! system( join( ' ', EMAIL_SCRIPT, $date_start, $date_end, $r->pnotes('user_id') ) ); } } *************** *** 182,185 **** --- 194,198 ---- 'date_end' => $date_end, 'notes_hide' => ($notes_view) ? 0 : 1, + 'username' => $r->pnotes('username'), 'login_as' => $r->pnotes('authz')->{'login_as'} || 0, 'team_summary' => $team_summary, |
From: Gryphon S. <gry...@us...> - 2006-11-28 21:58:41
|
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'}, }); |
From: Gryphon S. <gry...@us...> - 2006-11-28 21:58:41
|
Update of /cvsroot/wtf-tracker/wtf/templates/pages/reports In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22723/templates/pages/reports Modified Files: team_view.tmpl Log Message: Addition of support for an Email Team View to Me button on the Team View page Index: team_view.tmpl =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/templates/pages/reports/team_view.tmpl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** team_view.tmpl 11 Nov 2006 21:43:14 -0000 1.5 --- team_view.tmpl 28 Nov 2006 21:58:37 -0000 1.6 *************** *** 56,60 **** <label> <input type="checkbox" name="team" value="extended" ! <tmpl_if name="extended_team"> checked="checked" --- 56,60 ---- <label> <input type="checkbox" name="team" value="extended" ! <tmpl_if name="extended_team"> checked="checked" *************** *** 68,72 **** <label> <input type="checkbox" name="notes" value="view" ! <tmpl_unless name="notes_hide"> checked="checked" --- 68,72 ---- <label> <input type="checkbox" name="notes" value="view" ! <tmpl_unless name="notes_hide"> checked="checked" *************** *** 79,88 **** <p style="clear: both; padding-top: 5px"> ! <input type="submit" value="View Data" /> ! <input type="hidden" name="download" value="0"/> <input type="button" value="Download Data" /> </p> </form> --- 79,97 ---- <p style="clear: both; padding-top: 5px"> ! <input type="submit" value="View Data" /> ! <input type="hidden" name="special_action" value="none"/> <input type="button" value="Download Data" /> + <input type="button" value="Email Team View to Me" username"> address.' + ) ) { + this.form.special_action.value = 'email'; + this.form.submit(); + } + " /> </p> </form> |
From: Gryphon S. <gry...@us...> - 2006-11-28 18:54:16
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12306 Modified Files: Config.pm Log Message: Small changes to make things slightly more generic for the new implementations Index: Config.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Config.pm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Config.pm 18 Oct 2006 16:52:50 -0000 1.1.1.1 --- Config.pm 28 Nov 2006 18:54:13 -0000 1.2 *************** *** 10,14 **** PATHWAY => ( Apache2::ServerUtil::exists_config_define('DEVEL') ! ) ? '/home/gshafer/dev' : '/var/www', # MySQL database name for DEVEL and PROD --- 10,14 ---- PATHWAY => ( Apache2::ServerUtil::exists_config_define('DEVEL') ! ) ? '/home/gryphonshafer/dev' : '/var/www', # MySQL database name for DEVEL and PROD *************** *** 34,38 **** # Bugzilla database connections settings 'bugzilla' => { ! 'dsn' => 'DBI:mysql:database=bugs;host=grape;port=3306', 'user' => 'remote_bugzilla_username', 'passwd' => 'remote_bugzilla_password', --- 34,38 ---- # Bugzilla database connections settings 'bugzilla' => { ! 'dsn' => 'DBI:mysql:database=bugs;host=bugzilla_hostname;port=3306', 'user' => 'remote_bugzilla_username', 'passwd' => 'remote_bugzilla_password', *************** *** 63,67 **** 'full_path' => ( Apache2::ServerUtil::exists_config_define('DEVEL') ! ) ? 'http://w3d189a:8080/wtf' : 'http://w3d189a/wtf', }, --- 63,67 ---- 'full_path' => ( Apache2::ServerUtil::exists_config_define('DEVEL') ! ) ? 'http://localhost:8080/wtf' : 'http://localhost/wtf', }, *************** *** 72,76 **** 'email' => { 'wtf' => 'wt...@ex...', ! 'admin' => 'gs...@ex...', 'server' => 'mail.example.com', }, --- 72,76 ---- 'email' => { 'wtf' => 'wt...@ex...', ! 'admin' => 'gsh...@ex...', 'server' => 'mail.example.com', }, |
From: Gryphon S. <gry...@us...> - 2006-11-28 18:50:20
|
Update of /cvsroot/wtf-tracker/wtf/templates/pages/reports In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10674/templates/pages/reports Modified Files: activity.tmpl Log Message: Added a <p> wrapper around the month drop-down so that it'll appear more nice-ish in a few more browsers Index: activity.tmpl =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/templates/pages/reports/activity.tmpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** activity.tmpl 7 Nov 2006 16:15:49 -0000 1.1 --- activity.tmpl 28 Nov 2006 18:50:13 -0000 1.2 *************** *** 4,14 **** <form method="get" action="<tmpl_var name="root_url">/view/reports/activity"> ! Month of: <select name="month" > ! <tmpl_loop name="activity_months"> ! <option ! <tmpl_if name="selected">selected="selected"</tmpl_if> ! value="<tmpl_var name="datestamp">"><tmpl_var name="name"></option> ! </tmpl_loop> ! </select> </form> --- 4,16 ---- <form method="get" action="<tmpl_var name="root_url">/view/reports/activity"> ! <p> ! Month of: <select name="month" > ! <tmpl_loop name="activity_months"> ! <option ! <tmpl_if name="selected">selected="selected"</tmpl_if> ! value="<tmpl_var name="datestamp">"><tmpl_var name="name"></option> ! </tmpl_loop> ! </select> ! </p> </form> |
From: Gryphon S. <gry...@us...> - 2006-11-28 18:49:24
|
Update of /cvsroot/wtf-tracker/wtf/templates/pages/admin In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9489/templates/pages/admin Modified Files: table_data.tmpl Log Message: Changes to support full Table Data administration features Index: table_data.tmpl =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/templates/pages/admin/table_data.tmpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** table_data.tmpl 20 Nov 2006 03:19:12 -0000 1.2 --- table_data.tmpl 28 Nov 2006 18:47:50 -0000 1.3 *************** *** 23,26 **** --- 23,27 ---- <table class="tabular interactive_admin"> <tr> + <tmpl_if name="has_ordering"><th>Order #</th></tmpl_if> <tmpl_if name="has_parent_id"> <th>ID</th> *************** *** 33,43 **** </tr> <tmpl_loop name="table_data"> ! <tr<tmpl_if name="group"> class="group"</tmpl_if> ! id">, ! '<tmpl_var name="name" escape="url">', ! <tmpl_if name="has_parent_id"><tmpl_var name="parent_id"><tmpl_else>0</tmpl_if>, ! <tmpl_if name="has_description">'<tmpl_var name="description">'<tmpl_else>0</tmpl_if> ! )"> <tmpl_if name="has_parent_id"> <td align="right"><tmpl_var name="id"></td> --- 34,65 ---- </tr> <tmpl_loop name="table_data"> ! <tr<tmpl_if name="group"> class="group"</tmpl_if> root_url">/save/admin/tablesave', ! '<tmpl_var name="table">', ! <tmpl_var name="id">, ! '<tmpl_var name="name" escape="url">', ! <tmpl_if name="has_ordering"> ! <tmpl_var name="ordering"> ! <tmpl_else> ! -1 ! </tmpl_if>, ! <tmpl_if name="has_parent_id"> ! <tmpl_if name="parent_id"> ! <tmpl_var name="parent_id"> ! <tmpl_else> ! 'NULL' ! </tmpl_if> ! <tmpl_else> ! -1 ! </tmpl_if>, ! <tmpl_if name="has_description"> ! '<tmpl_var name="description" escape="url">' ! <tmpl_else> ! -1 ! </tmpl_if> ! )"> ! <tmpl_if name="has_ordering"> ! <td align="right"><tmpl_var name="ordering"></td> ! </tmpl_if> <tmpl_if name="has_parent_id"> <td align="right"><tmpl_var name="id"></td> *************** *** 54,58 **** </td> <tmpl_if name="has_active"> ! <td class="checkbox"> <input type="checkbox" name="active_<tmpl_var name="id">" --- 76,80 ---- </td> <tmpl_if name="has_active"> ! <td class="checkbox" > <input type="checkbox" name="active_<tmpl_var name="id">" *************** *** 62,66 **** </tmpl_if> <tmpl_if name="has_project"> ! <td class="checkbox"> <input type="checkbox" name="project_<tmpl_var name="id">" --- 84,88 ---- </tmpl_if> <tmpl_if name="has_project"> ! <td class="checkbox" > <input type="checkbox" name="project_<tmpl_var name="id">" *************** *** 76,82 **** </table> <p> ! <input type="button" value="Add New" /> ! <input type="submit" value="Save" /> </p> </form> --- 98,124 ---- </table> + <input type="hidden" name="table" value="<tmpl_var name="table">" /> + <input type="hidden" name="button" value="0" /> + <p> ! <input type="button" root_url">/save/admin/tablesave', ! '<tmpl_var name="table">', ! 0, ! '', ! <tmpl_if name="has_ordering">0<tmpl_else>-1</tmpl_if>, ! <tmpl_if name="has_parent_id">'NULL'<tmpl_else>-1</tmpl_if>, ! <tmpl_if name="has_description">''<tmpl_else>-1</tmpl_if> ! )" value="Add New" /> ! ! <tmpl_if name="has_ordering"> ! <input type="button" value="Reorder" /> ! </tmpl_if> ! <tmpl_if name="show_save"> ! <input type="submit" value="Save" /> ! </tmpl_if> </p> </form> |
From: Gryphon S. <gry...@us...> - 2006-11-28 18:49:03
|
Update of /cvsroot/wtf-tracker/wtf In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9929 Modified Files: httpd.conf Log Message: Changes to the static section of the conf to bring it inline with the way static subdirectories are suppose to be configured through Apache2 (as far as I can tell) Index: httpd.conf =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/httpd.conf,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** httpd.conf 20 Nov 2006 02:50:43 -0000 1.3 --- httpd.conf 28 Nov 2006 18:48:56 -0000 1.4 *************** *** 88,98 **** <Location /wtf/static> SetHandler default-handler ! ! # in production, this seems like the only way to default out of these two ! # handlers for static content; in development, these have to be gone or ! # else Apache2::Reload doesn't work ! <IfDefine !DEVEL> ! PerlAuthenHandler Apache2::Const::OK ! PerlAuthzHandler Apache2::Const::OK ! </IfDefine> </Location> --- 88,92 ---- <Location /wtf/static> SetHandler default-handler ! PerlAuthenHandler "sub { return Apache2::Const::OK }" ! PerlAuthzHandler "sub { return Apache2::Const::OK }" </Location> |
From: Gryphon S. <gry...@us...> - 2006-11-28 18:47:57
|
Update of /cvsroot/wtf-tracker/wtf/static In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9489/static Modified Files: tracking.js Log Message: Changes to support full Table Data administration features Index: tracking.js =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/static/tracking.js,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tracking.js 20 Nov 2006 03:19:12 -0000 1.7 --- tracking.js 28 Nov 2006 18:47:50 -0000 1.8 *************** *** 507,511 **** } ! function editTableData( id, name, parentId, description ) { ! alert("This doesn't work yet. Be patient."); } --- 507,582 ---- } ! var skipEditTableDataFunction = false; ! ! function editTableData( url, table, id, name, ordering, parentId, description ) { ! if (skipEditTableDataFunction) { ! skipEditTableDataFunction = false; ! return; ! } ! ! var originalName = name; ! name = prompt( ! "What name should this " + table + " record have:", ! unescape(name), ! "Name" ! ); ! if ( name == null ) return; ! ! while ( name.length == 0 ) { ! alert("The name of this " + table + " record cannot be blank."); ! name = prompt( ! "What name should this " + table + " record have:", ! unescape(originalName), ! "Name" ! ); ! if ( name == null ) return; ! } ! ! if ( parentId > 0 || parentId == "NULL" ) { ! parentId = prompt( ! "What parent ID number should \"" + name + "\" have:\n" + ! "(Enter \"NULL\" or \"0\" for a null value.)", ! parentId, ! "Parent ID #" ! ); ! if ( parentId == null ) return; ! ! parentId = ( ! parseInt(parentId) == 0 || ! parentId.toLowerCase() == "null" || ! parentId.toLowerCase() == "none" ! ) ? "NULL" : parseInt(parentId); ! if ( isNaN(parentId) ) parentId = "NULL"; ! } ! ! if ( ordering > -1 ) { ! ordering = prompt( ! "What order number should \"" + name + "\" have:", ! ordering, ! "Order #" ! ); ! if ( ordering == null ) return; ! ordering = parseInt(ordering); ! if ( isNaN(ordering) ) ordering = 0; ! } ! ! if ( description != -1 ) { ! description = prompt( ! "What description should \"" + name + "\" have:", ! unescape(description), ! "Description" ! ); ! if ( description == null ) return; ! description = encodeURIComponent(description); ! } ! ! name = encodeURIComponent(name); ! ! document.location.href = url + "?" + ! "table=" + table + "&" + ! "id=" + id + "&" + ! "name=" + name + "&" + ! "ordering=" + ordering + "&" + ! "pid=" + parentId + "&" + ! "description=" + description; } |
From: Gryphon S. <gry...@us...> - 2006-11-28 18:47:57
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Pages In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9489/lib/WTF/Pages Modified Files: Admin.pm Log Message: Changes to support full Table Data administration features Index: Admin.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Admin.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Admin.pm 20 Nov 2006 02:53:07 -0000 1.4 --- Admin.pm 28 Nov 2006 18:47:50 -0000 1.5 *************** *** 22,25 **** --- 22,26 ---- 'has_project' => 0, 'has_groups' => 0, + 'has_ordering' => 1, }, { *************** *** 31,34 **** --- 32,36 ---- 'has_project' => 0, 'has_groups' => 0, + 'has_ordering' => 1, }, { *************** *** 40,43 **** --- 42,46 ---- 'has_project' => 1, 'has_groups' => 1, + 'has_ordering' => 1, }, { *************** *** 49,52 **** --- 52,56 ---- 'has_project' => 0, 'has_groups' => 1, + 'has_ordering' => 1, }, ], *************** *** 411,418 **** --- 415,425 ---- 'tables' => \@tables, 'table_data' => $table_data, + 'table' => $table->{'table'}, 'has_parent_id' => $table->{'has_parent_id'}, 'has_description' => $table->{'has_description'}, 'has_active' => $table->{'has_active'}, 'has_project' => $table->{'has_project'}, + 'has_ordering' => $table->{'has_ordering'}, + 'show_save' => ( $table->{'has_active'} or $table->{'has_project'} ) ? 1 : 0, ); *************** *** 424,433 **** my $req = WTF::Utils::get_req($r); ! $r->headers_out->set( 'Location' => ROOT_URL . '/view/admin/tables' ); return $r->status( Apache2::Const::REDIRECT ); } --- 431,565 ---- my $req = WTF::Utils::get_req($r); + # store locally the data about the table we're going to edit + my $table = ( grep { + defined $req->param('table') and $req->param('table') eq $_->{'table'} + } @{ (DATA_TABLES) } )[0]; + # if there was some goof-up and we're not able to get table information, + # return to the main Table Data page + if ( not defined $table ) { + $r->headers_out->set( 'Location' => ROOT_URL . '/view/admin/tables' ); + return $r->status( Apache2::Const::REDIRECT ); + } + # reorder the ordering column so that the numbers are in a clean series + if ( $req->param('button') and $req->param('button') eq 'reorder' ) { + my $sth_upd = $dbh->prepare( + 'UPDATE ' . $table->{'table'} . ' SET ordering = ? WHERE id = ?' + ) or die $dbh->errstr(); + my $sql_sth = 'table_data_' . $table->{'table'}; + $sth->{$sql_sth}->execute() or die $dbh->errstr(); + my $ordering = 0; + while ( $_ = $sth->{$sql_sth}->fetchrow_hashref() ) { + $ordering++; + $sth_upd->execute( $ordering, $_->{'id'} ); + } + $sth->{$sql_sth}->finish(); + } ! # updating the boolean columns for an existing table record ! elsif ( not defined $req->param('id') ) { ! $dbh->do( ! 'UPDATE ' . $table->{'table'} . ' SET ' . join( ', ', grep { defined } ( ! ( $table->{'has_active'} ) ? 'active = 0' : undef, ! ( $table->{'has_project'} ) ? 'project = 0' : undef, ! ) ) ! ) or die $dbh->errstr(); ! ! if ( $table->{'has_active'} ) { ! $dbh->do( ! 'UPDATE ' . $table->{'table'} . ' SET active = 1 WHERE id IN ( ' . join( ', ', ! map { substr( $_, 7 ) } grep { substr( $_, 0, 7 ) eq 'active_' } $req->param() ) . ')' ! ) or die $dbh->errstr(); ! } ! ! if ( $table->{'has_project'} ) { ! $dbh->do( ! 'UPDATE ' . $table->{'table'} . ' SET project = 1 WHERE id IN ( ' . join( ', ', ! map { substr( $_, 8 ) } grep { substr( $_, 0, 8 ) eq 'project_' } $req->param() ) . ')' ! ) or die $dbh->errstr(); ! } ! } ! ! # inserting a new record into the table ! elsif ( $req->param('id') < 1 ) { ! ! # setup an array of column names we're going to use in our query; ! # "name" is always going to exist, the rest come from the ! # table definition structure ! my @columns = ( 'name', grep { defined } ( ! ( $table->{'has_parent_id'} ) ? $table->{'table'} . '_id' : undef, ! ( $table->{'has_ordering'} ) ? 'ordering' : undef, ! ( $table->{'has_description'} ) ? 'description' : undef, ! ) ); ! ! my $sth = $dbh->prepare( ! 'INSERT INTO ' . $table->{'table'} . ' ( ' . ! join( ', ', @columns ) . ' ) VALUES ( ' . join( ', ', ('?') x @columns ) . ' )' ! ) or die $dbh->errstr(); ! ! # set parent_id and description for SQL insert based on what the ! # Javascript sends into this method ! my $pid = ( ! not defined $req->param('pid') or ! lc( $req->param('pid') ) eq 'null' ! ) ? undef : $req->param('pid'); ! my $description = ( ! not defined $req->param('description') or ! length( $req->param('description') ) == 0 ! ) ? undef : $req->param('description'); ! ! # execute the query, grepping-out input values for columns that ! # don't exist ! $sth->execute( grep { $_ ne '-1' } ( ! $req->param('name'), ! ( $table->{'has_parent_id'} ) ? $pid : -1, ! ( $table->{'has_ordering'} ) ? $req->param('ordering') : -1, ! ( $table->{'has_description'} ) ? $description : -1, ! ) ) or die $dbh->errstr(); ! } ! ! # updating an existing record in the table ! elsif ( $req->param('id') > 0 ) { ! ! # setup an array of column names we're going to use in our query; ! # "name" is always going to exist, the rest come from the ! # table definition structure ! my @columns = ( 'name = ?', grep { defined } ( ! ( $table->{'has_parent_id'} ) ? $table->{'table'} . '_id = ?' : undef, ! ( $table->{'has_ordering'} ) ? 'ordering = ?' : undef, ! ( $table->{'has_description'} ) ? 'description = ?' : undef, ! ) ); ! ! my $sth = $dbh->prepare( ! 'UPDATE ' . $table->{'table'} . ' SET ' . join( ', ', @columns ) . ' WHERE id = ?' ! ) or die $dbh->errstr(); ! ! # set parent_id and description for SQL insert based on what the ! # Javascript sends into this method ! my $pid = ( ! not defined $req->param('pid') or ! lc( $req->param('pid') ) eq 'null' ! ) ? undef : $req->param('pid'); ! my $description = ( ! not defined $req->param('description') or ! length( $req->param('description') ) == 0 ! ) ? undef : $req->param('description'); ! ! # execute the query, grepping-out input values for columns that ! # don't exist ! $sth->execute( grep { $_ ne '-1' } ( ! $req->param('name'), ! ( $table->{'has_parent_id'} ) ? $pid : -1, ! ( $table->{'has_ordering'} ) ? $req->param('ordering') : -1, ! ( $table->{'has_description'} ) ? $description : -1, ! $req->param('id'), ! ) ) or die $dbh->errstr(); ! } ! ! # return to the Table Data view for the table to which we just made changes ! $r->headers_out->set( 'Location' => ROOT_URL . '/view/admin/tables?table=' . $table->{'table'} ); return $r->status( Apache2::Const::REDIRECT ); } |
From: Gryphon S. <gry...@us...> - 2006-11-28 18:47:57
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9489/lib/WTF Modified Files: SQL.pm Log Message: Changes to support full Table Data administration features Index: SQL.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/SQL.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SQL.pm 20 Nov 2006 02:53:07 -0000 1.6 --- SQL.pm 28 Nov 2006 18:47:50 -0000 1.7 *************** *** 333,346 **** }, ! 'table_data_team' => 'SELECT id, team_id AS parent_id, name FROM team', ! 'table_data_area' => 'SELECT id, name, description, active FROM area ORDER BY ordering', 'table_data_task' => q{ ! SELECT id, task_id AS parent_id, name, description, active, project FROM task ORDER BY ordering }, 'table_data_activity' => q{ ! SELECT id, activity_id AS parent_id, name, description, active FROM activity ORDER BY ordering }, --- 333,346 ---- }, ! 'table_data_team' => 'SELECT id, team_id AS parent_id, name, ordering FROM team ORDER BY ordering', ! 'table_data_area' => 'SELECT id, name, description, active, ordering FROM area ORDER BY ordering', 'table_data_task' => q{ ! SELECT id, task_id AS parent_id, name, description, active, project, ordering FROM task ORDER BY ordering }, 'table_data_activity' => q{ ! SELECT id, activity_id AS parent_id, name, description, active, ordering FROM activity ORDER BY ordering }, |
From: Gryphon S. <gry...@us...> - 2006-11-28 18:47:57
|
Update of /cvsroot/wtf-tracker/wtf/db In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9489/db Modified Files: next_rel_004.sql schema.xml Log Message: Changes to support full Table Data administration features Index: next_rel_004.sql =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/db/next_rel_004.sql,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** next_rel_004.sql 7 Nov 2006 16:20:49 -0000 1.2 --- next_rel_004.sql 28 Nov 2006 18:47:50 -0000 1.3 *************** *** 43,44 **** --- 43,47 ---- description = 'User can view the activity summary report detailing monthly summaries of activity by percent for each employee. Typically, this authorization is granted to finance and accounting teams.'; + ALTER TABLE team ADD COLUMN ordering TINYINT UNSIGNED NOT NULL AFTER name; + UPDATE team SET ordering = id; + Index: schema.xml =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/db/schema.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** schema.xml 11 Nov 2006 21:42:15 -0000 1.3 --- schema.xml 28 Nov 2006 18:47:50 -0000 1.4 *************** *** 2,6 **** <DBMODEL Version="4.0"> <SETTINGS> ! <GLOBALSETTINGS ModelName="wtf" IDModel="0" IDVersion="0" VersionStr="1.0.0.0" Comments="" UseVersionHistroy="1" AutoIncVersion="1" DatabaseType="MySQL" ZoomFac="100.00" XPos="0" YPos="0" DefaultDataType="5" DefaultTablePrefix="0" DefSaveDBConn="" DefSyncDBConn="" DefQueryDBConn="" Printer="\\pecan\LaserJet 4200 PCL 6 South Workroom" HPageCount="5.14572864321608" PageAspectRatio="1.328971962616822" PageOrientation="0" PageFormat="A4 (210x297 mm, 8.26x11.7 inches)" SelectedPages="0" UsePositionGrid="0" PositionGridX="20" PositionGridY="20" TableNameInRefs="1" DefaultTableType="0" ActivateRefDefForNewRelations="0" FKPrefix="" FKPostfix="" CreateFKRefDefIndex="0" DBQuoteCharacter="`" CreateSQLforLinkedObjects="0" DefModelFont="Tahoma" CanvasWidth="4096" CanvasHeight="2842" /> <DATATYPEGROUPS> <DATATYPEGROUP Name="Numeric Types" Icon="1" /> --- 2,6 ---- <DBMODEL Version="4.0"> <SETTINGS> ! <GLOBALSETTINGS ModelName="wtf" IDModel="0" IDVersion="0" VersionStr="1.0.0.0" Comments="" UseVersionHistroy="1" AutoIncVersion="1" DatabaseType="MySQL" ZoomFac="100.00" XPos="0" YPos="120" DefaultDataType="5" DefaultTablePrefix="0" DefSaveDBConn="" DefSyncDBConn="" DefQueryDBConn="" Printer="\\pecan\LaserJet 4200 PCL 6 South Workroom" HPageCount="5.14572864321608" PageAspectRatio="1.328971962616822" PageOrientation="0" PageFormat="A4 (210x297 mm, 8.26x11.7 inches)" SelectedPages="0" UsePositionGrid="0" PositionGridX="20" PositionGridY="20" TableNameInRefs="1" DefaultTableType="0" ActivateRefDefForNewRelations="0" FKPrefix="" FKPostfix="" CreateFKRefDefIndex="0" DBQuoteCharacter="`" CreateSQLforLinkedObjects="0" DefModelFont="Tahoma" CanvasWidth="4096" CanvasHeight="2842" /> <DATATYPEGROUPS> <DATATYPEGROUP Name="Numeric Types" Icon="1" /> *************** *** 586,590 **** </INDICES> </TABLE> ! <TABLE ID="1205" Tablename="team" PrevTableName="Table_08" XPos="529" YPos="368" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="13" > <COLUMNS> <COLUMN ID="1207" ColName="id" PrevColName="" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments=""> --- 586,590 ---- </INDICES> </TABLE> ! <TABLE ID="1205" Tablename="team" PrevTableName="Table_08" XPos="536" YPos="344" TableType="0" TablePrefix="0" nmTable="0" Temporary="0" UseStandardInserts="0" StandardInserts="\n" TableOptions="DelayKeyTblUpdates=0\nPackKeys=0\nRowChecksum=0\nRowFormat=0\nUseRaid=0\nRaidType=0\n" Comments="" Collapsed="0" IsLinkedObject="0" IDLinkedModel="-1" Obj_id_Linked="-1" OrderPos="13" > <COLUMNS> <COLUMN ID="1207" ColName="id" PrevColName="" Pos="0" idDatatype="5" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="1" NotNull="1" AutoInc="1" IsForeignKey="0" DefaultValue="" Comments=""> *************** *** 605,608 **** --- 605,614 ---- </OPTIONSELECTED> </COLUMN> + <COLUMN ID="1318" ColName="ordering" PrevColName="" Pos="3" idDatatype="1" DatatypeParams="" Width="-1" Prec="-1" PrimaryKey="0" NotNull="1" AutoInc="0" IsForeignKey="0" DefaultValue="" Comments=""> + <OPTIONSELECTED> + <OPTIONSELECT Value="1" /> + <OPTIONSELECT Value="0" /> + </OPTIONSELECTED> + </COLUMN> </COLUMNS> <RELATIONS_START> |
From: Gryphon S. <gry...@us...> - 2006-11-20 03:19:15
|
Update of /cvsroot/wtf-tracker/wtf/templates/pages/admin In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv7104/templates/pages/admin Modified Files: table_data.tmpl Log Message: Ever so slightly closer to functionality to support Table Data administration, but not totally there yet. Index: table_data.tmpl =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/templates/pages/admin/table_data.tmpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** table_data.tmpl 20 Nov 2006 02:53:54 -0000 1.1 --- table_data.tmpl 20 Nov 2006 03:19:12 -0000 1.2 *************** *** 34,38 **** <tmpl_loop name="table_data"> <tr<tmpl_if name="group"> class="group"</tmpl_if> ! > <tmpl_if name="has_parent_id"> <td align="right"><tmpl_var name="id"></td> --- 34,43 ---- <tmpl_loop name="table_data"> <tr<tmpl_if name="group"> class="group"</tmpl_if> ! id">, ! '<tmpl_var name="name" escape="url">', ! <tmpl_if name="has_parent_id"><tmpl_var name="parent_id"><tmpl_else>0</tmpl_if>, ! <tmpl_if name="has_description">'<tmpl_var name="description">'<tmpl_else>0</tmpl_if> ! )"> <tmpl_if name="has_parent_id"> <td align="right"><tmpl_var name="id"></td> |
From: Gryphon S. <gry...@us...> - 2006-11-20 03:19:15
|
Update of /cvsroot/wtf-tracker/wtf/static In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv7104/static Modified Files: tracking.js Log Message: Ever so slightly closer to functionality to support Table Data administration, but not totally there yet. Index: tracking.js =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/static/tracking.js,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tracking.js 20 Nov 2006 02:53:07 -0000 1.6 --- tracking.js 20 Nov 2006 03:19:12 -0000 1.7 *************** *** 506,507 **** --- 506,511 ---- } } + + function editTableData( id, name, parentId, description ) { + alert("This doesn't work yet. Be patient."); + } |
From: Gryphon S. <gry...@us...> - 2006-11-20 02:55:01
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Pages In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29771/lib/WTF/Pages Modified Files: Reports.pm Log Message: Removed some inputs to the SQL claus ('cause apparently DBI complains when I screw up) Index: Reports.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Reports.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Reports.pm 18 Nov 2006 20:47:18 -0000 1.6 --- Reports.pm 20 Nov 2006 02:54:58 -0000 1.7 *************** *** 118,123 **** $date_start, $date_end, $date_start, $date_end, - $date_start, $date_end, - $date_start, $date_end, ) or die $dbh->errstr(); --- 118,121 ---- |