diff --git a/admin/judges_schedulerconfig.php b/admin/judges_schedulerconfig.php
index c37171a..35c6707 100644
--- a/admin/judges_schedulerconfig.php
+++ b/admin/judges_schedulerconfig.php
@@ -70,14 +70,14 @@ if($config['judge_scheduler_percent']=="-1")
$missing_awards = judges_scheduler_check_awards();
if(count($missing_awards) == 0) {
- echo happy(i18n("There is a divisional award for each division, good"));
+ echo happy(i18n("There is a single divisional award for each division/category, good"));
} else {
- echo "
The following awards are missing:
";
+ echo "
The following divisional awards problems were identified:
";
for($x=0; $x");
}
echo "
";
- echo error(i18n("There are missing divisional awards"));
+ echo error(i18n("There needs to be exactly one award for each division/category"));
$ok = 0;
}
diff --git a/admin/judges_schedulerconfig_check.inc.php b/admin/judges_schedulerconfig_check.inc.php
index 14efa23..143ead8 100644
--- a/admin/judges_schedulerconfig_check.inc.php
+++ b/admin/judges_schedulerconfig_check.inc.php
@@ -27,10 +27,28 @@ function judges_scheduler_check_awards()
$dkeys = array_keys($div);
$ckeys = array_keys($cat);
+ if($config['filterdivisionbycategory']=="yes") {
+ $q=mysql_query("SELECT * FROM projectcategoriesdivisions_link WHERE year='".$config['FAIRYEAR']."' ORDER BY projectdivisions_id,projectcategories_id");
+ $divcat=array();
+ while($r=mysql_fetch_object($q)) {
+ $divcat[]=array("c"=>$r->projectcategories_id,"d"=>$r->projectdivisions_id);
+ }
+
+ }
+ else {
+ $divcat=array();
+ foreach($dkeys AS $d) {
+ foreach($ckeys AS $c) {
+ $divcat[]=array("c"=>$c,"d"=>$d);
+ }
+ }
+ }
+
+
$missing_awards = array();
- foreach($dkeys as $d) {
- reset($ckeys);
- foreach ($ckeys as $c) {
+ foreach($divcat AS $dc) {
+ $d=$dc['d'];
+ $c=$dc['c'];
$q=mysql_query("SELECT award_awards.id FROM
award_awards,
award_awards_projectcategories,
@@ -47,12 +65,10 @@ function judges_scheduler_check_awards()
");
echo mysql_error();
if(mysql_num_rows($q)!=1) {
- $missing_awards[] = "{$cat[$c]} - {$div[$d]}";
+ $missing_awards[] = "{$cat[$c]} - {$div[$d]} (".i18n("%1 found",array(mysql_num_rows($q))).")";
}
- }
}
return $missing_awards;
-
}