last note update feedback
This commit is contained in:
@@ -159,7 +159,7 @@ class CATC extends Main
|
||||
$sError = $oNote->setNote($asOps);
|
||||
$bSuccess = ($sError=='');
|
||||
|
||||
$asData = ($bSuccess)?array('led' => $oNote->getNote()['led']):array();
|
||||
$asData = ($bSuccess)?array('led_time' => $oNote->getNote()['led_time']):array();
|
||||
|
||||
return self::getJsonResult($bSuccess, $sError, $asData);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,11 @@ class Note extends PhpObject {
|
||||
|
||||
public function getNote() {
|
||||
$asCourse = $this->oDb->selectRow(self::NOTE_TABLE, $this->getNoteKeys());
|
||||
if(!empty($asCourse)) $asCourse['notes'] = json_decode($asCourse['notes'], true);
|
||||
if(!empty($asCourse)) {
|
||||
$asCourse['notes'] = json_decode($asCourse['notes'], true);
|
||||
$asCourse['led_date'] = date('d/m/Y', strtotime($asCourse['led']));
|
||||
$asCourse['led_time'] = date('H:i');
|
||||
}
|
||||
|
||||
return $asCourse;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ oCATC.pageInit = function(asHash, bFirstPage) {
|
||||
'get_note',
|
||||
(asData) => {
|
||||
oEditor.setContent(asData.notes);
|
||||
oCATC.feedback('notice', 'Last update on ('+asData.led.substr(11, 5)+')');
|
||||
oCATC.feedback('notice', 'Last update at '+asData.led_time+' on '+asData.led_date);
|
||||
},
|
||||
{id: self.tmp('id_course')},
|
||||
() => {console.log('Note not found for course ID = '+self.tmp('id_course'))}
|
||||
@@ -68,7 +68,7 @@ function save(bForce)
|
||||
getInfo(
|
||||
'set_note',
|
||||
function(sDesc, asData) {
|
||||
oCATC.feedback('notice', 'Note saved ('+asData.led.substr(11, 5)+')');
|
||||
oCATC.feedback('notice', 'Note saved ('+asData.led_time+')');
|
||||
self.tmp('saving', false);
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user