@@ -233,13 +233,13 @@ if ($command eq 'START') # start a timer
233
233
if (test_connection())
234
234
{
235
235
debuggit(5 => " given timer doesn't exist, getting new values" );
236
- get_timer_parameter(" client" );
237
- get_timer_parameter(" project" );
236
+ get_timer_parameter(" client" , $parminfo );
237
+ get_timer_parameter(" project" , $parminfo );
238
238
239
239
my ($phase_needed , $tracking_needed )
240
240
= proj_requirements($parminfo -> {' client' }, $parminfo -> {' project' }, calc_date(time ));
241
- get_timer_parameter(" phase" ) if $phase_needed ;
242
- get_timer_parameter(" tracking" ) if $tracking_needed ;
241
+ get_timer_parameter(" phase" , $parminfo ) if $phase_needed ;
242
+ get_timer_parameter(" tracking" , $parminfo ) if $tracking_needed ;
243
243
}
244
244
else
245
245
{
642
642
exit ;
643
643
}
644
644
645
- unless ($timers -> {T3::CURRENT_TIMER} eq $log_timername )
645
+ unless ($timers -> {T3::CURRENT_TIMER} and $timers -> {T3::CURRENT_TIMER} eq $log_timername )
646
646
{
647
647
# HACK! these are hardcoded for now; should be changed to pull from a config file or something
648
648
local $parminfo -> {' timer' } = $log_timername ;
@@ -904,28 +904,28 @@ sub get_giventimer
904
904
905
905
sub get_timer_parameter
906
906
{
907
- my ($parmname ) = @_ ;
907
+ my ($parmname , $info ) = @_ ;
908
908
debuggit(4 => " get_timer_parameter: wantarray is" , wantarray );
909
909
910
910
# objinfo would be the specified timer, which we get here
911
- my $objinfo = $timers -> {$parminfo -> {' timer' }};
911
+ my $objinfo = $timers -> {$info -> {' timer' }};
912
912
913
913
# this is somewhat complicated. we need to figure out what the proper thing (client, project, phase, or
914
914
# tracking code) should be, and then use it as the default. now, we have three possible places to get
915
915
# this info from: the default for this user (from the database; get_parameter knows how to retrieve that),
916
916
# the thing already set (for a pre-existing timer; this comes from objinfo), or the thing specified on the
917
- # command line (if specified at all; this comes from parminfo). for most cases, the priority is: command
918
- # line, pre-existing, default. for the start command, however, a pre-existing parameter can't be changed
919
- # if it exists, so we use it and exit. also, if -f (force) was specified (that flag is in parminfo), we
920
- # can quit right there.
917
+ # command line (if specified at all; this comes from info, which is usually $ parminfo). for most cases,
918
+ # the priority is: command line, pre-existing, default. for the start command, however, a pre-existing
919
+ # parameter can't be changed if it exists, so we use it and exit. also, if -f (force) was specified
920
+ # (that flag is in info), we can quit right there.
921
921
922
922
# got it? here we go ...
923
923
924
924
my $opts = {};
925
925
# this will keep people from being able to change parameters if the command is "start"
926
926
$opts -> {' RESTRICT_CHANGES' } = true if $command eq ' START' ;
927
927
928
- return get_parameter($parmname , $parminfo , $objinfo , $opts );
928
+ return get_parameter($parmname , $info , $objinfo , $opts );
929
929
}
930
930
931
931
@@ -1078,7 +1078,7 @@ sub gather_log_info
1078
1078
# based on this, there is not a whole lot you can do differently in
1079
1079
# the order chosen below, so DON'T MUCK WITH IT!
1080
1080
1081
- my ($emp_id , $emp_fullname ) = get_timer_parameter(" employee" );
1081
+ my ($emp_id , $emp_fullname ) = get_timer_parameter(" employee" , $info );
1082
1082
1083
1083
# $mod->user may not match emp_id at this point; that's ok.
1084
1084
# It lets us track the actual person who submitted the command.
@@ -1094,7 +1094,7 @@ sub gather_log_info
1094
1094
1095
1095
1096
1096
# Get client info
1097
- my ($client , $client_name ) = get_timer_parameter(" client" );
1097
+ my ($client , $client_name ) = get_timer_parameter(" client" , $info );
1098
1098
1099
1099
my $hours ;
1100
1100
HOURS: {
@@ -1108,15 +1108,15 @@ sub gather_log_info
1108
1108
$info -> {' hours' } = $hours ;
1109
1109
1110
1110
# Get project info
1111
- my ($project , $project_name ) = get_timer_parameter(" project" );
1111
+ my ($project , $project_name ) = get_timer_parameter(" project" , $info );
1112
1112
1113
1113
my ($phase_needed , $tracking_needed , $comments_needed ) = proj_requirements($client , $project , $date );
1114
1114
1115
1115
# Get phase information
1116
- my ($phase , $phase_name ) = $phase_needed ? get_timer_parameter(" phase" ) : (undef , " " );
1116
+ my ($phase , $phase_name ) = $phase_needed ? get_timer_parameter(" phase" , $info ) : (undef , " " );
1117
1117
$info -> {' phase' } = $phase ;
1118
1118
1119
- my ($tracking , $tracking_name ) = $tracking_needed ? get_timer_parameter(" tracking" ) : (undef , " " );
1119
+ my ($tracking , $tracking_name ) = $tracking_needed ? get_timer_parameter(" tracking" , $info ) : (undef , " " );
1120
1120
$info -> {tracking } = $tracking ;
1121
1121
1122
1122
# Get comments if necessary
0 commit comments