From 7406f2cc85a109e875bf2f81c45ab6f14032cdf2 Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Wed, 14 Jul 2021 12:55:33 +0200 Subject: [PATCH 1/2] a interventional drafts on commercial index --- htdocs/comm/index.php | 44 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 9d0d9f1befc..609e43ff765 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -497,6 +497,50 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU } } + +/* + * Draft interventionals + */ +if (!empty($conf->ficheinter->enabled)) { + $sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid"; + $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; + $sql .= ", ".MAIN_DB_PREFIX."societe as s"; + if (!$user->rights->societe->client->voir && !$socid) { + $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + } + $sql .= " WHERE f.entity IN (".getEntity('intervention').")"; + $sql .= " AND f.fk_soc = s.rowid"; + $sql .= " AND f.fk_statut = 0"; + if ($socid) { + $sql .= " AND f.fk_soc = ".$socid; + } + if (!$user->rights->societe->client->voir && !$socid) { + $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + } + + $resql = $db->query($sql); + if ($resql) { + print '
| '.$langs->trans("DraftFichinter").' | |
|---|---|
| '; + print "rowid."\">".img_object($langs->trans("ShowFichinter"), "intervention").' '.$obj->ref." | "; + print ''.img_object($langs->trans("ShowCompany"), "company").' '.dol_trunc($obj->name, 24).' |