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

This commit is contained in:
Laurent Destailleur 2015-11-26 00:47:29 +01:00
commit 1608fec937

View File

@ -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, '');