wtf-tracker-cvs Mailing List for Work Tracking Facilitator (Page 5)
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-11-20 02:53:57
|
Update of /cvsroot/wtf-tracker/wtf/templates/pages/admin In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29379/templates/pages/admin Added Files: table_data.tmpl Log Message: Added support for the Table Data administrator pages --- NEW FILE: table_data.tmpl --- <tmpl_include name="header.tmpl"> <h2><tmpl_var name="title"></h2> <p> Use the following form and table to alter the contents and<br/> setup of the various lookup tables within the application. </p> <form method="get" action="<tmpl_var name="root_url">/view/admin/tables"> <p> <select name="table" > <tmpl_loop name="tables"> <option <tmpl_if name="selected">selected="selected"</tmpl_if> value="<tmpl_var name="table">"><tmpl_var name="title"></option> </tmpl_loop> </select> </p> </form> <form method="get" action="<tmpl_var name="root_url">/save/admin/tablesave"> <table class="tabular interactive_admin"> <tr> <tmpl_if name="has_parent_id"> <th>ID</th> <th>Parent</th> </tmpl_if> <th>Name</th> <tmpl_if name="has_active"><th>Active</th></tmpl_if> <tmpl_if name="has_project"><th>Project Task</th></tmpl_if> <tmpl_if name="has_description"><th>Description</th></tmpl_if> </tr> <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> <td align="right"> <tmpl_if name="parent_id"> <tmpl_var name="parent_id"> <tmpl_else> NULL </tmpl_if> </td> </tmpl_if> <td class="task_indent_<tmpl_var name="indent">"> <tmpl_var name="name" escape="html"> </td> <tmpl_if name="has_active"> <td class="checkbox"> <input type="checkbox" name="active_<tmpl_var name="id">" <tmpl_if name="active">checked="checked"</tmpl_if> /> </td> </tmpl_if> <tmpl_if name="has_project"> <td class="checkbox"> <input type="checkbox" name="project_<tmpl_var name="id">" <tmpl_if name="project">checked="checked"</tmpl_if> /> </td> </tmpl_if> <tmpl_if name="has_description"> <td><tmpl_var name="description"></td> </tmpl_if> </tr> </tmpl_loop> </table> <p> <input type="button" value="Add New" /> <input type="submit" value="Save" /> </p> </form> <tmpl_include name="footer.tmpl"> |
From: Gryphon S. <gry...@us...> - 2006-11-20 02:53:11
|
Update of /cvsroot/wtf-tracker/wtf/templates/pages/admin In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29218/templates/pages/admin Modified Files: authz.tmpl task_area.tmpl Log Message: Added support for the Table Data administrator pages Index: authz.tmpl =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/templates/pages/admin/authz.tmpl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** authz.tmpl 18 Oct 2006 16:52:50 -0000 1.1.1.1 --- authz.tmpl 20 Nov 2006 02:53:08 -0000 1.2 *************** *** 4,8 **** <p> ! Use the following table to alter or administrate authorization privileges to specific features. </p> --- 4,8 ---- <p> ! Use the following table to alter or administrate<br/> authorization privileges to specific features. </p> Index: task_area.tmpl =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/templates/pages/admin/task_area.tmpl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** task_area.tmpl 18 Oct 2006 16:52:50 -0000 1.1.1.1 --- task_area.tmpl 20 Nov 2006 02:53:08 -0000 1.2 *************** *** 31,35 **** name="t_<tmpl_var name="task_id">_a_<tmpl_var name="area_id">" <tmpl_if name="checked">checked="checked"</tmpl_if> ! / > </td> </tmpl_loop> --- 31,35 ---- name="t_<tmpl_var name="task_id">_a_<tmpl_var name="area_id">" <tmpl_if name="checked">checked="checked"</tmpl_if> ! /> </td> </tmpl_loop> |
From: Gryphon S. <gry...@us...> - 2006-11-20 02:53:11
|
Update of /cvsroot/wtf-tracker/wtf/templates/framework In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29218/templates/framework Modified Files: nav_bar.tmpl Log Message: Added support for the Table Data administrator pages Index: nav_bar.tmpl =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/templates/framework/nav_bar.tmpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** nav_bar.tmpl 7 Nov 2006 16:40:41 -0000 1.3 --- nav_bar.tmpl 20 Nov 2006 02:53:07 -0000 1.4 *************** *** 41,44 **** --- 41,48 ---- href="<tmpl_var name="root_url">/view/admin/taskarea">Task/Area</a> + <a <tmpl_if name="current_admin_tables">class="current_page"</tmpl_if> + title="Alter the data in the various lookup tables within the application" + href="<tmpl_var name="root_url">/view/admin/tables">Table Data</a> + </tmpl_if> |
From: Gryphon S. <gry...@us...> - 2006-11-20 02:53:11
|
Update of /cvsroot/wtf-tracker/wtf/templates/pages In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29218/templates/pages Modified Files: input.tmpl Log Message: Added support for the Table Data administrator pages Index: input.tmpl =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/templates/pages/input.tmpl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** input.tmpl 18 Oct 2006 16:52:50 -0000 1.1.1.1 --- input.tmpl 20 Nov 2006 02:53:07 -0000 1.2 *************** *** 4,9 **** <p> ! To add a record to the displayed daily time, click on a project and ! task in the left and center table. </p> --- 4,8 ---- <p> ! Use the Open Projects and/or Tasks frames to fill the Daily Timesheet. </p> |
From: Gryphon S. <gry...@us...> - 2006-11-20 02:53:11
|
Update of /cvsroot/wtf-tracker/wtf/static In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29218/static Modified Files: general.css tracking.js Log Message: Added support for the Table Data administrator pages Index: general.css =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/static/general.css,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** general.css 18 Nov 2006 20:34:06 -0000 1.9 --- general.css 20 Nov 2006 02:53:07 -0000 1.10 *************** *** 252,255 **** --- 252,273 ---- } + /* Interactive Table Style for Table Data Administration Pages */ + + table.interactive_admin { + cursor: pointer; + margin-bottom: 20px; + } + + table.interactive_admin th { + cursor: default; + } + + table.interactive_admin tr:hover td, + table.interactive_admin tr.hover td, + table.interactive_admin tr.group:hover td { + background-color: #ccccff; + color: #000000; + } + /* Table Style for Tasks */ *************** *** 273,277 **** table td.task_indent_1 { ! padding-left: 15px; } --- 291,295 ---- table td.task_indent_1 { ! padding-left: 13px; } *************** *** 280,283 **** --- 298,329 ---- } + table td.task_indent_3 { + padding-left: 33px; + } + + table td.task_indent_4 { + padding-left: 43px; + } + + table td.task_indent_5 { + padding-left: 53px; + } + + table td.task_indent_6 { + padding-left: 63px; + } + + table td.task_indent_7 { + padding-left: 73px; + } + + table td.task_indent_8 { + padding-left: 83px; + } + + table td.task_indent_9 { + padding-left: 93px; + } + /* Task/Area Table Style */ Index: tracking.js =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/static/tracking.js,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tracking.js 7 Nov 2006 16:39:24 -0000 1.5 --- tracking.js 20 Nov 2006 02:53:07 -0000 1.6 *************** *** 81,104 **** if ( ( tables[t].className == "tabular interactive" ) || ( tables[t].className == "tabular interactive indent_more" ) || ( tables[t].className == "tabular tracking" ) ) { ! var rows = document.getElementsByTagName("tr"); for ( var i = 0; i < rows.length; i++ ) { - rows[i]. { ! // "deselected" is another IE hack because IE doesn't ! // implicitly return a style to the previous; must ! // explicitly force IE to a style ! if ( this.className == "deselected" ) { ! this.className = "hover"; } ! else { ! this.className += " hover"; } } - rows[i]. { - this.className = this.className.replace( "hover", "" ); - } } } --- 81,114 ---- if ( ( tables[t].className == "tabular interactive" ) || + ( tables[t].className == "tabular interactive_admin" ) || ( tables[t].className == "tabular interactive indent_more" ) || ( tables[t].className == "tabular tracking" ) ) { ! var rows = document.getElementsByTagName("tr"); for ( var i = 0; i < rows.length; i++ ) { ! // this if check ensures that if we're using IE and when we're hovering over a row ! // that's a group on a standard-ish tablular interactive table, we won't change the ! // background color ! if ( ! ( ! ( tables[t].className == "tabular interactive" ) && ! ( rows[i].className == "group" ) ! ) ) { ! rows[i]. { ! ! // "deselected" is another IE hack because IE doesn't ! // implicitly return a style to the previous; must ! // explicitly force IE to a style ! if ( this.className == "deselected" ) { ! this.className = "hover"; ! } ! else { ! this.className += " hover"; ! } } ! rows[i]. { ! this.className = this.className.replace( "hover", "" ); } } } } |
From: Gryphon S. <gry...@us...> - 2006-11-20 02:53:10
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29218/lib/WTF Modified Files: Pages.pm SQL.pm Log Message: Added support for the Table Data administrator pages Index: SQL.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/SQL.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SQL.pm 7 Nov 2006 16:25:52 -0000 1.5 --- SQL.pm 20 Nov 2006 02:53:07 -0000 1.6 *************** *** 333,336 **** --- 333,349 ---- }, + '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 + }, + ); Index: Pages.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Pages.pm 7 Nov 2006 16:23:21 -0000 1.3 --- Pages.pm 20 Nov 2006 02:53:07 -0000 1.4 *************** *** 40,43 **** --- 40,45 ---- '/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' ], }, }; |
From: Gryphon S. <gry...@us...> - 2006-11-20 02:53:10
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Pages In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29218/lib/WTF/Pages Modified Files: Admin.pm Log Message: Added support for the Table Data administrator pages Index: Admin.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Admin.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Admin.pm 7 Nov 2006 16:27:54 -0000 1.3 --- Admin.pm 20 Nov 2006 02:53:07 -0000 1.4 *************** *** 11,16 **** use constant { ! ROOT_URL => WTF::Config->get( 'links', 'root_url' ), ! UPDATE => WTF::Config->get( 'update' ), }; --- 11,54 ---- use constant { ! ROOT_URL => WTF::Config->get( 'links', 'root_url' ), ! UPDATE => WTF::Config->get( 'update' ), ! DATA_TABLES => [ ! { ! 'title' => 'Teams / Groups', ! 'table' => 'team', ! 'has_parent_id' => 1, ! 'has_description' => 0, ! 'has_active' => 0, ! 'has_project' => 0, ! 'has_groups' => 0, ! }, ! { ! 'title' => 'Functional Areas', ! 'table' => 'area', ! 'has_parent_id' => 0, ! 'has_description' => 1, ! 'has_active' => 1, ! 'has_project' => 0, ! 'has_groups' => 0, ! }, ! { ! 'title' => 'Tasks', ! 'table' => 'task', ! 'has_parent_id' => 1, ! 'has_description' => 1, ! 'has_active' => 1, ! 'has_project' => 1, ! 'has_groups' => 1, ! }, ! { ! 'title' => 'Summary Activities', ! 'table' => 'activity', ! 'has_parent_id' => 1, ! 'has_description' => 1, ! 'has_active' => 1, ! 'has_project' => 0, ! 'has_groups' => 1, ! }, ! ], }; *************** *** 287,290 **** --- 325,436 ---- } + sub screen_table_data { + my ( $self, $r ) = @_; + my $req = WTF::Utils::get_req($r); + my $tmpl_obj = $self->setup_tmpl('admin/table_data.tmpl'); + + my $table; + my @tables = map { + # set selected to true for the appropriate table requested by the user + # and save that name into $table for later + if ( defined $req->param('table') and $req->param('table') eq $_->{'table'} ) { + $_->{'selected'} = 1; + $table = $_; + } + else { + $_->{'selected'} = 0; + } + + $_; + } @{ (DATA_TABLES) }; + + # if user requested a table not in the above hard-coded data, then + # redirect them to the default Table Data view + if ( defined $req->param('table') and not defined $table ) { + $r->headers_out->set( 'Location' => ROOT_URL . '/view/admin/tables' ); + return $r->status( Apache2::Const::REDIRECT ); + } + + $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( + 'title' => 'Administrate Table Data', + 'nav_bar' => WTF::Utils::nav_bar_data( $r, 'admin_tables' ), + 'tables' => \@tables, + 'table_data' => $table_data, + 'has_parent_id' => $table->{'has_parent_id'}, + 'has_description' => $table->{'has_description'}, + 'has_active' => $table->{'has_active'}, + 'has_project' => $table->{'has_project'}, + ); + + return $tmpl_obj->output(); + } + + sub action_save_table_data { + my ( $self, $r ) = @_; + my $req = WTF::Utils::get_req($r); + + + + + + + $r->headers_out->set( 'Location' => ROOT_URL . '/view/admin/tables' ); + return $r->status( Apache2::Const::REDIRECT ); + } + 1; __END__ |
From: Gryphon S. <gry...@us...> - 2006-11-20 02:53:10
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Apache In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29218/lib/WTF/Apache Modified Files: Authz.pm Log Message: Added support for the Table Data administrator pages Index: Authz.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Apache/Authz.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Authz.pm 7 Nov 2006 16:27:07 -0000 1.3 --- Authz.pm 20 Nov 2006 02:53:07 -0000 1.4 *************** *** 38,42 **** ( $section eq 'admin/saveusers' and not $r->pnotes('is_admin') ) or ( $section eq 'admin/taskarea' and not $r->pnotes('is_admin') ) or ! ( $section eq 'admin/savetarea' and not $r->pnotes('is_admin') ) ) { --- 38,44 ---- ( $section eq 'admin/saveusers' and not $r->pnotes('is_admin') ) or ( $section eq 'admin/taskarea' and not $r->pnotes('is_admin') ) or ! ( $section eq 'admin/savetarea' and not $r->pnotes('is_admin') ) or ! ( $section eq 'admin/tables' and not $r->pnotes('is_admin') ) or ! ( $section eq 'admin/tablesave' and not $r->pnotes('is_admin') ) ) { |
From: Gryphon S. <gry...@us...> - 2006-11-20 02:50:51
|
Update of /cvsroot/wtf-tracker/wtf In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28130 Modified Files: httpd.conf Log Message: Added PerlInitHandler for Apache2::Reload and turned-off the Authen and Authz overrides when in development... This will probably mean more of those stupid iframe problems in development, but at least Apache2::Reload seems to work correctly... most of the time. There's probably something screwed-up somewhere in this conf regarding Apache2::Reload and/or the /wtf/static section of the site. Not sure how to fix this right now. Index: httpd.conf =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/httpd.conf,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** httpd.conf 27 Oct 2006 22:35:39 -0000 1.2 --- httpd.conf 20 Nov 2006 02:50:43 -0000 1.3 *************** *** 19,22 **** --- 19,23 ---- <IfDefine DEVEL> PerlModule Apache2::Reload + PerlInitHandler Apache2::Reload </IfDefine> *************** *** 87,91 **** <Location /wtf/static> SetHandler default-handler ! PerlAuthenHandler Apache2::Const::OK ! PerlAuthzHandler Apache2::Const::OK </Location> --- 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> |
From: Gryphon S. <gry...@us...> - 2006-11-18 21:15:31
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Pages In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23902/lib/WTF/Pages Modified Files: Input.pm Log Message: If the user isn't assigned to a company functional area, then the user will see all tasks. The solution requires two DB queries, but this should be OK because it should be very rare (and indicative of a problem) if a user isn't assigned to a company functional area. Index: Input.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Input.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Input.pm 7 Nov 2006 16:49:10 -0000 1.4 --- Input.pm 18 Nov 2006 21:15:23 -0000 1.5 *************** *** 68,73 **** $sth->{'tasks'}->execute( $r->pnotes('user_id') ) or die $dbh->errstr(); my ( $indent, $last_task_id, @tasks ) = ( 0, 0 ); ! while ( $_ = $sth->{'tasks'}->fetchrow_hashref() ) { # if the task_id doesn't exist or if it does but it's not the same --- 68,79 ---- $sth->{'tasks'}->execute( $r->pnotes('user_id') ) or die $dbh->errstr(); + my $tasks_from_db = $sth->{'tasks'}->fetchall_arrayref({}) or die $dbh->errstr(); + if ( not @{$tasks_from_db} ) { + $sth->{'all_tasks'}->execute() or die $dbh->errstr(); + $tasks_from_db = $sth->{'all_tasks'}->fetchall_arrayref({}) or die $dbh->errstr(); + } + 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 |
From: Gryphon S. <gry...@us...> - 2006-11-18 20:47:22
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Pages In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv13072/lib/WTF/Pages Modified Files: Reports.pm Log Message: Fixed use of uninitialized value warning Index: Reports.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Reports.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Reports.pm 18 Nov 2006 20:27:09 -0000 1.5 --- Reports.pm 18 Nov 2006 20:47:18 -0000 1.6 *************** *** 329,332 **** --- 329,333 ---- $_->{'employees'} ||= 0; $_->{'days'} ||= 0; + $_->{'average'} ||= 0; $_->{'average'} = int( $_->{'average'} * 100 ) / 100; |
From: Gryphon S. <gry...@us...> - 2006-11-18 20:34:11
|
Update of /cvsroot/wtf-tracker/wtf/static In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv7973/static Modified Files: general.css Log Message: Moved Open Projects codeline header styles down a bit into their own section, and dropped the font from 11 to 10 ('cause I like it better that way) Index: general.css =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/static/general.css,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** general.css 11 Nov 2006 21:43:14 -0000 1.8 --- general.css 18 Nov 2006 20:34:06 -0000 1.9 *************** *** 38,66 **** } - span.codeline_header a { - text-decoration: none; - display: block; - padding: 1px 3px 1px 3px; - border: 1px solid #999999; - font-size: 11pt; - margin: 0px 0px 8px 0px; - } - - a.codeline_nav { - color: #000000; - background-color: #fafafa; - } - - a.codeline_nav:hover { - background-color: #ccccff; - color: #000000; - } - - a.codeline_current { - font-weight: bold; - background-color: #ffcccc; - color: #000000; - } - .indent { margin-left: 20px; --- 38,41 ---- *************** *** 161,164 **** --- 136,166 ---- } + /* Open Projects codeline headers */ + + span.codeline_header a { + text-decoration: none; + display: block; + padding: 1px 3px 1px 3px; + border: 1px solid #999999; + font-size: 10pt; + margin: 0px 0px 8px 0px; + } + + a.codeline_nav { + color: #000000; + background-color: #fafafa; + } + + a.codeline_nav:hover { + background-color: #ccccff; + color: #000000; + } + + a.codeline_current { + font-weight: bold; + background-color: #ffcccc; + color: #000000; + } + /* Column Layout */ |
From: Gryphon S. <gry...@us...> - 2006-11-18 20:27:14
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Pages In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5256/lib/WTF/Pages Modified Files: Reports.pm Log Message: Removed part of the WHERE clause for the SQL that SELECTs the summary data for the Team View page; this fixes a bug wherein users with no data at all would just vanish from the summary. Index: Reports.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Reports.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Reports.pm 11 Nov 2006 21:43:14 -0000 1.4 --- Reports.pm 18 Nov 2006 20:27:09 -0000 1.5 *************** *** 111,117 **** LEFT OUTER JOIN work AS w ON e.id = w.employee_id LEFT OUTER JOIN notes AS n ON e.id = n.employee_id ! WHERE ! e.team_id IN ( } . join( ',', @{$summary_team_ids} ) . q{ ) AND e.active = 1 AND ! ( w.work_day BETWEEN ? AND ? OR n.work_day BETWEEN ? AND ? ) GROUP BY e.id ORDER BY e.name --- 111,115 ---- LEFT OUTER JOIN work AS w ON e.id = w.employee_id LEFT OUTER JOIN notes AS n ON e.id = n.employee_id ! WHERE e.team_id IN ( } . join( ',', @{$summary_team_ids} ) . q{ ) AND e.active = 1 GROUP BY e.id ORDER BY e.name |
From: Jason <jbr...@us...> - 2006-11-06 16:47:04
|
Update of /cvsroot/wtf-tracker/wtf/static In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19531/static Modified Files: general.css tracking.js Log Message: cleaned up file formatting Index: general.css =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/static/general.css,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** general.css 3 Nov 2006 16:29:37 -0000 1.5 --- general.css 6 Nov 2006 16:46:56 -0000 1.6 *************** *** 31,35 **** font-size: 11pt; padding-top: 2px; ! margin: 0px 0px 8px 0px; } --- 31,35 ---- font-size: 11pt; padding-top: 2px; ! margin: 0px 0px 3px 0px; } *************** *** 38,65 **** } ! a.code_nav { text-decoration: none; display: block; - color: #000000; padding: 1px 3px 1px 3px; border: 1px solid #999999; - background-color: #fafafa; font-size: 11pt; margin: 0px 0px 8px 0px; } ! a:hover { background-color: #ccccff; color: #000000; } ! a.current_codeline { ! text-decoration: none; ! display: block; ! padding: 1px 3px 1px 3px; ! border: 1px solid #999999; ! font-size: 11pt; font-weight: bold; - margin: 0px 0px 8px 0px; background-color: #ffcccc; color: #000000; --- 38,62 ---- } ! span.codeline_header a { text-decoration: none; display: block; padding: 1px 3px 1px 3px; border: 1px solid #999999; font-size: 11pt; margin: 0px 0px 8px 0px; } ! a.codeline_nav { ! color: #000000; ! background-color: #fafafa; ! } ! ! a.codeline_nav:hover { background-color: #ccccff; color: #000000; } ! a.codeline_current { font-weight: bold; background-color: #ffcccc; color: #000000; Index: tracking.js =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/static/tracking.js,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tracking.js 3 Nov 2006 16:29:37 -0000 1.3 --- tracking.js 6 Nov 2006 16:46:56 -0000 1.4 *************** *** 392,410 **** //Javascript for expanding/contracting of specific codeline projects ! function expandCodelines(codeline_id, codeline_id_link) { ! var CD = document.getElementById(codeline_id).style; ! var isIE = window.ActiveXObject ? true : false; // ActiveX is only used in Internet Explorer // to open a codeline ! if (CD.display == 'none') { ! document.getElementById(codeline_id_link).className = 'current_codeline'; if (isIE) { ! CD.display = 'block'; } else { ! CD.display = 'table'; } // to close a codeline ! } else if (CD.display == 'block' || CD.display == 'table') { ! CD.display = 'none'; ! document.getElementById(codeline_id_link).className = 'code_nav'; } } --- 392,410 ---- //Javascript for expanding/contracting of specific codeline projects ! function expandCodelines( codeline_id, codeline_id_link ) { ! var codelineStyle = document.getElementById(codeline_id).style; ! var isIE = (window.ActiveXObject) ? true : false; // ActiveX is only used in Internet Explorer // to open a codeline ! if (codelineStyle.display == "none") { ! document.getElementById(codeline_id_link).className = 'codeline_current'; if (isIE) { ! codelineStyle.display = "block"; } else { ! codelineStyle.display = "table"; } // to close a codeline ! }else if ( codelineStyle.display == "block" || codelineStyle.display == "table" ) { ! codelineStyle.display = "none"; ! document.getElementById(codeline_id_link).className = 'codeline_nav'; } } |
From: Jason <jbr...@us...> - 2006-11-06 16:47:03
|
Update of /cvsroot/wtf-tracker/wtf/templates/pages/input In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19531/templates/pages/input Modified Files: projects.tmpl Log Message: cleaned up file formatting Index: projects.tmpl =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/templates/pages/input/projects.tmpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** projects.tmpl 3 Nov 2006 16:29:37 -0000 1.2 --- projects.tmpl 6 Nov 2006 16:46:56 -0000 1.3 *************** *** 4,13 **** <tmpl_loop name="codelines"> ! <a id="codeline_<tmpl_var name="id">_link" class="code_nav" ! href="javascript:expandCodelines('codeline_<tmpl_var name="id">','codeline_<tmpl_var name="id">_link');"> ! <tmpl_var name="codeline"> ! </a> ! <table class="tabular interactive" id="codeline_<tmpl_var name='id'>" style="display: none;"> <tr> <th>Summary</th> --- 4,15 ---- <tmpl_loop name="codelines"> ! <span class="codeline_header"> ! <a id="codeline_<tmpl_var name="id">_link" class="codeline_nav" ! href="javascript:expandCodelines('codeline_<tmpl_var name="id">','codeline_<tmpl_var name="id">_link')"> ! <tmpl_var name="codeline"> ! </a> ! </span> ! <table class="tabular interactive" id="codeline_<tmpl_var name='id'>" style="display: none"> <tr> <th>Summary</th> |
From: Jason <jbr...@us...> - 2006-11-03 16:29:47
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Pages In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3740/lib/WTF/Pages Modified Files: Input.pm Log Message: Added show/hide functionality to codeline project tables Index: Input.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Input.pm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Input.pm 18 Oct 2006 16:52:50 -0000 1.1.1.1 --- Input.pm 3 Nov 2006 16:29:37 -0000 1.2 *************** *** 40,43 **** --- 40,44 ---- push @codelines, { 'codeline' => $projects->[0]{'codeline'}, + 'id' => $projects->[0]{'codeline_id'}, 'projects' => $projects, }; |
From: Jason <jbr...@us...> - 2006-11-03 16:29:45
|
Update of /cvsroot/wtf-tracker/wtf/templates/pages/input In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3740/templates/pages/input Modified Files: projects.tmpl Log Message: Added show/hide functionality to codeline project tables Index: projects.tmpl =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/templates/pages/input/projects.tmpl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** projects.tmpl 18 Oct 2006 16:52:50 -0000 1.1.1.1 --- projects.tmpl 3 Nov 2006 16:29:37 -0000 1.2 *************** *** 4,10 **** <tmpl_loop name="codelines"> ! <h5><tmpl_var name="codeline"></h5> ! <table class="tabular interactive"> <tr> <th>Summary</th> --- 4,13 ---- <tmpl_loop name="codelines"> ! <a id="codeline_<tmpl_var name="id">_link" class="code_nav" ! href="javascript:expandCodelines('codeline_<tmpl_var name="id">','codeline_<tmpl_var name="id">_link');"> ! <tmpl_var name="codeline"> ! </a> ! <table class="tabular interactive" id="codeline_<tmpl_var name='id'>" style="display: none;"> <tr> <th>Summary</th> |
From: Jason <jbr...@us...> - 2006-11-03 16:29:42
|
Update of /cvsroot/wtf-tracker/wtf/static In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3740/static Modified Files: general.css tracking.js Log Message: Added show/hide functionality to codeline project tables Index: general.css =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/static/general.css,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** general.css 27 Oct 2006 22:34:51 -0000 1.4 --- general.css 3 Nov 2006 16:29:37 -0000 1.5 *************** *** 31,35 **** font-size: 11pt; padding-top: 2px; ! margin: 0px 0px 3px 0px; } --- 31,35 ---- font-size: 11pt; padding-top: 2px; ! margin: 0px 0px 8px 0px; } *************** *** 38,41 **** --- 38,69 ---- } + a.code_nav { + text-decoration: none; + display: block; + color: #000000; + padding: 1px 3px 1px 3px; + border: 1px solid #999999; + background-color: #fafafa; + font-size: 11pt; + margin: 0px 0px 8px 0px; + } + + a:hover { + background-color: #ccccff; + color: #000000; + } + + a.current_codeline { + text-decoration: none; + display: block; + padding: 1px 3px 1px 3px; + border: 1px solid #999999; + font-size: 11pt; + font-weight: bold; + margin: 0px 0px 8px 0px; + background-color: #ffcccc; + color: #000000; + } + .indent { margin-left: 20px; Index: tracking.js =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/static/tracking.js,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tracking.js 27 Oct 2006 22:34:51 -0000 1.2 --- tracking.js 3 Nov 2006 16:29:37 -0000 1.3 *************** *** 1,4 **** window. () { - // activate the "resizeIframeHeight" functionality if the current page // contains a "projects_iframe" object (activate if on the home page) --- 1,3 ---- *************** *** 391,392 **** --- 390,418 ---- } } + + //Javascript for expanding/contracting of specific codeline projects + function expandCodelines(codeline_id, codeline_id_link) { + var CD = document.getElementById(codeline_id).style; + var isIE = window.ActiveXObject ? true : false; // ActiveX is only used in Internet Explorer + // to open a codeline + if (CD.display == 'none') { + document.getElementById(codeline_id_link).className = 'current_codeline'; + if (isIE) { + CD.display = 'block'; + } else { + CD.display = 'table'; + } + // to close a codeline + } else if (CD.display == 'block' || CD.display == 'table') { + CD.display = 'none'; + document.getElementById(codeline_id_link).className = 'code_nav'; + } + } + + + + + + + + |
From: Jason <jbr...@us...> - 2006-11-03 16:29:41
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3740/lib/WTF Modified Files: SQL.pm Log Message: Added show/hide functionality to codeline project tables Index: SQL.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/SQL.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SQL.pm 27 Oct 2006 22:34:51 -0000 1.3 --- SQL.pm 3 Nov 2006 16:29:37 -0000 1.4 *************** *** 144,148 **** 'projects' => q{ ! SELECT p.id, p.bug, p.name, c.name AS codeline FROM project AS p INNER JOIN codeline AS c ON p.codeline_id = c.id --- 144,148 ---- 'projects' => q{ ! SELECT p.id, p.bug, p.name, c.name AS codeline, c.id AS codeline_id FROM project AS p INNER JOIN codeline AS c ON p.codeline_id = c.id |
From: Gryphon S. <gry...@us...> - 2006-10-27 22:37:09
|
Update of /cvsroot/wtf-tracker/wtf/db In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3585/db Added Files: next_rel_004.sql Log Message: Initial add of the SQL file for changes to support release 4 --- NEW FILE: next_rel_004.sql --- # database changes to support Release 004 INSERT INTO authz SET name='login_as', ordering=7, description='User can login as any member of his or her extended team by clicking on links from the Team View report page. Typically, this authorization is granted only to team managers.'; |
From: Gryphon S. <gry...@us...> - 2006-10-27 22:35:43
|
Update of /cvsroot/wtf-tracker/wtf In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2826 Modified Files: httpd.conf Log Message: Changes to support the creation of 'login as' functionality; managers with this new authz can login as one of their employees Index: httpd.conf =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/httpd.conf,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** httpd.conf 18 Oct 2006 16:52:50 -0000 1.1.1.1 --- httpd.conf 27 Oct 2006 22:35:39 -0000 1.2 *************** *** 5,8 **** --- 5,9 ---- PerlModule Apache::DBI PerlModule Apache2::Access + PerlModule Apache2::Cookie PerlModule Apache2::Request PerlModule Apache2::RequestIO *************** *** 85,88 **** # set default handler for static files like graphics, CSS, and Javascript <Location /wtf/static> ! SetHandler default-handler </Location> --- 86,91 ---- # set default handler for static files like graphics, CSS, and Javascript <Location /wtf/static> ! SetHandler default-handler ! PerlAuthenHandler Apache2::Const::OK ! PerlAuthzHandler Apache2::Const::OK </Location> |
From: Gryphon S. <gry...@us...> - 2006-10-27 22:34:55
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Apache In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2283/lib/WTF/Apache Modified Files: Authen.pm Authz.pm Log Message: Changes to support the creation of 'login as' functionality; managers with this new authz can login as one of their employees Index: Authen.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Apache/Authen.pm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Authen.pm 18 Oct 2006 16:52:50 -0000 1.1.1.1 --- Authen.pm 27 Oct 2006 22:34:51 -0000 1.2 *************** *** 4,10 **** --- 4,13 ---- use warnings; use Apache2::Const -compile => qw( OK AUTH_REQUIRED DECLINED ); + use Apache2::Cookie; use WTF::DBH; use WTF::SQL; + use constant ROOT_URL => WTF::Config->get( 'links', 'root_url' ); + # setup database and SQL statement handles my $dbh = WTF::DBH->connect(); *************** *** 27,30 **** --- 30,35 ---- $sth->{'authen'}->finish(); + $r->pnotes( 'username' => $r->user() ); + # use simple crypt() encryption to test password if ( *************** *** 32,39 **** ( crypt( $passwd_auth, substr( $passwd_db, 0, 2 ) ) eq $passwd_db || '' ) ) { ! $sth->{'last_login'}->execute($id) or die $dbh->errstr(); $r->pnotes( 'user_id' => $id ); $r->pnotes( 'user_name' => $user_name ); $r->pnotes( 'is_admin' => $is_admin ); return Apache2::Const::OK; } --- 37,89 ---- ( crypt( $passwd_auth, substr( $passwd_db, 0, 2 ) ) eq $passwd_db || '' ) ) { ! ! # setup cookie jar ! my $jar = Apache2::Cookie::Jar->new($r); ! ! # if this is an initial request and we haven't logged in, set ! # authen cookie and update last login ! unless ( $jar->cookies('authen') and $jar->cookies('authen')->value() ) { ! Apache2::Cookie->new( ! $r, ! '-name' => 'authen', ! '-value' => 1, ! '-path' => ROOT_URL, ! )->bake($r); ! $sth->{'last_login'}->execute($id) or die $dbh->errstr(); ! } ! ! # if we're trying to login as someone else, verify that we can ! # login as this particular user by checking if that user is in ! # our extended team ! if ( ! $jar->cookies('login_as') and ! $jar->cookies('login_as')->value() > 0 and ! ( ! grep { $jar->cookies('login_as')->value() == $_ } ! @{ WTF::Data::get_team_employee_ids($id) } ! ) ! ) { ! ! # verify current user has authorization to login as other user ! $sth->{'authz'}->execute($id) or die $dbh->errstr(); ! if ( grep { $_->[0] eq 'login_as' } @{ $sth->{'authz'}->fetchall_arrayref() } ) { ! ! $r->pnotes( 'real_user_id' => $id ); ! ! $sth->{'employee_by_id'}->execute( $jar->cookies('login_as')->value() ); ! $r->pnotes( 'username' => $sth->{'employee_by_id'}->fetchrow_array() ); ! $sth->{'employee_by_id'}->finish(); ! ! $sth->{'authen'}->execute( $r->pnotes('username') ) or die $dbh->errstr(); ! ( $id, $passwd_db, $user_name, $is_admin ) = $sth->{'authen'}->fetchrow_array(); ! $sth->{'authen'}->finish(); ! } ! $sth->{'authz'}->finish(); ! } ! $r->pnotes( 'user_id' => $id ); $r->pnotes( 'user_name' => $user_name ); $r->pnotes( 'is_admin' => $is_admin ); + return Apache2::Const::OK; } Index: Authz.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Apache/Authz.pm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Authz.pm 18 Oct 2006 16:52:50 -0000 1.1.1.1 --- Authz.pm 27 Oct 2006 22:34:51 -0000 1.2 *************** *** 31,34 **** --- 31,35 ---- ( $section eq 'admin/newauthzs' and not $r->pnotes('authz')->{'admin_authz'} ) or ( $section eq 'admin/update' and not $r->pnotes('authz')->{'update'} ) or + ( $section eq 'admin/loginas' and not $r->pnotes('authz')->{'login_as'} ) or # pages and actions only administrators can view or do |
From: Gryphon S. <gry...@us...> - 2006-10-27 22:34:55
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF/Pages In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2283/lib/WTF/Pages Modified Files: Reports.pm Admin.pm Log Message: Changes to support the creation of 'login as' functionality; managers with this new authz can login as one of their employees Index: Reports.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Reports.pm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Reports.pm 18 Oct 2006 16:52:50 -0000 1.1.1.1 --- Reports.pm 27 Oct 2006 22:34:51 -0000 1.2 *************** *** 96,99 **** --- 96,100 ---- 'date_end' => $date_end, 'notes_hide' => ($notes_view) ? 0 : 1, + 'login_as' => $r->pnotes('authz')->{'login_as'} || 0, 'team_data' => WTF::Data::team_data( $team_ids, Index: Admin.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages/Admin.pm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Admin.pm 18 Oct 2006 16:52:50 -0000 1.1.1.1 --- Admin.pm 27 Oct 2006 22:34:51 -0000 1.2 *************** *** 5,8 **** --- 5,9 ---- use base 'WTF::Pages'; use Apache2::Const; + use Apache2::Cookie; use WTF::DBH; use WTF::SQL; *************** *** 66,79 **** # query for employees in the user's team and extended team(s) ! my $sth_employees = $dbh->prepare(q{ ! SELECT id ! FROM employee ! WHERE team_id IN ( } . join(', ', @{ ! WTF::Utils::generate_team_ids( $r->pnotes('user_id') ) ! }) . q{ ) ! AND active = 1 ! }); ! $sth_employees->execute() or die $dbh->errstr(); ! my $employee_ids = join( ',', map { $_->[0] } @{ $sth_employees->fetchall_arrayref() } ); # delete every authorization for every employee in the user's team or --- 67,71 ---- # query for employees in the user's team and extended team(s) ! my $employee_ids = join( ',', @{ WTF::Data::get_team_employee_ids( $r->pnotes('user_id') ) } ); # delete every authorization for every employee in the user's team or *************** *** 253,256 **** --- 245,286 ---- } + sub action_login_as { + my ( $self, $r ) = @_; + my $req = WTF::Utils::get_req($r); + + if ( + grep { $req->param('id') == $_ } + @{ WTF::Data::get_team_employee_ids( $r->pnotes('user_id') ) } + ) { + Apache2::Cookie->new( + $r, + '-name' => 'login_as', + '-value' => $req->param('id'), + '-path' => ROOT_URL, + )->bake($r); + $r->headers_out->set( 'Location' => ROOT_URL . '/view/reports/myweekly' ); + } + else { + $r->headers_out->set( 'Location' => ROOT_URL . '/view/reports/team' ); + } + + return $r->status( Apache2::Const::REDIRECT ); + } + + sub action_revert_to_self { + my ( $self, $r ) = @_; + + Apache2::Cookie->new( + $r, + '-name' => 'login_as', + '-value' => 0, + '-path' => ROOT_URL, + '-expires' => '-1d', + )->bake($r); + + $r->headers_out->set( 'Location' => ROOT_URL . '/view/reports/myweekly' ); + return $r->status( Apache2::Const::REDIRECT ); + } + 1; __END__ |
From: Gryphon S. <gry...@us...> - 2006-10-27 22:34:55
|
Update of /cvsroot/wtf-tracker/wtf/templates/framework In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2283/templates/framework Modified Files: nav_bar.tmpl Log Message: Changes to support the creation of 'login as' functionality; managers with this new authz can login as one of their employees Index: nav_bar.tmpl =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/templates/framework/nav_bar.tmpl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** nav_bar.tmpl 18 Oct 2006 16:52:50 -0000 1.1.1.1 --- nav_bar.tmpl 27 Oct 2006 22:34:51 -0000 1.2 *************** *** 57,60 **** --- 57,63 ---- title="You are logged in as <tmpl_var name="username" escape="html">" href="mailto:<tmpl_var name="username">"><tmpl_var name="username"></a>) + <tmpl_if name="revert"> + [ <a href="<tmpl_var name="root_url">/action/admin/revert">Revert to Self</a> ] + </tmpl_if> </p> </tmpl_loop> |
From: Gryphon S. <gry...@us...> - 2006-10-27 22:34:55
|
Update of /cvsroot/wtf-tracker/wtf/lib/WTF In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2283/lib/WTF Modified Files: Utils.pm SQL.pm Pages.pm Data.pm Log Message: Changes to support the creation of 'login as' functionality; managers with this new authz can login as one of their employees Index: SQL.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/SQL.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SQL.pm 24 Oct 2006 23:24:02 -0000 1.2 --- SQL.pm 27 Oct 2006 22:34:51 -0000 1.3 *************** *** 44,47 **** --- 44,49 ---- }, + 'employee_by_id' => 'SELECT username FROM employee WHERE id = ?', + 'employee_first_letter' => q{ SELECT Index: Pages.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Pages.pm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Pages.pm 18 Oct 2006 16:52:50 -0000 1.1.1.1 --- Pages.pm 27 Oct 2006 22:34:51 -0000 1.2 *************** *** 37,40 **** --- 37,42 ---- '/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' ], }, }; Index: Data.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Data.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Data.pm 25 Oct 2006 16:40:19 -0000 1.2 --- Data.pm 27 Oct 2006 22:34:51 -0000 1.3 *************** *** 1,4 **** package WTF::Data; ! our $VERSION = 1.01; use strict; use warnings; --- 1,4 ---- package WTF::Data; ! our $VERSION = 1.02; use strict; use warnings; *************** *** 95,98 **** --- 95,113 ---- } + sub get_team_employee_ids { + my ($id) = @_; + + my $sth_employees = $dbh->prepare(q{ + SELECT id + FROM employee + WHERE team_id IN ( } . join(', ', @{ + WTF::Utils::generate_team_ids($id) + }) . q{ ) + AND active = 1 + }); + $sth_employees->execute() or die $dbh->errstr(); + return [ map { $_->[0] } @{ $sth_employees->fetchall_arrayref() } ]; + } + 1; __END__ *************** *** 112,115 **** --- 127,131 ---- my ( $work_data, $week_of ) = WTF::Data::myweekly_data( $user_id, $date ); my $team_data = WTF::Data::team_data( @input_parameters ); + my $employee_ids = WTF::Data::get_team_employee_ids($id); =head1 DESCRIPTION *************** *** 222,225 **** --- 238,252 ---- } + =head2 get_team_employee_ids() + + This simple function accepts a user ID (typically the user ID of the current + user) and returns an array reference containing a list of all the user IDs + of all the users in the extended team of the initial user referenced by the + incoming user ID. + + my $employee_ids = WTF::Data::get_team_employee_ids($id); + # $id might be 1138 + # $employee_ids might be [ 42, 1138, 433 ] + =head1 DEPENDENCIES Index: Utils.pm =================================================================== RCS file: /cvsroot/wtf-tracker/wtf/lib/WTF/Utils.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Utils.pm 25 Oct 2006 16:40:19 -0000 1.2 --- Utils.pm 27 Oct 2006 22:34:51 -0000 1.3 *************** *** 88,95 **** return [ { ! 'username' => $r->user(), 'user_name' => $r->pnotes('user_name'), 'current_' . $current_link => 1, 'is_admin' => $r->pnotes('is_admin'), map { 'authz_' . $_ => 1 } keys %{ $r->pnotes('authz') }, --- 88,96 ---- return [ { ! 'username' => $r->pnotes('username'), 'user_name' => $r->pnotes('user_name'), 'current_' . $current_link => 1, 'is_admin' => $r->pnotes('is_admin'), + 'revert' => $r->pnotes('real_user_id') || 0, map { 'authz_' . $_ => 1 } keys %{ $r->pnotes('authz') }, |