forked from science-ation/science-ation
If availability is disabled, dont fail loading judges
Fix the team languages array Fix the timeslots checks for schedulerconfig (need round AND timeslots, not just a round)
This commit is contained in:
parent
7e6795fd0d
commit
c67488d375
@ -51,6 +51,10 @@ function getJudgingTeams()
|
||||
{
|
||||
$u = user_load($mr->judges_id, false);
|
||||
$judgelangs = join('/', $u['languages']);
|
||||
foreach($u['languages'] AS $l) {
|
||||
if(!in_array($l,$teamlangs))
|
||||
$teamlangs[]=$l;
|
||||
}
|
||||
|
||||
$teams[$lastteamid]['members'][]=array(
|
||||
"id"=>$mr->judges_id,
|
||||
|
@ -466,17 +466,18 @@ foreach($judges as &$j) {
|
||||
unset($judges[$j['id']]);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Load the judge time availability */
|
||||
$q = mysql_query("SELECT * FROM judges_availability WHERE users_id='{$j['id']}' ORDER BY `start`");
|
||||
if(mysql_num_rows($q) == 0) {
|
||||
TRACE(" {$j['name']} hasn't selected any time availability, POTENTIAL BUG (they shouldn't be marked as complete).\n");
|
||||
TRACE(" Ignoring this judge.\n");
|
||||
unset($judges[$j['id']]);
|
||||
continue;
|
||||
}
|
||||
while($r = mysql_fetch_assoc($q)) {
|
||||
$j['availability'][] = $r;
|
||||
if($config['judges_availability_enable']=="yes") {
|
||||
/* Load the judge time availability */
|
||||
$q = mysql_query("SELECT * FROM judges_availability WHERE users_id='{$j['id']}' ORDER BY `start`");
|
||||
if(mysql_num_rows($q) == 0) {
|
||||
TRACE(" {$j['name']} hasn't selected any time availability, POTENTIAL BUG (they shouldn't be marked as complete).\n");
|
||||
TRACE(" Ignoring this judge.\n");
|
||||
unset($judges[$j['id']]);
|
||||
continue;
|
||||
}
|
||||
while($r = mysql_fetch_assoc($q)) {
|
||||
$j['availability'][] = $r;
|
||||
}
|
||||
}
|
||||
|
||||
/* Load special award preferences */
|
||||
@ -1310,7 +1311,7 @@ for($k=0; $k<$keys_count; $k++) {
|
||||
print_r($jteams_ids);
|
||||
*/
|
||||
print("Jteams ids len=".count($jteams_ids));
|
||||
print("\n");
|
||||
print("n_timeslots=$n_timeslots\n");
|
||||
|
||||
set_percent(50 + ($k / $keys_count) * 50);
|
||||
|
||||
|
@ -7,9 +7,13 @@ function judges_scheduler_check_timeslots()
|
||||
$q=mysql_query("SELECT * FROM judges_timeslots WHERE ".
|
||||
" year='".$config['FAIRYEAR']."'".
|
||||
" AND `type`='divisional1'" );
|
||||
$rows = mysql_num_rows($q);
|
||||
|
||||
return $rows;
|
||||
if(mysql_num_rows($q)) {
|
||||
$round=mysql_fetch_object($q);
|
||||
$q=mysql_query("SELECT * FROM judges_timeslots WHERE round_id='$round->id' AND type='timeslot'");
|
||||
return mysql_num_rows($q);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
function judges_scheduler_check_awards()
|
||||
|
@ -350,10 +350,8 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
|
||||
echo "<td width=\"200\">";
|
||||
echo "<b>".$team['name']." (#".$team['num'].")</b><br />";
|
||||
$memberlist="";
|
||||
if(count($team['members']))
|
||||
{
|
||||
foreach($team['members'] AS $member)
|
||||
{
|
||||
if(count($team['members'])) {
|
||||
foreach($team['members'] AS $member) {
|
||||
echo " ";
|
||||
if($member['captain']=="yes")
|
||||
echo "<i>";
|
||||
|
Loading…
Reference in New Issue
Block a user