| Line 23... |
Line 23... |
| 23 |
my $deptDesc = getDepartmentDescriptions ();
|
23 |
my $deptDesc = getDepartmentDescriptions ();
|
| 24 |
my $deptLink = getDepartmentLinks ();
|
24 |
my $deptLink = getDepartmentLinks ();
|
| 25 |
my $AccessLevel = getAccessLevels;
|
25 |
my $AccessLevel = getAccessLevels;
|
| 26 |
my @tshirtOptions = ("", "MS", "MM", "ML", "MXL", "M2X", "M3X");
|
26 |
my @tshirtOptions = ("", "MS", "MM", "ML", "MXL", "M2X", "M3X");
|
| 27 |
my @AUTODEPTS = map { $_->[0] } @{$dbh->selectall_arrayref ("select TLA from department where autoapprove = true")};
|
27 |
my @AUTODEPTS = map { $_->[0] } @{$dbh->selectall_arrayref ("select TLA from department where autoapprove = true")};
|
| 28 |
my @FIELDS = qw/ derby_name email real_name phone password access department tshirt pronouns timeformat /;
|
28 |
my @FIELDS = qw/ derby_name email real_name phone password access department tshirt pronouns timeformat showme /;
|
| 29 |
my @PRIVFIELDS = qw/ email access /;
|
29 |
my @PRIVFIELDS = qw/ email access /;
|
| 30 |
$ORCUSER->{department} = ref $ORCUSER->{department} eq "HASH" ? $ORCUSER->{department} : convertDepartments($ORCUSER->{department});
|
30 |
$ORCUSER->{department} = ref $ORCUSER->{department} eq "HASH" ? $ORCUSER->{department} : convertDepartments($ORCUSER->{department});
|
| Line 31... |
Line 31... |
| 31 |
|
31 |
|
| Line 87... |
Line 87... |
| 87 |
$F->{real_name} = WebDB::trim param ('real_name') // '';
|
87 |
$F->{real_name} = WebDB::trim param ('real_name') // '';
|
| 88 |
$F->{pronouns} = WebDB::trim param ('pronouns') // '';
|
88 |
$F->{pronouns} = WebDB::trim param ('pronouns') // '';
|
| 89 |
$F->{tshirt} = WebDB::trim param ('tshirt') // '';
|
89 |
$F->{tshirt} = WebDB::trim param ('tshirt') // '';
|
| 90 |
$F->{phone} = WebDB::trim param ('phone') // '';
|
90 |
$F->{phone} = WebDB::trim param ('phone') // '';
|
| 91 |
$F->{timeformat} = WebDB::trim param ('timeformat') // '24hr';
|
91 |
$F->{timeformat} = WebDB::trim param ('timeformat') // '24hr';
|
| - |
|
92 |
$F->{showme} = WebDB::trim param ('showme') ? 1 : 0;
|
| 92 |
$F->{RCid} = param ('RCid') // '';
|
93 |
$F->{RCid} = param ('RCid') // '';
|
| 93 |
$F->{access} = param ('access') // 0;
|
94 |
$F->{access} = param ('access') // 0;
|
| 94 |
$F->{department} = join ":", map { "$_-".param ("DEPT-".$_) } map { s/^DEPT-//; $_ } grep { param ($_) ne "" } grep { /^DEPT-/ } param ;
|
95 |
$F->{department} = join ":", map { "$_-".param ("DEPT-".$_) } map { s/^DEPT-//; $_ } grep { param ($_) ne "" } grep { /^DEPT-/ } param ;
|
| Line 95... |
Line 96... |
| 95 |
|
96 |
|
| Line 116... |
Line 117... |
| 116 |
# Check to see if any of the departments they've requested are set to autoapprove.
|
117 |
# Check to see if any of the departments they've requested are set to autoapprove.
|
| 117 |
$F->{department} = convertDepartments $F->{department};
|
118 |
$F->{department} = convertDepartments $F->{department};
|
| 118 |
map { $F->{department}->{$_} = inArray ($_, \@AUTODEPTS) } keys %{$F->{department}};
|
119 |
map { $F->{department}->{$_} = inArray ($_, \@AUTODEPTS) } keys %{$F->{department}};
|
| 119 |
$F->{department} = convertDepartments $F->{department};
|
120 |
$F->{department} = convertDepartments $F->{department};
|
| Line 120... |
Line 121... |
| 120 |
|
121 |
|
| 121 |
$dbh->do ("insert into official (email, password, derby_name, real_name, pronouns, tshirt, phone, timeformat, access, department, added, activation) values (?, password(?), ?, ?, ?, ?, ?, ?, ?, ?, CONVERT_TZ(now(), 'America/Chicago', 'America/Los_Angeles'), md5(rand()))", undef,
|
122 |
$dbh->do ("insert into official (email, password, derby_name, real_name, pronouns, tshirt, phone, timeformat, showme, access, department, added, activation) values (?, password(?), ?, ?, ?, ?, ?, ?, ?, ?, ?, CONVERT_TZ(now(), 'America/Chicago', 'America/Los_Angeles'), md5(rand()))", undef,
|
| 122 |
$F->{email}, $F->{password}, $F->{derby_name}, $F->{real_name}, $F->{pronouns}, $F->{tshirt}, $F->{phone}, $F->{timeformat}, 0, $F->{department})
|
123 |
$F->{email}, $F->{password}, $F->{derby_name}, $F->{real_name}, $F->{pronouns}, $F->{tshirt}, $F->{phone}, $F->{timeformat}, $F->{showme}, 0, $F->{department})
|
| Line 123... |
Line 124... |
| 123 |
or display_form ("New", "New User", "ERROR: DB: ".$dbh->errstr, $F);
|
124 |
or display_form ("New", "New User", "ERROR: DB: ".$dbh->errstr, $F);
|
| Line 124... |
Line 125... |
| 124 |
|
125 |
|
| Line 164... |
Line 165... |
| 164 |
map { $FORMDepts->{$_} = max ($DBDepts->{$_}, $FORMDepts->{$_}) } keys %{$DBDepts};
|
165 |
map { $FORMDepts->{$_} = max ($DBDepts->{$_}, $FORMDepts->{$_}) } keys %{$DBDepts};
|
| 165 |
$F->{department} = convertDepartments $FORMDepts;
|
166 |
$F->{department} = convertDepartments $FORMDepts;
|
| 166 |
}
|
167 |
}
|
| Line 167... |
Line 168... |
| 167 |
|
168 |
|
| 168 |
foreach my $field (@FIELDS) {
|
169 |
foreach my $field (@FIELDS) {
|
| 169 |
if ($F->{$field} eq $OG->{$field} or ($field eq "access" and $F->{$field} == $OG->{$field}) or ($field eq "password" and !$F->{$field})) {
|
170 |
if ($F->{$field} eq $OG->{$field} or (($field eq "access" or $field eq "showme") and $F->{$field} == $OG->{$field}) or ($field eq "password" and !$F->{$field})) {
|
| 170 |
# No changes to this field, move on...
|
171 |
# No changes to this field, move on...
|
| 171 |
next;
|
172 |
next;
|
| Line 172... |
Line 173... |
| 172 |
}
|
173 |
}
|
| Line 239... |
Line 240... |
| 239 |
$F->{real_name} = $h->input ({ type=>"text", name=>"real_name", value=>$F->{real_name} });
|
240 |
$F->{real_name} = $h->input ({ type=>"text", name=>"real_name", value=>$F->{real_name} });
|
| 240 |
$F->{pronouns} = $h->input ({ type=>"text", name=>"pronouns", value=>$F->{pronouns} });
|
241 |
$F->{pronouns} = $h->input ({ type=>"text", name=>"pronouns", value=>$F->{pronouns} });
|
| 241 |
$F->{tshirt} = $h->select ({ name=>"tshirt" }, [map { $F->{tshirt} eq $_ ? $h->option ({ selected=>[] }, $_) : $h->option ($_) } @tshirtOptions] );
|
242 |
$F->{tshirt} = $h->select ({ name=>"tshirt" }, [map { $F->{tshirt} eq $_ ? $h->option ({ selected=>[] }, $_) : $h->option ($_) } @tshirtOptions] );
|
| 242 |
$F->{phone} = $h->input ({ type=>"text", name=>"phone", value=>$F->{phone} });
|
243 |
$F->{phone} = $h->input ({ type=>"text", name=>"phone", value=>$F->{phone} });
|
| 243 |
$F->{timeformat} = $h->select ({ name=>"timeformat" }, [map { $F->{timeformat} eq $_ ? $h->option ({ selected=>[] }, $_) : $h->option ($_) } qw(24hr ampm)] );
|
244 |
$F->{timeformat} = $h->select ({ name=>"timeformat" }, [map { $F->{timeformat} eq $_ ? $h->option ({ selected=>[] }, $_) : $h->option ($_) } qw(24hr ampm)] );
|
| - |
|
245 |
if ($F->{showme}) {
|
| - |
|
246 |
$F->{showme} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"showme", value=>1, checked=>[] }), $h->span ({ class=>"slider round" })]);
|
| - |
|
247 |
} else {
|
| - |
|
248 |
$F->{showme} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"showme", value=>1 }), $h->span ({ class=>"slider round" })]);
|
| - |
|
249 |
}
|
| 244 |
} else {
|
250 |
} else {
|
| 245 |
$F->{password} = '*******';
|
251 |
$F->{password} = '*******';
|
| 246 |
}
|
252 |
}
|
| 247 |
$F->{RCid} = $h->input ({ type=>"hidden", name=>"RCid", value=>$F->{RCid} })."$F->{RCid} ";
|
253 |
$F->{RCid} = $h->input ({ type=>"hidden", name=>"RCid", value=>$F->{RCid} })."$F->{RCid} ";
|
| 248 |
$F->{buttons} = join " ", $h->input ({ type=>"submit", name=>"submit", value=>"Save" }), $h->input ({ type=>"reset", value=>"Reset" }), $h->input ({ type=>"submit", name=>"submit", value=>"Cancel" });
|
254 |
$F->{buttons} = join " ", $h->input ({ type=>"submit", name=>"submit", value=>"Save" }), $h->input ({ type=>"reset", value=>"Reset" }), $h->input ({ type=>"submit", name=>"submit", value=>"Cancel" });
|
| Line 278... |
Line 284... |
| 278 |
$F->{real_name} = $h->input ({ type=>"text", name=>"real_name", value=>$F->{real_name} });
|
284 |
$F->{real_name} = $h->input ({ type=>"text", name=>"real_name", value=>$F->{real_name} });
|
| 279 |
$F->{pronouns} = $h->input ({ type=>"text", name=>"pronouns", value=>$F->{pronouns} });
|
285 |
$F->{pronouns} = $h->input ({ type=>"text", name=>"pronouns", value=>$F->{pronouns} });
|
| 280 |
$F->{tshirt} = $h->select ({ name=>"tshirt" }, [map { $F->{tshirt} eq $_ ? $h->option ({ selected=>[] }, $_) : $h->option ($_) } @tshirtOptions] );
|
286 |
$F->{tshirt} = $h->select ({ name=>"tshirt" }, [map { $F->{tshirt} eq $_ ? $h->option ({ selected=>[] }, $_) : $h->option ($_) } @tshirtOptions] );
|
| 281 |
$F->{phone} = $h->input ({ type=>"text", name=>"phone", value=>$F->{phone} });
|
287 |
$F->{phone} = $h->input ({ type=>"text", name=>"phone", value=>$F->{phone} });
|
| 282 |
$F->{timeformat} = $h->select ({ name=>"timeformat" }, [map { $F->{timeformat} eq $_ ? $h->option ({ selected=>[] }, $_) : $h->option ($_) } qw(24hr ampm)] );
|
288 |
$F->{timeformat} = $h->select ({ name=>"timeformat" }, [map { $F->{timeformat} eq $_ ? $h->option ({ selected=>[] }, $_) : $h->option ($_) } qw(24hr ampm)] );
|
| - |
|
289 |
if ($F->{showme}) {
|
| - |
|
290 |
$F->{showme} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"showme", value=>1, checked=>[] }), $h->span ({ class=>"slider round" })]);
|
| - |
|
291 |
} else {
|
| - |
|
292 |
$F->{showme} = $h->label ({ class=>"switch" }, [$h->input ({ type=>"checkbox", name=>"showme", value=>1 }), $h->span ({ class=>"slider round" })]);
|
| - |
|
293 |
}
|
| 283 |
$F->{RCid} = $h->input ({ type=>"hidden", name=>"RCid", value=>"New" })."TBD ";
|
294 |
$F->{RCid} = $h->input ({ type=>"hidden", name=>"RCid", value=>"New" })."TBD ";
|
| 284 |
$F->{access} = $h->input ({ type=>"hidden", name=>"access", value=>0 })."0";
|
295 |
$F->{access} = $h->input ({ type=>"hidden", name=>"access", value=>0 })."0";
|
| Line 285... |
Line 296... |
| 285 |
|
296 |
|
| 286 |
$F->{department} = convertDepartments ($F->{department});
|
297 |
$F->{department} = convertDepartments ($F->{department});
|
| Line 308... |
Line 319... |
| 308 |
|
319 |
|
| 309 |
if (canView ($ORCUSER, $targetuser)) {
|
320 |
if (canView ($ORCUSER, $targetuser)) {
|
| 310 |
$F = $targetuser;
|
321 |
$F = $targetuser;
|
| 311 |
$F->{department} = convertDepartments ($F->{department});
|
322 |
$F->{department} = convertDepartments ($F->{department});
|
| - |
|
323 |
$F->{access} = $AccessLevel->{$F->{access}};
|
| 312 |
$F->{access} = $AccessLevel->{$F->{access}};
|
324 |
$F->{showme} = $F->{showme} ? "True" : "False";
|
| 313 |
$F->{'password'} = "*******";
|
325 |
$F->{'password'} = "*******";
|
| Line 314... |
Line 326... |
| 314 |
$F->{buttons} = $h->input ({ type=>"hidden", name=>"RCid", value=>$F->{'RCid'} }).$h->input ({ type=>"submit", name=>"submit", value=>"Edit" });
|
326 |
$F->{buttons} = $h->input ({ type=>"hidden", name=>"RCid", value=>$F->{'RCid'} }).$h->input ({ type=>"submit", name=>"submit", value=>"Edit" });
|
| 315 |
|
327 |
|
| Line 344... |
Line 356... |
| 344 |
$F->{real_name} = " ";
|
356 |
$F->{real_name} = " ";
|
| 345 |
$F->{pronouns} = " ";
|
357 |
$F->{pronouns} = " ";
|
| 346 |
$F->{tshirt} = " ";
|
358 |
$F->{tshirt} = " ";
|
| 347 |
$F->{phone} = " ";
|
359 |
$F->{phone} = " ";
|
| 348 |
$F->{timeformat} = " ";
|
360 |
$F->{timeformat} = " ";
|
| - |
|
361 |
$F->{showme} = " ";
|
| 349 |
$F->{RCid} = " ";
|
362 |
$F->{RCid} = " ";
|
| 350 |
$F->{access} = " ";
|
363 |
$F->{access} = " ";
|
| 351 |
$F->{MVPid} = " ";
|
364 |
$F->{MVPid} = " ";
|
| 352 |
$F->{buttons} = " ";
|
365 |
$F->{buttons} = " ";
|
| 353 |
}
|
366 |
}
|
| Line 393... |
Line 406... |
| 393 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Full Name: ", $F->{real_name}) ]),
|
406 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Full Name: ", $F->{real_name}) ]),
|
| 394 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Pronouns: ", $F->{pronouns}) ]),
|
407 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Pronouns: ", $F->{pronouns}) ]),
|
| 395 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "TShirt Size: ", $F->{tshirt}) ]),
|
408 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "TShirt Size: ", $F->{tshirt}) ]),
|
| 396 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Phone: ", $F->{phone}) ]),
|
409 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Phone: ", $F->{phone}) ]),
|
| 397 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Time Format: ", $F->{timeformat}) ]),
|
410 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Time Format: ", $F->{timeformat}) ]),
|
| - |
|
411 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Share My Shifts: ", $F->{showme}) ]),
|
| 398 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Database ID: ", $F->{RCid}) ]),
|
412 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Database ID: ", $F->{RCid}) ]),
|
| 399 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "User Added: ", $F->{added}) ]),
|
413 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "User Added: ", $F->{added}) ]),
|
| 400 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Last Login: ", $F->{last_login}) ]),
|
414 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "Last Login: ", $F->{last_login}) ]),
|
| 401 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "vORC Access Level: ", $F->{access}) ]),
|
415 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "vORC Access Level: ", $F->{access}) ]),
|
| 402 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "MVP Pass: ", $F->{MVPid}) ]),
|
416 |
$h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableCellr", style=>"font-size: unset;" }, "MVP Pass: ", $F->{MVPid}) ]),
|