The languages for a team should also be based on which PROJECTS are assigned to the team

Update the judges_teams_members list to show "BAD" judges (judges assigned to a team in
a language that they dont speak)
This commit is contained in:
james 2010-04-06 16:15:48 +00:00
parent 28db0a6871
commit 00e1743aed
2 changed files with 29 additions and 10 deletions

View File

@ -80,6 +80,18 @@ function getJudgingTeams()
"languages"=>$judgelangs
);
}
//we also need to add all the languages that the team must JUDGE to the teams languages.
$lq=mysql_query("SELECT projects.language
FROM judges_teams_timeslots_projects_link
LEFT JOIN projects ON judges_teams_timeslots_projects_link.projects_id=projects.id
WHERE judges_teams_timeslots_projects_link.year='{$config['FAIRYEAR']}' AND
judges_teams_id='$r->id' ");
echo mysql_error();
while($lr=mysql_fetch_object($lq)) {
if(!in_array($lr->language,$teamlangs))
$teamlangs[]=$lr->language;
}
$teams[$r->id]['languages']=$teamlangs;
//get the awards for this team

View File

@ -297,27 +297,33 @@ function switchjudgeinfo()
echo "</th></tr>\n";
echo "<tr><td colspan=\"2\">";
foreach($team['rounds'] as $ts) {
echo "{$ts['name']}: {$ts['starttime']} - {$ts['endtime']}<br />";
echo "{$ts['name']}: ".format_time($ts['starttime'])." - ".format_time($ts['endtime'])."<br />";
}
echo "</td></tr>";
if(count($team['members']))
{
foreach($team['members'] AS $member)
{
if(count($team['members'])) {
foreach($team['members'] AS $member) {
$j = &$judgelist[$member['id']];
echo "<tr><td>";
$langerr=false;
foreach($team['languages'] AS $teamlang) {
if(!in_array($teamlang,$j['languages'])) {
$langerr=true;
break;
}
}
echo "<a onclick=\"return confirmClick('Are you sure you want to remove this judge from this team?')\" href=\"judges_teams_members.php?action=del&team_id=".$team['id']."&team_num=".$team['num']."&users_id=".$member['id']."&team_name=".rawurlencode($team['name'])."\"><img border=0 src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\"></a>";
echo "</td><td width=\"100%\">";
if($member['captain']=="yes")
{
if($langerr) echo "<span class=\"error\" style=\"width: 100%; display: block;\">";
if($member['captain']=="yes") {
echo "<a title=\"Captain - Click to remove captain status\" href=\"judges_teams_members.php?action=removecaptain&team_id=".$team['id']."&judge_id=".$member['id']."\">";
echo "<img border=0 src=\"".$config['SFIABDIRECTORY']."/images/16/bookmark.".$config['icon_extension']."\">";
echo "</a>&nbsp;";
}
else
{
else {
echo "<a title=\"Non-Captain - Click to make a team captain\" href=\"judges_teams_members.php?action=addcaptain&team_id=".$team['id']."&judge_id=".$member['id']."\">";
echo "<img border=0 src=\"".$config['SFIABDIRECTORY']."/images/16/bookmark_disabled.".$config['icon_extension']."\">";
echo "</a>&nbsp;";
@ -328,7 +334,8 @@ function switchjudgeinfo()
if(is_array($j['languages']))
$l = is_array($j['languages']) ? join(' ',$j['languages']) : '';
echo "</a> (<font size=-1>$l</font>)";
echo "</a>&nbsp;<span style=\"font-size: 1.0em;\">($l)</span>\n";
if($langerr) echo "</span>\n";
echo "</td></tr>";
}