Add a configuration option to specify whether to collect 'personal' information about the students, such as address, phone number, date of birth, etc.

This commit is contained in:
james 2006-02-05 21:39:32 +00:00
parent 99af4b4f4a
commit 1771c83da4
3 changed files with 25 additions and 2 deletions

2
db/db.update.14.sql Normal file
View File

@ -0,0 +1,2 @@
INSERT INTO `config` ( `var` , `val` , `description` , `year` ) VALUES ( 'participant_student_personal', 'yes', 'Collect personal information about the students, such as phone number, address, gender, etc.', '-1');
INSERT INTO `config` ( `var` , `val` , `description` , `year` ) VALUES ( 'participant_student_personal', 'yes', 'Collect personal information about the students, such as phone number, address, gender, etc.', '2006');

View File

@ -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");
if($config['participant_student_personal']=="yes")
$required_fields=array("firstname","lastname","address","city","postalcode","phone","email","grade","dateofbirth","schools_id");
else
$required_fields=array("firstname","lastname","email","grade","schools_id");
if($config['participant_student_tshirt']=="yes")
$required_fields[]="tshirt";

View File

@ -239,6 +239,8 @@ else if($newstatus=="complete")
echo " <td>".i18n("Last Name")."</td><td><input type=\"text\" name=\"lastname[$x]\" value=\"$studentinfo->lastname\" />".REQUIREDFIELD."</td>\n";
echo "</tr>\n";
if($config['participant_student_personal']=="yes")
{
echo "<tr>\n";
echo " <td>".i18n("Sex")."</td><td>";
echo "<select name=\"sex[$x]\">";
@ -248,15 +250,27 @@ else if($newstatus=="complete")
if($studentinfo->sex=="female") $sel="selected=\"selected\""; else $sel="";
echo "<option $sel value=\"female\">".i18n("Female")."</option>\n";
echo "</select>".REQUIREDFIELD;
}
echo "</td>\n";
echo " <td></td><td></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td>".i18n("Email Address")."</td><td><input type=\"text\" name=\"email[$x]\" value=\"$studentinfo->email\" />".REQUIREDFIELD."</td>\n";
if($config['participant_student_personal']=="yes")
{
echo " <td>".i18n("City")."</td><td><input type=\"text\" name=\"city[$x]\" value=\"$studentinfo->city\" />".REQUIREDFIELD."</td>\n";
}
else
{
echo "<td></td>";
}
echo "</tr>\n";
if($config['participant_student_personal']=="yes")
{
echo "<tr>\n";
echo " <td>".i18n("Address")."</td><td><input type=\"text\" name=\"address[$x]\" value=\"$studentinfo->address\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n("Province")."</td><td>";
@ -285,6 +299,10 @@ else if($newstatus=="complete")
emit_year_selector("year[$x]",$year,$minyearselect,$maxyearselect);
echo "</td><td>".REQUIREDFIELD."</td></tr></table>\n";
echo "</td>\n";
}
else
echo "<tr>";
echo " <td>".i18n("Grade")."</td><td>\n";
echo "<select name=\"grade[$x]\">\n";