* Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2024 MDW * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file htdocs/contrat/index.php * \ingroup contrat * \brief Home page of contract area */ require "../main.inc.php"; require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"; require_once DOL_DOCUMENT_ROOT."/product/class/product.class.php"; $hookmanager = new HookManager($db); // Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('contractindex')); // Load translation files required by the page $langs->loadLangs(array('products', 'companies', 'contracts')); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); $statut = GETPOST('statut') ? GETPOST('statut') : 1; $max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5); // Security check $socid = 0; $id = GETPOSTINT('id'); if (!empty($user->socid)) { $socid = $user->socid; } $result = restrictedArea($user, 'contrat', $id); $staticcompany = new Societe($db); $staticcontrat = new Contrat($db); $staticcontratligne = new ContratLigne($db); $productstatic = new Product($db); /* * Action */ // None /* * View */ $now = dol_now(); $title = $langs->trans("ContractsArea"); $help_url = 'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio'; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-contrat page-index'); print load_fiche_titre($langs->trans("ContractsArea"), '', 'contract'); print '
'; /* * Statistics */ $nb = array(); $total = 0; $totalinprocess = 0; $dataseries = array(); $vals = array(); // Search by status (except expired) $sql = "SELECT count(cd.rowid) as nb, cd.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE cd.fk_contrat = c.rowid AND c.fk_soc = s.rowid"; $sql .= " AND (cd.statut != 4 OR (cd.statut = 4 AND (cd.date_fin_validite is null or cd.date_fin_validite >= '".$db->idate($now)."')))"; $sql .= " AND c.entity IN (".getEntity('contract', 0).")"; if ($user->socid) { $sql .= ' AND c.fk_soc = '.((int) $user->socid); } if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " GROUP BY cd.statut"; $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); $i = 0; while ($i < $num) { $obj = $db->fetch_object($resql); if ($obj) { $nb[$obj->status] = $obj->nb; if ($obj->status != 5) { $vals[$obj->status] = $obj->nb; $totalinprocess += $obj->nb; } $total += $obj->nb; } $i++; } $db->free($resql); } else { dol_print_error($db); } // Search by status (only expired) $sql = "SELECT count(cd.rowid) as nb, cd.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."contratdet as cd, ".MAIN_DB_PREFIX."contrat as c"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE cd.fk_contrat = c.rowid AND c.fk_soc = s.rowid"; $sql .= " AND (cd.statut = 4 AND cd.date_fin_validite < '".$db->idate($now)."')"; $sql .= " AND c.entity IN (".getEntity('contract', 0).")"; if ($user->socid) { $sql .= ' AND c.fk_soc = '.((int) $user->socid); } if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $sql .= " GROUP BY cd.statut"; $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); // 0 inactive, 4 active, 5 closed $i = 0; while ($i < $num) { $obj = $db->fetch_object($resql); if ($obj) { $nb[$obj->status.((string) true)] = $obj->nb; if ($obj->status != 5) { $vals[$obj->status.((string) true)] = $obj->nb; $totalinprocess += $obj->nb; } $total += $obj->nb; } $i++; } $db->free($resql); } else { dol_print_error($db); } $colorseries = array(); include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; print '
'; print ''; print ''."\n"; $listofstatus = array(0, 4, 4, 5); $bool = false; foreach ($listofstatus as $status) { $bool_str = (string) $bool; $dataseries[] = array($staticcontratligne->LibStatut($status, 1, ($bool ? 1 : 0)), (isset($nb[$status.$bool_str]) ? (int) $nb[$status.$bool_str] : 0)); if ($status == ContratLigne::STATUS_INITIAL) { $colorseries[$status.$bool_str] = '-'.$badgeStatus0; } if ($status == ContratLigne::STATUS_OPEN && !$bool) { $colorseries[$status.$bool_str] = $badgeStatus4; } if ($status == ContratLigne::STATUS_OPEN && $bool) { $colorseries[$status.$bool_str] = $badgeStatus1; } if ($status == ContratLigne::STATUS_CLOSED) { $colorseries[$status.$bool_str] = $badgeStatus6; } if (empty($conf->use_javascript_ajax)) { print ''; print ''; print ''; print "\n"; } if ($status == 4 && !$bool) { $bool = true; } else { $bool = false; } } if (!empty($conf->use_javascript_ajax)) { print ''; } $listofstatus = array(0, 4, 4, 5); $bool = false; foreach ($listofstatus as $status) { $bool_str = (string) $bool; if (empty($conf->use_javascript_ajax)) { print ''; print ''; print ''; if ($status == 4 && !$bool) { $bool = true; } else { $bool = false; } print "\n"; } } print ''; print "
'.$langs->trans("Statistics").' - '.$langs->trans("Services").'
'.$staticcontratligne->LibStatut($status, 0, ($bool ? 1 : 0)).''.($nb[$status.$bool_str] ? $nb[$status.$bool_str] : 0).' '.$staticcontratligne->LibStatut($status, 3, ($bool ? 1 : 0)).'
'; include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); $dolgraph->SetDataColor(array_values($colorseries)); $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); $dolgraph->setHeight('200'); $dolgraph->draw('idgraphstatus'); print $dolgraph->show($total ? 0 : 1); print '
'.$staticcontratligne->LibStatut($status, 0, ($bool ? 1 : 0)).''.($nb[$status.$bool_str] ? $nb[$status.$bool_str] : 0).' '.$staticcontratligne->LibStatut($status, 3, ($bool ? 1 : 0)).'
'.$langs->trans("Total").''.$total.'

