| Line 1... |
Line 1... |
| 1 |
#!/usr/bin/perl
|
1 |
#!/usr/bin/perl
|
| Line 2... |
Line 2... |
| 2 |
|
2 |
|
| Line 3... |
Line 3... |
| 3 |
#if ($ENV{SHELL}) { die "This script shouldn't be executed from the command line!\n"; }
|
3 |
#if ($ENV{SHELL}) { die "This script shouldn't be executed from the command line!\n"; }
|
| 4 |
|
4 |
|
| 5 |
#use strict;
|
5 |
use strict;
|
| 6 |
use cPanelUserConfig;
|
6 |
use cPanelUserConfig;
|
| 7 |
use CGI qw/param cookie header start_html url/;
|
7 |
use CGI qw/param cookie header start_html url/;
|
| 8 |
use HTML::Tiny;
|
8 |
use HTML::Tiny;
|
| Line 18... |
Line 18... |
| 18 |
our ($EML, $PWD, $LVL) = split /&/, $cookie_string;
|
18 |
our ($EML, $PWD, $LVL) = split /&/, $cookie_string;
|
| 19 |
my $user = getUser ($EML);
|
19 |
my $user = getUser ($EML);
|
| 20 |
$user->{department} = convertDepartments $user->{department};
|
20 |
$user->{department} = convertDepartments $user->{department};
|
| Line 21... |
Line 21... |
| 21 |
|
21 |
|
| - |
|
22 |
if ($user->{department}->{"ANN"} < 1 and $LVL < 4) {
|
| 22 |
if ($user->{department}->{"ANN"} < 1 and $LVL < 4) {
|
23 |
no strict;
|
| 23 |
print header(-cookie=>$RCAUTH_cookie);
|
24 |
print header(-cookie=>$RCAUTH_cookie);
|
| 24 |
printRCHeader("Unauthorized Page");
|
25 |
printRCHeader("Unauthorized Page");
|
| 25 |
print $h->div ({ class=>"error" }, "You're not an Announcer");
|
26 |
print $h->div ({ class=>"error" }, "You're not an Announcer");
|
| 26 |
print $h->div ("Your user account is not registered as an Announcer, so you can't see these shifts. It's possible that your access is still being reviewed. Please be patient.");
|
27 |
print $h->div ("Your user account is not registered as an Announcer, so you can't see these shifts. It's possible that your access is still being reviewed. Please be patient.");
|
| Line 31... |
Line 32... |
| 31 |
|
32 |
|
| 32 |
my $username = $h->a ({ href=>"/schedule/manage_user.pl?submit=View&RCid=$user->{RCid}" }, $user->{derby_name});
|
33 |
my $username = $h->a ({ href=>"/schedule/manage_user.pl?submit=View&RCid=$user->{RCid}" }, $user->{derby_name});
|
| 33 |
my $RCid = $user->{RCid};
|
34 |
my $RCid = $user->{RCid};
|
| 34 |
my $RCAUTH_cookie = CGI::Cookie->new(-name=>'RCAUTH',-value=>"$cookie_string",-expires=>"+30m");
|
35 |
my $RCAUTH_cookie = CGI::Cookie->new(-name=>'RCAUTH',-value=>"$cookie_string",-expires=>"+30m");
|
| 35 |
#my $YEAR = 1900 + (localtime)[5]; #which year of data to display, default to current
|
36 |
#my $YEAR = 1900 + (localtime)[5]; #which year of data to display, default to current
|
| Line 36... |
Line 37... |
| 36 |
my $YEAR = "2022";
|
37 |
my $YEAR = "2023";
|
| Line 37... |
Line 38... |
| 37 |
|
38 |
|
| 38 |
#$LVL = 1;
|
39 |
#$LVL = 1;
|
| Line 118... |
Line 119... |
| 118 |
}
|
119 |
}
|
| 119 |
}
|
120 |
}
|
| 120 |
return $t->{derby_name};
|
121 |
return $t->{derby_name};
|
| 121 |
}
|
122 |
}
|
| Line -... |
Line 123... |
| - |
|
123 |
|
| - |
|
124 |
sub modify_time {
|
| - |
|
125 |
my $t = shift;
|
| - |
|
126 |
return convertTime $t->{time};
|
| Line 122... |
Line 127... |
| 122 |
|
127 |
}
|
| Line 378... |
Line 383... |
| 378 |
# Print the things
|
383 |
# Print the things
|
| 379 |
foreach my $t (@ProductList) {
|
384 |
foreach my $t (@ProductList) {
|
| 380 |
if ($t->{RCid} eq $ORCUSER->{RCid}) {
|
385 |
if ($t->{RCid} eq $ORCUSER->{RCid}) {
|
| 381 |
print $h->div ({ class=>'rTableRow highlighted' }, [ map { $h->div ({ class=>'rTableCell' }, exists &{"modify_".$_} ? &{"modify_".$_} ($t) : $t->{$_}) } @displayFields ]);
|
386 |
print $h->div ({ class=>'rTableRow highlighted' }, [ map { $h->div ({ class=>'rTableCell' }, exists &{"modify_".$_} ? &{"modify_".$_} ($t) : $t->{$_}) } @displayFields ]);
|
| 382 |
} else {
|
387 |
} else {
|
| - |
|
388 |
no strict;
|
| 383 |
print $h->div ({ class=>'rTableRow shaded' }, [ map { $h->div ({ class=>'rTableCell' }, exists &{"modify_".$_} ? &{"modify_".$_} ($t) : $t->{$_}) } @displayFields ]);
|
389 |
print $h->div ({ class=>'rTableRow shaded' }, [ map { $h->div ({ class=>'rTableCell' }, exists &{"modify_".$_} ? &{"modify_".$_} ($t) : $t->{$_}) } @displayFields ]);
|
| 384 |
}
|
390 |
}
|
| 385 |
}
|
391 |
}
|