forked from science-ation/science-ation
Add support to choose what status a project must have to be used by the judge scheduler. Allows for any of open, payment pending or complete projects to be allowed.
This commit is contained in:
parent
145c6f88ff
commit
a169e422e6
@ -178,4 +178,19 @@ function getJudgingTeam($teamid)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getJudgingEligibilityCode() {
|
||||||
|
global $config;
|
||||||
|
switch($config['project_status']) {
|
||||||
|
case 'open' :
|
||||||
|
return " AND registrations.status != 'open' ";
|
||||||
|
break;
|
||||||
|
case 'payment_pending' :
|
||||||
|
return " AND registrations.status IN ('paymentpending', 'complete')";
|
||||||
|
break;
|
||||||
|
case 'complete' :
|
||||||
|
return " AND registrations.status = 'complete'";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -249,11 +249,13 @@ for($k=0; $k<count($keys); $k++) {
|
|||||||
$d = $jdiv[$jdiv_id]['config'][$x];
|
$d = $jdiv[$jdiv_id]['config'][$x];
|
||||||
if($x > 0) TRACE("\t- ");
|
if($x > 0) TRACE("\t- ");
|
||||||
TRACE($cat[$d['cat']]." ".$div[$d['div']]." - ".$langr[$d['lang']]);
|
TRACE($cat[$d['cat']]." ".$div[$d['div']]." - ".$langr[$d['lang']]);
|
||||||
$qp = mysql_query("SELECT * FROM projects WHERE ".
|
$qp = mysql_query("SELECT projects.* FROM projects, registrations WHERE ".
|
||||||
" year='".$config['FAIRYEAR']."' AND ".
|
" projects.year='".$config['FAIRYEAR']."' AND ".
|
||||||
" projectdivisions_id='{$d['div']}' AND ".
|
" projectdivisions_id='{$d['div']}' AND ".
|
||||||
" projectcategories_id='{$d['cat']}' AND ".
|
" projectcategories_id='{$d['cat']}' AND ".
|
||||||
" language='{$d['lang']}' "
|
" language='{$d['lang']}' AND " .
|
||||||
|
" registrations.id = projects.registrations_id " .
|
||||||
|
getJudgingEligibilityCode()
|
||||||
);
|
);
|
||||||
$count = 0;
|
$count = 0;
|
||||||
while($rp = mysql_fetch_object($qp)) {
|
while($rp = mysql_fetch_object($qp)) {
|
||||||
|
@ -79,11 +79,13 @@ function judges_scheduler_check_judges()
|
|||||||
$c = $r->projectcategories_id;
|
$c = $r->projectcategories_id;
|
||||||
$l = $r->lang;
|
$l = $r->lang;
|
||||||
|
|
||||||
$qp = mysql_query("SELECT COUNT(id) as cnt FROM projects WHERE ".
|
$qp = mysql_query("SELECT COUNT(projects.id) as cnt FROM projects, registrations WHERE ".
|
||||||
" year='".$config['FAIRYEAR']."' AND ".
|
" projects.year='".$config['FAIRYEAR']."' AND ".
|
||||||
" projectdivisions_id='$d' AND ".
|
" projectdivisions_id='$d' AND ".
|
||||||
" projectcategories_id='$c' AND ".
|
" projectcategories_id='$c' AND ".
|
||||||
" language='$l' "
|
" language='$l' AND " .
|
||||||
|
" registrations.id = projects.registrations_id " .
|
||||||
|
getJudgingEligibilityCode()
|
||||||
);
|
);
|
||||||
$qr = mysql_fetch_object($qp);
|
$qr = mysql_fetch_object($qp);
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
21
|
22
|
||||||
|
2
db/db.update.22.sql
Normal file
2
db/db.update.22.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
INSERT INTO `config` (`var`, `val`, `description`, `category`, `year`, `ord`) VALUES
|
||||||
|
('project_status', 'payment_pending', 'The status a project must have have to be considered eligible for judge scheduling. Must be one of "open", "payment_pending" or "complete".', 'Judge Scheduler', -1, 600);
|
Loading…
Reference in New Issue
Block a user