forked from science-ation/science-ation
Added the api/registration/dictionary functionality
This commit is contained in:
parent
e730a5ab05
commit
8b15620f69
12
api.php
12
api.php
@ -732,6 +732,18 @@ switch($request[0]) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* APIDOC: registration/dictionary
|
||||
description(retrieves a list of all user fields with their label and category information)
|
||||
return(dictionary array)
|
||||
*/
|
||||
case 'dictionary':
|
||||
$ret['status'] = 'ok';
|
||||
if(is_array($conference) && array_key_exists('id', $conference)){
|
||||
$ret['dictionary'] = user_get_field_info();
|
||||
}else{
|
||||
$ret['dictionary'] = user_get_field_info(true);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$ret['status']="error";
|
||||
|
24
user.inc.php
24
user.inc.php
@ -300,7 +300,7 @@ function user_get_role_fields($role){
|
||||
return $fields;
|
||||
}
|
||||
|
||||
function user_get_field_info(){
|
||||
function user_get_field_info($noConference = false){
|
||||
global $conference;
|
||||
$returnval = array(
|
||||
'salutation' => array('label' => 'Salutation', 'group' => 'Personal Information'),
|
||||
@ -342,16 +342,20 @@ function user_get_field_info(){
|
||||
'special_awards' => array('label' => 'Special Awards', 'group' => 'Judges'),
|
||||
'volunteer_positions' => array('label' => 'Volunteer Positions', 'group' => 'Volunteers')
|
||||
);
|
||||
switch($conference['type']){
|
||||
case 'sciencefair':
|
||||
$returnval['available_times'] = array('label' => 'Times Available', 'group' => 'Judges');
|
||||
$returnval['available_events'] = array('label' => 'Event Availability', 'group' => 'Volunteers');
|
||||
break;
|
||||
case 'scienceolympics':
|
||||
$returnval['available_events'] = array('label' => 'Event Availability', 'group' => 'Judges,Volunteers');
|
||||
break;
|
||||
if($noConference){
|
||||
$returnval['available_times'] = array('label' => 'Times Available', 'group' => 'Judges');
|
||||
$returnval['available_events'] = array('label' => 'Event Availability', 'group' => 'Judges,Volunteers');
|
||||
}else{
|
||||
switch($conference['type']){
|
||||
case 'sciencefair':
|
||||
$returnval['available_times'] = array('label' => 'Times Available', 'group' => 'Judges');
|
||||
$returnval['available_events'] = array('label' => 'Event Availability', 'group' => 'Volunteers');
|
||||
break;
|
||||
case 'scienceolympics':
|
||||
$returnval['available_events'] = array('label' => 'Event Availability', 'group' => 'Judges,Volunteers');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $returnval;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user