| Line 786... |
Line 786... |
| 786 |
if ($ampm eq "pm") { $hr += 12; }
|
786 |
if ($ampm eq "pm") { $hr += 12; }
|
| 787 |
elsif ($ampm eq "am" and $hr == 12) { $hr = "00" }
|
787 |
elsif ($ampm eq "am" and $hr == 12) { $hr = "00" }
|
| Line 788... |
Line 788... |
| 788 |
|
788 |
|
| 789 |
$st = $hr.":".$min;
|
789 |
$st = $hr.":".$min;
|
| - |
|
790 |
$shift_id = join "|", ($td, $st, $tl);
|
| - |
|
791 |
} else {
|
| 790 |
$shift_id = join "|", ($td, $st, $tl);
|
792 |
$shift_id =~ s/(\d+:\d+):00/$1/;
|
| 791 |
}
|
793 |
}
|
| 792 |
#warn join " - ", $change, $shift_id, $role, $user_id;
|
794 |
#warn join " - ", $change, $shift_id, $role, $user_id;
|
| 793 |
my $leadership_change = 0;
|
795 |
my $leadership_change = 0;
|
| 794 |
# my $department = getShiftDepartment ($role ? $shift_id."-".$role : $shift_id);
|
796 |
# my $department = getShiftDepartment ($role ? $shift_id."-".$role : $shift_id);
|
| Line 844... |
Line 846... |
| 844 |
if ($change eq "add") {
|
846 |
if ($change eq "add") {
|
| 845 |
if ($department eq "CLA" and !getUser($user_id)->{MVPid}) {
|
847 |
if ($department eq "CLA" and !getUser($user_id)->{MVPid}) {
|
| 846 |
return "<br>Denied! User ($user_id) does not have an MVP Pass!<br>\n";
|
848 |
return "<br>Denied! User ($user_id) does not have an MVP Pass!<br>\n";
|
| 847 |
} elsif ($department ne "CLA" and getUser($user_id)->{department} and convertDepartments(getUser($user_id)->{department})->{$department} < 1) {
|
849 |
} elsif ($department ne "CLA" and getUser($user_id)->{department} and convertDepartments(getUser($user_id)->{department})->{$department} < 1) {
|
| 848 |
return "<br>Denied! User ($user_id) is not a member of Department ($department)!<br>\n" unless $department eq "CMP";
|
850 |
return "<br>Denied! User ($user_id) is not a member of Department ($department)!<br>\n" unless $department eq "CMP";
|
| - |
|
851 |
} elsif ($department eq "EMT" and getUser($user_id)->{emt_verified} == 0) {
|
| - |
|
852 |
return "<br>Denied! User ($user_id) has not had their EMT status verified!<br>\n";
|
| 849 |
}
|
853 |
}
|
| 850 |
}
|
854 |
}
|
| Line 851... |
Line 855... |
| 851 |
|
855 |
|
| 852 |
my $conflict = findConflict ($user_id, $shift_id, $game_based);
|
856 |
my $conflict = findConflict ($user_id, $shift_id, $game_based);
|
| Line 1073... |
Line 1077... |
| 1073 |
return 0 unless $limit > 0;
|
1077 |
return 0 unless $limit > 0;
|
| Line 1074... |
Line 1078... |
| 1074 |
|
1078 |
|
| Line 1075... |
Line 1079... |
| 1075 |
my $limitkey = $dept ? "sign_ups_today_".$dept : "sign_ups_today";
|
1079 |
my $limitkey = $dept ? "sign_ups_today_".$dept : "sign_ups_today";
|
| - |
|
1080 |
|
| - |
|
1081 |
if ($shifttype eq "class") {
|
| 1076 |
|
1082 |
my $classid = $t->{id};
|
| 1077 |
if ($shifttype eq "class") {
|
1083 |
$t->{start_time} =~ s/^(\d+:\d+):00$/$1/;
|
| 1078 |
($t->{id}) = $dbh->selectrow_array ("select id from v_class_new where date = ? and location = ? and start_time = ?", undef, $t->{date}, $t->{location}, $t->{start_time});
|
1084 |
($t->{id}) = $dbh->selectrow_array ("select id from v_class_new where date = ? and location = ? and start_time = ?", undef, $t->{date}, $t->{location}, $t->{start_time});
|
| 1079 |
$t->{dept} = "CLA";
|
1085 |
$t->{dept} = "CLA";
|
| 1080 |
$dept = "CLA";
|
1086 |
$dept = "CLA";
|
| Line 1292... |
Line 1298... |
| 1292 |
} elsif ($change eq "del") {
|
1298 |
} elsif ($change eq "del") {
|
| 1293 |
if (!$uservalidate->{emt_verified}) {
|
1299 |
if (!$uservalidate->{emt_verified}) {
|
| 1294 |
warn "ERROR: validate_emt() called to del on a user that isn't verified: $target, change: $change";
|
1300 |
warn "ERROR: validate_emt() called to del on a user that isn't verified: $target, change: $change";
|
| 1295 |
return -1;
|
1301 |
return -1;
|
| 1296 |
} else {
|
1302 |
} else {
|
| 1297 |
$dbh->do ("delete from emt_credential_verified where date = date(now()) and RCid = ?", undef, $target) or warn $dbh->errstr;
|
1303 |
$dbh->do ("delete from emt_credential_verified where year(date) = year(now()) and RCid = ?", undef, $target) or warn $dbh->errstr;
|
| 1298 |
logit ($target, "EMT Credential Verification removed");
|
1304 |
logit ($target, "EMT Credential Verification removed");
|
| 1299 |
logit ($ORCUSER->{RCid}, "Removed EMT Credential verification for $uservalidate->{derby_name} [$target]");
|
1305 |
logit ($ORCUSER->{RCid}, "Removed EMT Credential verification for $uservalidate->{derby_name} [$target]");
|
| 1300 |
}
|
1306 |
}
|
| 1301 |
} else {
|
1307 |
} else {
|
| 1302 |
warn "ERROR: validate_emt() called with a bad parameter! target: $target, change: $change";
|
1308 |
warn "ERROR: validate_emt() called with a bad parameter! target: $target, change: $change";
|