| Line 41... |
Line 41... |
| 41 |
our $DBTABLE = 'v_shift';
|
41 |
our $DBTABLE = 'v_shift';
|
| 42 |
my %COLUMNS = (
|
42 |
my %COLUMNS = (
|
| 43 |
# colname => [qw(DisplayName N type status)], status -> static | default | <blank>
|
43 |
# colname => [qw(DisplayName N type status)], status -> static | default | <blank>
|
| 44 |
id => [qw(ShiftID 5 number )],
|
44 |
id => [qw(ShiftID 5 number )],
|
| 45 |
dept => [qw(Department 10 select default )],
|
45 |
dept => [qw(Department 10 select default )],
|
| 46 |
role => [qw(Role 15 select default )],
|
46 |
role => [qw(Role 15 text default )],
|
| 47 |
type => [qw(Type 20 select default )],
|
47 |
type => [qw(Type 20 select default )],
|
| 48 |
date => [qw(Date 25 date default )],
|
48 |
date => [qw(Date 25 date default )],
|
| 49 |
dayofweek => [qw(Day 27 select )],
|
49 |
dayofweek => [qw(Day 27 select )],
|
| 50 |
location => [qw(Location 30 select default )],
|
50 |
location => [qw(Location 30 select default )],
|
| 51 |
time => [qw(Time 35 text default )],
|
51 |
time => [qw(Time 35 text default )],
|
| Line 61... |
Line 61... |
| 61 |
my $stylesheet = "/style.css";
|
61 |
my $stylesheet = "/style.css";
|
| 62 |
my $homeURL = '/schedule/';
|
62 |
my $homeURL = '/schedule/';
|
| 63 |
my @pagelimitoptions = ("All", 5, 10, 25);
|
63 |
my @pagelimitoptions = ("All", 5, 10, 25);
|
| Line 64... |
Line 64... |
| 64 |
|
64 |
|
| 65 |
my @whereClause;
|
65 |
my @whereClause;
|
| 66 |
if ($LVL <= 3) {
|
66 |
if ($LVL <= 3 and $user->{department}->{VCI} < 2) {
|
| 67 |
my $string = "dept in (".join ",", map { '"'.$_.'"' } grep { $ORCUSER->{department}->{$_} > 0 } keys %{$ORCUSER->{department}};
|
67 |
my $string = "dept in (".join ",", map { '"'.$_.'"' } grep { $ORCUSER->{department}->{$_} > 0 } keys %{$ORCUSER->{department}};
|
| 68 |
$string .= ")";
|
68 |
$string .= ")";
|
| 69 |
# warn $string;
|
69 |
# warn $string;
|
| 70 |
push @whereClause, $string;
|
70 |
push @whereClause, $string;
|
| Line 96... |
Line 96... |
| 96 |
minute => 0,
|
96 |
minute => 0,
|
| 97 |
second => 0,
|
97 |
second => 0,
|
| 98 |
time_zone => 'America/Los_Angeles'
|
98 |
time_zone => 'America/Los_Angeles'
|
| 99 |
);
|
99 |
);
|
| Line 100... |
Line 100... |
| 100 |
|
100 |
|
| 101 |
if (($t->{RCid} == $RCid and $t->{type} ne "selected" and $now < $cutoff) or ($t->{derby_name} and ($user->{department}->{$t->{dept}} >= 2 or $LVL >= 5))) {
|
101 |
if (($t->{RCid} == $RCid and $t->{type} ne "selected" and $now < $cutoff) or ($t->{derby_name} and ($user->{department}->{$t->{dept}} >= 2 or $LVL >= 5 or $user->{department}->{VCI} >= 2))) {
|
| 102 |
if ($t->{dept} eq "PER") {
|
102 |
if ($t->{dept} eq "PER") {
|
| 103 |
# DEL Personal Block
|
103 |
# DEL Personal Block
|
| 104 |
$t->{derby_name} .= " ".$h->a ({ onClick=>"if (confirm('Really? You want to delete this personal time?')==true) { window.open('manage_personal_time.pl?choice=Delete&id=$s[0]','Confirm Change','resizable,height=260,width=370'); return false; }" }, "[DEL]");
|
104 |
$t->{derby_name} .= " ".$h->a ({ onClick=>"if (confirm('Really? You want to delete this personal time?')==true) { window.open('manage_personal_time.pl?choice=Delete&id=$s[0]','Confirm Change','resizable,height=260,width=370'); return false; }" }, "[DEL]");
|
| 105 |
} else {
|
105 |
} else {
|
| 106 |
# DROP
|
106 |
# DROP
|
| 107 |
$t->{derby_name} .= " ".$h->a ({ onClick=>"if (confirm('Really? You want to drop this shift?')==true) { window.open('make_shift_change.pl?change=del&RCid=$t->{RCid}&id=$t->{id}','Confirm Change','resizable,height=260,width=370'); return false; }" }, "[DROP]");
|
107 |
$t->{derby_name} .= " ".$h->a ({ onClick=>"if (confirm('Really? You want to drop this shift?')==true) { window.open('make_shift_change.pl?change=del&RCid=$t->{RCid}&id=$t->{id}','Confirm Change','resizable,height=260,width=370'); return false; }" }, "[DROP]");
|
| 108 |
if ($user->{department}->{$t->{dept}} >= 2 or $LVL >= 5) {
|
108 |
if ($user->{department}->{$t->{dept}} >= 2 or $LVL >= 5 or $user->{department}->{VCI} >= 2) {
|
| 109 |
# NO SHOW
|
109 |
# NO SHOW and MOD TIME
|
| 110 |
$t->{derby_name} .= " | ".$h->a ({ href=>'#', onClick=>"if (confirm('Really? They were a no show?')==true) { window.open('make_shift_change.pl?noshow=true&change=del&RCid=$t->{RCid}&id=$t->{id}','Confirm Shift Change','resizable,height=260,width=370'); return false; }" }, "[NO SHOW]");
|
110 |
$t->{derby_name} .= " | ".$h->a ({ href=>'#', onClick=>"if (confirm('Really? They were a no show?')==true) { window.open('make_shift_change.pl?noshow=true&change=del&RCid=$t->{RCid}&id=$t->{id}','Confirm Shift Change','resizable,height=260,width=370'); return false; }" }, "[NO SHOW]");
|
| 111 |
$t->{derby_name} .= " | ".$h->a ({ onClick=>"window.open('mod_shift_time.pl?RCid=$t->{RCid}&shiftid=$t->{id}','Mod Vol Hours','resizable,height=260,width=370');" }, "[MOD]");
|
111 |
$t->{derby_name} .= " | ".$h->a ({ onClick=>"window.open('mod_shift_time.pl?RCid=$t->{RCid}&shiftid=$t->{id}','Mod Vol Hours','resizable,height=260,width=370');" }, "[MOD]");
|
| 112 |
}
|
112 |
}
|
| 113 |
}
|
113 |
}
|
| 114 |
} elsif (!$t->{derby_name}) {
|
114 |
} elsif (!$t->{derby_name}) {
|
| 115 |
if (signUpEligible ($ORCUSER, $t, "vol") and $now < $cutoff) {
|
115 |
if (signUpEligible ($ORCUSER, $t, "vol") and $now < $cutoff) {
|
| 116 |
# SIGN UP
|
116 |
# SIGN UP
|
| 117 |
$t->{derby_name} = $h->a ({ onClick=>"window.open('make_shift_change.pl?change=add&RCid=$RCid&id=$t->{id}','Confirm Shift Change','resizable,height=260,width=370'); return false;" }, "[SIGN UP]");
|
117 |
$t->{derby_name} = $h->a ({ onClick=>"window.open('make_shift_change.pl?change=add&RCid=$RCid&id=$t->{id}','Confirm Shift Change','resizable,height=260,width=370'); return false;" }, "[SIGN UP]");
|
| 118 |
}
|
118 |
}
|
| 119 |
if ($user->{department}->{$t->{dept}} >= 2 or $LVL > 4) {
|
119 |
if ($user->{department}->{$t->{dept}} >= 2 or $LVL > 4 or $user->{department}->{VCI} >= 2) {
|
| 120 |
# ADD USER
|
120 |
# ADD USER
|
| 121 |
$t->{derby_name} ? $t->{derby_name} .= " | " : {};
|
121 |
$t->{derby_name} ? $t->{derby_name} .= " | " : {};
|
| 122 |
$t->{derby_name} .= $h->a ({ onClick=>"window.open('make_shift_change.pl?change=lookup&RCid=$RCid&id=$t->{id}','Confirm Shift Change','resizable,height=260,width=370'); return false;" }, "[ADD USER]");
|
122 |
$t->{derby_name} .= $h->a ({ onClick=>"window.open('make_shift_change.pl?change=lookup&RCid=$RCid&id=$t->{id}','Confirm Shift Change','resizable,height=260,width=370'); return false;" }, "[ADD USER]");
|
| 123 |
}
|
123 |
}
|
| Line 200... |
Line 200... |
| 200 |
}
|
200 |
}
|
| Line 201... |
Line 201... |
| 201 |
|
201 |
|
| 202 |
|
202 |
|
| 203 |
if (!(exists $FORM{autoload})) { # No FORM was submitted...
|
203 |
if (!(exists $FORM{autoload})) { # No FORM was submitted...
|
| 204 |
if (my $prefs = cookie ($prefscookie) and !defined param ("ignoreCookie")) { # Check for cookies from previous visits.
|
204 |
if (my $prefs = cookie ($prefscookie) and !defined param ("ignoreCookie")) { # Check for cookies from previous visits.
|
| Line 205... |
Line 205... |
| 205 |
my ($disF, $filts, $sb, $al) = split /&/,$prefs;
|
205 |
my ($disF, $filts, $sb, $al, $si) = split /&/,$prefs;
|
| 206 |
@displayFields = split /:/,$disF;
|
206 |
@displayFields = split /:/,$disF;
|
| 207 |
|
207 |
|