Fix td not closed and js code duplicated (at wrong place)
This commit is contained in:
parent
ff002a45e0
commit
f4bef82bfa
@ -1434,7 +1434,8 @@ class ExtraFields
|
|||||||
$perms=dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1);
|
$perms=dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1);
|
||||||
$langfile=$this->attributes[$extrafieldsobjectkey]['langfile'][$key];
|
$langfile=$this->attributes[$extrafieldsobjectkey]['langfile'][$key];
|
||||||
$list=dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1);
|
$list=dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1);
|
||||||
$hidden=(empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
|
$help=$this->attributes[$extrafieldsobjectkey]['help'][$key];
|
||||||
|
$hidden=(empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
|
||||||
}
|
}
|
||||||
else // Old usage
|
else // Old usage
|
||||||
{
|
{
|
||||||
@ -1449,7 +1450,8 @@ class ExtraFields
|
|||||||
$perms=dol_eval($this->attribute_perms[$key], 1);
|
$perms=dol_eval($this->attribute_perms[$key], 1);
|
||||||
$langfile=$this->attribute_langfile[$key];
|
$langfile=$this->attribute_langfile[$key];
|
||||||
$list=dol_eval($this->attribute_list[$key], 1);
|
$list=dol_eval($this->attribute_list[$key], 1);
|
||||||
$hidden=(empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
|
$help=''; // Not supported with old syntax
|
||||||
|
$hidden=(empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($hidden) return ''; // This is a protection. If field is hidden, we should just not call this method.
|
if ($hidden) return ''; // This is a protection. If field is hidden, we should just not call this method.
|
||||||
|
|||||||
@ -88,7 +88,8 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<tr><td>';
|
print '<tr>';
|
||||||
|
print '<td>';
|
||||||
print '<table width="100%" class="nobordernopadding">';
|
print '<table width="100%" class="nobordernopadding">';
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td';
|
print '<td';
|
||||||
@ -120,6 +121,8 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
|
|||||||
print '<td align="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?'.$fieldid.'=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>';
|
print '<td align="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?'.$fieldid.'=' . $object->id . '&action=edit_extras&attribute=' . $key . '">' . img_edit().'</a></td>';
|
||||||
}
|
}
|
||||||
print '</tr></table>';
|
print '</tr></table>';
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
$html_id = !empty($object->id) ? $object->element.'_extras_'.$key.'_'.$object->id : '';
|
$html_id = !empty($object->id) ? $object->element.'_extras_'.$key.'_'.$object->id : '';
|
||||||
print '<td id="'.$html_id.'" class="'.$object->element.'_extras_'.$key.'" colspan="'.$cols.'">';
|
print '<td id="'.$html_id.'" class="'.$object->element.'_extras_'.$key.'" colspan="'.$cols.'">';
|
||||||
|
|
||||||
@ -137,7 +140,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO Improve element and rights detection
|
//TODO Improve element and rights detection
|
||||||
if ($action == 'edit_extras' && $permok && GETPOST('attribute') == $key)
|
if ($action == 'edit_extras' && $permok && GETPOST('attribute','none') == $key)
|
||||||
{
|
{
|
||||||
$fieldid='id';
|
$fieldid='id';
|
||||||
if ($object->table_element == 'societe') $fieldid='socid';
|
if ($object->table_element == 'societe') $fieldid='socid';
|
||||||
@ -150,7 +153,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
|
|||||||
|
|
||||||
print $extrafields->showInputField($key, $value, '', '', '', 0, $object->id);
|
print $extrafields->showInputField($key, $value, '', '', '', 0, $object->id);
|
||||||
|
|
||||||
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
|
print '<input type="submit" class="button" value="' . dol_escape_htmltag($langs->trans('Modify')) . '">';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
@ -159,12 +162,18 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
|
|||||||
//print $key.'-'.$value.'-'.$object->table_element;
|
//print $key.'-'.$value.'-'.$object->table_element;
|
||||||
print $extrafields->showOutputField($key, $value, '', $object->table_element);
|
print $extrafields->showOutputField($key, $value, '', $object->table_element);
|
||||||
}
|
}
|
||||||
print '</td></tr>' . "\n";
|
print '</td>';
|
||||||
|
print '</tr>' . "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print "\n";
|
|
||||||
// Add code to manage list depending on others
|
// Add code to manage list depending on others
|
||||||
if (! empty($conf->use_javascript_ajax))
|
// TODO Test/enhance this with a more generic solution
|
||||||
print '
|
if (! empty($conf->use_javascript_ajax))
|
||||||
|
{
|
||||||
|
print "\n";
|
||||||
|
print '
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
function showOptions(child_list, parent_list)
|
function showOptions(child_list, parent_list)
|
||||||
@ -193,7 +202,6 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
|
|||||||
setListDependencies();
|
setListDependencies();
|
||||||
});
|
});
|
||||||
</script>'."\n";
|
</script>'."\n";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user