From 819a7a1cc68e52c2e2f1fa67fabc09f24bec6ccd Mon Sep 17 00:00:00 2001 From: Jan Kristinus Date: Mon, 11 Nov 2024 15:38:32 +0100 Subject: [PATCH] =?UTF-8?q?isSortable=20erg=C3=A4nzt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fragments/yform/manager/page/list.php | 4 +++- lib/manager/field.php | 5 +++++ lib/yform/base_abstract.php | 5 +++++ lib/yform/value/be_manager_relation.php | 6 ++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/fragments/yform/manager/page/list.php b/fragments/yform/manager/page/list.php index 176caea0f..6704a6a91 100644 --- a/fragments/yform/manager/page/list.php +++ b/fragments/yform/manager/page/list.php @@ -78,9 +78,11 @@ if ('value' == $field->getType()) { if ($field->isHiddenInList()) { $list->removeColumn($field->getName()); - } else { + } elseif ($field->isSortable()) { $list->setColumnSortable($field->getName()); $list->setColumnLabel($field->getName(), $field->getLabel()); + } else { + $list->setColumnLabel($field->getName(), $field->getLabel()); } } } diff --git a/lib/manager/field.php b/lib/manager/field.php index 5fc6a2584..9e65d9d58 100644 --- a/lib/manager/field.php +++ b/lib/manager/field.php @@ -164,6 +164,11 @@ public function isSearchable() return false; } + public function isSortable(): bool + { + return $this->getObject()->isSortable(); + } + public function isHiddenInListDisabled() { if (!isset($this->definitions['is_hiddeninlist'])) { diff --git a/lib/yform/base_abstract.php b/lib/yform/base_abstract.php index 270c9e1cc..8ece01e8a 100644 --- a/lib/yform/base_abstract.php +++ b/lib/yform/base_abstract.php @@ -121,5 +121,10 @@ public function isDeprecated(): bool return false; } + public function isSortable(): bool + { + return true; + } + public function init() {} } diff --git a/lib/yform/value/be_manager_relation.php b/lib/yform/value/be_manager_relation.php index e6af2a6c5..9441a8f29 100644 --- a/lib/yform/value/be_manager_relation.php +++ b/lib/yform/value/be_manager_relation.php @@ -885,4 +885,10 @@ private static function getRelationTableFieldsForTables($mainTable, $relationTab return ['source' => reset($source)->getName(), 'target' => reset($target)->getName()]; } + + public function isSortable(): bool + { + return false; + } + }