From 82746f754b0f31be1dc18c10264ef5bdfd5d0fb4 Mon Sep 17 00:00:00 2001 From: jacob Date: Thu, 24 Feb 2011 18:42:46 +0000 Subject: [PATCH] Added the emergencycontact info to the code describing the structure of the user object (user_get_fields). --- user.inc.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/user.inc.php b/user.inc.php index dfb4ca0..40a520c 100644 --- a/user.inc.php +++ b/user.inc.php @@ -381,7 +381,8 @@ function user_get_field_info($noConference = false){ 'foodreq' => array('label' => 'Special Food Requirements', 'group' => 'Personal Information'), 'tshirt' => array('label' => 'T-shirt Size', '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){ $returnval['cat_prefs'] = array('label' => 'Category Preferences', 'group' => 'Judges'); @@ -599,7 +600,8 @@ function user_get_fields($userRoles = null){ 'special_awards' => array('judge', 'participant'), 'available_times' => array('judge'), 'available_events' => array('volunteer'), - 'volunteer_positions' => array('volunteer') + 'volunteer_positions' => array('volunteer'), + 'emergencycontacts' => array('participant') ); break; case 'scienceolympics': @@ -607,7 +609,9 @@ function user_get_fields($userRoles = null){ 'special_awards' => array(), 'available_times' => array(), 'available_events' => array('judge', 'volunteer'), - 'volunteer_positions' => array('volunteer') + 'volunteer_positions' => array('volunteer'), + 'emergencycontacts' => array('participant') + ); break; 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; }