Add a bunch of missing i18n's on the judges teams projects

Make the timeslot/project listings not be stupidly tiny
Highlight more errors in big bold red for language mismatches
This commit is contained in:
james 2010-04-06 17:05:59 +00:00
parent 2afa6a5ec8
commit fcccfd16c0
2 changed files with 38 additions and 39 deletions

View File

@ -77,9 +77,11 @@ function getJudgingTeams()
"firstname"=>$mr->firstname,
"lastname"=>$mr->lastname,
"captain"=>$mr->captain,
"languages"=>$judgelangs
"languages"=>$judgelangs,
"languages_array"=>$u['languages']
);
}
$teams[$r->id]['languages_members']=$teamlangs;
//we also need to add all the languages that the team must JUDGE to the teams languages.
$lq=mysql_query("SELECT projects.language
@ -88,10 +90,14 @@ function getJudgingTeams()
WHERE judges_teams_timeslots_projects_link.year='{$config['FAIRYEAR']}' AND
judges_teams_id='$r->id' ");
echo mysql_error();
$projectlangs=array();
while($lr=mysql_fetch_object($lq)) {
if(!in_array($lr->language,$projectlangs))
$projectlangs[]=$lr->language;
if(!in_array($lr->language,$teamlangs))
$teamlangs[]=$lr->language;
}
$teams[$r->id]['languages_projects']=$projectlangs;
$teams[$r->id]['languages']=$teamlangs;
//get the awards for this team

View File

@ -247,26 +247,22 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
$numprojects=0;
echo "<select name=\"project_id\">";
echo "<option value=\"\">Choose Project to Assign to Timeslot</option>\n";
while($pr=mysql_fetch_object($pq))
{
if($_SESSION['viewstate']['judges_projects_list_eligible']=='true')
{
if(in_array($pr->projectnumber,$eligibleprojectsnumbers))
{
echo "<option value=\"\">".i18n("Choose Project to Assign to Timeslot")."</option>\n";
while($pr=mysql_fetch_object($pq)) {
if($_SESSION['viewstate']['judges_projects_list_eligible']=='true') {
if(in_array($pr->projectnumber,$eligibleprojectsnumbers)) {
echo "<option value=\"$pr->id\">$pr->projectnumber - $pr->title</option>\n";
$numprojects++;
}
}
else
{
else {
echo "<option value=\"$pr->id\">$pr->projectnumber - $pr->title</option>\n";
$numprojects++;
}
}
echo "</select>";
echo "</td><td>";
echo "$numprojects projects listed";
echo i18n("%1 projects listed",array($numprojects));
echo "</td></tr>";
echo "</table>";
@ -275,18 +271,17 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
echo "<table class=\"summarytable\">";
echo "<tr>";
echo "<th>Timeslot</th>";
echo "<th>Project</th>";
echo "<th>".i18n("Timeslot")."</th>";
echo "<th>".i18n("Project")."</th>";
echo "</tr>";
while($r=mysql_fetch_object($q))
{
while($r=mysql_fetch_object($q)) {
echo "<tr><td>";
echo "<nobr>";
if($show_date)
echo format_date($r->date);
echo format_date($r->date)."&nbsp;";
echo format_time($r->starttime);
echo " - ";
echo format_time($r->endtime);
@ -311,30 +306,25 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
");
echo mysql_Error();
while($proj=mysql_fetch_object($projq))
{
while($proj=mysql_fetch_object($projq)) {
echo "<a onclick=\"return confirmClick('Are you sure you want to remove this project from this team timeslot?')\" href=\"judges_teams_projects.php?action=delete&delete=".$proj->link_id."&edit=".$team['id']."\"><img border=0 src=\"".$config['SFIABDIRECTORY']."/images/16/button_cancel.".$config['icon_extension']."\"></a>";
echo "$proj->projectnumber - $proj->title <br />";
}
echo "<input name=\"assignbtn[$r->id]\" type=\"button\" onclick=\"assign('$r->id')\" value=\"Assign\">";
echo "<input name=\"assignbtn[$r->id]\" type=\"button\" onclick=\"assign('$r->id')\" value=\"".i18n("Assign")."\">";
echo "</td></tr>";
}
echo "</table>";
}
else
{
else {
echo error(i18n("Team has no timeslots assigned to it. <a href=\"judges_teams_timeslots.php\">Assign Timeslots Here</a>"));
}
echo "</form>";
}
else
{
else {
echo "<input type=\"hidden\" name=\"action\" value=\"assign\">";
echo "<table class=\"tableview\">";
@ -344,8 +334,7 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
echo "</tr></thead>";
$teams=getJudgingTeams();
foreach($teams AS $team)
{
foreach($teams AS $team) {
echo "<tr>";
echo "<td width=\"200\">";
echo "<b>".$team['name']." (#".$team['num'].")</b><br />";
@ -353,11 +342,20 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
if(count($team['members'])) {
foreach($team['members'] AS $member) {
echo "&nbsp;&nbsp;";
$err=false;
foreach($team['languages_projects'] AS $projectlang) {
if(!in_array($projectlang, $member['languages_array'])) {
$err=true;
break;
}
}
if($err) echo "<span class=\"error\">";
if($member['captain']=="yes")
echo "<i>";
echo $member['firstname']." ".$member['lastname']." (".$member['languages'].")<br />";
if($member['captain']=="yes")
echo "</i>";
if($err) echo "</span>";
}
}
echo "</td>";
@ -381,18 +379,16 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
");
$numslots=mysql_num_rows($q);
echo "<a href=\"judges_teams_projects.php?action=edit&edit=".$team['id']."\">Edit team project assignments</a>";
echo "<a href=\"judges_teams_projects.php?action=edit&edit=".$team['id']."\">".i18n("Edit team project assignments")."</a>";
echo "<table class=tableview style=\"margin-left: 0px; width: 100%;\">";
echo "<table class=\"tableview\" style=\"margin-left: 0px; width: 100%; font-size: 1.0em;\">";
while($r=mysql_fetch_object($q))
{
while($r=mysql_fetch_object($q)) {
echo "<tr><td width=\"100\" align=\"center\">";
echo "<nobr>";
if($show_date)
echo format_date($r->date);
echo format_date($r->date)."&nbsp;";
echo format_time($r->starttime);
echo " - ";
echo format_time($r->endtime);
@ -416,9 +412,9 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
projectnumber
");
echo mysql_Error();
echo mysql_error();
while($proj=mysql_fetch_object($projq)) {
if(!in_array($proj->language,$team['languages']))
if(!in_array($proj->language,$team['languages_members']))
echo "<span class=\"error\">";
echo "$proj->projectnumber - $proj->title ($proj->language)";
@ -426,10 +422,7 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
if(!in_array($proj->language,$team['languages']))
echo "</span>\n";
echo "<br />";
}
echo "</td></tr>";
}
echo "</table>";
@ -438,7 +431,7 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
echo "</tr>";
}
echo "</table>";
echo "</table>";
}