Merge branch '16.0' of git@github.com:Dolibarr/dolibarr.git into 16.0

This commit is contained in:
Laurent Destailleur 2022-09-22 14:57:35 +02:00
commit 7dfaf953e9

View File

@ -63,8 +63,18 @@ foreach ($TMoChilds as $key => $objectlink) {
echo '<td class="linkedcol-amount right">-</td>';
echo '<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).'</td>';
echo '<td class="linkedcol-action right">';
// For now, shipments must stay linked to order, so link is not deletable
echo '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a>';
// we want to make the link via element_element for delete action
$sql = " Select rowid from " . MAIN_DB_PREFIX . "element_element";
$sql .= " WHERE fk_source = ". (int) $object->id . " and fk_target = '" . dol_escape_htmltag($key) ."'";
$resql = $db->query($sql);
$k = 0;
if ($resql) {
$obj = $db->fetch_object($resql);
if ($obj->rowid && $obj->rowid > 0 ) $k = $obj->rowid;
}
echo '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=dellink&token=' . newToken() . '&dellinkid=' . $k . '">' . img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink') . '</a>';
echo '</td>';
echo "</tr>\n";
}