NEW add html id/class to locate value in the DOM html

This commit is contained in:
phf 2016-02-04 21:05:19 +01:00
parent 7e3a787688
commit 32c0b2a9b1
2 changed files with 4 additions and 2 deletions

View File

@ -4110,7 +4110,8 @@ abstract class CommonObject
$label = '<span'.($mode != 'view' ? ' class="fieldrequired"':'').'>'.$label.'</span>';
$out .= '<td>'.$langs->trans($label).'</td>';
$out .='<td'.($colspan?' colspan="'.$colspan.'"':'').'>';
$html_id = !empty($this->id) ? $this->element.'_extras_'.$key.'_'.$this->id : '';
$out .='<td id="'.$html_id.'" class="'.$this->element.'_extras_'.$key.'" '.($colspan?' colspan="'.$colspan.'"':'').'>';
switch($mode) {
case "view":

View File

@ -68,7 +68,8 @@ if (empty($reshook) && ! empty($extrafields->attribute_label))
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>';
print '</tr></table>';
print '<td colspan="'.$cols.'">';
$html_id = !empty($object->id) ? $object->element.'_extras_'.$key.'_'.$object->id : '';
print '<td id="'.$html_id.'" class="'.$object->element.'_extras_'.$key.'" colspan="'.$cols.'">';
// Convert date into timestamp format
if (in_array($extrafields->attribute_type[$key], array('date','datetime'))) {