2
0
forked from Wavyzz/dolibarr

fix list of event unformize code

This commit is contained in:
florian HENRY
2018-07-12 18:27:09 +02:00
parent 5da89e1cad
commit 1fa13fc747
2 changed files with 8 additions and 48 deletions

View File

@@ -1478,10 +1478,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60;
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db); $formactions=new FormActions($db);
@@ -1490,12 +1487,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$userstatic=new User($db); $userstatic=new User($db);
$contactstatic = new Contact($db); $contactstatic = new Contact($db);
// TODO mutualize/uniformize
$propalstatic=new Propal($db);
$orderstatic=new Commande($db);
$supplierorderstatic=new CommandeFournisseur($db);
$facturestatic=new Facture($db);
$out.='<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; $out.='<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
if ($objcon && get_class($objcon) == 'Contact' && $filterobj && get_class($filterobj) == 'Societe') if ($objcon && get_class($objcon) == 'Contact' && $filterobj && get_class($filterobj) == 'Societe')
{ {
@@ -1656,45 +1647,10 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
//$out.='<td>'.dol_trunc($histo[$key]['note'], 40).'</td>'; //$out.='<td>'.dol_trunc($histo[$key]['note'], 40).'</td>';
// Objet lie // Objet lie
// TODO mutualize/uniformize
$out.='<td>'; $out.='<td>';
//var_dump($histo[$key]['elementtype']); if (isset($histo[$key]['elementtype']) && !empty($histo[$key]['fk_element']))
if (isset($histo[$key]['elementtype']))
{ {
if ($histo[$key]['elementtype'] == 'propal' && ! empty($conf->propal->enabled)) $out.=dolGetElementUrl($histo[$key]['fk_element'],$histo[$key]['elementtype'],1);
{
//$propalstatic->ref=$langs->trans("ProposalShort");
//$propalstatic->id=$histo[$key]['fk_element'];
if ($propalstatic->fetch($histo[$key]['fk_element'])>0) {
$propalstatic->type=$histo[$key]['ftype'];
$out.=$propalstatic->getNomUrl(1);
} else {
//$out.= '<span class="opacitymedium">'.$langs->trans("ProposalDeleted").'</span>';
}
}
elseif (($histo[$key]['elementtype'] == 'order' || $histo[$key]['elementtype'] == 'commande') && ! empty($conf->commande->enabled))
{
//$orderstatic->ref=$langs->trans("Order");
//$orderstatic->id=$histo[$key]['fk_element'];
if ($orderstatic->fetch($histo[$key]['fk_element'])>0) {
$orderstatic->type=$histo[$key]['ftype'];
$out.=$orderstatic->getNomUrl(1);
} else {
//$out.= '<span class="opacitymedium">'.$langs->trans("OrderDeleted").'<span>';
}
}
elseif (($histo[$key]['elementtype'] == 'invoice' || $histo[$key]['elementtype'] == 'facture') && ! empty($conf->facture->enabled))
{
//$facturestatic->ref=$langs->trans("Invoice");
//$facturestatic->id=$histo[$key]['fk_element'];
if ($facturestatic->fetch($histo[$key]['fk_element'])>0) {
$facturestatic->type=$histo[$key]['ftype'];
$out.=$facturestatic->getNomUrl(1,'compta');
} else {
//$out.= '<span class="opacitymedium">'.$langs->trans("InvoiceDeleted").'</span>';
}
}
else $out.='&nbsp;';
} }
else $out.='&nbsp;'; else $out.='&nbsp;';
$out.='</td>'; $out.='</td>';

View File

@@ -1865,7 +1865,11 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='')
{ {
$object = new $classname($db); $object = new $classname($db);
$res=$object->fetch($objectid); $res=$object->fetch($objectid);
if ($res > 0) $ret=$object->getNomUrl($withpicto,$option); if ($res > 0) {
$ret=$object->getNomUrl($withpicto,$option);
} elseif($res==0) {
$ret=$langs->trans('Deleted');
}
unset($object); unset($object);
} }
else dol_syslog("Class with classname ".$classname." is unknown even after the include", LOG_ERR); else dol_syslog("Class with classname ".$classname." is unknown even after the include", LOG_ERR);