diff --git a/activities.inc.php b/activities.inc.php new file mode 100644 index 00000000..a6a99750 --- /dev/null +++ b/activities.inc.php @@ -0,0 +1,33 @@ + + Copyright (C) 2005 James Grant + Copyright (C) 2009 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. +*/ + +function activities_status(&$u) +{ + global $config; + + /* They must select a language */ + if(count($u['languages']) < 1) return 'incomplete'; + return 'complete'; +} + diff --git a/so_judge_other.php b/activities.php similarity index 71% rename from so_judge_other.php rename to activities.php index 9c8c388c..23131634 100644 --- a/so_judge_other.php +++ b/activities.php @@ -24,12 +24,12 @@ 0 ORDER BY date, hour, minute"); +$q = mysql_query(" + SELECT schedule.id, date, hour, minute, duration, title + FROM schedule + JOIN events ON schedule.events_id = events.id + WHERE schedule.conferences_id = {$conference['id']} + ORDER BY date, hour, minute +"); $x = 0; while($r = mysql_fetch_assoc($q)){ $dateParts = explode('-', $r['date']); @@ -66,19 +72,18 @@ case 'save': $u['willing_chair'] = ($_POST['willing_chair'] == 'yes') ? 'yes' : 'no'; $u['highest_psd'] = stripslashes($_POST['highest_psd']); user_save($u); - +/* if(is_array($_POST['questions'])){ questions_save_answers("judgereg",$u['id'],$_POST['questions']); } - - // save the judging availability selection +*/ + // save the availability selection mysql_query("DELETE FROM schedule_users_availability_link WHERE users_id='{$u['id']}'"); if(is_array($_POST['time']) ) { - $judgeRole = mysql_result(mysql_query("SELECT id FROM roles WHERE type = 'judge'"), 0, 0); foreach($_POST['time'] as $idx) { mysql_query(" - INSERT INTO schedule_users_availability_link (schedule_id, users_id, roles_id) - VALUES($idx, {$u['id']}, $judgeRole) + INSERT INTO schedule_users_availability_link (schedule_id, users_id) + VALUES($idx, {$u['id']}) "); } } @@ -87,11 +92,10 @@ case 'save': happy_("Preferences successfully saved"); $u = user_load($u['id']); - $newstatus=judge_status_other($u); - echo "\$newstatus = $newstatus"; + $newstatus=activities_status($u); ?> 1) $required[] = 'time[]'; ?> -

-

+

-


-
+ - + 1) { ?> 1) $required[] = 'time[]'; $q = mysql_query(" SELECT eual.* FROM schedule_users_availability_link eual JOIN schedule ON schedule.id = eual.schedule_id - JOIN roles ON roles.id = eual.roles_id WHERE eual.users_id=\"{$u['id']}\" AND schedule.conferences_id = {$conference['id']} - AND roles.type = 'judge' ORDER BY `schedule`.`date`, `schedule`.`hour`, `schedule`.`minute` "); @@ -144,14 +146,7 @@ if(count($times) > 1) $required[] = 'time[]'; user_edit_item($u, 'Time Availability', 'time[]', 'checklist', $items, $sel); echo ''; } -?> - - - - - -




- +



@@ -160,14 +155,14 @@ questions_print_answer_editor('judgereg', $u, 'questions');