| Line 1... |
Line 1... |
| 1 |
#!/usr/bin/perl
|
1 |
#!/usr/bin/perl
|
| Line -... |
Line 2... |
| - |
|
2 |
|
| - |
|
3 |
# Redirect error messages to a log of my choosing. (it's annoying to filter for errors in the shared env)
|
| - |
|
4 |
my $error_log_path = $ENV{SERVER_NAME} eq "volunteers.rollercon.com" ? "/home3/rollerco/logs/" : "/tmp/";
|
| - |
|
5 |
close STDERR;
|
| - |
|
6 |
open STDERR, '>>', $error_log_path.'vorc_error.log' or warn "Failed to open redirected logfile ($0): $!";
|
| - |
|
7 |
#warn "Redirecting errors to ${error_log_path}vorc_error.log";
|
| 2 |
|
8 |
|
| Line 3... |
Line 9... |
| 3 |
#if ($ENV{SHELL}) { die "This script shouldn't be executed from the command line!\n"; }
|
9 |
#if ($ENV{SHELL}) { die "This script shouldn't be executed from the command line!\n"; }
|
| 4 |
|
10 |
|
| 5 |
use strict;
|
11 |
use strict;
|
| Line 28... |
Line 34... |
| 28 |
print $h->a ({ href=>"/schedule/" }, "[Go Home]");
|
34 |
print $h->a ({ href=>"/schedule/" }, "[Go Home]");
|
| 29 |
print $h->close ("html");
|
35 |
print $h->close ("html");
|
| 30 |
exit;
|
36 |
exit;
|
| 31 |
}
|
37 |
}
|
| Line 32... |
Line 38... |
| 32 |
|
38 |
|
| 33 |
my $username = $h->a ({ href=>"/schedule/manage_user.pl?submit=View&RCid=$user->{RCid}" }, $user->{derby_name});
|
39 |
my $username = $h->a ({ href=>"/schedule/view_user.pl?submit=View&RCid=$user->{RCid}" }, $user->{derby_name});
|
| 34 |
my $RCid = $user->{RCid};
|
40 |
my $RCid = $user->{RCid};
|
| 35 |
my $RCAUTH_cookie = CGI::Cookie->new(-name=>'RCAUTH',-value=>"$cookie_string",-expires=>"+30m");
|
41 |
my $RCAUTH_cookie = CGI::Cookie->new(-name=>'RCAUTH',-value=>"$cookie_string",-expires=>"+30m");
|
| 36 |
#my $YEAR = 1900 + (localtime)[5]; #which year of data to display, default to current
|
42 |
#my $YEAR = 1900 + (localtime)[5]; #which year of data to display, default to current
|
| Line 158... |
Line 164... |
| 158 |
|
164 |
|
| Line 159... |
Line 165... |
| 159 |
$FORM{$_} = param($_); # Retrieve all of the FORM data submitted
|
165 |
$FORM{$_} = param($_); # Retrieve all of the FORM data submitted
|
| 160 |
|
166 |
|
| 161 |
if ((/^filter/) and ($FORM{$_} ne '')) { # Build a set of filters to apply
|
167 |
if ((/^filter/) and ($FORM{$_} ne '')) { # Build a set of filters to apply
|
| 162 |
my ($filter,$field) = split /-/, $_;
|
168 |
my ($filter,$field) = split /-/, $_;
|
| 163 |
$FILTER->{$field} = $FORM{$_};
|
169 |
$FILTER->{$field} = $FORM{$_} unless notInArray ($field, \@allFields);
|
| 164 |
} elsif ($FORM{$_} eq "true") { # Compile list of fields to display
|
170 |
} elsif ($FORM{$_} eq "true") { # Compile list of fields to display
|
| 165 |
if ($_ ne "shiftinclude") {
|
171 |
if ($_ ne "shiftinclude") {
|
| 166 |
push @displayFields, $_;
|
172 |
push @displayFields, $_;
|
| Line 272... |
Line 278... |
| 272 |
$radiobutton = $h->div ({ class=>'autoload' },
|
278 |
$radiobutton = $h->div ({ class=>'autoload' },
|
| 273 |
["Autoload Changes: ",
|
279 |
["Autoload Changes: ",
|
| 274 |
$h->input ({ type=>"radio", name=>'autoload', class=>'accent', value=>1, onClick=>'submit();', checked=>[] }), "On ",
|
280 |
$h->input ({ type=>"radio", name=>'autoload', class=>'accent', value=>1, onClick=>'submit();', checked=>[] }), "On ",
|
| 275 |
$h->input ({ type=>"radio", name=>'autoload', class=>'accent', value=>0, onClick=>'submit();' }), "Off ",
|
281 |
$h->input ({ type=>"radio", name=>'autoload', class=>'accent', value=>0, onClick=>'submit();' }), "Off ",
|
| 276 |
]);
|
282 |
]);
|
| - |
|
283 |
$refreshbutton = "";
|
| 277 |
$sortby = $h->select ({name=>"sortby", onChange=>'submit();' }, [ map { $FORM{sortby} eq $_ ? $h->option ({ value=>$_, selected=>[] }, $NAME{$_}) : $h->option ({ value=>$_ }, $NAME{$_}) } @displayFields ]);
|
284 |
$sortby = $h->select ({name=>"sortby", onChange=>'submit();' }, [ map { $FORM{sortby} eq $_ ? $h->option ({ value=>$_, selected=>[] }, $NAME{$_}) : $h->option ({ value=>$_ }, $NAME{$_}) } @displayFields ]);
|
| 278 |
} else {
|
285 |
} else {
|
| 279 |
$onClick = "";
|
286 |
$onClick = "";
|
| 280 |
$onChange = "onChange='page.value = 1;'";
|
287 |
$onChange = "onChange='page.value = 1;'";
|
| 281 |
$radiobutton = $h->div ({ class=>'autoload' },
|
288 |
$radiobutton = $h->div ({ class=>'autoload' },
|
| Line 344... |
Line 351... |
| 344 |
print $h->div ({ class=>"sp0" }, [
|
351 |
print $h->div ({ class=>"sp0" }, [
|
| 345 |
$h->div ({ class=>"spLeft" }, [ @topleft ]),
|
352 |
$h->div ({ class=>"spLeft" }, [ @topleft ]),
|
| 346 |
$h->div ({ class=>"spRight" }, [
|
353 |
$h->div ({ class=>"spRight" }, [
|
| 347 |
$signedOnAs, $h->br,
|
354 |
$signedOnAs, $h->br,
|
| 348 |
"Show my shifts: ", $SIChecked, $h->br,
|
355 |
"Show my shifts: ", $SIChecked, $h->br,
|
| 349 |
$h->input ({ type=>"button", value=>"Block Personal Time", onClick=>"window.location.href='manage_personal_time.pl'" }),
|
356 |
$h->input ({ type=>"button", value=>"Block Personal Time", onClick=>"window.location.href='personal_time.pl'" }),
|
| 350 |
])
|
357 |
])
|
| 351 |
]);
|
358 |
]);
|
| 352 |
}
|
359 |
}
|
| Line 353... |
Line 360... |
| 353 |
|
360 |
|
| Line 372... |
Line 379... |
| 372 |
print $h->div ({ class=>'rTableHeading' }, [ @tmptitlerow ], [ map { $h->div ({ class=>'rTableCell filters' }, filter ($_)) } @displayFields ], $h->div ({ class=>"rTableCell" }));
|
379 |
print $h->div ({ class=>'rTableHeading' }, [ @tmptitlerow ], [ map { $h->div ({ class=>'rTableCell filters' }, filter ($_)) } @displayFields ], $h->div ({ class=>"rTableCell" }));
|
| Line 373... |
Line 380... |
| 373 |
|
380 |
|
| 374 |
|
381 |
|
| 375 |
if ($FORM{shiftinclude}) { # Include all of the user's shifts at the top
|
382 |
if ($FORM{shiftinclude}) { # Include all of the user's shifts at the top
|
| 376 |
foreach my $t (@shifts) {
|
383 |
foreach my $t (@shifts) {
|
| 377 |
print $h->div ({ class=>'rTableRow highlighted' }, [ map { $h->div ({ class=>'rTableCell' }, exists &{"modify_".$_} ? &{"modify_".$_} ($t) : $t->{$_}) } @displayFields ]);
|
384 |
print $h->div ({ class=>'rTableRow highlighted' }, [ map { $h->div ({ class=>'rTableCell' }, exists &{"modify_".$_} ? &{"modify_".$_} ($t) : $t->{$_} ? $t->{$_} : "") } @displayFields ]);
|
| 378 |
}
|
385 |
}
|