forked from science-ation/science-ation
Move nummentors to project object
Remove registration/edit (we dont need to post anything back... for now...)
This commit is contained in:
parent
26e4204015
commit
22b4d119f6
6
api.php
6
api.php
@ -918,11 +918,12 @@ switch($request[0]) {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
||||||
/* APIDOC: registration/edit
|
/* COMMENTEDOUT because there's nothing to be saved!: registration/edit
|
||||||
description(update registration information. Updatable data: nummentors)
|
description(update registration information)
|
||||||
post(registration array)
|
post(registration array)
|
||||||
return(registration array)
|
return(registration array)
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
case 'edit':
|
case 'edit':
|
||||||
$chk=api_user_auth_required('participant');
|
$chk=api_user_auth_required('participant');
|
||||||
if($chk['status']!="ok") {
|
if($chk['status']!="ok") {
|
||||||
@ -948,6 +949,7 @@ switch($request[0]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -351,12 +351,21 @@ function saveProjectData($data){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//and update nummentors in registrations, yea, i know its not in the projects table
|
||||||
|
if(isset($data['nummentors'])) {
|
||||||
|
if($data['nummentors']==null) {
|
||||||
|
mysql_query("UPDATE registrations SET nummentors=NULL WHERE id='{$_SESSION['registration_id']}'");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mysql_query("UPDATE registrations SET nummentors='".intval($data['nummentors'])."' WHERE id='{$_SESSION['registration_id']}'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($message == ''){
|
if($message == ''){
|
||||||
$message = 'success';
|
$message = 'success';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
$message = i18n("Invalid project to update");
|
$message = i18n("Invalid project to update");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -464,6 +473,13 @@ function getRegistration($id) {
|
|||||||
//and also get the project
|
//and also get the project
|
||||||
$pq=mysql_query("SELECT id,projectnumber,title FROM projects WHERE registrations_id='$id' AND conferences_id='{$conference['id']}'");
|
$pq=mysql_query("SELECT id,projectnumber,title FROM projects WHERE registrations_id='$id' AND conferences_id='{$conference['id']}'");
|
||||||
$p=mysql_fetch_assoc($pq);
|
$p=mysql_fetch_assoc($pq);
|
||||||
|
|
||||||
|
//move nummentors from registration object into the project object
|
||||||
|
//we'll also load it on getProejct, and save it on saveProjectData
|
||||||
|
//even though its in the registrations table not the projects table
|
||||||
|
$p['nummentors']=$reg['nummentors'];
|
||||||
|
unset($reg['nummentors']);
|
||||||
|
|
||||||
$reg['project']=$p;
|
$reg['project']=$p;
|
||||||
|
|
||||||
//and finally, the status breakdown for the entire registration
|
//and finally, the status breakdown for the entire registration
|
||||||
@ -473,12 +489,15 @@ function getRegistration($id) {
|
|||||||
|
|
||||||
function saveRegistrationData($d) {
|
function saveRegistrationData($d) {
|
||||||
global $conference;
|
global $conference;
|
||||||
|
/*
|
||||||
if($d['id']) {
|
if($d['id']) {
|
||||||
mysql_query("UPDATE registrations SET nummentors='{$d['nummentors']}' WHERE id='{$d['id']}' AND conferences_id='{$conference['id']}'");
|
mysql_query("UPDATE registrations SET nummentors='{$d['nummentors']}' WHERE id='{$d['id']}' AND conferences_id='{$conference['id']}'");
|
||||||
return getRegistration($d['id']);
|
return getRegistration($d['id']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
|
*/
|
||||||
|
return getRegistration($data['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getProject($userId){
|
function getProject($userId){
|
||||||
@ -514,6 +533,10 @@ function getProject($userId){
|
|||||||
$returnval = mysql_fetch_assoc($q);
|
$returnval = mysql_fetch_assoc($q);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$q=mysql_query("SELECT nummentors FROM registrations WHERE id='$regId'");
|
||||||
|
$r=mysql_fetch_assoc($q);
|
||||||
|
$returnval['nummentors']=$r['nummentors'];
|
||||||
|
|
||||||
$safetyquestions=getSafetyQuestions($regId);
|
$safetyquestions=getSafetyQuestions($regId);
|
||||||
$returnval['safetyquestions']=$safetyquestions;
|
$returnval['safetyquestions']=$safetyquestions;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user