From 75d1a604011454da78184a2df07493b56e3a2dd6 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 22 Feb 2018 13:54:30 +0100 Subject: [PATCH] - Removed parameter alternativeMarkRowClass from FilterWidget - Now the parameter markRow must be a function that returns directly the class to mark records in FilterWidget - Changed InfoCenter to mark locked record with the new markRow function --- .../system/infocenter/infocenterData.php | 4 +-- application/widgets/FilterWidget.php | 30 +------------------ 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 540125560..1caa6ffb4 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -154,10 +154,8 @@ if ($datasetRaw->LockDate != '') { - return true; + return FilterWidget::DEFAULT_MARK_ROW_CLASS; } - - return false; } ); diff --git a/application/widgets/FilterWidget.php b/application/widgets/FilterWidget.php index aa446bfbc..9f949e352 100644 --- a/application/widgets/FilterWidget.php +++ b/application/widgets/FilterWidget.php @@ -14,7 +14,6 @@ class FilterWidget extends Widget const ADDITIONAL_COLUMNS = 'additionalColumns'; const FORMAT_RAW = 'formatRaw'; const MARK_ROW = 'markRow'; - const ALTERNATIVE_MARK_ROW_CLASS = 'alternativeMarkRowClass'; const CHECKBOXES = 'checkboxes'; const HIDE_HEADER = 'hideHeader'; const HIDE_SAVE = 'hideSave'; @@ -73,7 +72,6 @@ class FilterWidget extends Widget private $additionalColumns; private $formatRaw; private $markRow; - private $alternativeMarkRowClass; private $checkboxes; private $columnsAliases; private $filterName; @@ -409,21 +407,9 @@ class FilterWidget extends Widget if (is_object($datasetRaw)) { $markRow = self::$FilterWidgetInstance->getMarkRow(); - if ($markRow != null) { - if ($markRow($datasetRaw) === true) - { - $alternativeMarkRowClass = self::$FilterWidgetInstance->getAlternativeMarkRowClass(); - if ($alternativeMarkRowClass != null) - { - $class = $alternativeMarkRowClass; - } - else - { - $class = self::DEFAULT_MARK_ROW_CLASS; - } - } + $class = $markRow($datasetRaw); } } @@ -483,14 +469,6 @@ class FilterWidget extends Widget return $this->markRow; } - /** - * - */ - protected function getAlternativeMarkRowClass() - { - return $this->alternativeMarkRowClass; - } - /** * */ @@ -652,7 +630,6 @@ class FilterWidget extends Widget $this->additionalColumns = null; $this->formatRaw = null; $this->markRow = null; - $this->alternativeMarkRowClass = null; $this->checkboxes = null; $this->hideHeader = false; $this->hideSave = false; @@ -723,11 +700,6 @@ class FilterWidget extends Widget $this->markRow = $args[self::MARK_ROW]; } - if (isset($args[self::ALTERNATIVE_MARK_ROW_CLASS]) && $args[self::ALTERNATIVE_MARK_ROW_CLASS] != '') - { - $this->alternativeMarkRowClass = $args[self::ALTERNATIVE_MARK_ROW_CLASS]; - } - if (isset($args[self::CHECKBOXES]) && is_array($args[self::CHECKBOXES]) && count($args[self::CHECKBOXES]) > 0)