From 70beeb726ae653620e45f17a38a04c3a8a1ef7d5 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 14 Dec 2020 09:54:01 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B03123=20-=20Fix=20"view=5Flink"=20paramet?= =?UTF-8?q?er=20for=20shortcuts=20preferences?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/shortcut.class.inc.php | 2 +- .../Component/DataTable/DataTableFactory.php | 40 ++++++++++--------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/application/shortcut.class.inc.php b/application/shortcut.class.inc.php index bdaf98f23..6332df7ab 100644 --- a/application/shortcut.class.inc.php +++ b/application/shortcut.class.inc.php @@ -49,7 +49,7 @@ abstract class Shortcut extends DBObject implements iDisplay // Display lists MetaModel::Init_SetZListItems('details', array('name', 'context')); // Attributes to be displayed for the complete details - MetaModel::Init_SetZListItems('list', array()); // Attributes to be displayed for a list + MetaModel::Init_SetZListItems('list', array('name')); // Attributes to be displayed for a list // Search criteria // MetaModel::Init_SetZListItems('standard_search', array('name')); // Criteria of the std search form // MetaModel::Init_SetZListItems('advanced_search', array('name')); // Criteria of the advanced search form diff --git a/sources/application/UI/Base/Component/DataTable/DataTableFactory.php b/sources/application/UI/Base/Component/DataTable/DataTableFactory.php index d0427a655..bce12190d 100644 --- a/sources/application/UI/Base/Component/DataTable/DataTableFactory.php +++ b/sources/application/UI/Base/Component/DataTable/DataTableFactory.php @@ -303,15 +303,17 @@ class DataTableFactory } if ($aData['checked']) { if ($sAttCode == '_key_') { - $aColumnDefinition[] = [ - 'description' => $aData['label'], - 'object_class' => $sClassName, - 'class_alias' => $sClassAlias, - 'attribute_code' => $sAttCode, - 'attribute_type' => '_key_', - 'attribute_label' => $aData['alias'], - "render" => "return ''+row['".$sClassAlias."/friendlyname']+'' ;", - ]; + if ($bViewLink) { + $aColumnDefinition[] = [ + 'description' => $aData['label'], + 'object_class' => $sClassName, + 'class_alias' => $sClassAlias, + 'attribute_code' => $sAttCode, + 'attribute_type' => '_key_', + 'attribute_label' => $aData['alias'], + "render" => "return ''+row['".$sClassAlias."/friendlyname']+'' ;", + ]; + } } else { $oAttDef = MetaModel::GetAttributeDef($sClassName, $sAttCode); $sAttDefClass = get_class($oAttDef); @@ -520,15 +522,17 @@ class DataTableFactory } if ($aData['checked']) { if ($sAttCode == '_key_') { - $aColumnDefinition[] = [ - 'description' => $aData['label'], - 'object_class' => $sClassName, - 'class_alias' => $sClassAlias, - 'attribute_code' => $sAttCode, - 'attribute_type' => '_key_', - 'attribute_label' => $aData['alias'], - "render" => "return ''+row['".$sClassAlias."/friendlyname']+'' ;", - ]; + if ($bViewLink) { + $aColumnDefinition[] = [ + 'description' => $aData['label'], + 'object_class' => $sClassName, + 'class_alias' => $sClassAlias, + 'attribute_code' => $sAttCode, + 'attribute_type' => '_key_', + 'attribute_label' => $aData['alias'], + "render" => "return ''+row['".$sClassAlias."/friendlyname']+'' ;", + ]; + } } else { $oAttDef = MetaModel::GetAttributeDef($sClassName, $sAttCode); $sAttDefClass = get_class($oAttDef);