From 0dd2da71458770ff9c1616552015daa6245f141e Mon Sep 17 00:00:00 2001 From: james Date: Tue, 2 Jan 2007 20:33:16 +0000 Subject: [PATCH] Add configuration options to choose whether to ask the students if they require: - table - electricity --- admin/project_editor.php | 48 ++++++++++++++++++++----------- db/db.code.version.txt | 2 +- db/db.update.33.sql | 3 ++ register_participants_project.php | 48 ++++++++++++++++++++----------- 4 files changed, 68 insertions(+), 33 deletions(-) create mode 100644 db/db.update.33.sql diff --git a/admin/project_editor.php b/admin/project_editor.php index 9a07d232..4d82f875 100644 --- a/admin/project_editor.php +++ b/admin/project_editor.php @@ -224,23 +224,39 @@ if($projectinfo) echo "".i18n("Requirements").": "; echo ""; - echo ""; - echo " "; - if($projectinfo->req_table=="yes") $check="checked=\"checked\""; else $check=""; - echo " "; - echo " "; - if($projectinfo->req_table=="no") $check="checked=\"checked\""; else $check=""; - echo " "; - echo ""; + 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 " "; + } + else + { + echo ""; + echo " "; + if($projectinfo->req_table=="yes") $check="checked=\"checked\""; else $check=""; + echo " "; + echo " "; + if($projectinfo->req_table=="no") $check="checked=\"checked\""; else $check=""; + echo " "; + echo ""; + } - echo ""; - echo " "; - if($projectinfo->req_electricity=="yes") $check="checked=\"checked\""; else $check=""; - echo " "; - echo " "; - if($projectinfo->req_electricity=="no") $check="checked=\"checked\""; else $check=""; - echo " "; - echo ""; + 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 " "; + } + else + { + echo ""; + echo " "; + if($projectinfo->req_electricity=="yes") $check="checked=\"checked\""; else $check=""; + echo " "; + echo " "; + if($projectinfo->req_electricity=="no") $check="checked=\"checked\""; else $check=""; + echo " "; + echo ""; + } echo ""; echo " "; diff --git a/db/db.code.version.txt b/db/db.code.version.txt index f5c89552..bb95160c 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -32 +33 diff --git a/db/db.update.33.sql b/db/db.update.33.sql new file mode 100644 index 00000000..e1e9cc15 --- /dev/null +++ b/db/db.update.33.sql @@ -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); + diff --git a/register_participants_project.php b/register_participants_project.php index 4b9b95bb..c2138d94 100644 --- a/register_participants_project.php +++ b/register_participants_project.php @@ -261,23 +261,39 @@ function countwords() echo "
".i18n("Table").REQUIREDFIELD."Yes No
".i18n("Table").REQUIREDFIELD."Yes No
".i18n("Electricity").REQUIREDFIELD."Yes No
".i18n("Electricity").REQUIREDFIELD."Yes No
".i18n("Special")."
".i18n("Requirements").": "; echo ""; - echo ""; - echo " "; - if($projectinfo->req_table=="yes") $check="checked=\"checked\""; else $check=""; - echo " "; - echo " "; - if($projectinfo->req_table=="no") $check="checked=\"checked\""; else $check=""; - echo " "; - echo ""; + 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 " "; + } + else + { + echo ""; + echo " "; + if($projectinfo->req_table=="yes") $check="checked=\"checked\""; else $check=""; + echo " "; + echo " "; + if($projectinfo->req_table=="no") $check="checked=\"checked\""; else $check=""; + echo " "; + echo ""; + } - echo ""; - echo " "; - if($projectinfo->req_electricity=="yes") $check="checked=\"checked\""; else $check=""; - echo " "; - echo " "; - if($projectinfo->req_electricity=="no") $check="checked=\"checked\""; else $check=""; - echo " "; - echo ""; + 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 " "; + } + else + { + echo ""; + echo " "; + if($projectinfo->req_electricity=="yes") $check="checked=\"checked\""; else $check=""; + echo " "; + echo " "; + if($projectinfo->req_electricity=="no") $check="checked=\"checked\""; else $check=""; + echo " "; + echo ""; + } echo ""; echo " ";
".i18n("Table").REQUIREDFIELD."Yes No
".i18n("Table").REQUIREDFIELD."Yes No
".i18n("Electricity").REQUIREDFIELD."Yes No
".i18n("Electricity").REQUIREDFIELD."Yes No
".i18n("Special")."