summaryrefslogtreecommitdiff
path: root/lib/study/batchreview.php
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2013-08-10 17:15:22 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2013-08-10 17:15:22 +0200
commit5435a0a45fdfa1bcceeb36f8531826ddc2bb3508 (patch)
tree6254e6f19ca78e394693ef22ea5393dcefc5468d /lib/study/batchreview.php
parent2a748125c27c7f7c41a32a1dba14484c66dc351f (diff)
downloadBits-5435a0a45fdfa1bcceeb36f8531826ddc2bb3508.tar.gz
Bits-5435a0a45fdfa1bcceeb36f8531826ddc2bb3508.zip
Added possibility to add notes to studied batch items.
Diffstat (limited to 'lib/study/batchreview.php')
-rw-r--r--lib/study/batchreview.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/study/batchreview.php b/lib/study/batchreview.php
index 8639193..58fc852 100644
--- a/lib/study/batchreview.php
+++ b/lib/study/batchreview.php
@@ -6,7 +6,8 @@ $batchid = intval($args[2]);
$info = mysql_fetch_assoc(sql(
"SELECT list_study.id AS studyid, batches.name AS bname, ".
"lists.name AS lname, account.login AS uname, ".
- "batch_study.id AS bsid, batches.id AS batchid, batches.json_data AS json_data ".
+ "batch_study.id AS bsid, batch_study.notes_json AS notes, ".
+ "batches.id AS batchid, batches.json_data AS json_data ".
"FROM batches LEFT JOIN list_study ON list_study.list = batches.list AND list_study.user = " . $user['id'] . " " .
"LEFT JOIN batch_study ON batch_study.batch = $batchid AND batch_study.user = " . $user['id'] . " " .
"LEFT JOIN lists ON batches.list = lists.id ".
@@ -16,8 +17,9 @@ assert_error($info, "This batch does not exist.");
assert_error($info['studyid'] != 0, "You are not studying this list.");
if ($info["bsid"] == 0) {
- sql("INSERT INTO batch_study(user, batch, last_review) VALUES(" . $user['id'] . ", $batchid, 0)");
+ sql("INSERT INTO batch_study(user, batch, last_review, notes_json) VALUES(" . $user['id'] . ", $batchid, 0, '{}')");
$info['bsid'] = mysql_insert_id();
+ $info['notes'] = '{}';
}
require("tpl/study/batch_review.php");