forked from Wavyzz/dolibarr
NEW: add link to a element by ref
This commit is contained in:
@@ -7971,6 +7971,21 @@ class Form
|
||||
|
||||
if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
|
||||
print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
|
||||
|
||||
if (!empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) {
|
||||
print '<br><form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
|
||||
print '<input type="hidden" name="id" value="' . $object->id . '">';
|
||||
print '<input type="hidden" name="action" value="addlinkbyref">';
|
||||
print '<input type="hidden" name="addlink" value="' . $key . '">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr>';
|
||||
print '<td>' . $langs->trans("Ref") . '</td>';
|
||||
print '<td><input type="text" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '"> <input type="submit" class="button valignmiddle" value="' . $langs->trans('ToLink') . '"> <input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
$sql = $possiblelink['sql'];
|
||||
|
||||
$resqllist = $this->db->query($sql);
|
||||
@@ -8028,7 +8043,7 @@ class Form
|
||||
print '</div>';
|
||||
|
||||
//$linktoelem.=($linktoelem?' ':'');
|
||||
if ($num > 0) {
|
||||
if ($num > 0 || !empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) {
|
||||
$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
|
||||
// } else $linktoelem.=$langs->trans($possiblelink['label']);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user