From 46b39f81e0f4c923d46078c35979728d3478df75 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 25 Nov 2010 20:45:44 +0000 Subject: [PATCH] Add copyoriginal, copyparent, and notes(currently unused) to conferences table Add code in create conference and copy conference to set copyoriginal and copyparent Add missing json_decode to API (we expect ALL arrays being POSTED to be json encoded) --- api.php | 2 +- db/db.code.version.txt | 2 +- db/db.update.224.sql | 4 ---- db/db.update.225.sql | 6 ++++++ super/conferences.php | 7 ++++++- 5 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 db/db.update.225.sql diff --git a/api.php b/api.php index 74fed50..f2a7e27 100644 --- a/api.php +++ b/api.php @@ -732,7 +732,7 @@ switch($request[0]) { return(fields array) */ case 'fields': - $reqroles=$_POST['roles']; + $reqroles=json_decode($_POST['roles'],true); if(is_array($reqroles)) { for($x=0;$x$errorMessage"; @@ -726,7 +731,7 @@ function copy_conference($params){ $oldConfId = $params['mastercopy']; $oldConf = mysql_fetch_assoc(mysql_query("SELECT * FROM conferences WHERE id = {$oldConfId}")); - mysql_query("INSERT INTO conferences (oid, name, type, status) VALUES (1, '" . mysql_real_escape_string($params['name']) . "', '{$oldConf['type']}', 'pending')"); + mysql_query("INSERT INTO conferences (oid, name, type, status, copyoriginal, copyparent) VALUES (1, '" . mysql_real_escape_string($params['name']) . "', '{$oldConf['type']}', 'pending','{$oldConf['copyoriginal']}','{$oldConf['id']}')"); if(mysql_error() != ''){ wizard_draw_step('error', 'SQL error on line #' . (__LINE__ - 1) . ':
' . mysql_error()); return false; } $newConfId = mysql_insert_id();