From 2f6683d014753e37cdf8d01d38bc66a80330c6d6 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 2 Apr 2009 16:35:02 +0000 Subject: [PATCH] Show language problems when a judge is assigned to judge projects in a different language --- admin/judges.inc.php | 4 ++++ admin/judges_teams_projects.php | 21 ++++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/admin/judges.inc.php b/admin/judges.inc.php index 9d9b5ca..22aac84 100644 --- a/admin/judges.inc.php +++ b/admin/judges.inc.php @@ -46,6 +46,7 @@ function getJudgingTeams() echo mysql_error(); + $teamlangs=array(); while($mr=mysql_fetch_object($mq)) { $lq=mysql_query("SELECT * FROM judges_languages WHERE judges_id='$mr->judges_id'"); @@ -53,6 +54,8 @@ function getJudgingTeams() if(mysql_num_rows($lq)) { while($lr=mysql_fetch_object($lq)) { $judgelangs.="$lr->languages_lang/"; + if(!in_array($lr->languages_lang,$teamlangs)) + $teamlangs[]=$lr->languages_lang; } $judgelangs=substr($judgelangs,0,-1); } @@ -64,6 +67,7 @@ function getJudgingTeams() "languages"=>$judgelangs ); } + $teams[$r->id]['languages']=$teamlangs; //get the awards for this team $aq=mysql_query("SELECT award_awards.id, diff --git a/admin/judges_teams_projects.php b/admin/judges_teams_projects.php index 6267c92..4d722c9 100644 --- a/admin/judges_teams_projects.php +++ b/admin/judges_teams_projects.php @@ -337,7 +337,7 @@ if( ($action=="edit" || $action=="assign" ) && $edit) { echo ""; - echo ""; + echo "
"; echo ""; echo ""; echo ""; @@ -357,10 +357,9 @@ if( ($action=="edit" || $action=="assign" ) && $edit) echo "  "; if($member['captain']=="yes") echo ""; - echo $member['firstname']." ".$member['lastname']."
"; + echo $member['firstname']." ".$member['lastname']." (".$member['languages'].")
"; if($member['captain']=="yes") echo "
"; - } } echo ""; @@ -405,7 +404,8 @@ if( ($action=="edit" || $action=="assign" ) && $edit) $projq=mysql_query("SELECT projects.projectnumber, projects.id, - projects.title + projects.title, + projects.language FROM projects, judges_teams_timeslots_projects_link @@ -419,9 +419,16 @@ if( ($action=="edit" || $action=="assign" ) && $edit) "); echo mysql_Error(); - while($proj=mysql_fetch_object($projq)) - { - echo "$proj->projectnumber - $proj->title
"; + while($proj=mysql_fetch_object($projq)) { + if(!in_array($proj->language,$team['languages'])) + echo ""; + + echo "$proj->projectnumber - $proj->title ($proj->language)"; + + if(!in_array($proj->language,$team['languages'])) + echo "\n"; + echo "
"; + }
".i18n("Team")."".i18n("Timeslots and Projects")."