From 69b4b943acc758d58f064891be5b7b807d8fd1ee Mon Sep 17 00:00:00 2001 From: james Date: Wed, 18 Jan 2006 05:33:13 +0000 Subject: [PATCH] Make the T-Shirt size question to students able to be disabled via a configuration variable for fairs that dont give out tshirts --- db/db.update.12.sql | 1 + register_participants.inc.php | 5 ++++- register_participants_students.php | 33 +++++++++++++++++------------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/db/db.update.12.sql b/db/db.update.12.sql index 8af5cbc0..7f743ba5 100644 --- a/db/db.update.12.sql +++ b/db/db.update.12.sql @@ -1,2 +1,3 @@ UPDATE `config` SET `description` = 'Self nominations for special awards are due either with registration or on a specific date. If "date" is used, it must be configured under "Important Dates" section. If you do not wish to allow students to self-nominate for special awards, set to "none" (none|date|registration)' WHERE `var` = 'specialawardnomination'; ALTER TABLE `schools` ADD `projectlimit` INT NOT NULL , ADD `projectlimitper` ENUM( 'total', 'agecategory' ) NOT NULL ; +INSERT INTO `config` ( `var` , `val` , `description` , `year` ) VALUES ( 'participant_student_tshirt', 'yes', 'Ask for students their T-Shirt size (yes/no).', '-1'); diff --git a/register_participants.inc.php b/register_participants.inc.php index 578cd1c6..97870400 100644 --- a/register_participants.inc.php +++ b/register_participants.inc.php @@ -49,7 +49,10 @@ function registrationDeadlinePassed() function studentStatus($reg_id="") { global $config; - $required_fields=array("firstname","lastname","address","city","postalcode","phone","email","grade","dateofbirth","schools_id","tshirt"); + $required_fields=array("firstname","lastname","address","city","postalcode","phone","email","grade","dateofbirth","schools_id"); + + if($config['participant_student_tshirt']=="yes") + $required_fields[]="tshirt"; if($reg_id) $rid=$reg_id; else $rid=$_SESSION['registration_id']; diff --git a/register_participants_students.php b/register_participants_students.php index 4c27f2b9..9d2aa088 100644 --- a/register_participants_students.php +++ b/register_participants_students.php @@ -294,6 +294,24 @@ else if($newstatus=="complete") echo REQUIREDFIELD.""; echo ""; + if($config['participant_student_tshirt']=="yes") + { + echo "\n"; + echo " ".i18n("T-Shirt Size").""; + echo " "; + echo "\n"; + echo ""; + } + echo "\n"; echo "".i18n("Medical Alert Info").""; echo "medicalalert\" />"; @@ -310,7 +328,7 @@ else if($newstatus=="complete") } echo "\n"; - echo " ".i18n("School").""; + echo " ".i18n("School").""; $schoolq=mysql_query("SELECT id,school FROM schools WHERE year='".$config['FAIRYEAR']."' ORDER by school"); echo "".REQUIREDFIELD; - echo "\n"; - echo " ".i18n("T-Shirt Size").""; - echo " "; - echo "\n"; echo "\n";