diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8003b8d95cc..0709c07a252 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1,11 +1,9 @@ * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2010-2015 Juanjo Menent * Copyright (C) 2012-2013 Christophe Battarel - * Copyright (C) 2011-2018 Philippe Grand + * Copyright (C) 2011-2018 Philippe Grand * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012-2015 Raphaël Doursenaud * Copyright (C) 2012 Cedric Salvador @@ -13,8 +11,9 @@ * Copyright (C) 2016 Bahfir abbes * Copyright (C) 2017 ATM Consulting * Copyright (C) 2017 Nicolas ZABOURI - * Copyright (C) 2017 Rui Strecht + * Copyright (C) 2017 Rui Strecht * Copyright (C) 2018 Frederic France + * Copyright (C) 2018 Josep Lluís Amador * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -6144,6 +6143,9 @@ abstract class CommonObject $e = 0; foreach($extrafields->attributes[$this->table_element]['label'] as $key=>$label) { + //Show only the key field in params + if (is_array($params) && array_key_exists('onlykey',$params) && $key != $params['onlykey']) continue; + $enabled = 1; if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key])) {