Add user id to docs/todos/notes tables

This commit is contained in:
2019-09-07 12:38:37 +02:00
parent 81a17332b4
commit 42c6f8eff7
6 changed files with 97 additions and 55 deletions

View File

@@ -28,26 +28,6 @@ class Course extends PhpObject {
$this->iCourseId = $iCourseId;
}
public function getNote() {
$asCourse = $this->oDb->selectRow(self::COURSE_TABLE, $this->getCourseId(), array(Db::getId(self::COURSE_TABLE), 'notes', 'led'));
$asCourse['notes'] = json_decode($asCourse['notes'], true);
return $asCourse;
}
public function setNote($asOps) {
$sError = '';
$sIdCol = Db::getId(self::COURSE_TABLE);
if($this->getCourseId() > 0) {
$iCourseId = $this->oDb->insertUpdateRow(self::COURSE_TABLE, array($sIdCol=>$this->getCourseId(), 'notes'=>json_encode($asOps)), array($sIdCol));
if(!$iCourseId) $sError = $this->oDb->getLastError();
}
else $sError = 'Course ID not set';
return $sError;
}
public function getWorkshops() {
$asCourses = $this->oDb->selectRows(array(
'select'=> array(Db::getId(self::WS_TABLE), 'dates', Db::getId(self::COURSE_TABLE), 'description', 'timeslot'),