31require
"../main.inc.php";
32require_once DOL_DOCUMENT_ROOT.
"/contrat/class/contrat.class.php";
33require_once DOL_DOCUMENT_ROOT.
"/product/class/product.class.php";
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/dashboard.lib.php';
45$langs->loadLangs(array(
'products',
'companies',
'contracts'));
48$hookmanager->initHooks(array(
'contractindex'));
50$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
51$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
61if (!empty($user->socid)) {
62 $socid = $user->socid;
66$staticcompany =
new Societe($db);
67$staticcontrat =
new Contrat($db);
69$productstatic =
new Product($db);
86$title = $langs->trans(
"ContractsArea");
87$help_url =
'EN:Module_Contracts|FR:Module_Contrat|ES:Contratos_de_servicio';
89llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-contrat page-index');
94print
'<div class="fichecenter"><div class="fichethirdleft">';
107$sql =
"SELECT count(cd.rowid) as nb, cd.statut as status";
108$sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
109$sql .=
", ".MAIN_DB_PREFIX.
"contratdet as cd, ".MAIN_DB_PREFIX.
"contrat as c";
110if (!$user->hasRight(
'societe',
'client',
'voir')) {
111 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
113$sql .=
" WHERE cd.fk_contrat = c.rowid AND c.fk_soc = s.rowid";
114$sql .=
" AND (cd.statut != 4 OR (cd.statut = 4 AND (cd.date_fin_validite is null or cd.date_fin_validite >= '".$db->idate($now).
"')))";
115$sql .=
" AND c.entity IN (".getEntity(
'contract', 0).
")";
117 $sql .=
' AND c.fk_soc = '.((int) $user->socid);
119if (!$user->hasRight(
'societe',
'client',
'voir')) {
120 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
122$sql .=
" GROUP BY cd.statut";
123$resql = $db->query($sql);
125 $num = $db->num_rows($resql);
128 $obj = $db->fetch_object($resql);
130 $nb[$obj->status] = $obj->nb;
131 if ($obj->status != 5) {
132 $vals[$obj->status] = $obj->nb;
133 $totalinprocess += $obj->nb;
141 dol_print_error($db);
144$sql =
"SELECT count(cd.rowid) as nb, cd.statut as status";
145$sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
146$sql .=
", ".MAIN_DB_PREFIX.
"contratdet as cd, ".MAIN_DB_PREFIX.
"contrat as c";
147if (!$user->hasRight(
'societe',
'client',
'voir')) {
148 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
150$sql .=
" WHERE cd.fk_contrat = c.rowid AND c.fk_soc = s.rowid";
151$sql .=
" AND (cd.statut = 4 AND cd.date_fin_validite < '".$db->idate($now).
"')";
152$sql .=
" AND c.entity IN (".getEntity(
'contract', 0).
")";
154 $sql .=
' AND c.fk_soc = '.((int) $user->socid);
156if (!$user->hasRight(
'societe',
'client',
'voir')) {
157 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
159$sql .=
" GROUP BY cd.statut";
160$resql = $db->query($sql);
162 $num = $db->num_rows($resql);
167 $obj = $db->fetch_object($resql);
169 $nb[$obj->status.((string)
true)] = $obj->nb;
170 if ($obj->status != 5) {
171 $vals[$obj->status.((string)
true)] = $obj->nb;
172 $totalinprocess += $obj->nb;
180 dol_print_error($db);
185$listofstatus = array(0, 4, 4);
191foreach ($listofstatus as $status) {
192 $bool_str = (string) $bool;
194 if ($status == ContratLigne::STATUS_INITIAL) {
195 $color =
'-'.$colors[0];
197 if ($status == ContratLigne::STATUS_OPEN && !$bool) {
200 if ($status == ContratLigne::STATUS_OPEN && $bool) {
203 if ($status == ContratLigne::STATUS_CLOSED) {
207 'label' => $staticcontratligne->LibStatut($status, 1, ($bool ? 1 : 0)),
208 'labelnojs' => $staticcontratligne->LibStatut($status, 0, ($bool ? 1 : 0)),
209 'nb' => (isset($nb[$status.$bool_str]) ? (int) $nb[$status.$bool_str] : 0),
211 'url' =>
'services_list.php?search_status='.((int) $status).($bool ?
'&filter=expired' :
''),
213 if ($status == 4 && !$bool) {
219print
getStatusPieChart($langs->trans(
"Statistics").
' - '.$langs->trans(
"Services"), $series, array(
'total' => $total));
224if (
isModEnabled(
'contract') && $user->hasRight(
'contrat',
'lire')) {
225 $sql =
"SELECT c.rowid, c.ref,";
226 $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";
227 $sql .=
" FROM ".MAIN_DB_PREFIX.
"contrat as c, ".MAIN_DB_PREFIX.
"societe as s";
228 if (!$user->hasRight(
'societe',
'client',
'voir')) {
229 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
231 $sql .=
" WHERE s.rowid = c.fk_soc";
232 $sql .=
" AND c.entity IN (".getEntity(
'contract', 0).
")";
233 $sql .=
" AND c.statut = 0";
234 if (!$user->hasRight(
'societe',
'client',
'voir')) {
235 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
238 $sql .=
" AND c.fk_soc = ".((int) $socid);
241 $resql = $db->query($sql);
244 $num = $db->num_rows($resql);
246 print
'<div class="div-table-responsive-no-min">';
247 print
'<table class="noborder centpercent">';
248 print
'<tr class="liste_titre">';
249 print
'<th colspan="3">'.$langs->trans(
"DraftContracts").($num ?
'<span class="badge marginleftonlyshort">'.$num.
'</span>' :
'').
'</th></tr>';
254 $obj = $db->fetch_object($resql);
256 $staticcontrat->ref = $obj->ref;
257 $staticcontrat->id = $obj->rowid;
259 $staticcompany->id = $obj->socid;
260 $staticcompany->name = $obj->name;
261 $staticcompany->name_alias = $obj->name_alias;
262 $staticcompany->logo = $obj->logo;
263 $staticcompany->code_client = $obj->code_client;
264 $staticcompany->code_fournisseur = $obj->code_fournisseur;
265 $staticcompany->code_compta = $obj->code_compta_client;
266 $staticcompany->code_compta_client = $obj->code_compta_client;
267 $staticcompany->code_compta_fournisseur = $obj->code_compta_fournisseur;
268 $staticcompany->client = $obj->client;
269 $staticcompany->fournisseur = $obj->fournisseur;
271 print
'<tr class="oddeven"><td class="nowrap">';
272 print $staticcontrat->getNomUrl(1, 0);
275 print $staticcompany->getNomUrl(1,
'', 16);
282 print
'<tr class="oddeven"><td colspan="3"><span class="opacitymedium">'.$langs->trans(
"NoContracts").
'</span></td></tr>';
284 print
"</table></div><br>";
287 dol_print_error($db);
292print
'</div><div class="fichetwothirdright">';
297$sql .=
" sum(".$db->ifsql(
"cd.statut=0",
'1',
'0').
') as nb_initial,';
298$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,';
299$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,';
300$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,';
301$sql .=
" sum(".$db->ifsql(
"cd.statut=5",
'1',
'0').
') as nb_closed,';
302$sql .=
" c.rowid as cid, c.ref, c.datec, c.tms, c.statut,";
303$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";
304$sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s,";
305if (!$user->hasRight(
'societe',
'client',
'voir')) {
306 $sql .=
" ".MAIN_DB_PREFIX.
"societe_commerciaux as sc,";
308$sql .=
" ".MAIN_DB_PREFIX.
"contrat as c";
309$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"contratdet as cd ON c.rowid = cd.fk_contrat";
310$sql .=
" WHERE c.fk_soc = s.rowid";
311$sql .=
" AND c.entity IN (".getEntity(
'contract', 0).
")";
312$sql .=
" AND c.statut > 0";
313if (!$user->hasRight(
'societe',
'client',
'voir')) {
314 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
317 $sql .=
" AND s.rowid = ".((int) $socid);
319$sql .=
" GROUP BY c.rowid, c.ref, c.datec, c.tms, c.statut,";
320$sql .=
" s.nom, s.name_alias, s.logo, s.rowid, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur";
321$sql .=
" ORDER BY c.tms DESC";
322$sql .= $db->plimit($max);
325$result = $db->query($sql);
327 $num = $db->num_rows($result);
330 print
'<div class="div-table-responsive-no-min">';
331 print
'<table class="noborder centpercent">';
333 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"LastContracts", $max).
'</th>';
334 print
'<th class="center">'.$langs->trans(
"DateModification").
'</th>';
336 print
'<th class="center" width="80" colspan="4">'.$langs->trans(
"Services").
'</th>';
340 $obj = $db->fetch_object($result);
341 $datem = $db->jdate($obj->tms);
343 $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->cid);
344 $staticcontrat->id = $obj->cid;
346 $staticcompany->id = $obj->socid;
347 $staticcompany->name = $obj->name;
348 $staticcompany->name_alias = $obj->name_alias;
349 $staticcompany->photo = 1;
350 $staticcompany->code_client = $obj->code_client;
351 $staticcompany->code_fournisseur = $obj->code_fournisseur;
352 $staticcompany->code_compta = $obj->code_compta_client;
353 $staticcompany->code_compta_client = $obj->code_compta_client;
354 $staticcompany->code_compta_fournisseur = $obj->code_compta_fournisseur;
355 $staticcompany->client = $obj->client;
356 $staticcompany->fournisseur = $obj->fournisseur;
358 print
'<tr class="oddeven">';
359 print
'<td class="nowraponall">';
360 print $staticcontrat->getNomUrl(1, 16);
362 print img_warning($langs->trans(
"Late"));
366 print
'<td class="tdoverflowmax150">';
367 print $staticcompany->getNomUrl(1,
'', 20);
369 print
'<td class="center nowraponall" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
373 print
'<td class="right nowraponall" width="32">'.($obj->nb_initial > 0 ?
'<span class="paddingright">'.$obj->nb_initial.
'</span>'.$staticcontratligne->LibStatut(0, 3, -1,
'class="paddingleft"') :
'').
'</td>';
374 print
'<td class="right nowraponall" width="32">'.($obj->nb_running > 0 ?
'<span class="paddingright">'.$obj->nb_running.
'</span>'.$staticcontratligne->LibStatut(4, 3, 0,
'class="marginleft"') :
'').
'</td>';
375 print
'<td class="right nowraponall" width="32">'.($obj->nb_expired > 0 ?
'<span class="paddingright">'.$obj->nb_expired.
'</span>'.$staticcontratligne->LibStatut(4, 3, 1,
'class="paddingleft"') :
'').
'</td>';
376 print
'<td class="right nowraponall" width="32">'.($obj->nb_closed > 0 ?
'<span class="paddingright">'.$obj->nb_closed.
'</span>'.$staticcontratligne->LibStatut(5, 3, -1,
'class="paddingleft"') :
'').
'</td>';
382 print
"</table></div>";
384 dol_print_error($db);
390$sql =
"SELECT c.ref, c.fk_soc as socid,";
391$sql .=
" cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat, cd.date_fin_validite,";
392$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,";
393$sql .=
" p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity";
394$sql .=
" FROM (".MAIN_DB_PREFIX.
"contrat as c";
395$sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
396if (!$user->hasRight(
'societe',
'client',
'voir')) {
397 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
399$sql .=
", ".MAIN_DB_PREFIX.
"contratdet as cd";
400$sql .=
") LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON cd.fk_product = p.rowid";
401$sql .=
" WHERE c.entity IN (".getEntity(
'contract', 0).
")";
402$sql .=
" AND cd.fk_contrat = c.rowid";
403$sql .=
" AND c.fk_soc = s.rowid";
404if (!$user->hasRight(
'societe',
'client',
'voir')) {
405 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
408 $sql .=
" AND s.rowid = ".((int) $socid);
410$sql .=
" ORDER BY cd.tms DESC";
412$resql = $db->query($sql);
414 $num = $db->num_rows($resql);
417 print
'<div class="div-table-responsive-no-min">';
418 print
'<table class="noborder centpercent">';
420 print
'<tr class="liste_titre"><th colspan="4">'.$langs->trans(
"LastModifiedServices", $max).
'</th>';
423 while ($i < min($num, $max)) {
424 $obj = $db->fetch_object($resql);
426 print
'<tr class="oddeven">';
427 print
'<td class="nowraponall">';
429 $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat);
430 $staticcontrat->id = $obj->fk_contrat;
432 $staticcompany->id = $obj->socid;
433 $staticcompany->name = $obj->name;
434 $staticcompany->name_alias = $obj->name_alias;
435 $staticcompany->photo = 1;
436 $staticcompany->code_client = $obj->code_client;
437 $staticcompany->code_fournisseur = $obj->code_fournisseur;
438 $staticcompany->code_compta = $obj->code_compta_client;
439 $staticcompany->code_compta_client = $obj->code_compta_client;
440 $staticcompany->code_compta_fournisseur = $obj->code_compta_fournisseur;
441 $staticcompany->client = $obj->client;
442 $staticcompany->fournisseur = $obj->fournisseur;
444 print $staticcontrat->getNomUrl(1, 16);
449 if ($obj->fk_product > 0) {
450 $productstatic->id = $obj->fk_product;
451 $productstatic->type = $obj->ptype;
452 $productstatic->ref = $obj->pref;
453 $productstatic->entity = $obj->pentity;
454 print $productstatic->getNomUrl(1,
'', 20);
456 print
'<a href="'.DOL_URL_ROOT.
'/contrat/card.php?id='.$obj->fk_contrat.
'">'.img_object($langs->trans(
"ShowService"),
"service");
458 print
' '.dol_trunc($obj->label, 20).
'</a>';
460 print
'</a> '.dol_trunc($obj->note, 20);
464 print
'<td class="tdoverflowmax125">';
465 print $staticcompany->getNomUrl(1,
'', 20);
467 print
'<td class="nowrap right"><a href="'.DOL_URL_ROOT.
'/contrat/card.php?id='.$obj->fk_contrat.
'&ligne='.$obj->cid.
'">';
468 $dateend = $db->jdate($obj->date_fin_validite);
469 print $staticcontratligne->LibStatut($obj->statut, 3, ($dateend && $dateend < $now) ? 1 : 0);
476 print
"</table></div>";
478 dol_print_error($db);
484$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,";
485$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,";
486$sql .=
" p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity";
487$sql .=
" FROM (".MAIN_DB_PREFIX.
"contrat as c";
488$sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
489if (!$user->hasRight(
'societe',
'client',
'voir')) {
490 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
492$sql .=
", ".MAIN_DB_PREFIX.
"contratdet as cd";
493$sql .=
" ) LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON cd.fk_product = p.rowid";
494$sql .=
" WHERE c.entity IN (".getEntity(
'contract', 0).
")";
495$sql .=
" AND c.statut = 1";
496$sql .=
" AND cd.statut = 0";
497$sql .=
" AND cd.fk_contrat = c.rowid";
498$sql .=
" AND c.fk_soc = s.rowid";
499if (!$user->hasRight(
'societe',
'client',
'voir')) {
500 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
503 $sql .=
" AND s.rowid = ".((int) $socid);
505$sql .=
" ORDER BY cd.tms DESC";
507$resql = $db->query($sql);
509 $num = $db->num_rows($resql);
512 print
'<div class="div-table-responsive-no-min">';
513 print
'<table class="noborder centpercent">';
515 print
'<tr class="liste_titre"><th colspan="4">'.$langs->trans(
"NotActivatedServices").
' <a href="'.DOL_URL_ROOT.
'/contrat/services_list.php?mode=0"><span class="badge">'.$num.
'</span></a></th>';
519 $obj = $db->fetch_object($resql);
521 $staticcompany->id = $obj->thirdpartyid;
522 $staticcompany->name = $obj->name;
523 $staticcompany->name_alias = $obj->name_alias;
524 $staticcompany->photo = 1;
525 $staticcompany->code_client = $obj->code_client;
526 $staticcompany->code_fournisseur = $obj->code_fournisseur;
527 $staticcompany->code_compta = $obj->code_compta_client;
528 $staticcompany->code_compta_client = $obj->code_compta_client;
529 $staticcompany->code_compta_fournisseur = $obj->code_compta_fournisseur;
530 $staticcompany->client = $obj->client;
531 $staticcompany->fournisseur = $obj->fournisseur;
533 $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat);
534 $staticcontrat->id = $obj->fk_contrat;
536 $productstatic->id = $obj->fk_product;
537 $productstatic->type = $obj->ptype;
538 $productstatic->ref = $obj->pref;
539 $productstatic->entity = $obj->pentity;
541 print
'<tr class="oddeven">';
543 print
'<td class="nowraponall">';
544 print $staticcontrat->getNomUrl(1, 16);
546 print
'<td class="nowrap">';
547 if ($obj->fk_product > 0) {
548 print $productstatic->getNomUrl(1,
'', 20);
550 print
'<a href="'.DOL_URL_ROOT.
'/contrat/card.php?id='.$obj->fk_contrat.
'">'.img_object($langs->trans(
"ShowService"),
"service");
552 print
' '.dol_trunc($obj->label, 20).
'</a>';
554 print
'</a> '.dol_trunc($obj->note, 20);
558 print
'<td class="tdoverflowmax125">';
559 print $staticcompany->getNomUrl(1,
'', 20);
561 print
'<td width="16" class="right"><a href="line.php?id='.$obj->fk_contrat.
'&ligne='.$obj->cid.
'">';
562 print $staticcontratligne->LibStatut($obj->statut, 3);
570 print
"</table></div>";
572 dol_print_error($db);
578$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,";
579$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,";
580$sql .=
" p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity";
581$sql .=
" FROM (".MAIN_DB_PREFIX.
"contrat as c";
582$sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
583if (!$user->hasRight(
'societe',
'client',
'voir')) {
584 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
586$sql .=
", ".MAIN_DB_PREFIX.
"contratdet as cd";
587$sql .=
" ) LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON cd.fk_product = p.rowid";
588$sql .=
" WHERE c.entity IN (".getEntity(
'contract', 0).
")";
589$sql .=
" AND c.statut = 1";
590$sql .=
" AND cd.statut = 4";
591$sql .=
" AND cd.date_fin_validite < '".$db->idate($now).
"'";
592$sql .=
" AND cd.fk_contrat = c.rowid";
593$sql .=
" AND c.fk_soc = s.rowid";
594if (!$user->hasRight(
'societe',
'client',
'voir')) {
595 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
598 $sql .=
" AND s.rowid = ".((int) $socid);
600$sql .=
" ORDER BY cd.tms DESC";
602$resql = $db->query($sql);
604 $num = $db->num_rows($resql);
607 print
'<div class="div-table-responsive-no-min">';
608 print
'<table class="noborder centpercent">';
610 print
'<tr class="liste_titre"><th colspan="4">'.$langs->trans(
"ListOfExpiredServices").
' <a href="'.DOL_URL_ROOT.
'/contrat/services_list.php?search_status=4&filter=expired"><span class="badge">'.$num.
'</span></a></th>';
614 $obj = $db->fetch_object($resql);
616 $staticcompany->id = $obj->thirdpartyid;
617 $staticcompany->name = $obj->name;
618 $staticcompany->name_alias = $obj->name_alias;
619 $staticcompany->photo = 1;
620 $staticcompany->code_client = $obj->code_client;
621 $staticcompany->code_fournisseur = $obj->code_fournisseur;
622 $staticcompany->code_compta = $obj->code_compta_client;
623 $staticcompany->code_compta_client = $obj->code_compta_client;
624 $staticcompany->code_compta_fournisseur = $obj->code_compta_fournisseur;
625 $staticcompany->client = $obj->client;
626 $staticcompany->fournisseur = $obj->fournisseur;
628 $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat);
629 $staticcontrat->id = $obj->fk_contrat;
631 $productstatic->id = $obj->fk_product;
632 $productstatic->type = $obj->ptype;
633 $productstatic->ref = $obj->pref;
634 $productstatic->entity = $obj->pentity;
636 print
'<tr class="oddeven">';
638 print
'<td class="nowraponall">';
639 print $staticcontrat->getNomUrl(1, 16);
641 print
'<td class="nowrap">';
642 if ($obj->fk_product > 0) {
643 print $productstatic->getNomUrl(1,
'', 20);
645 print
'<a href="'.DOL_URL_ROOT.
'/contrat/card.php?id='.$obj->fk_contrat.
'">'.img_object($langs->trans(
"ShowService"),
"service");
647 print
' '.dol_trunc($obj->label, 20).
'</a>';
649 print
'</a> '.dol_trunc($obj->note, 20);
653 print
'<td class="tdoverflowmax125">';
654 print $staticcompany->getNomUrl(1,
'', 20);
656 print
'<td width="16" class="right"><a href="line.php?id='.$obj->fk_contrat.
'&ligne='.$obj->cid.
'">';
657 print $staticcontratligne->LibStatut($obj->statut, 3, 1);
664 print
"</table></div>";
666 dol_print_error($db);
672$parameters = array(
'user' => $user);
673$reshook = $hookmanager->executeHooks(
'dashboardContracts', $parameters, $object);
$id
Support class for third parties, contacts, members, users or resources.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage lines of contracts.
Class to manage products or services.
Class to manage third parties objects (customers, suppliers, prospects...)
getThemeBadgeStatusColors()
Return the colors of status badges defined by the current theme (theme_vars.inc.php)
getStatusPieChart($title, $series, $options=array())
Return the HTML table with a pie chart of values by status, as shown on the home page of a module.
dol_now($mode='gmt')
Return date for now.
getDolUserInt($key, $default=0, $tmpuser=null)
Return Dolibarr user constant int value.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
Check permissions of a user to show a page and an object.