Skip to content

Commit

Permalink
Dev: Filter assessments by language to not show duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Mar 5, 2018
1 parent ebcd93c commit 303bc60
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions application/models/Assessment.php
Expand Up @@ -123,9 +123,9 @@ public function getColumns()
),
array(
'name' => 'scope',
'value' => '$data->scope == "G" ? eT("Global") : eT("Total")',
'value' => '$data->scope == "G" ? eT("Group") : eT("Total")',
'htmlOptions' => ['class' => 'col-sm-1'],
'filter' => TbHtml::dropDownList('assessment["scope"]', 'scope', ['' => gT('All'), 'T' => gT('Total'), 'G' => gT("Global")])
'filter' => TbHtml::dropDownList('assessment["scope"]', 'scope', ['' => gT('All'), 'T' => gT('Total'), 'G' => gT("Group")])
),
array(
'name' => 'name',
Expand All @@ -149,7 +149,7 @@ public function getColumns()

public function search()
{
// @todo Please modify the following code to remove attributes that should not be searched.
// @todo Please modify the following code to remove attributes that should not be searched.

$criteria = new CDbCriteria;

Expand All @@ -161,6 +161,7 @@ public function search()
$criteria->compare('minimum', $this->minimum);
$criteria->compare('maximum', $this->maximum);
$criteria->compare('message', $this->message, true);
$criteria->compare('language', App()->language);

// TODO: Does not work with Postgres.
//$criteria->group = 'id';
Expand Down

0 comments on commit 303bc60

Please sign in to comment.