Commit a43cd1d7 authored by Son Nguyen's avatar Son Nguyen Committed by Gerrit Code Review
Browse files

Merge "Sort notifications by read/unread (bug 547696) - read has been changed to ASC"

parents d1a73341 c7a3cb8a
......@@ -46,7 +46,7 @@ function activitylistin($type='all', $limit=10, $offset=0) {
$msgidquery = "
(
SELECT a.id, a.ctime, 'notification_internal_activity' AS msgtable, subject
SELECT a.id, a.read, a.ctime, 'notification_internal_activity' AS msgtable, subject
FROM {notification_internal_activity} AS a
INNER JOIN {activity_type} AS at ON a.type = at.id
WHERE a." . $notificationtargetcolumn . " = ?
......@@ -54,7 +54,7 @@ function activitylistin($type='all', $limit=10, $offset=0) {
)
UNION
(
SELECT a.id, a.ctime, 'artefact_multirecipient_notification' AS msgtable, subject
SELECT a.id, CAST(b.read AS int), a.ctime, 'artefact_multirecipient_notification' AS msgtable, subject
FROM {artefact_multirecipient_notification} AS a
INNER JOIN {artefact_multirecipient_userrelation} AS b
ON a.id = b.notification
......@@ -69,7 +69,7 @@ function activitylistin($type='all', $limit=10, $offset=0) {
$result->count = count_records_sql($countquery, array($userid, $userid));
$msgidquery .= "
ORDER BY ctime DESC, subject ASC";
ORDER BY read ASC, ctime DESC, subject ASC";
$result->msgidrecords = get_records_sql_array($msgidquery, array($userid, $userid), $offset, $limit);
if (!is_array($result->msgidrecords)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment