forked from science-ation/science-ation
Added the emergencycontact info to the code describing the structure of the user object (user_get_fields).
This commit is contained in:
parent
2ec08b64d9
commit
82746f754b
22
user.inc.php
22
user.inc.php
@ -381,7 +381,8 @@ function user_get_field_info($noConference = false){
|
|||||||
'foodreq' => array('label' => 'Special Food Requirements', 'group' => 'Personal Information'),
|
'foodreq' => array('label' => 'Special Food Requirements', 'group' => 'Personal Information'),
|
||||||
'tshirt' => array('label' => 'T-shirt Size', 'group' => 'Personal Information'),
|
'tshirt' => array('label' => 'T-shirt Size', 'group' => 'Personal Information'),
|
||||||
'medicalalert' => array('label' => 'Medical Alert Info', 'group' => 'Personal Information'),
|
'medicalalert' => array('label' => 'Medical Alert Info', 'group' => 'Personal Information'),
|
||||||
'dateofbirth' => array('label' => 'Date of Birth', 'group' => 'Personal Information')
|
'dateofbirth' => array('label' => 'Date of Birth', 'group' => 'Personal Information'),
|
||||||
|
'emergencycontacts' => array('label' => 'Emergency Contacts', 'group' => 'Personal Information')
|
||||||
);
|
);
|
||||||
if($noConference){
|
if($noConference){
|
||||||
$returnval['cat_prefs'] = array('label' => 'Category Preferences', 'group' => 'Judges');
|
$returnval['cat_prefs'] = array('label' => 'Category Preferences', 'group' => 'Judges');
|
||||||
@ -599,7 +600,8 @@ function user_get_fields($userRoles = null){
|
|||||||
'special_awards' => array('judge', 'participant'),
|
'special_awards' => array('judge', 'participant'),
|
||||||
'available_times' => array('judge'),
|
'available_times' => array('judge'),
|
||||||
'available_events' => array('volunteer'),
|
'available_events' => array('volunteer'),
|
||||||
'volunteer_positions' => array('volunteer')
|
'volunteer_positions' => array('volunteer'),
|
||||||
|
'emergencycontacts' => array('participant')
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 'scienceolympics':
|
case 'scienceolympics':
|
||||||
@ -607,7 +609,9 @@ function user_get_fields($userRoles = null){
|
|||||||
'special_awards' => array(),
|
'special_awards' => array(),
|
||||||
'available_times' => array(),
|
'available_times' => array(),
|
||||||
'available_events' => array('judge', 'volunteer'),
|
'available_events' => array('judge', 'volunteer'),
|
||||||
'volunteer_positions' => array('volunteer')
|
'volunteer_positions' => array('volunteer'),
|
||||||
|
'emergencycontacts' => array('participant')
|
||||||
|
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -666,6 +670,18 @@ function user_get_fields($userRoles = null){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// and also the emergency contacts info
|
||||||
|
if(count(array_intersect($specialFieldRoles['emergencycontacts'], $userRoles)) > 0){
|
||||||
|
$fields['emergencycontacts'] = array();
|
||||||
|
$fields['emergencycontacts']['field'] = 'emergencycontacts';
|
||||||
|
$fields['emergencycontacts']['display'] = i18n($fieldInfo['emergencycontacts']['label']);
|
||||||
|
$fields['emergencycontacts']['group'] = i18n($fieldInfo['emergencycontacts']['group']);
|
||||||
|
$fields['emergencycontacts']['type'] = 'table';
|
||||||
|
$fields['emergencycontacts']['tablefields'] = array('firstname', 'lastname', 'relation', 'phone1', 'phone2', 'phone3', 'phone4', 'email');
|
||||||
|
$fields['emergencycontacts']['description'] = "A list of records for the emergency contact information for a student. Each record has a list of values for the fields listed in the \"tablefields\" record listed here. e.g. [['firstname':'Bob', 'lastname':'Smith', ...],['firstname':'John', 'lastname':'doe' ...], ...]";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user