forked from science-ation/science-ation
make foodreq field based on configuration
api registration/fields accepts both string (to json decode) or a post array, so the testapi page works
This commit is contained in:
parent
6ca366e1b8
commit
699e12523f
6
api.php
6
api.php
@ -842,7 +842,11 @@ switch($request[0]) {
|
||||
return(fields array)
|
||||
*/
|
||||
case 'fields':
|
||||
$reqroles=json_decode($_POST['roles'],true);
|
||||
if(is_array($_POST['roles'])) {
|
||||
$reqroles=$_POST['roles'];
|
||||
} else {
|
||||
$reqroles=json_decode($_POST['roles'],true);
|
||||
}
|
||||
if(is_array($reqroles)) {
|
||||
for($x=0;$x<count($reqroles);$x++) {
|
||||
if(is_numeric($reqroles[$x]))
|
||||
|
@ -320,13 +320,16 @@ function user_get_role_fields($role){
|
||||
}
|
||||
break;
|
||||
case 'participant':
|
||||
$fields = array('grade', 'schools_id', 'foodreq', 'medicalalert', 'registrations_id');
|
||||
$fields = array('grade', 'schools_id', 'medicalalert', 'registrations_id');
|
||||
if($config['participant_student_personal'] == "yes"){
|
||||
$fields[] = 'dateofbirth';
|
||||
}
|
||||
if($config['participant_student_tshirt'] == "yes"){
|
||||
$fields[] = 'tshirt';
|
||||
}
|
||||
if($config['participant_student_foodreq'] == "yes"){
|
||||
$fields[] = 'foodreq';
|
||||
}
|
||||
break;
|
||||
case 'fair':
|
||||
$fields = array('fairs_id');
|
||||
|
Loading…
Reference in New Issue
Block a user