diff --git a/core/class/eqLogic.class.php b/core/class/eqLogic.class.php index 5c677485fb..e98e8fb639 100644 --- a/core/class/eqLogic.class.php +++ b/core/class/eqLogic.class.php @@ -775,7 +775,7 @@ public function preToHtml($_version = 'dashboard', $_default = array(), $_noCach '#translate_category#' => $translate_category, '#style#' => '', '#logicalId#' => $this->getLogicalId(), - '#object_name#' => (is_object($this->getObject())) ? $this->getObject()->getName() : __('Aucun', __FILE__), + '#object_name#' => (is_object($this->getObject())) ? $this->getObject()->getDisplayName() : __('Aucun', __FILE__), '#height#' => $this->getDisplay('height', 'auto'), '#width#' => $this->getDisplay('width', 'auto'), '#uid#' => $uid, diff --git a/core/class/jeeObject.class.php b/core/class/jeeObject.class.php index 39f6884f0a..b7d6b23959 100644 --- a/core/class/jeeObject.class.php +++ b/core/class/jeeObject.class.php @@ -1036,16 +1036,21 @@ public function parentNumber() { return 0; } + public function getDisplayName() { + $display_name = $this->getConfiguration('display_name', ''); + return ($display_name != '') ? $display_name : $this->getName(); + } + public function getHumanName($_tag = false, $_prettify = false) { if ($_tag) { if ($_prettify) { if ($this->getConfiguration('useCustomColor') == 1) { - return '' . $this->getDisplay('icon') . ' ' . $this->getName() . ''; + return '' . $this->getDisplay('icon') . ' ' . $this->getDisplayName() . ''; } else { - return '' . $this->getDisplay('icon') . ' ' . $this->getName() . ''; + return '' . $this->getDisplay('icon') . ' ' . $this->getDisplayName() . ''; } } else { - return $this->getDisplay('icon') . ' ' . $this->getName(); + return $this->getDisplay('icon') . ' ' . $this->getDisplayName(); } } else { return '[' . $this->getName() . ']'; diff --git a/mobile/js/home.js b/mobile/js/home.js index 953733e3c5..56ad89b7a0 100644 --- a/mobile/js/home.js +++ b/mobile/js/home.js @@ -58,8 +58,8 @@ function initHome() { if (isset(objects[i].configuration) && isset(objects[i].configuration.parentNumber)) { decay = objects[i].configuration.parentNumber } - li += '' - li += '' + '  '.repeat(decay) + icon + ' ' + objects[i].name + li += '' + li += '' + '  '.repeat(decay) + icon + ' ' + (objects[i].configuration?.display_name || objects[i].name) li += '' summaries.push({object_id : objects[i].id}) }