";
echo "";
@@ -131,8 +118,7 @@ echo "";
echo outputStatus($statusmentor);
echo " | ";
}
- else
- {
+ else {
//if mentorship isnt required, then assume its complete so the checks below will still work properly
$statusmentor="complete";
}
@@ -169,7 +155,7 @@ echo "";
echo "";
echo " | ";
//check to see if its complete
- $statusnamecheck=namecheckStatus($_SESSION['registration_id']);
+ $statusnamecheck=namecheckStatus($u['registrations_id']);
echo outputStatus($statusnamecheck);
echo " | ";
@@ -263,7 +249,7 @@ echo "";
}
}
- $q=mysql_query("SELECT * FROM projects WHERE registrations_id='".$_SESSION['registration_id']."' AND conferences_id='{$conference['id']}'");
+ $q=mysql_query("SELECT * FROM projects WHERE registrations_id='".$u['registrations_id']."' AND conferences_id='{$conference['id']}'");
$project=mysql_fetch_object($q);
$nominatedawards=getSpecialAwardsNominatedForProject($project->id);
$num=count($nominatedawards);
@@ -320,7 +306,7 @@ echo "";
{
echo "".i18n("Registration Fee Information")."";
- list($regfee, $rfeedata) = computeRegistrationFee($_SESSION['registration_id']);
+ list($regfee, $rfeedata) = computeRegistrationFee($u['registrations_id']);
$extra_after = "";
echo "";
diff --git a/user.inc.php b/user.inc.php
index f1d91e6..910eedf 100644
--- a/user.inc.php
+++ b/user.inc.php
@@ -99,7 +99,15 @@ function user_load($users_id, $accounts_id = false)
// get a list of all fields relevant to this user
$fieldDat = user_get_fields(array_keys($u['roles']));
// we need to separate the fields that are in the users table from those in separate tables
- $fields = array_unique(array_merge(array_keys($fieldDat), array('id', 'accounts_id', 'conferences_id')));
+
+ //if its a participant, we want the registrations_id as well
+ if(array_key_exists('participant', $u['roles'])){
+ $startfields=array('id', 'accounts_id', 'conferences_id','registrations_id');
+ }
+ else {
+ $startfields=array('id', 'accounts_id', 'conferences_id');
+ }
+ $fields = array_unique(array_merge(array_keys($fieldDat), $startfields));
$userFields = array();
$q = mysql_query("DESCRIBE users");
while($row = mysql_fetch_assoc($q)){
@@ -113,7 +121,7 @@ function user_load($users_id, $accounts_id = false)
accounts.email
FROM users JOIN accounts ON accounts.id=users.accounts_id
WHERE `users`.`id`='$users_id'";
- // echo $query=$query;
+// echo "query=$query";
$q = mysql_query($query);
echo mysql_error();
@@ -722,7 +730,7 @@ function user_save(&$u)
$fields = array('salutation','firstname','lastname',
'phonehome','phonework','phonecell','fax','organization',
'address','address2','city','province','postalcode','sex',
- 'firstaid', 'cpr', 'lang', 'notes');
+ 'firstaid', 'cpr', 'lang', 'notes','birthdate');
/* Merge fields as necessary, build a big list of fields to save */
foreach($new_roles as $r) {
@@ -1373,6 +1381,7 @@ $user_fields_map = array(
'phonehome' => array('phonehome'),
'phonecell' => array('phonecell'),
'birthdate' => array('birthdate'),
+ 'grade' => array('grade'),
'lang' => array('lang'),
'address' => array('address', 'address2', 'postalcode'),
'city' => array('city'),
@@ -1393,6 +1402,8 @@ function user_fields_enabled($role)
global $config, $user_fields_map;
$ret = array('firstname','lastname');
$fields = $config["{$role}_personal_fields"];
+ //for participants, grade is required
+ if($role=="participant") $ret[]="grade";
if($fields != '') {
$fields = explode(',', $fields);
foreach($fields as $f) {
@@ -1411,6 +1422,8 @@ function user_fields_required($role)
global $config, $user_fields_map;
$ret = array('firstname','lastname');
$required = $config["{$role}_personal_required"];
+ //for participants, grade is required
+ if($role=="participant") $ret[]="grade";
if($required != '') {
$fields = explode(',', $required);
foreach($fields as $f) {
diff --git a/user_edit.inc.php b/user_edit.inc.php
index 689c643..e0b51d7 100644
--- a/user_edit.inc.php
+++ b/user_edit.inc.php
@@ -125,10 +125,14 @@ function user_personal_info_status(&$u)
$our_fields = array('salutation', 'firstname','lastname','address',
'address2','city','province','postalcode',
'phonehome','phonecell','language','sex',
- 'firstaid','cpr');
+ 'firstaid','cpr','birthdate','grade');
$required = array_intersect($our_fields, $required);
foreach($required as $r) {
+ if($r=="birthdate") {
+ if($u[$r]=="0000-00-00" || !$u[$r])
+ return "incomplete";
+ }
if(trim($u[$r]) == '') return 'incomplete';
}
/* FIXME: somehow call the $role _status_update() function to update
diff --git a/user_personal.php b/user_personal.php
index b45e9f9..190171d 100644
--- a/user_personal.php
+++ b/user_personal.php
@@ -51,7 +51,7 @@ foreach(array_keys($u['roles']) as $r) {
$our_fields = array('salutation', 'firstname','lastname','address',
'address2','city','province','postalcode',
'phonehome','phonecell','language','sex',
- 'firstaid','cpr');
+ 'firstaid','cpr','birthdate','grade');
$fields = array_intersect($our_fields, $fields);
$required = array_intersect($our_fields, $required);
@@ -173,6 +173,8 @@ if(count($u['roles']) > 1) {
=user_edit_item($u, 'Gender', 'sex', 'sex')?>
=user_edit_item($u, 'First Aid Training', 'firstaid', 'yesno')?>
=user_edit_item($u, 'CPR Training', 'cpr', 'yesno')?>
+=user_edit_item($u, 'Birth Date', 'birthdate')?>
+=user_edit_item($u, 'Grade', 'grade')?>
|
|
|