Skip to content

Commit 856e311

Browse files
author
Buddy Burden
committed
=> fixed bug in -L introduced by previous fix (doh!)
cleaned up a few uninitialized warnings
1 parent 8ffa67c commit 856e311

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

Barefoot/T3/valid.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ sub get_parameter
198198
}
199199

200200
debuggit(4 => Dumper($valid_parms));
201-
debuggit(3 => wantarray ? "will return ($parm, $valid_parms->{$parm})" : "will return", $parm);
201+
debuggit(3 => wantarray ? ("will return (", $parm, ", ", $valid_parms->{$parm}, ")") : ("will return", $parm));
202202

203203
# if force was specified, you'll get ($parm, undef)
204204
# if ALLOW_NULL was specified and the user chooses NULL, you'll get (undef, undef)

t3/timer/timer

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,13 @@ if ($command eq 'START') # start a timer
233233
if (test_connection())
234234
{
235235
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);
238238

239239
my ($phase_needed, $tracking_needed)
240240
= 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;
243243
}
244244
else
245245
{
@@ -642,7 +642,7 @@ END
642642
exit;
643643
}
644644

645-
unless ($timers->{T3::CURRENT_TIMER} eq $log_timername)
645+
unless ($timers->{T3::CURRENT_TIMER} and $timers->{T3::CURRENT_TIMER} eq $log_timername)
646646
{
647647
# HACK! these are hardcoded for now; should be changed to pull from a config file or something
648648
local $parminfo->{'timer'} = $log_timername;
@@ -904,28 +904,28 @@ sub get_giventimer
904904

905905
sub get_timer_parameter
906906
{
907-
my ($parmname) = @_;
907+
my ($parmname, $info) = @_;
908908
debuggit(4 => "get_timer_parameter: wantarray is", wantarray);
909909

910910
# objinfo would be the specified timer, which we get here
911-
my $objinfo = $timers->{$parminfo->{'timer'}};
911+
my $objinfo = $timers->{$info->{'timer'}};
912912

913913
# this is somewhat complicated. we need to figure out what the proper thing (client, project, phase, or
914914
# tracking code) should be, and then use it as the default. now, we have three possible places to get
915915
# this info from: the default for this user (from the database; get_parameter knows how to retrieve that),
916916
# 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.
921921

922922
# got it? here we go ...
923923

924924
my $opts = {};
925925
# this will keep people from being able to change parameters if the command is "start"
926926
$opts->{'RESTRICT_CHANGES'} = true if $command eq 'START';
927927

928-
return get_parameter($parmname, $parminfo, $objinfo, $opts);
928+
return get_parameter($parmname, $info, $objinfo, $opts);
929929
}
930930

931931

@@ -1078,7 +1078,7 @@ sub gather_log_info
10781078
# based on this, there is not a whole lot you can do differently in
10791079
# the order chosen below, so DON'T MUCK WITH IT!
10801080

1081-
my ($emp_id, $emp_fullname) = get_timer_parameter("employee");
1081+
my ($emp_id, $emp_fullname) = get_timer_parameter("employee", $info);
10821082

10831083
# $mod->user may not match emp_id at this point; that's ok.
10841084
# It lets us track the actual person who submitted the command.
@@ -1094,7 +1094,7 @@ sub gather_log_info
10941094

10951095

10961096
# Get client info
1097-
my ($client, $client_name) = get_timer_parameter("client");
1097+
my ($client, $client_name) = get_timer_parameter("client", $info);
10981098

10991099
my $hours;
11001100
HOURS: {
@@ -1108,15 +1108,15 @@ sub gather_log_info
11081108
$info->{'hours'} = $hours;
11091109

11101110
# Get project info
1111-
my ($project, $project_name) = get_timer_parameter("project");
1111+
my ($project, $project_name) = get_timer_parameter("project", $info);
11121112

11131113
my ($phase_needed, $tracking_needed, $comments_needed) = proj_requirements($client, $project, $date);
11141114

11151115
# 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, "");
11171117
$info->{'phase'} = $phase;
11181118

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, "");
11201120
$info->{tracking} = $tracking;
11211121

11221122
# Get comments if necessary

0 commit comments

Comments
 (0)