From 1128b66b30eec2aa8a59a5ca1fe3799dda1faa28 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Dec 2017 20:58:06 +0100 Subject: [PATCH] Fix ref of contract --- htdocs/contrat/index.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 5cd0d3773de..5d3a3603b8f 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -230,14 +230,14 @@ foreach($listofstatus as $status) print ''.$langs->trans("Total").''.$total.''; print "
"; -/** - * Draft contratcs - */ + +// Draft contracts + if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) { - $sql = "SELECT c.rowid as ref, c.rowid,"; + $sql = "SELECT c.rowid, c.ref,"; $sql.= " s.nom as name, s.rowid as socid"; - $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s"; + $sql.= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.rowid = c.fk_soc"; $sql.= " AND c.entity IN (".getEntity('contract', 0).")"; @@ -263,15 +263,18 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) while ($i < $num) { $obj = $db->fetch_object($resql); - print ''; + $staticcontrat->ref=$obj->ref; $staticcontrat->id=$obj->rowid; - print $staticcontrat->getNomUrl(1,''); - print ''; - print ''; + $companystatic->id=$obj->socid; $companystatic->name=$obj->name; $companystatic->client=1; + + print ''; + print $staticcontrat->getNomUrl(1,''); + print ''; + print ''; print $companystatic->getNomUrl(1,'',16); print ''; print '';