From 6bd52d6ff2ff0ecacf3a210a93c3a59c12736fe4 Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 12 Apr 2009 03:13:09 +0000 Subject: [PATCH] - Add the basics for a science fair "user". --- admin/index.php | 8 +++- admin/user_editor_window.php | 10 +++- db/db.code.version.txt | 2 +- db/db.update.125.sql | 6 +++ fair_info.php | 93 ++++++++++++++++++++++++++++++++++++ fair_main.php | 87 +++++++++++++++++++++++++++++++++ user.inc.php | 5 +- 7 files changed, 204 insertions(+), 7 deletions(-) create mode 100644 db/db.update.125.sql create mode 100644 fair_info.php create mode 100644 fair_main.php diff --git a/admin/index.php b/admin/index.php index 9fc1542..9fa3c63 100644 --- a/admin/index.php +++ b/admin/index.php @@ -42,8 +42,12 @@ echo "".theme_icon("volunteer_management")."
".i18n("Volunteer Management")."
"; else echo theme_icon("volunteer_management")."
".i18n("Volunteer Management")."
(".i18n("disabled").")"; - echo ""; - echo " "; + echo ''; + echo " ".theme_icon("sciencefair_management")."
".i18n("Science Fair Management")."
"; + echo ''; + echo ''; + echo ''; + echo "\n"; echo "
"; echo ""; diff --git a/admin/user_editor_window.php b/admin/user_editor_window.php index cee98da..0e4578b 100644 --- a/admin/user_editor_window.php +++ b/admin/user_editor_window.php @@ -29,12 +29,12 @@ $tabs = array('personal' => array( 'name' => 'Personal', - 'types' => array('student','judge','committee','volunteer','sponsor'), + 'types' => array('student','judge','committee','volunteer','sponsor','fair'), 'file' => '../user_personal.php', 'enabled' => true), 'roles' => array( 'name' => 'Roles/Account', - 'types' => array('student','judge','committee','volunteer','sponsor'), + 'types' => array('student','judge','committee','volunteer','sponsor','fair'), 'file' => '../user_activate.php', 'enabled' => true), 'judgeother' => array( @@ -63,6 +63,12 @@ $tabs = array('personal' => array( 'file' => '../volunteer_position.php', 'enabled' => true,), + 'fairinfo' => array( + 'name' => 'Fair Information', + 'types' => array('fair'), + 'file' => '../fair_info.php', + 'enabled' => true,), + ); $selected = $_GET['tab']; diff --git a/db/db.code.version.txt b/db/db.code.version.txt index fc902f4..d136d6a 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -124 +125 diff --git a/db/db.update.125.sql b/db/db.update.125.sql new file mode 100644 index 0000000..dfe8474 --- /dev/null +++ b/db/db.update.125.sql @@ -0,0 +1,6 @@ +DROP TABLE `fairs`; +ALTER TABLE `users_fair` CHANGE `fairs_id` `fair_name` TINYTEXT NOT NULL; +ALTER TABLE `users_fair` ADD `fair_abbrv` VARCHAR( 16 ) NOT NULL AFTER `fair_name` ; + + + diff --git a/fair_info.php b/fair_info.php new file mode 100644 index 0000000..a515659 --- /dev/null +++ b/fair_info.php @@ -0,0 +1,93 @@ + + Copyright (C) 2005 James Grant + Copyright (C) 2007 David Grant + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation, version 2. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ +?> +"; + display_messages(); + echo "

".i18n('Fair Information')."

"; + echo "
"; +} else { + //send the header + send_header("Fair Information", + array("Science Fair Main" => "fair_main.php") + ); +} + + $s = ($_SESSION['embed'] == true) ? $_SESSION['embed_submit_url'] : 'fair_info.php'; + echo "
\n"; + echo "\n"; + echo "
\n"; + echo '
'.i18n('Fair Name').''; + echo ""; + echo '
'.i18n('Fair Abbreviation').''; + echo ""; + echo ''; + +echo "
"; + echo "
"; +echo "\n"; +echo ""; + + echo "
"; + + if($_SESSION['embed'] != true) send_footer(); +?> diff --git a/fair_main.php b/fair_main.php new file mode 100644 index 0000000..8706c53 --- /dev/null +++ b/fair_main.php @@ -0,0 +1,87 @@ + + Copyright (C) 2005 James Grant + Copyright (C) 2007 David Grant + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation, version 2. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ +?> +Activate Role' button in the Volunteer section below",array($config['FAIRYEAR'],$config['fairname'])))); + header('Location: user_activate.php'); + exit; + } + */ + send_header("Science Fair Main", array()); + + //only display the named greeting if we have their name + echo i18n("Hello %1",array($_SESSION['name'])); + echo "
"; + echo "
"; + + echo i18n("Please use the checklist below to complete your data. Click on an item in the table to edit that information. When you have entered all information, the Status field will change to Complete"); + echo "
"; + echo "
"; + + user_page_summary_begin(); + user_page_summary_item("Contact Information", + "user_personal.php", "user_personal_info_status", array($u)); + user_page_summary_item("Volunteer Positions", + "fair_info", "fair_status_info", array($u)); + $overallstatus = user_page_summary_end(true); + + /* Update fair_status */ + fair_status_update($u); + + echo "
"; + echo "
"; + + /* + if($overallstatus!='complete') + { + echo error(i18n("You will not be marked as an active fair until your \"Overall Status\" is \"Complete\"")); + } + else + { + echo happy(i18n("Thank you for completing the fair registration process. We look forward to seeing you at the fair")); + } + */ + echo "
"; + echo i18n('Other Options and Things To Do').':
'; + echo ''; + + send_footer(); +?> diff --git a/user.inc.php b/user.inc.php index faa77dd..9aa592f 100644 --- a/user.inc.php +++ b/user.inc.php @@ -64,7 +64,8 @@ function user_load_fair(&$u) { $u['fair_active'] = ($u['fair_active'] == 'yes') ? 'yes' : 'no'; $u['fair_complete'] = ($u['fair_complete'] == 'yes') ? 'yes' : 'no'; - $u['fairs_id'] = intval($u['fairs_id']); +// $u['fair_name'] = $u['fair_name']; +// $u['fair_abbrv'] = $u['fair_abbrv']; return true; } @@ -309,7 +310,7 @@ function user_save_student($u) function user_save_fair($u) { - $fields = array('fair_active'); + $fields = array('fair_active','fair_name','fair_abbrv'); user_save_type_list($u, 'users_fair', $fields); }