Fix id in link

This commit is contained in:
Laurent Destailleur 2021-08-30 22:10:26 +02:00
parent 60832c6e87
commit b29fc5552d
2 changed files with 9 additions and 6 deletions

View File

@ -199,11 +199,13 @@ if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['l
if (($isdraft || !empty($extrafields->attributes[$object->table_element]['alwayseditable'][$tmpkeyextra]))
&& $permok && $enabled != 5 && ($action != 'edit_extras' || GETPOST('attribute') != $tmpkeyextra)
&& empty($extrafields->attributes[$object->table_element]['computed'][$tmpkeyextra])) {
$fieldid = 'id';
$fieldid = empty($forcefieldid) ? 'id' : $forcefieldid;
$valueid = empty($forceobjectid) ? $object->id : $forceobjectid;
if ($object->table_element == 'societe') {
$fieldid = 'socid';
}
print '<td class="right"><a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?'.$fieldid.'='.$object->id.'&action=edit_extras&attribute='.$tmpkeyextra.'&ignorecollapsesetup=1">'.img_edit().'</a></td>';
print '<td class="right"><a class="reposition editfielda" href="'.$_SERVER['PHP_SELF'].'?'.$fieldid.'='.$valueid.'&action=edit_extras&attribute='.$tmpkeyextra.'&ignorecollapsesetup=1">'.img_edit().'</a></td>';
}
print '</tr></table>';
print '</td>';

View File

@ -245,7 +245,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$socid = $object->id;
// TODO Replace this card with the list of all partnerships.
// TODO Replace this card with a table of list of all partnerships.
$object = new Partnership($db);
$partnershipid = $object->fetch(0, '', 0, $socid);
@ -257,10 +257,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<table class="border centpercent tableforfield">'."\n";
// Common attributes
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
//unset($object->fields['fk_project']); // Hide field already shown in banner
//unset($object->fields['fk_member']); // Hide field already shown in banner
unset($object->fields['fk_soc']); // Hide field already shown in banner
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
$forcefieldid = 'socid';
$forceobjectid = $object->fk_soc;
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
print '</table>';
print '</div>';