From ef4a14a386789161ff9287ec7a4a456a68610f11 Mon Sep 17 00:00:00 2001 From: jacob Date: Fri, 18 Feb 2011 16:14:23 +0000 Subject: [PATCH] modified the project/add API to not expect any data, but simply create the project. --- api.php | 15 +++++++++------ register_participants.inc.php | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/api.php b/api.php index e494b58..535b1d4 100644 --- a/api.php +++ b/api.php @@ -870,7 +870,6 @@ switch($request[0]) { switch($request[1]){ /* APIDOC: project/add description(add a project) - post(projectdivisions_id integer, title varchar(255), language char(2), req_electricity enum('no', 'yes'), req_table enum('no', 'yes'), req_special varchar(128), summary text) return(project array) */ case 'add': @@ -898,6 +897,13 @@ switch($request[0]) { break; } + // if we got this far, then all's good and we can return the project data + $ret['status'] = 'ok'; + $ret['project'] = getProject($regNumber); + break; + // remarking this code for now as it may get used very shortly for a project update + // functionality. Was previously in the "add" post + /* // and then save the posted data to that project $params['project_id'] = $project['id']; foreach($_POST as $fieldName){ @@ -909,12 +915,9 @@ switch($request[0]) { $ret['error'] = $message; break; } - - // if we got thes far, then all's good and we can return the project data - $ret['status'] = 'ok'; - $ret['project'] = getProject($regNumber); - break; + */ + /* APIDOC: project/edit post(project_id integer, projectdivisions_id integer, title varchar(255), language char(2), req_electricity enum('no', 'yes'), req_table enum('no', 'yes'), req_special varchar(128), summary text) diff --git a/register_participants.inc.php b/register_participants.inc.php index cc344c7..0632b1b 100644 --- a/register_participants.inc.php +++ b/register_participants.inc.php @@ -593,7 +593,7 @@ function saveProjectData($data){ //get a random registration number between 100000 and 999999 (six digit integer) // that isn't already in use -//TODO - set up a method or ensuring that the very unlikely chance of two people simultaneously +//TODO - set up a method of ensuring that the very unlikely chance of two people simultaneously // getting the same number is in fact impossible function getNewRegNum(){ global $conference;