28 require
"../main.inc.php";
29 require_once DOL_DOCUMENT_ROOT.
"/contrat/class/contrat.class.php";
30 require_once DOL_DOCUMENT_ROOT.
"/product/class/product.class.php";
35 $hookmanager->initHooks(array(
'contractindex'));
38 $langs->loadLangs(array(
'products',
'companies',
'contracts'));
40 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
41 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
49 if (!empty($user->socid)) {
50 $socid = $user->socid;
54 $staticcompany =
new Societe($db);
55 $staticcontrat =
new Contrat($db);
57 $productstatic =
new Product($db);
73 $title = $langs->trans(
"ContractsArea");
81 print
'<div class="fichecenter"><div class="fichethirdleft">';
91 $dataseries = array();
95 $sql =
"SELECT count(cd.rowid) as nb, cd.statut as status";
96 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
97 $sql .=
", ".MAIN_DB_PREFIX.
"contratdet as cd, ".MAIN_DB_PREFIX.
"contrat as c";
98 if (empty($user->rights->societe->client->voir) && !$socid) {
99 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
101 $sql .=
" WHERE cd.fk_contrat = c.rowid AND c.fk_soc = s.rowid";
102 $sql .=
" AND (cd.statut != 4 OR (cd.statut = 4 AND (cd.date_fin_validite is null or cd.date_fin_validite >= '".$db->idate($now).
"')))";
103 $sql .=
" AND c.entity IN (".getEntity(
'contract', 0).
")";
105 $sql .=
' AND c.fk_soc = '.((int) $user->socid);
107 if (empty($user->rights->societe->client->voir) && !$socid) {
108 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
110 $sql .=
" GROUP BY cd.statut";
111 $resql = $db->query($sql);
113 $num = $db->num_rows(
$resql);
116 $obj = $db->fetch_object(
$resql);
118 $nb[$obj->status] = $obj->nb;
119 if ($obj->status != 5) {
120 $vals[$obj->status] = $obj->nb;
121 $totalinprocess += $obj->nb;
132 $sql =
"SELECT count(cd.rowid) as nb, cd.statut as status";
133 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s";
134 $sql .=
", ".MAIN_DB_PREFIX.
"contratdet as cd, ".MAIN_DB_PREFIX.
"contrat as c";
135 if (empty($user->rights->societe->client->voir) && !$socid) {
136 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
138 $sql .=
" WHERE cd.fk_contrat = c.rowid AND c.fk_soc = s.rowid";
139 $sql .=
" AND (cd.statut = 4 AND cd.date_fin_validite < '".$db->idate($now).
"')";
140 $sql .=
" AND c.entity IN (".getEntity(
'contract', 0).
")";
142 $sql .=
' AND c.fk_soc = '.((int) $user->socid);
144 if (empty($user->rights->societe->client->voir) && !$socid) {
145 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
147 $sql .=
" GROUP BY cd.statut";
148 $resql = $db->query($sql);
150 $num = $db->num_rows(
$resql);
155 $obj = $db->fetch_object(
$resql);
157 $nb[$obj->status.true] = $obj->nb;
158 if ($obj->status != 5) {
159 $vals[$obj->status.true] = $obj->nb;
160 $totalinprocess += $obj->nb;
171 $colorseries = array();
173 include DOL_DOCUMENT_ROOT.
'/theme/'.$conf->theme.
'/theme_vars.inc.php';
175 print
'<div class="div-table-responsive-no-min">';
176 print
'<table class="noborder nohover centpercent">';
177 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"Statistics").
' - '.$langs->trans(
"Services").
'</th></tr>'.
"\n";
178 $listofstatus = array(0, 4, 4, 5); $bool =
false;
179 foreach ($listofstatus as $status) {
180 $dataseries[] = array($staticcontratligne->LibStatut($status, 1, ($bool ? 1 : 0)), (isset($nb[$status.$bool]) ? (
int) $nb[$status.$bool] : 0));
181 if ($status == ContratLigne::STATUS_INITIAL) {
182 $colorseries[$status.$bool] =
'-'.$badgeStatus0;
184 if ($status == ContratLigne::STATUS_OPEN && !$bool) {
185 $colorseries[$status.$bool] = $badgeStatus4;
187 if ($status == ContratLigne::STATUS_OPEN && $bool) {
188 $colorseries[$status.$bool] = $badgeStatus1;
190 if ($status == ContratLigne::STATUS_CLOSED) {
191 $colorseries[$status.$bool] = $badgeStatus6;
194 if (empty($conf->use_javascript_ajax)) {
195 print
'<tr class="oddeven">';
196 print
'<td>'.$staticcontratligne->LibStatut($status, 0, ($bool ? 1 : 0)).
'</td>';
197 print
'<td class="right"><a href="services_list.php?mode='.$status.($bool ?
'&filter=expired' :
'').
'">'.($nb[$status.$bool] ? $nb[$status.$bool] : 0).
' '.$staticcontratligne->LibStatut($status, 3, ($bool ? 1 : 0)).
'</a></td>';
200 if ($status == 4 && !$bool) {
206 if (!empty($conf->use_javascript_ajax)) {
207 print
'<tr class="impair"><td class="center" colspan="2">';
209 include_once DOL_DOCUMENT_ROOT.
'/core/class/dolgraph.class.php';
211 $dolgraph->SetData($dataseries);
212 $dolgraph->SetDataColor(array_values($colorseries));
213 $dolgraph->setShowLegend(2);
214 $dolgraph->setShowPercent(1);
215 $dolgraph->SetType(array(
'pie'));
216 $dolgraph->setHeight(
'200');
217 $dolgraph->draw(
'idgraphstatus');
218 print $dolgraph->show($total ? 0 : 1);
222 $listofstatus = array(0, 4, 4, 5); $bool =
false;
223 foreach ($listofstatus as $status) {
224 if (empty($conf->use_javascript_ajax)) {
225 print
'<tr class="oddeven">';
226 print
'<td>'.$staticcontratligne->LibStatut($status, 0, ($bool ? 1 : 0)).
'</td>';
227 print
'<td class="right"><a href="services_list.php?mode='.$status.($bool ?
'&filter=expired' :
'').
'">'.($nb[$status.$bool] ? $nb[$status.$bool] : 0).
' '.$staticcontratligne->LibStatut($status, 3, ($bool ? 1 : 0)).
'</a></td>';
228 if ($status == 4 && !$bool) {
236 print
'<tr class="liste_total"><td>'.$langs->trans(
"Total").
'</td><td class="right">'.$total.
'</td></tr>';
237 print
"</table></div><br>";
242 if (
isModEnabled(
'contrat') && $user->rights->contrat->lire) {
243 $sql =
"SELECT c.rowid, c.ref,";
244 $sql .=
" s.nom as name, s.rowid as socid";
245 $sql .=
" FROM ".MAIN_DB_PREFIX.
"contrat as c, ".MAIN_DB_PREFIX.
"societe as s";
246 if (empty($user->rights->societe->client->voir) && !$socid) {
247 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
249 $sql .=
" WHERE s.rowid = c.fk_soc";
250 $sql .=
" AND c.entity IN (".getEntity(
'contract', 0).
")";
251 $sql .=
" AND c.statut = 0";
252 if (empty($user->rights->societe->client->voir) && !$socid) {
253 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
256 $sql .=
" AND c.fk_soc = ".((int) $socid);
259 $resql = $db->query($sql);
262 $num = $db->num_rows(
$resql);
264 print
'<div class="div-table-responsive-no-min">';
265 print
'<table class="noborder centpercent">';
266 print
'<tr class="liste_titre">';
267 print
'<th colspan="3">'.$langs->trans(
"DraftContracts").($num ?
'<span class="badge marginleftonlyshort">'.$num.
'</span>' :
'').
'</th></tr>';
269 $companystatic =
new Societe($db);
274 $obj = $db->fetch_object(
$resql);
276 $staticcontrat->ref = $obj->ref;
277 $staticcontrat->id = $obj->rowid;
279 $companystatic->id = $obj->socid;
280 $companystatic->name = $obj->name;
281 $companystatic->client = 1;
283 print
'<tr class="oddeven"><td class="nowrap">';
284 print $staticcontrat->getNomUrl(1,
'');
287 print $companystatic->getNomUrl(1,
'', 16);
294 print
'<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans(
"NoContracts").
'</td></tr>';
296 print
"</table></div><br>";
304 print
'</div><div class="fichetwothirdright">';
310 $sql .=
" sum(".$db->ifsql(
"cd.statut=0", 1, 0).
') as nb_initial,';
311 $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,';
312 $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,';
313 $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,';
314 $sql .=
" sum(".$db->ifsql(
"cd.statut=5", 1, 0).
') as nb_closed,';
315 $sql .=
" c.rowid as cid, c.ref, c.datec, c.tms, c.statut, s.nom as name, s.rowid as socid";
316 $sql .=
" FROM ".MAIN_DB_PREFIX.
"societe as s,";
317 if (empty($user->rights->societe->client->voir) && !$socid) {
318 $sql .=
" ".MAIN_DB_PREFIX.
"societe_commerciaux as sc,";
320 $sql .=
" ".MAIN_DB_PREFIX.
"contrat as c";
321 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"contratdet as cd ON c.rowid = cd.fk_contrat";
322 $sql .=
" WHERE c.fk_soc = s.rowid";
323 $sql .=
" AND c.entity IN (".getEntity(
'contract', 0).
")";
324 $sql .=
" AND c.statut > 0";
325 if (empty($user->rights->societe->client->voir) && !$socid) {
326 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
329 $sql .=
" AND s.rowid = ".((int) $socid);
331 $sql .=
" GROUP BY c.rowid, c.ref, c.datec, c.tms, c.statut, s.nom, s.rowid";
332 $sql .=
" ORDER BY c.tms DESC";
333 $sql .= $db->plimit($max);
336 $result = $db->query($sql);
338 $num = $db->num_rows($result);
341 print
'<div class="div-table-responsive-no-min">';
342 print
'<table class="noborder centpercent">';
344 print
'<tr class="liste_titre"><th colspan="2">'.$langs->trans(
"LastContracts", 5).
'</th>';
345 print
'<th class="center">'.$langs->trans(
"DateModification").
'</th>';
347 print
'<th class="center" width="80" colspan="4">'.$langs->trans(
"Services").
'</th>';
351 $obj = $db->fetch_object($result);
352 $datem = $db->jdate($obj->tms);
354 $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->cid);
355 $staticcontrat->id = $obj->cid;
357 $staticcompany->id = $obj->socid;
358 $staticcompany->name = $obj->name;
360 print
'<tr class="oddeven">';
361 print
'<td class="nowraponall">';
362 print $staticcontrat->getNomUrl(1, 16);
368 print
'<td class="tdoverflowmax150">';
369 print $staticcompany->getNomUrl(1,
'', 20);
371 print
'<td class="center nowraponall" title="'.dol_escape_htmltag($langs->trans(
"DateModification").
': '.
dol_print_date($datem,
'dayhour',
'tzuserrel')).
'">';
375 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>';
376 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>';
377 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>';
378 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>';
384 print
"</table></div>";
392 $sql =
"SELECT c.ref, c.fk_soc, ";
393 $sql .=
" cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat, cd.date_fin_validite,";
394 $sql .=
" s.nom as name,";
395 $sql .=
" p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity";
396 $sql .=
" FROM (".MAIN_DB_PREFIX.
"contrat as c";
397 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
398 if (empty($user->rights->societe->client->voir) && !$socid) {
399 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
401 $sql .=
", ".MAIN_DB_PREFIX.
"contratdet as cd";
402 $sql .=
") LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON cd.fk_product = p.rowid";
403 $sql .=
" WHERE c.entity IN (".getEntity(
'contract', 0).
")";
404 $sql .=
" AND cd.fk_contrat = c.rowid";
405 $sql .=
" AND c.fk_soc = s.rowid";
406 if (empty($user->rights->societe->client->voir) && !$socid) {
407 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
410 $sql .=
" AND s.rowid = ".((int) $socid);
412 $sql .=
" ORDER BY cd.tms DESC";
414 $resql = $db->query($sql);
416 $num = $db->num_rows(
$resql);
419 print
'<div class="div-table-responsive-no-min">';
420 print
'<table class="noborder centpercent">';
422 print
'<tr class="liste_titre"><th colspan="4">'.$langs->trans(
"LastModifiedServices", $max).
'</th>';
425 while ($i < min($num, $max)) {
426 $obj = $db->fetch_object(
$resql);
428 print
'<tr class="oddeven">';
429 print
'<td class="nowraponall">';
430 $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat);
431 $staticcontrat->id = $obj->fk_contrat;
432 print $staticcontrat->getNomUrl(1, 16);
436 if ($obj->fk_product > 0) {
437 $productstatic->id = $obj->fk_product;
438 $productstatic->type = $obj->ptype;
439 $productstatic->ref = $obj->pref;
440 $productstatic->entity = $obj->pentity;
441 print $productstatic->getNomUrl(1,
'', 20);
443 print
'<a href="'.DOL_URL_ROOT.
'/contrat/card.php?id='.$obj->fk_contrat.
'">'.
img_object($langs->trans(
"ShowService"),
"service");
445 print
' '.dol_trunc($obj->label, 20).
'</a>';
447 print
'</a> '.dol_trunc($obj->note, 20);
451 print
'<td class="tdoverflowmax125">';
452 $staticcompany->id = $obj->fk_soc;
453 $staticcompany->name = $obj->name;
454 print $staticcompany->getNomUrl(1,
'', 20);
456 print
'<td class="nowrap right"><a href="'.DOL_URL_ROOT.
'/contrat/card.php?id='.$obj->fk_contrat.
'&ligne='.$obj->cid.
'">';
457 $dateend = $db->jdate($obj->date_fin_validite);
458 print $staticcontratligne->LibStatut($obj->statut, 3, ($dateend && $dateend < $now) ? 1 : 0);
465 print
"</table></div>";
473 $sql =
"SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,";
474 $sql .=
" s.nom as name,";
475 $sql .=
" p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity";
476 $sql .=
" FROM (".MAIN_DB_PREFIX.
"contrat as c";
477 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
478 if (empty($user->rights->societe->client->voir) && !$socid) {
479 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
481 $sql .=
", ".MAIN_DB_PREFIX.
"contratdet as cd";
482 $sql .=
" ) LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON cd.fk_product = p.rowid";
483 $sql .=
" WHERE c.entity IN (".getEntity(
'contract', 0).
")";
484 $sql .=
" AND c.statut = 1";
485 $sql .=
" AND cd.statut = 0";
486 $sql .=
" AND cd.fk_contrat = c.rowid";
487 $sql .=
" AND c.fk_soc = s.rowid";
488 if (empty($user->rights->societe->client->voir) && !$socid) {
489 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
492 $sql .=
" AND s.rowid = ".((int) $socid);
494 $sql .=
" ORDER BY cd.tms DESC";
496 $resql = $db->query($sql);
498 $num = $db->num_rows(
$resql);
501 print
'<div class="div-table-responsive-no-min">';
502 print
'<table class="noborder centpercent">';
504 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>';
508 $obj = $db->fetch_object(
$resql);
510 print
'<tr class="oddeven">';
512 print
'<td class="nowraponall">';
513 $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat);
514 $staticcontrat->id = $obj->fk_contrat;
515 print $staticcontrat->getNomUrl(1, 16);
517 print
'<td class="nowrap">';
518 if ($obj->fk_product > 0) {
519 $productstatic->id = $obj->fk_product;
520 $productstatic->type = $obj->ptype;
521 $productstatic->ref = $obj->pref;
522 $productstatic->entity = $obj->pentity;
523 print $productstatic->getNomUrl(1,
'', 20);
525 print
'<a href="'.DOL_URL_ROOT.
'/contrat/card.php?id='.$obj->fk_contrat.
'">'.
img_object($langs->trans(
"ShowService"),
"service");
527 print
' '.dol_trunc($obj->label, 20).
'</a>';
529 print
'</a> '.dol_trunc($obj->note, 20);
533 print
'<td class="tdoverflowmax125">';
534 $staticcompany->id = $obj->fk_soc;
535 $staticcompany->name = $obj->name;
536 print $staticcompany->getNomUrl(1,
'', 20);
538 print
'<td width="16" class="right"><a href="line.php?id='.$obj->fk_contrat.
'&ligne='.$obj->cid.
'">';
539 print $staticcontratligne->LibStatut($obj->statut, 3);
547 print
"</table></div>";
555 $sql =
"SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,";
556 $sql .=
" s.nom as name,";
557 $sql .=
" p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype, p.entity as pentity";
558 $sql .=
" FROM (".MAIN_DB_PREFIX.
"contrat as c";
559 $sql .=
", ".MAIN_DB_PREFIX.
"societe as s";
560 if (empty($user->rights->societe->client->voir) && !$socid) {
561 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
563 $sql .=
", ".MAIN_DB_PREFIX.
"contratdet as cd";
564 $sql .=
" ) LEFT JOIN ".MAIN_DB_PREFIX.
"product as p ON cd.fk_product = p.rowid";
565 $sql .=
" WHERE c.entity IN (".getEntity(
'contract', 0).
")";
566 $sql .=
" AND c.statut = 1";
567 $sql .=
" AND cd.statut = 4";
568 $sql .=
" AND cd.date_fin_validite < '".$db->idate($now).
"'";
569 $sql .=
" AND cd.fk_contrat = c.rowid";
570 $sql .=
" AND c.fk_soc = s.rowid";
571 if (empty($user->rights->societe->client->voir) && !$socid) {
572 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
575 $sql .=
" AND s.rowid = ".((int) $socid);
577 $sql .=
" ORDER BY cd.tms DESC";
579 $resql = $db->query($sql);
581 $num = $db->num_rows(
$resql);
584 print
'<div class="div-table-responsive-no-min">';
585 print
'<table class="noborder centpercent">';
587 print
'<tr class="liste_titre"><th colspan="4">'.$langs->trans(
"ListOfExpiredServices").
' <a href="'.DOL_URL_ROOT.
'/contrat/services_list.php?mode=4&filter=expired"><span class="badge">'.$num.
'</span></a></th>';
591 $obj = $db->fetch_object(
$resql);
593 print
'<tr class="oddeven">';
595 print
'<td class="nowraponall">';
596 $staticcontrat->ref = ($obj->ref ? $obj->ref : $obj->fk_contrat);
597 $staticcontrat->id = $obj->fk_contrat;
598 print $staticcontrat->getNomUrl(1, 16);
600 print
'<td class="nowrap">';
601 if ($obj->fk_product > 0) {
602 $productstatic->id = $obj->fk_product;
603 $productstatic->type = $obj->ptype;
604 $productstatic->ref = $obj->pref;
605 $productstatic->entity = $obj->pentity;
606 print $productstatic->getNomUrl(1,
'', 20);
608 print
'<a href="'.DOL_URL_ROOT.
'/contrat/card.php?id='.$obj->fk_contrat.
'">'.
img_object($langs->trans(
"ShowService"),
"service");
610 print
' '.dol_trunc($obj->label, 20).
'</a>';
612 print
'</a> '.dol_trunc($obj->note, 20);
616 print
'<td class="tdoverflowmax125">';
617 $staticcompany->id = $obj->fk_soc;
618 $staticcompany->name = $obj->name;
619 print $staticcompany->getNomUrl(1,
'', 20);
621 print
'<td width="16" class="right"><a href="line.php?id='.$obj->fk_contrat.
'&ligne='.$obj->cid.
'">';
622 print $staticcontratligne->LibStatut($obj->statut, 3, 1);
629 print
"</table></div>";
635 print
'</div></div>';
637 $parameters = array(
'user' => $user);
638 $reshook = $hookmanager->executeHooks(
'dashboardContracts', $parameters, $object);
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
Class to manage contracts.
Class to manage lines of contracts.
Class to manage products or services.
Class to manage third parties objects (customers, suppliers, prospects...)
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
if(!defined('NOTOKENRENEWAL')) if(!defined('NOLOGIN')) if(!defined('NOCSRFCHECK')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) if(!defined('NOIPCHECK')) if(!defined('NOBROWSERNOTIF')) llxHeader()
Header empty.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.