Fix popup customer

This commit is contained in:
Laurent Destailleur 2018-08-15 15:07:23 +02:00
parent 15144a2473
commit 7d6e25789c

View File

@ -197,7 +197,7 @@ $now=dol_now();
$form=new Form($db); $form=new Form($db);
$sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut,"; $sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut,";
$sql.= " s.rowid as socid, s.nom as name,"; $sql.= " s.rowid as socid, s.nom as name, s.email, s.client, s.fournisseur,";
$sql.= " cd.rowid, cd.description, cd.statut,"; $sql.= " cd.rowid, cd.description, cd.statut,";
$sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype, p.entity as pentity,"; $sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype, p.entity as pentity,";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,";
@ -540,6 +540,11 @@ while ($i < min($num,$limit))
$contractstatic->id=$obj->cid; $contractstatic->id=$obj->cid;
$contractstatic->ref=$obj->ref?$obj->ref:$obj->cid; $contractstatic->ref=$obj->ref?$obj->ref:$obj->cid;
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;
$companystatic->email=$obj->email;
$companystatic->client=$obj->client;
$companystatic->fournisseur=$obj->fournisseur;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
@ -555,7 +560,7 @@ while ($i < min($num,$limit))
if (! empty($arrayfields['p.description']['checked'])) if (! empty($arrayfields['p.description']['checked']))
{ {
print '<td>'; print '<td>';
if ($obj->pid) if ($obj->pid > 0)
{ {
$productstatic->id=$obj->pid; $productstatic->id=$obj->pid;
$productstatic->type=$obj->ptype; $productstatic->type=$obj->ptype;
@ -625,9 +630,6 @@ while ($i < min($num,$limit))
if (! empty($arrayfields['s.nom']['checked'])) if (! empty($arrayfields['s.nom']['checked']))
{ {
print '<td>'; print '<td>';
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;
$companystatic->client=1;
print $companystatic->getNomUrl(1,'customer',28); print $companystatic->getNomUrl(1,'customer',28);
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;