Skip to content
Snippets Groups Projects
Commit c75cf004 authored by Tim Steiner's avatar Tim Steiner
Browse files

Don't count editorial/private comments when counting unread comments on main request page.

parent 0d39cf41
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,7 @@ class Requests_IndexController extends Unl_Controller_Action
$requestParentCourses = Courses_CourseModel::findParentOfRequest($allRequests);
$requestCurrentCourses = Courses_CourseModel::findLatestOfRequest($allRequests);
$requestActions = Requests_ApprovalActionModel::findByRequest($allRequests);
$requestComments = Requests_CommentsModel::findByRequest($allRequests);
$requestComments = Requests_CommentsModel::findByRequest($allRequests, true);
$requestViewTimes = Requests_ViewTimeModel::findByUserAndRequest($user, $allRequests);
$requestVotes = Requests_ApproverVoteModel::findUsersVotesForRequsets($user, $allRequests);
......
......@@ -41,7 +41,7 @@ class Requests_CommentsModel extends Unl_Model
}
}
static public function findByRequest($request)
static public function findByRequest($request, $hideLowPriority = false)
{
$db = Zend_Registry::get('db');
$requestId = $request->getId();
......@@ -53,6 +53,9 @@ class Requests_CommentsModel extends Unl_Model
} else {
$select->where('c.request = ?', $requestId);
}
if ($hideLowPriority) {
$select->where('c.visibility NOT IN("editorial", "self")');
}
$records = $db->query($select)->fetchAll();
$requestComments = array();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment