forked from science-ation/science-ation
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:
parent
2afa6a5ec8
commit
fcccfd16c0
@ -77,9 +77,11 @@ function getJudgingTeams()
|
|||||||
"firstname"=>$mr->firstname,
|
"firstname"=>$mr->firstname,
|
||||||
"lastname"=>$mr->lastname,
|
"lastname"=>$mr->lastname,
|
||||||
"captain"=>$mr->captain,
|
"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.
|
//we also need to add all the languages that the team must JUDGE to the teams languages.
|
||||||
$lq=mysql_query("SELECT projects.language
|
$lq=mysql_query("SELECT projects.language
|
||||||
@ -88,10 +90,14 @@ function getJudgingTeams()
|
|||||||
WHERE judges_teams_timeslots_projects_link.year='{$config['FAIRYEAR']}' AND
|
WHERE judges_teams_timeslots_projects_link.year='{$config['FAIRYEAR']}' AND
|
||||||
judges_teams_id='$r->id' ");
|
judges_teams_id='$r->id' ");
|
||||||
echo mysql_error();
|
echo mysql_error();
|
||||||
|
$projectlangs=array();
|
||||||
while($lr=mysql_fetch_object($lq)) {
|
while($lr=mysql_fetch_object($lq)) {
|
||||||
|
if(!in_array($lr->language,$projectlangs))
|
||||||
|
$projectlangs[]=$lr->language;
|
||||||
if(!in_array($lr->language,$teamlangs))
|
if(!in_array($lr->language,$teamlangs))
|
||||||
$teamlangs[]=$lr->language;
|
$teamlangs[]=$lr->language;
|
||||||
}
|
}
|
||||||
|
$teams[$r->id]['languages_projects']=$projectlangs;
|
||||||
$teams[$r->id]['languages']=$teamlangs;
|
$teams[$r->id]['languages']=$teamlangs;
|
||||||
|
|
||||||
//get the awards for this team
|
//get the awards for this team
|
||||||
|
@ -247,26 +247,22 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
|
|||||||
|
|
||||||
$numprojects=0;
|
$numprojects=0;
|
||||||
echo "<select name=\"project_id\">";
|
echo "<select name=\"project_id\">";
|
||||||
echo "<option value=\"\">Choose Project to Assign to Timeslot</option>\n";
|
echo "<option value=\"\">".i18n("Choose Project to Assign to Timeslot")."</option>\n";
|
||||||
while($pr=mysql_fetch_object($pq))
|
while($pr=mysql_fetch_object($pq)) {
|
||||||
{
|
if($_SESSION['viewstate']['judges_projects_list_eligible']=='true') {
|
||||||
if($_SESSION['viewstate']['judges_projects_list_eligible']=='true')
|
if(in_array($pr->projectnumber,$eligibleprojectsnumbers)) {
|
||||||
{
|
|
||||||
if(in_array($pr->projectnumber,$eligibleprojectsnumbers))
|
|
||||||
{
|
|
||||||
echo "<option value=\"$pr->id\">$pr->projectnumber - $pr->title</option>\n";
|
echo "<option value=\"$pr->id\">$pr->projectnumber - $pr->title</option>\n";
|
||||||
$numprojects++;
|
$numprojects++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
echo "<option value=\"$pr->id\">$pr->projectnumber - $pr->title</option>\n";
|
echo "<option value=\"$pr->id\">$pr->projectnumber - $pr->title</option>\n";
|
||||||
$numprojects++;
|
$numprojects++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "</select>";
|
echo "</select>";
|
||||||
echo "</td><td>";
|
echo "</td><td>";
|
||||||
echo "$numprojects projects listed";
|
echo i18n("%1 projects listed",array($numprojects));
|
||||||
echo "</td></tr>";
|
echo "</td></tr>";
|
||||||
echo "</table>";
|
echo "</table>";
|
||||||
|
|
||||||
@ -275,18 +271,17 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
|
|||||||
|
|
||||||
echo "<table class=\"summarytable\">";
|
echo "<table class=\"summarytable\">";
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo "<th>Timeslot</th>";
|
echo "<th>".i18n("Timeslot")."</th>";
|
||||||
echo "<th>Project</th>";
|
echo "<th>".i18n("Project")."</th>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
|
|
||||||
|
|
||||||
while($r=mysql_fetch_object($q))
|
while($r=mysql_fetch_object($q)) {
|
||||||
{
|
|
||||||
echo "<tr><td>";
|
echo "<tr><td>";
|
||||||
|
|
||||||
echo "<nobr>";
|
echo "<nobr>";
|
||||||
if($show_date)
|
if($show_date)
|
||||||
echo format_date($r->date);
|
echo format_date($r->date)." ";
|
||||||
echo format_time($r->starttime);
|
echo format_time($r->starttime);
|
||||||
echo " - ";
|
echo " - ";
|
||||||
echo format_time($r->endtime);
|
echo format_time($r->endtime);
|
||||||
@ -311,30 +306,25 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
|
|||||||
");
|
");
|
||||||
|
|
||||||
echo mysql_Error();
|
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 "<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 "$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 "</td></tr>";
|
||||||
}
|
}
|
||||||
echo "</table>";
|
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 error(i18n("Team has no timeslots assigned to it. <a href=\"judges_teams_timeslots.php\">Assign Timeslots Here</a>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "</form>";
|
echo "</form>";
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
echo "<input type=\"hidden\" name=\"action\" value=\"assign\">";
|
echo "<input type=\"hidden\" name=\"action\" value=\"assign\">";
|
||||||
|
|
||||||
echo "<table class=\"tableview\">";
|
echo "<table class=\"tableview\">";
|
||||||
@ -344,8 +334,7 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
|
|||||||
echo "</tr></thead>";
|
echo "</tr></thead>";
|
||||||
|
|
||||||
$teams=getJudgingTeams();
|
$teams=getJudgingTeams();
|
||||||
foreach($teams AS $team)
|
foreach($teams AS $team) {
|
||||||
{
|
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo "<td width=\"200\">";
|
echo "<td width=\"200\">";
|
||||||
echo "<b>".$team['name']." (#".$team['num'].")</b><br />";
|
echo "<b>".$team['name']." (#".$team['num'].")</b><br />";
|
||||||
@ -353,11 +342,20 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
|
|||||||
if(count($team['members'])) {
|
if(count($team['members'])) {
|
||||||
foreach($team['members'] AS $member) {
|
foreach($team['members'] AS $member) {
|
||||||
echo " ";
|
echo " ";
|
||||||
|
$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")
|
if($member['captain']=="yes")
|
||||||
echo "<i>";
|
echo "<i>";
|
||||||
echo $member['firstname']." ".$member['lastname']." (".$member['languages'].")<br />";
|
echo $member['firstname']." ".$member['lastname']." (".$member['languages'].")<br />";
|
||||||
if($member['captain']=="yes")
|
if($member['captain']=="yes")
|
||||||
echo "</i>";
|
echo "</i>";
|
||||||
|
if($err) echo "</span>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
@ -381,18 +379,16 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
|
|||||||
");
|
");
|
||||||
$numslots=mysql_num_rows($q);
|
$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 "<tr><td width=\"100\" align=\"center\">";
|
||||||
|
|
||||||
echo "<nobr>";
|
echo "<nobr>";
|
||||||
if($show_date)
|
if($show_date)
|
||||||
echo format_date($r->date);
|
echo format_date($r->date)." ";
|
||||||
|
|
||||||
echo format_time($r->starttime);
|
echo format_time($r->starttime);
|
||||||
echo " - ";
|
echo " - ";
|
||||||
echo format_time($r->endtime);
|
echo format_time($r->endtime);
|
||||||
@ -416,9 +412,9 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
|
|||||||
projectnumber
|
projectnumber
|
||||||
");
|
");
|
||||||
|
|
||||||
echo mysql_Error();
|
echo mysql_error();
|
||||||
while($proj=mysql_fetch_object($projq)) {
|
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 "<span class=\"error\">";
|
||||||
|
|
||||||
echo "$proj->projectnumber - $proj->title ($proj->language)";
|
echo "$proj->projectnumber - $proj->title ($proj->language)";
|
||||||
@ -426,10 +422,7 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
|
|||||||
if(!in_array($proj->language,$team['languages']))
|
if(!in_array($proj->language,$team['languages']))
|
||||||
echo "</span>\n";
|
echo "</span>\n";
|
||||||
echo "<br />";
|
echo "<br />";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
echo "</td></tr>";
|
echo "</td></tr>";
|
||||||
}
|
}
|
||||||
echo "</table>";
|
echo "</table>";
|
||||||
|
Loading…
Reference in New Issue
Block a user