| Line 265... |
Line 265... |
| 265 |
use HTML::Tiny;
|
265 |
use HTML::Tiny;
|
| 266 |
my $h = HTML::Tiny->new( mode => 'html' );
|
266 |
my $h = HTML::Tiny->new( mode => 'html' );
|
| Line 267... |
Line 267... |
| 267 |
|
267 |
|
| 268 |
my $where = scalar @whereclause ? "where ".join " and ", @whereclause : "";
|
268 |
my $where = scalar @whereclause ? "where ".join " and ", @whereclause : "";
|
| 269 |
my @shifts;
|
269 |
my @shifts;
|
| 270 |
my $sth = $dbh->prepare("select * from (select id, date, dayofweek, track as location, time, role, teams, gtype, 'OFF' as dept, volhours from v_shift_officiating where RCid = ? union
|
270 |
my $sth = $dbh->prepare("select * from (select id, date, dayofweek, track as location, time, role, teams, signup, 'OFF' as dept, volhours from v_shift_officiating where RCid = ? union
|
| 271 |
select id, date, dayofweek, track as location, time, role, teams, gtype, 'ANN' as dept, volhours from v_shift_announcer where RCid = ? union
|
271 |
select id, date, dayofweek, track as location, time, role, teams, signup, 'ANN' as dept, volhours from v_shift_announcer where RCid = ? union
|
| 272 |
select id, date, dayofweek, location, time, role, '' as teams, type as gtype, dept, volhours from v_shift where RCid = ?) temp
|
272 |
select id, date, dayofweek, location, time, role, '' as teams, type as signup, dept, volhours from v_shift where RCid = ?) temp
|
| 273 |
$where order by date, time");
|
273 |
$where order by date, time");
|
| 274 |
$sth->execute($RCid, $RCid, $RCid);
|
274 |
$sth->execute($RCid, $RCid, $RCid);
|
| 275 |
my $hours = 0;
|
275 |
my $hours = 0;
|
| 276 |
while (my $s = $sth->fetchrow_hashref) {
|
276 |
while (my $s = $sth->fetchrow_hashref) {
|
| Line 294... |
Line 294... |
| 294 |
$s->{buttons} = $h->button ({ onClick=>"if (confirm('Really? You want to delete this personal time?')==true) { window.open('manage_personal_time.pl?choice=Delete&id=$s->{id}','Confirm Change','resizable,height=260,width=370'); return false; }" }, "DEL")." ".$h->button ({ onClick=>"location.href='manage_personal_time.pl?choice=Update&id=$s->{id}'" }, "EDIT");
|
294 |
$s->{buttons} = $h->button ({ onClick=>"if (confirm('Really? You want to delete this personal time?')==true) { window.open('manage_personal_time.pl?choice=Delete&id=$s->{id}','Confirm Change','resizable,height=260,width=370'); return false; }" }, "DEL")." ".$h->button ({ onClick=>"location.href='manage_personal_time.pl?choice=Update&id=$s->{id}'" }, "EDIT");
|
| 295 |
} else {
|
295 |
} else {
|
| 296 |
$s->{location} = "";
|
296 |
$s->{location} = "";
|
| 297 |
$s->{role} = "";
|
297 |
$s->{role} = "";
|
| 298 |
}
|
298 |
}
|
| 299 |
} elsif (($RCid == $ORCUSER->{RCid} and $s->{gtype} !~ /^selected/ and $now < $cutoff) or ($ORCUSER->{department}->{$s->{dept}} >= 2 or $ORCUSER->{access} >= 5)) {
|
299 |
} elsif (($RCid == $ORCUSER->{RCid} and $s->{signup} !~ /^selected/ and $now < $cutoff) or ($ORCUSER->{department}->{$s->{dept}} >= 2 or $ORCUSER->{access} >= 5)) {
|
| 300 |
# DROP
|
300 |
# DROP
|
| 301 |
$s->{buttons} = $h->button ({ onClick=>"if (confirm('Really? You want to drop this shift?')==true) { window.open('make_shift_change.pl?change=del&id=$s->{id}','Confirm Shift Change','resizable,height=260,width=370'); return false; }" }, "DROP");
|
301 |
$s->{buttons} = $h->button ({ onClick=>"if (confirm('Really? You want to drop this shift?')==true) { window.open('make_shift_change.pl?change=del&id=$s->{id}','Confirm Shift Change','resizable,height=260,width=370'); return false; }" }, "DROP");
|
| 302 |
if ($ORCUSER->{department}->{$s->{dept}} >= 2 or $ORCUSER->{access} >= 5) {
|
302 |
if ($ORCUSER->{department}->{$s->{dept}} >= 2 or $ORCUSER->{access} >= 5) {
|
| 303 |
# NO SHOW
|
303 |
# NO SHOW
|
| 304 |
$s->{buttons} .= " ".$h->button ({ onClick=>"if (confirm('Really? They were a no show?')==true) { window.open('make_shift_change.pl?noshow=true&change=del&RCid=$RCid&id=$s->{id}','Confirm Shift Change','resizable,height=260,width=370'); return false; }" }, "NO SHOW");
|
304 |
$s->{buttons} .= " ".$h->button ({ onClick=>"if (confirm('Really? They were a no show?')==true) { window.open('make_shift_change.pl?noshow=true&change=del&RCid=$RCid&id=$s->{id}','Confirm Shift Change','resizable,height=260,width=370'); return false; }" }, "NO SHOW");
|
| 305 |
}
|
305 |
}
|
| 306 |
$hours += $s->{volhours};
|
306 |
$hours += $s->{volhours};
|
| 307 |
}
|
307 |
}
|
| Line 308... |
Line 308... |
| 308 |
|
308 |
|
| 309 |
} elsif (($RCid == $ORCUSER->{RCid} and $s->{gtype} !~ /^selected/ and $now < $cutoff) or ($ORCUSER->{department}->{$s->{dept}} >= 2 or $ORCUSER->{access} >= 5)) {
|
309 |
} elsif (($RCid == $ORCUSER->{RCid} and $s->{signup} !~ /^selected/ and $now < $cutoff) or ($ORCUSER->{department}->{$s->{dept}} >= 2 or $ORCUSER->{access} >= 5)) {
|
| 310 |
# it's a game shift
|
310 |
# it's a game shift
|
| 311 |
#DROP
|
311 |
#DROP
|
| 312 |
$s->{buttons} = $h->button ({ onClick=>"if (confirm('Really? You want to drop this shift?')==true) { window.open('make_shift_change.pl?change=del&RCid=$RCid&id=$s->{id}&role=$s->{role}','Confirm Shift Change','resizable,height=260,width=370'); return false; }" }, "DROP");
|
312 |
$s->{buttons} = $h->button ({ onClick=>"if (confirm('Really? You want to drop this shift?')==true) { window.open('make_shift_change.pl?change=del&RCid=$RCid&id=$s->{id}&role=$s->{role}','Confirm Shift Change','resizable,height=260,width=370'); return false; }" }, "DROP");
|
| 313 |
if ($ORCUSER->{department}->{$s->{dept}} >= 2 or $ORCUSER->{access} >= 5) {
|
313 |
if ($ORCUSER->{department}->{$s->{dept}} >= 2 or $ORCUSER->{access} >= 5) {
|
| Line 578... |
Line 578... |
| 578 |
if (!exists $user->{$limitkey}) {
|
578 |
if (!exists $user->{$limitkey}) {
|
| 579 |
$user->{$limitkey} = signUpCount('get', $user->{RCid}, $dept);
|
579 |
$user->{$limitkey} = signUpCount('get', $user->{RCid}, $dept);
|
| 580 |
}
|
580 |
}
|
| Line 581... |
Line 581... |
| 581 |
|
581 |
|
| 582 |
if ($shifttype eq "game") {
|
582 |
if ($shifttype eq "game") {
|
| - |
|
583 |
# if ($t->{gtype} !~ /^selected/ and $t->{gtype} ne "short track" and $user->{$limitkey} < $limit) {
|
| 583 |
if ($t->{gtype} !~ /^selected/ and $t->{gtype} ne "short track" and $user->{$limitkey} < $limit) {
|
584 |
if ($t->{signup} ne "selected" and $user->{$limitkey} < $limit) {
|
| 584 |
return 1;
|
585 |
return 1;
|
| 585 |
} else {
|
586 |
} else {
|
| 586 |
return 0;
|
587 |
return 0;
|
| 587 |
}
|
588 |
}
|