"; // Draft contracts if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $sql = "SELECT c.rowid, c.ref,"; $sql .= " s.nom as name, s.name_alias, s.logo, s.rowid as socid, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur"; $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE s.rowid = c.fk_soc"; $sql .= " AND c.entity IN (".getEntity('contract', 0).")"; $sql .= " AND c.statut = 0"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { $sql .= " AND c.fk_soc = ".((int) $socid); } $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); print '
'; print ''; print ''; print ''; if ($num) { $i = 0; //$tot_ttc = 0; while ($i < $num) { $obj = $db->fetch_object($resql); $staticcontrat->ref = $obj->ref; $staticcontrat->id = $obj->rowid; $staticcompany->id = $obj->socid; $staticcompany->name = $obj->name; $staticcompany->name_alias = $obj->name_alias; $staticcompany->logo = $obj->logo; $staticcompany->code_client = $obj->code_client; $staticcompany->code_fournisseur = $obj->code_fournisseur; $staticcompany->code_compta = $obj->code_compta_client; $staticcompany->code_compta_client = $obj->code_compta_client; $staticcompany->code_compta_fournisseur = $obj->code_compta_fournisseur; $staticcompany->client = $obj->client; $staticcompany->fournisseur = $obj->fournisseur; print ''; print ''; print ''; //$tot_ttc+=$obj->total_ttc; $i++; } } else { print ''; } print "
'.$langs->trans("DraftContracts").($num ? ''.$num.'' : '').'
'; print $staticcontrat->getNomUrl(1, ''); print ''; print $staticcompany->getNomUrl(1, '', 16); print '
'.$langs->trans("NoContracts").'

