Skip to content

Commit

Permalink
Fixed issue: Assessment filter scope does not work for selection 'All'
Browse files Browse the repository at this point in the history
  • Loading branch information
Trischi80 authored and c-schmitz committed May 6, 2021
1 parent ce510e0 commit 91d9293
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions application/models/Assessment.php
Expand Up @@ -29,6 +29,7 @@
*/
class Assessment extends LSActiveRecord
{

public function init()
{
parent::init();
Expand Down Expand Up @@ -137,7 +138,11 @@ public function getColumns()
'name' => 'scope',
'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("Group")])
'filter' => TbHtml::dropDownList(
'Assessment[scope]',
$this->scope,
['A' => gT('All'), 'T' => gT('Total'), 'G' => gT("Group")]
)
),
array(
'name' => 'name',
Expand Down Expand Up @@ -171,7 +176,9 @@ public function search()
$criteria->compare('id', $this->id);
$criteria->compare('sid', $this->sid);
$criteria->compare('gid', $this->gid);
$criteria->compare('scope', $this->scope);
if ($this->scope !== 'A') {
$criteria->compare('scope', $this->scope);
}
$criteria->compare('name', $this->name, true);
$criteria->compare('minimum', $this->minimum);
$criteria->compare('maximum', $this->maximum);
Expand Down

0 comments on commit 91d9293

Please sign in to comment.