From 7076b17366f57538b603f78a9a3e90ec3bd05cfc Mon Sep 17 00:00:00 2001 From: james Date: Thu, 26 Jan 2006 15:06:56 +0000 Subject: [PATCH] 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). --- projects.inc.php | 57 +++++++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/projects.inc.php b/projects.inc.php index 74a54a5..b3f4a6b 100644 --- a/projects.inc.php +++ b/projects.inc.php @@ -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)