"; $db->free($resql); } else { dol_print_error($db); } } print '
'; // Last modified contracts $sql = 'SELECT '; $sql .= " sum(".$db->ifsql("cd.statut=0", 1, 0).') as nb_initial,'; $sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')", 1, 0).') as nb_running,'; $sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')", 1, 0).') as nb_expired,'; $sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')", 1, 0).') as nb_late,'; $sql .= " sum(".$db->ifsql("cd.statut=5", 1, 0).') as nb_closed,'; $sql .= " c.rowid as cid, c.ref, c.datec, c.tms, c.statut,"; $sql .= " s.nom as name, s.name_alias, s.logo, s.rowid as socid, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s,"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,"; } $sql .= " ".MAIN_DB_PREFIX."contrat as c"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat"; $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('contract', 0).")"; $sql .= " AND c.statut > 0"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } $sql .= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.statut,"; $sql .= " s.nom, s.name_alias, s.logo, s.rowid, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur"; $sql .= " ORDER BY c.tms DESC"; $sql .= $db->plimit($max); dol_syslog("contrat/index.php", LOG_DEBUG); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); $i = 0; print '
'; print ''; print ''; print ''; //print ''; print ''; print "\n"; while ($i < $num) { $obj = $db->fetch_object($result); $datem = $db->jdate($obj->tms); $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->cid); $staticcontrat->id = $obj->cid; $staticcompany->id = $obj->socid; $staticcompany->name = $obj->name; $staticcompany->name_alias = $obj->name_alias; $staticcompany->photo = 1; $staticcompany->code_client = $obj->code_client; $staticcompany->code_fournisseur = $obj->code_fournisseur; $staticcompany->code_compta = $obj->code_compta_client; $staticcompany->code_compta_client = $obj->code_compta_client; $staticcompany->code_compta_fournisseur = $obj->code_compta_fournisseur; $staticcompany->client = $obj->client; $staticcompany->fournisseur = $obj->fournisseur; print ''; print ''; print ''; print ''; //print ''; print ''; print ''; print ''; print ''; print "\n"; $i++; } $db->free($result); print "
'.$langs->trans("LastContracts", $max).''.$langs->trans("DateModification").''.$langs->trans("Status").''.$langs->trans("Services").'
'; print $staticcontrat->getNomUrl(1, 16); if ($obj->nb_late) { print img_warning($langs->trans("Late")); } print ''; print $staticcompany->getNomUrl(1, '', 20); print ''; print dol_print_date($datem, 'dayhour'); print ''.$staticcontrat->LibStatut($obj->statut,2).''.($obj->nb_initial > 0 ? ''.$obj->nb_initial.''.$staticcontratligne->LibStatut(0, 3, -1, 'class="paddingleft"') : '').''.($obj->nb_running > 0 ? ''.$obj->nb_running.''.$staticcontratligne->LibStatut(4, 3, 0, 'class="marginleft"') : '').''.($obj->nb_expired > 0 ? ''.$obj->nb_expired.''.$staticcontratligne->LibStatut(4, 3, 1, 'class="paddingleft"') : '').''.($obj->nb_closed > 0 ? ''.$obj->nb_closed.''.$staticcontratligne->LibStatut(5, 3, -1, 'class="paddingleft"') : '').'
"; } else { dol_print_error($db); } print '
'; // Last modified services $sql = "SELECT c.ref, c.fk_soc as socid,"; $sql .= " cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat, cd.date_fin_validite,"; $sql .= " s.nom as name, s.name_alias, s.logo, s.rowid as socid, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,"; $sql .= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity"; $sql .= " FROM (".MAIN_DB_PREFIX."contrat as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ", ".MAIN_DB_PREFIX."contratdet as cd"; $sql .= ") LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; $sql .= " WHERE c.entity IN (".getEntity('contract', 0).")"; $sql .= " AND cd.fk_contrat = c.rowid"; $sql .= " AND c.fk_soc = s.rowid"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } $sql .= " ORDER BY cd.tms DESC"; $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); $i = 0; print '
'; print ''; print ''; print "\n"; while ($i < min($num, $max)) { $obj = $db->fetch_object($resql); print ''; print ''; print ''; print ''; print ''; print "\n"; $i++; } $db->free($resql); print "
'.$langs->trans("LastModifiedServices", $max).'
'; $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat); $staticcontrat->id = $obj->fk_contrat; $staticcompany->id = $obj->socid; $staticcompany->name = $obj->name; $staticcompany->name_alias = $obj->name_alias; $staticcompany->photo = 1; $staticcompany->code_client = $obj->code_client; $staticcompany->code_fournisseur = $obj->code_fournisseur; $staticcompany->code_compta = $obj->code_compta_client; $staticcompany->code_compta_client = $obj->code_compta_client; $staticcompany->code_compta_fournisseur = $obj->code_compta_fournisseur; $staticcompany->client = $obj->client; $staticcompany->fournisseur = $obj->fournisseur; print $staticcontrat->getNomUrl(1, 16); //if (1 == 1) print img_warning($langs->trans("Late")); print ''; if ($obj->fk_product > 0) { $productstatic->id = $obj->fk_product; $productstatic->type = $obj->ptype; $productstatic->ref = $obj->pref; $productstatic->entity = $obj->pentity; print $productstatic->getNomUrl(1, '', 20); } else { print ''.img_object($langs->trans("ShowService"), "service"); if ($obj->label) { print ' '.dol_trunc($obj->label, 20).''; } else { print ' '.dol_trunc($obj->note, 20); } } print ''; print $staticcompany->getNomUrl(1, '', 20); print ''; $dateend = $db->jdate($obj->date_fin_validite); print $staticcontratligne->LibStatut($obj->statut, 3, ($dateend && $dateend < $now) ? 1 : 0); print '
"; } else { dol_print_error($db); } print '
'; // Not activated services $sql = "SELECT c.ref, c.fk_soc as thirdpartyid, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,"; $sql .= " s.nom as name, s.name_alias, s.logo, s.rowid as socid, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,"; $sql .= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity"; $sql .= " FROM (".MAIN_DB_PREFIX."contrat as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ", ".MAIN_DB_PREFIX."contratdet as cd"; $sql .= " ) LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; $sql .= " WHERE c.entity IN (".getEntity('contract', 0).")"; $sql .= " AND c.statut = 1"; $sql .= " AND cd.statut = 0"; $sql .= " AND cd.fk_contrat = c.rowid"; $sql .= " AND c.fk_soc = s.rowid"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } $sql .= " ORDER BY cd.tms DESC"; $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); $i = 0; print '
'; print ''; print ''; print "\n"; while ($i < $num) { $obj = $db->fetch_object($resql); $staticcompany->id = $obj->thirdpartyid; $staticcompany->name = $obj->name; $staticcompany->name_alias = $obj->name_alias; $staticcompany->photo = 1; $staticcompany->code_client = $obj->code_client; $staticcompany->code_fournisseur = $obj->code_fournisseur; $staticcompany->code_compta = $obj->code_compta_client; $staticcompany->code_compta_client = $obj->code_compta_client; $staticcompany->code_compta_fournisseur = $obj->code_compta_fournisseur; $staticcompany->client = $obj->client; $staticcompany->fournisseur = $obj->fournisseur; $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat); $staticcontrat->id = $obj->fk_contrat; $productstatic->id = $obj->fk_product; $productstatic->type = $obj->ptype; $productstatic->ref = $obj->pref; $productstatic->entity = $obj->pentity; print ''; print ''; print ''; print ''; print ''; print "\n"; $i++; } $db->free($resql); print "
'.$langs->trans("NotActivatedServices").' '.$num.'
'; print $staticcontrat->getNomUrl(1, 16); print ''; if ($obj->fk_product > 0) { print $productstatic->getNomUrl(1, '', 20); } else { print ''.img_object($langs->trans("ShowService"), "service"); if ($obj->label) { print ' '.dol_trunc($obj->label, 20).''; } else { print ' '.dol_trunc($obj->note, 20); } } print ''; print $staticcompany->getNomUrl(1, '', 20); print ''; print $staticcontratligne->LibStatut($obj->statut, 3); print '
"; } else { dol_print_error($db); } print '
'; // Expired services $sql = "SELECT c.ref, c.fk_soc as thirdpartyid, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,"; $sql .= " s.nom as name, s.name_alias, s.logo, s.rowid as socid, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,"; $sql .= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity"; $sql .= " FROM (".MAIN_DB_PREFIX."contrat as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= ", ".MAIN_DB_PREFIX."contratdet as cd"; $sql .= " ) LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid"; $sql .= " WHERE c.entity IN (".getEntity('contract', 0).")"; $sql .= " AND c.statut = 1"; $sql .= " AND cd.statut = 4"; $sql .= " AND cd.date_fin_validite < '".$db->idate($now)."'"; $sql .= " AND cd.fk_contrat = c.rowid"; $sql .= " AND c.fk_soc = s.rowid"; if (!$user->hasRight('societe', 'client', 'voir')) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } if ($socid) { $sql .= " AND s.rowid = ".((int) $socid); } $sql .= " ORDER BY cd.tms DESC"; $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); $i = 0; print '
'; print ''; print ''; print "\n"; while ($i < $num) { $obj = $db->fetch_object($resql); $staticcompany->id = $obj->thirdpartyid; $staticcompany->name = $obj->name; $staticcompany->name_alias = $obj->name_alias; $staticcompany->photo = 1; $staticcompany->code_client = $obj->code_client; $staticcompany->code_fournisseur = $obj->code_fournisseur; $staticcompany->code_compta = $obj->code_compta_client; $staticcompany->code_compta_client = $obj->code_compta_client; $staticcompany->code_compta_fournisseur = $obj->code_compta_fournisseur; $staticcompany->client = $obj->client; $staticcompany->fournisseur = $obj->fournisseur; $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat); $staticcontrat->id = $obj->fk_contrat; $productstatic->id = $obj->fk_product; $productstatic->type = $obj->ptype; $productstatic->ref = $obj->pref; $productstatic->entity = $obj->pentity; print ''; print ''; print ''; print ''; print ''; print "\n"; $i++; } $db->free($resql); print "
'.$langs->trans("ListOfExpiredServices").' '.$num.'
'; print $staticcontrat->getNomUrl(1, 16); print ''; if ($obj->fk_product > 0) { print $productstatic->getNomUrl(1, '', 20); } else { print ''.img_object($langs->trans("ShowService"), "service"); if ($obj->label) { print ' '.dol_trunc($obj->label, 20).''; } else { print ' '.dol_trunc($obj->note, 20); } } print ''; print $staticcompany->getNomUrl(1, '', 20); print ''; print $staticcontratligne->LibStatut($obj->statut, 3, 1); print '
"; } else { dol_print_error($db); } print '
'; $parameters = array('user' => $user); $reshook = $hookmanager->executeHooks('dashboardContracts', $parameters, $object); // Note that $action and $object may have been modified by hook llxFooter(); $db->close();