diff --git a/application/models/Assessment.php b/application/models/Assessment.php index e2c151edac0..796677cdf2e 100644 --- a/application/models/Assessment.php +++ b/application/models/Assessment.php @@ -29,6 +29,7 @@ */ class Assessment extends LSActiveRecord { + public function init() { parent::init(); @@ -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', @@ -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);