Skip to content

Commit

Permalink
Messenger: show most recent Message Wall posts first
Browse files Browse the repository at this point in the history
  • Loading branch information
SKuipers committed Sep 15, 2023
1 parent b97c9db commit 4307d9b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ v26.0.00
Messenger: restored SMS credit balance to New Message screen
Messenger: made Duplicate With Members the top bulk action in Manage Groups
Messenger: moved Read Receipt links to the top of messages by default
Messenger: updated Message Wall to show most recent posts first
Reports: added a filter to view Pending Edits on Proof Read page, pre-selected filter in notifications
Reports: added the name of who wrote the comment to CourseCriteria data source
Rubrics: updated visualize and historical data views so teachers can see unpublished results
Expand Down
4 changes: 2 additions & 2 deletions modules/Messenger/src/MessageProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ public function runSendMessage($gibbonMessengerID, $gibbonSchoolYearID, $gibbonP
$studentNameList = join(' & ', array_filter(array_merge(array(join(', ', array_slice($nameArray, 0, -1))), array_slice($nameArray, -1)), 'strlen'));

if (count($nameArray) > 1) {
$studentNames = '<i>'.__('This email relates to the following students: ').$studentNameList.'</i><br/><br/>';
$studentNames = '<i>'.__('This email relates to the following students: ').$studentNameList.'</i><br/>';
} else {
$studentNames = '<i>'.__('This email relates to the following student: ').$studentNameList.'</i><br/><br/>';
$studentNames = '<i>'.__('This email relates to the following student: ').$studentNameList.'</i><br/>';
}
}
$bodyOut = $studentNames.$bodyOut;
Expand Down
6 changes: 3 additions & 3 deletions src/Domain/Messenger/MessengerGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -693,12 +693,12 @@ public function getMessages(string $mode = 'print', string $date = '')
if ($mode == 'result') {
$resultReturn = array();
$resultReturn[0] = $dataPosts;
$resultReturn[1] = $sqlPosts.' ORDER BY messageWallPin DESC, timestamp, gibbonMessengerID, source';
$resultReturn[1] = $sqlPosts.' ORDER BY messageWallPin DESC, timestamp DESC, gibbonMessengerID, source';

return serialize($resultReturn);
} elseif ($mode == 'array') {
try {
$sqlPosts = $sqlPosts.' ORDER BY messageWallPin DESC, timestamp, gibbonMessengerID, source';
$sqlPosts = $sqlPosts.' ORDER BY messageWallPin DESC, timestamp DESC, gibbonMessengerID, source';
$resultPosts = $connection2->prepare($sqlPosts);
$resultPosts->execute($dataPosts);
} catch (\PDOException $e) {
Expand All @@ -719,7 +719,7 @@ public function getMessages(string $mode = 'print', string $date = '')
} else {
$count = 0;
try {
$sqlPosts = $sqlPosts.' ORDER BY messageWallPin DESC, timestamp, gibbonMessengerID, source';
$sqlPosts = $sqlPosts.' ORDER BY messageWallPin DESC, timestamp DESC, gibbonMessengerID, source';
$resultPosts = $connection2->prepare($sqlPosts);
$resultPosts->execute($dataPosts);
} catch (\PDOException $e) {
Expand Down

0 comments on commit 4307d9b

Please sign in to comment.