From fcccfd16c0dee03d164f93d90f879017ccfd3e78 Mon Sep 17 00:00:00 2001 From: james Date: Tue, 6 Apr 2010 17:05:59 +0000 Subject: [PATCH] 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 --- admin/judges.inc.php | 8 +++- admin/judges_teams_projects.php | 69 +++++++++++++++------------------ 2 files changed, 38 insertions(+), 39 deletions(-) diff --git a/admin/judges.inc.php b/admin/judges.inc.php index ea74b77..e3f893d 100644 --- a/admin/judges.inc.php +++ b/admin/judges.inc.php @@ -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 diff --git a/admin/judges_teams_projects.php b/admin/judges_teams_projects.php index ec5763c..7b4f9c8 100644 --- a/admin/judges_teams_projects.php +++ b/admin/judges_teams_projects.php @@ -247,26 +247,22 @@ if( ($action=="edit" || $action=="assign" ) && $edit) $numprojects=0; echo ""; echo ""; - echo "$numprojects projects listed"; + echo i18n("%1 projects listed",array($numprojects)); echo ""; echo ""; @@ -275,18 +271,17 @@ if( ($action=="edit" || $action=="assign" ) && $edit) echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; - while($r=mysql_fetch_object($q)) - { + while($r=mysql_fetch_object($q)) { echo ""; } echo "
TimeslotProject".i18n("Timeslot")."".i18n("Project")."
"; echo ""; if($show_date) - echo format_date($r->date); + echo format_date($r->date)." "; 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 "link_id."&edit=".$team['id']."\">"; echo "$proj->projectnumber - $proj->title
"; } - echo "id]\" type=\"button\" onclick=\"assign('$r->id')\" value=\"Assign\">"; + echo "id]\" type=\"button\" onclick=\"assign('$r->id')\" value=\"".i18n("Assign")."\">"; echo "
"; } - else - { + else { echo error(i18n("Team has no timeslots assigned to it. Assign Timeslots Here")); } - - echo ""; } - else - { + else { echo ""; echo ""; @@ -344,8 +334,7 @@ if( ($action=="edit" || $action=="assign" ) && $edit) echo ""; $teams=getJudgingTeams(); - foreach($teams AS $team) - { + foreach($teams AS $team) { echo ""; echo ""; @@ -381,18 +379,16 @@ if( ($action=="edit" || $action=="assign" ) && $edit) "); $numslots=mysql_num_rows($q); - echo "Edit team project assignments"; + echo "".i18n("Edit team project assignments").""; - echo "
"; echo "".$team['name']." (#".$team['num'].")
"; @@ -353,11 +342,20 @@ if( ($action=="edit" || $action=="assign" ) && $edit) if(count($team['members'])) { foreach($team['members'] AS $member) { echo "  "; + $err=false; + foreach($team['languages_projects'] AS $projectlang) { + if(!in_array($projectlang, $member['languages_array'])) { + $err=true; + break; + } + } + if($err) echo ""; if($member['captain']=="yes") echo ""; echo $member['firstname']." ".$member['lastname']." (".$member['languages'].")
"; if($member['captain']=="yes") echo "
"; + if($err) echo "
"; } } echo "
"; + echo "
"; - while($r=mysql_fetch_object($q)) - { + while($r=mysql_fetch_object($q)) { echo ""; } echo "
"; echo ""; if($show_date) - echo format_date($r->date); - + echo format_date($r->date)." "; 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 ""; 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 "\n"; echo "
"; - } - - echo "
"; @@ -438,7 +431,7 @@ if( ($action=="edit" || $action=="assign" ) && $edit) echo ""; } - echo ""; + echo ""; }