Skip to content
Snippets Groups Projects
Commit a1a5eba2 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge pull request #4096 from braito4/patch-1

Part solution bug #4095
parents bc6d04e4 677cba01
No related branches found
No related tags found
No related merge requests found
......@@ -510,24 +510,27 @@ foreach ($listofreferent as $key => $value)
$idtofilterthirdparty=0;
if (! in_array($tablename, array('facture_fourn', 'commande_fourn'))) $idtofilterthirdparty=$object->thirdparty->id;
$selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth200');
if (! $selectList || ($selectList<0))
{
setEventMessages($formproject->error,$formproject->errors,'errors');
}
elseif($selectList)
{
// Define form with the combo list of elements to link
$addform.='<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
$addform.='<input type="hidden" name="tablename" value="'.$tablename.'">';
$addform.='<input type="hidden" name="action" value="addelement">';
$addform.='<input type="hidden" name="datesrfc" value="'.dol_print_date($dates,'dayhourrfc').'">';
$addform.='<input type="hidden" name="dateerfc" value="'.dol_print_date($datee,'dayhourrfc').'">';
$addform.='<table><tr><td>'.$langs->trans("SelectElement").'</td>';
$addform.='<td>'.$selectList.'</td>';
$addform.='<td><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("AddElement")).'"></td>';
$addform.='</tr></table>';
$addform.='</form>';
if (empty($conf->global->PROJECT_LINK_DISABLE))
{
$selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth200');
if (! $selectList || ($selectList<0))
{
setEventMessages($formproject->error,$formproject->errors,'errors');
}
elseif($selectList)
{
// Define form with the combo list of elements to link
$addform.='<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
$addform.='<input type="hidden" name="tablename" value="'.$tablename.'">';
$addform.='<input type="hidden" name="action" value="addelement">';
$addform.='<input type="hidden" name="datesrfc" value="'.dol_print_date($dates,'dayhourrfc').'">';
$addform.='<input type="hidden" name="dateerfc" value="'.dol_print_date($datee,'dayhourrfc').'">';
$addform.='<table><tr><td>'.$langs->trans("SelectElement").'</td>';
$addform.='<td>'.$selectList.'</td>';
$addform.='<td><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("AddElement")).'"></td>';
$addform.='</tr></table>';
$addform.='</form>';
}
}
print_fiche_titre($langs->trans($title), $addform, '');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment