forked from science-ation/science-ation
Whoops! the last commit was for this file - not the scheduler.. DOH
BUGFIX From Just Reardon: If specialawardnomination is set to "none" (fair doesnt use special award self-nominations) then the pick winners page will instead show all projects that are eligible for the award to choose a winner, instead of those that are nominated for it (which is none).
This commit is contained in:
parent
fefd9c8e35
commit
7076b17366
@ -169,31 +169,42 @@ function getProjectsNominatedForSpecialAward($award_id)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$prjq=mysql_query("SELECT
|
||||
projects.projectnumber,
|
||||
projects.title,
|
||||
projects.id AS projects_id
|
||||
FROM
|
||||
project_specialawards_link,
|
||||
projects
|
||||
WHERE
|
||||
project_specialawards_link.award_awards_id='$award_id'
|
||||
AND project_specialawards_link.projects_id=projects.id
|
||||
AND projects.projectnumber is not null
|
||||
AND projects.year='".$config['FAIRYEAR']."'
|
||||
ORDER BY
|
||||
projectnumber
|
||||
");
|
||||
$projects=array();
|
||||
while($prjr=mysql_fetch_object($prjq))
|
||||
//if they dont use special award nominations, then we will instead get all of the projects that
|
||||
//are eligible for the award, instead of nominated for it.
|
||||
if($config['specialawardnomination']!="none")
|
||||
{
|
||||
$projects[$prjr->projectnumber]=array(
|
||||
"id"=>$prjr->projects_id,
|
||||
"projectnumber"=>$prjr->projectnumber,
|
||||
"title"=>$prjr->title
|
||||
);
|
||||
$prjq=mysql_query("SELECT
|
||||
projects.projectnumber,
|
||||
projects.title,
|
||||
projects.id AS projects_id
|
||||
FROM
|
||||
project_specialawards_link,
|
||||
projects
|
||||
WHERE
|
||||
project_specialawards_link.award_awards_id='$award_id'
|
||||
AND project_specialawards_link.projects_id=projects.id
|
||||
AND projects.projectnumber is not null
|
||||
AND projects.year='".$config['FAIRYEAR']."'
|
||||
ORDER BY
|
||||
projectnumber
|
||||
");
|
||||
$projects=array();
|
||||
while($prjr=mysql_fetch_object($prjq))
|
||||
{
|
||||
$projects[$prjr->projectnumber]=array(
|
||||
"id"=>$prjr->projects_id,
|
||||
"projectnumber"=>$prjr->projectnumber,
|
||||
"title"=>$prjr->title
|
||||
);
|
||||
}
|
||||
//return the projects that have self-nominated themselves for the award
|
||||
return $projects;
|
||||
}
|
||||
else
|
||||
{
|
||||
//return the projects that are eligible for the award instead
|
||||
return getProjectsEligibleForAward($award_id);
|
||||
}
|
||||
return $projects;
|
||||
}
|
||||
|
||||
function getSpecialAwardsNominatedByRegistrationID($id)
|
||||
|
Loading…
Reference in New Issue
Block a user