From 32c0b2a9b14bdb11d39388d2ee7221282bf840b8 Mon Sep 17 00:00:00 2001 From: phf Date: Thu, 4 Feb 2016 21:05:19 +0100 Subject: [PATCH] NEW add html id/class to locate value in the DOM html --- htdocs/core/class/commonobject.class.php | 3 ++- htdocs/core/tpl/extrafields_view.tpl.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d90932d1738..d1153a73eda 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4110,7 +4110,8 @@ abstract class CommonObject $label = ''.$label.''; $out .= ''.$langs->trans($label).''; - $out .=''; + $html_id = !empty($this->id) ? $this->element.'_extras_'.$key.'_'.$this->id : ''; + $out .=''; switch($mode) { case "view": diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 9789922e6dc..f4b817b583d 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -68,7 +68,8 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) print '' . img_edit().''; print ''; - print ''; + $html_id = !empty($object->id) ? $object->element.'_extras_'.$key.'_'.$object->id : ''; + print ''; // Convert date into timestamp format if (in_array($extrafields->attribute_type[$key], array('date','datetime'))) {