Part solution bug #4095

It allow us to deactivate the link to a project queries to lower the page workload.
This commit is contained in:
braito4 2015-11-25 18:58:47 +01:00
parent 7bde781206
commit 677cba01ce

View File

@ -510,24 +510,27 @@ foreach ($listofreferent as $key => $value)
$idtofilterthirdparty=0; $idtofilterthirdparty=0;
if (! in_array($tablename, array('facture_fourn', 'commande_fourn'))) $idtofilterthirdparty=$object->thirdparty->id; if (! in_array($tablename, array('facture_fourn', 'commande_fourn'))) $idtofilterthirdparty=$object->thirdparty->id;
$selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth200'); if (empty($conf->global->PROJECT_LINK_DISABLE))
if (! $selectList || ($selectList<0)) {
{ $selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth200');
setEventMessages($formproject->error,$formproject->errors,'errors'); if (! $selectList || ($selectList<0))
} {
elseif($selectList) setEventMessages($formproject->error,$formproject->errors,'errors');
{ }
// Define form with the combo list of elements to link elseif($selectList)
$addform.='<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">'; {
$addform.='<input type="hidden" name="tablename" value="'.$tablename.'">'; // Define form with the combo list of elements to link
$addform.='<input type="hidden" name="action" value="addelement">'; $addform.='<form action="'.$_SERVER["PHP_SELF"].'?id='.$projectid.'" method="post">';
$addform.='<input type="hidden" name="datesrfc" value="'.dol_print_date($dates,'dayhourrfc').'">'; $addform.='<input type="hidden" name="tablename" value="'.$tablename.'">';
$addform.='<input type="hidden" name="dateerfc" value="'.dol_print_date($datee,'dayhourrfc').'">'; $addform.='<input type="hidden" name="action" value="addelement">';
$addform.='<table><tr><td>'.$langs->trans("SelectElement").'</td>'; $addform.='<input type="hidden" name="datesrfc" value="'.dol_print_date($dates,'dayhourrfc').'">';
$addform.='<td>'.$selectList.'</td>'; $addform.='<input type="hidden" name="dateerfc" value="'.dol_print_date($datee,'dayhourrfc').'">';
$addform.='<td><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("AddElement")).'"></td>'; $addform.='<table><tr><td>'.$langs->trans("SelectElement").'</td>';
$addform.='</tr></table>'; $addform.='<td>'.$selectList.'</td>';
$addform.='</form>'; $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, ''); print_fiche_titre($langs->trans($title), $addform, '');