Add configuration options to choose whether to ask the students if they require:

- table
	- electricity
This commit is contained in:
james 2007-01-02 20:33:16 +00:00
parent 9fc98fc288
commit 0dd2da7145
4 changed files with 68 additions and 33 deletions

View File

@ -224,23 +224,39 @@ if($projectinfo)
echo "<tr><td>".i18n("Requirements").": </td><td>";
echo "<table>";
echo "<tr>";
echo " <td>".i18n("Table").REQUIREDFIELD."</td>";
if($projectinfo->req_table=="yes") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_table\" value=\"yes\" />Yes</td>";
echo " <td width=\"20\">&nbsp;</td>";
if($projectinfo->req_table=="no") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_table\" value=\"no\" />No</td>";
echo "</tr>";
if($config['participant_project_table']=="no")
{
//if we arent asking them if they want a table or not, then we set it to 'yes' assuming everyone will get a table
echo " <input type=\"hidden\" name=\"req_table\" value=\"yes\" />";
}
else
{
echo "<tr>";
echo " <td>".i18n("Table").REQUIREDFIELD."</td>";
if($projectinfo->req_table=="yes") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_table\" value=\"yes\" />Yes</td>";
echo " <td width=\"20\">&nbsp;</td>";
if($projectinfo->req_table=="no") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_table\" value=\"no\" />No</td>";
echo "</tr>";
}
echo "<tr>";
echo " <td>".i18n("Electricity").REQUIREDFIELD."</td>";
if($projectinfo->req_electricity=="yes") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_electricity\" value=\"yes\" />Yes</td>";
echo " <td width=\"20\">&nbsp;</td>";
if($projectinfo->req_electricity=="no") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_electricity\" value=\"no\" />No</td>";
echo "</tr>";
if($config['participant_project_electricity']=="no")
{
//if we arent asking them if they want electricity or not, then we set it to 'yes' assuming everyone will get electricity
echo " <input type=\"hidden\" name=\"req_electricity\" value=\"yes\" />";
}
else
{
echo "<tr>";
echo " <td>".i18n("Electricity").REQUIREDFIELD."</td>";
if($projectinfo->req_electricity=="yes") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_electricity\" value=\"yes\" />Yes</td>";
echo " <td width=\"20\">&nbsp;</td>";
if($projectinfo->req_electricity=="no") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_electricity\" value=\"no\" />No</td>";
echo "</tr>";
}
echo "<tr>";
echo " <td>".i18n("Special")."</td>";

View File

@ -1 +1 @@
32
33

3
db/db.update.33.sql Normal file
View File

@ -0,0 +1,3 @@
INSERT INTO `config` (category,ord,var,val,description,year) VALUES ('Participant Registration','1160','participant_project_table','yes','Ask if the project requires a table (yes/no)',-1);
INSERT INTO `config` (category,ord,var,val,description,year) VALUES ('Participant Registration','1170','participant_project_electricity','yes','Ask if the project requires electricity (yes/no)',-1);

View File

@ -261,23 +261,39 @@ function countwords()
echo "<tr><td>".i18n("Requirements").": </td><td>";
echo "<table>";
echo "<tr>";
echo " <td>".i18n("Table").REQUIREDFIELD."</td>";
if($projectinfo->req_table=="yes") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_table\" value=\"yes\" />Yes</td>";
echo " <td width=\"20\">&nbsp;</td>";
if($projectinfo->req_table=="no") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_table\" value=\"no\" />No</td>";
echo "</tr>";
if($config['participant_project_table']=="no")
{
//if we arent asking them if they want a table or not, then we set it to 'yes' assuming everyone will get a table
echo " <input type=\"hidden\" name=\"req_table\" value=\"yes\" />";
}
else
{
echo "<tr>";
echo " <td>".i18n("Table").REQUIREDFIELD."</td>";
if($projectinfo->req_table=="yes") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_table\" value=\"yes\" />Yes</td>";
echo " <td width=\"20\">&nbsp;</td>";
if($projectinfo->req_table=="no") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_table\" value=\"no\" />No</td>";
echo "</tr>";
}
echo "<tr>";
echo " <td>".i18n("Electricity").REQUIREDFIELD."</td>";
if($projectinfo->req_electricity=="yes") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_electricity\" value=\"yes\" />Yes</td>";
echo " <td width=\"20\">&nbsp;</td>";
if($projectinfo->req_electricity=="no") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_electricity\" value=\"no\" />No</td>";
echo "</tr>";
if($config['participant_project_electricity']=="no")
{
//if we arent asking them if they want electricity or not, then we set it to 'yes' assuming everyone will get electricity
echo " <input type=\"hidden\" name=\"req_electricity\" value=\"yes\" />";
}
else
{
echo "<tr>";
echo " <td>".i18n("Electricity").REQUIREDFIELD."</td>";
if($projectinfo->req_electricity=="yes") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_electricity\" value=\"yes\" />Yes</td>";
echo " <td width=\"20\">&nbsp;</td>";
if($projectinfo->req_electricity=="no") $check="checked=\"checked\""; else $check="";
echo " <td><input $check type=\"radio\" name=\"req_electricity\" value=\"no\" />No</td>";
echo "</tr>";
}
echo "<tr>";
echo " <td>".i18n("Special")."</td>";