28 require
'../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.
'/resource/class/dolresource.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
41 $langs->loadLangs(array(
'resource',
'other',
'interventions'));
51 $hookmanager->initHooks(array(
'element_resource'));
52 $object->available_resources = array(
'dolresource');
56 $element_id =
GETPOST(
'element_id',
'int');
57 $element_ref =
GETPOST(
'ref',
'alpha');
58 $element =
GETPOST(
'element',
'alpha');
59 $action =
GETPOST(
'action',
'alpha');
60 $mode =
GETPOST(
'mode',
'alpha');
61 $lineid =
GETPOST(
'lineid',
'int');
62 $resource_id =
GETPOST(
'fk_resource',
'int');
63 $resource_type =
GETPOST(
'resource_type',
'alpha');
65 $mandatory =
GETPOST(
'mandatory',
'int');
66 $cancel =
GETPOST(
'cancel',
'alpha');
67 $confirm =
GETPOST(
'confirm',
'alpha');
68 $socid =
GETPOST(
'socid',
'int');
70 if (empty($mandatory)) {
82 if (!$user->rights->resource->read) {
87 if ($element ==
'action') {
88 $result =
restrictedArea($user,
'agenda', $element_id,
'actioncomm&societe',
'myactions|allactions',
'fk_soc',
'id');
90 if ($element ==
'fichinter') {
91 $result =
restrictedArea($user,
'ficheinter', $element_id,
'fichinter');
93 if ($element ==
'product' || $element ==
'service') {
95 $tmpobject->fetch($element_id);
96 $fieldtype = $tmpobject->type;
97 $result =
restrictedArea($user,
'produit|service', $element_id,
'product&product',
'',
'', $fieldtype);
105 $parameters = array(
'resource_id' => $resource_id);
106 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
111 if (empty($reshook)) {
114 if ($action ==
'add_element_resource' && !$cancel) {
116 if (!($resource_id > 0)) {
118 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Resource")), null,
'errors');
122 $objstat->element = $element;
126 if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $objstat->element ==
'action' && $resource_type ==
'dolresource' && intval($busy) == 1) {
127 $eventDateStart = $objstat->datep;
128 $eventDateEnd = $objstat->datef;
129 $isFullDayEvent = $objstat->fulldayevent;
130 if (empty($eventDateEnd)) {
131 if ($isFullDayEvent) {
133 $eventDateStart =
dol_mktime(0, 0, 0, $eventDateStartArr[
'mon'], $eventDateStartArr[
'mday'], $eventDateStartArr[
'year']);
134 $eventDateEnd =
dol_mktime(23, 59, 59, $eventDateStartArr[
'mon'], $eventDateStartArr[
'mday'], $eventDateStartArr[
'year']);
138 $sql =
"SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label";
139 $sql .=
" FROM ".MAIN_DB_PREFIX.
"element_resources as er";
140 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"resource as r ON r.rowid = er.resource_id AND er.resource_type = '".$db->escape($resource_type).
"'";
141 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"actioncomm as ac ON ac.id = er.element_id AND er.element_type = '".$db->escape($objstat->element).
"'";
142 $sql .=
" WHERE er.resource_id = ".((int) $resource_id);
143 $sql .=
" AND er.busy = 1";
147 $sql .=
" (ac.datep <= '".$db->idate($eventDateStart).
"' AND (ac.datep2 IS NULL OR ac.datep2 >= '".$db->idate($eventDateStart).
"'))";
149 if (!empty($eventDateEnd)) {
150 $sql .=
" OR (ac.datep <= '".$db->idate($eventDateEnd).
"' AND (ac.datep2 >= '".$db->idate($eventDateEnd).
"'))";
154 $sql .=
"ac.datep >= '".$db->idate($eventDateStart).
"'";
155 if (!empty($eventDateEnd)) {
156 $sql .=
" AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '".$db->idate($eventDateEnd).
"')";
161 $resql = $db->query($sql);
164 $objstat->error = $db->lasterror();
165 $objstat->errors[] = $objstat->error;
167 if ($db->num_rows(
$resql) > 0) {
170 $objstat->error = $langs->trans(
'ErrorResourcesAlreadyInUse').
' : ';
171 while ($obj = $db->fetch_object(
$resql)) {
172 $objstat->error .=
'<br> - '.$langs->trans(
'ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label.
' ['.$obj->ac_id.
']');
174 $objstat->errors[] = $objstat->error;
181 $res = $objstat->add_element_resource($resource_id, $resource_type, $busy, $mandatory);
185 if (!$error && $res > 0) {
186 setEventMessages($langs->trans(
'ResourceLinkedWithSuccess'), null,
'mesgs');
187 header(
"Location: ".$_SERVER[
'PHP_SELF'].
'?element='.$element.
'&element_id='.$objstat->id);
189 } elseif ($objstat) {
195 if ($action ==
'update_linked_resource' && $user->rights->resource->write && !
GETPOST(
'cancel',
'alpha')) {
196 $res = $object->fetch_element_resource($lineid);
198 $object->busy = $busy;
199 $object->mandatory = $mandatory;
201 if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element_type ==
'action' && $object->resource_type ==
'dolresource' && intval($object->busy) == 1) {
202 $eventDateStart = $object->objelement->datep;
203 $eventDateEnd = $object->objelement->datef;
204 $isFullDayEvent = $objstat->fulldayevent;
205 if (empty($eventDateEnd)) {
206 if ($isFullDayEvent) {
208 $eventDateStart =
dol_mktime(0, 0, 0, $eventDateStartArr[
'mon'], $eventDateStartArr[
'mday'], $eventDateStartArr[
'year']);
209 $eventDateEnd =
dol_mktime(23, 59, 59, $eventDateStartArr[
'mon'], $eventDateStartArr[
'mday'], $eventDateStartArr[
'year']);
213 $sql =
"SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label";
214 $sql .=
" FROM ".MAIN_DB_PREFIX.
"element_resources as er";
215 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"resource as r ON r.rowid = er.resource_id AND er.resource_type = '".$db->escape($object->resource_type).
"'";
216 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"actioncomm as ac ON ac.id = er.element_id AND er.element_type = '".$db->escape($object->element_type).
"'";
217 $sql .=
" WHERE er.resource_id = ".((int) $object->resource_id);
218 $sql .=
" AND ac.id <> ".((int) $object->element_id);
219 $sql .=
" AND er.busy = 1";
223 $sql .=
" (ac.datep <= '".$db->idate($eventDateStart).
"' AND (ac.datep2 IS NULL OR ac.datep2 >= '".$db->idate($eventDateStart).
"'))";
225 if (!empty($eventDateEnd)) {
226 $sql .=
" OR (ac.datep <= '".$db->idate($eventDateEnd).
"' AND (ac.datep2 IS NULL OR ac.datep2 >= '".$db->idate($eventDateEnd).
"'))";
230 $sql .=
"ac.datep >= '".$db->idate($eventDateStart).
"'";
231 if (!empty($eventDateEnd)) {
232 $sql .=
" AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '".$db->idate($eventDateEnd).
"')";
237 $resql = $db->query($sql);
240 $object->error = $db->lasterror();
241 $object->errors[] = $object->error;
243 if ($db->num_rows(
$resql) > 0) {
246 $object->error = $langs->trans(
'ErrorResourcesAlreadyInUse').
' : ';
247 while ($obj = $db->fetch_object(
$resql)) {
248 $object->error .=
'<br> - '.$langs->trans(
'ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label.
' ['.$obj->ac_id.
']');
250 $object->errors[] = $objstat->error;
257 $result = $object->update_element_resource($user);
266 setEventMessages($langs->trans(
'RessourceLineSuccessfullyUpdated'), null,
'mesgs');
267 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?element=".$element.
"&element_id=".$element_id);
274 if ($action ==
'confirm_delete_linked_resource' && $user->rights->resource->delete && $confirm ===
'yes') {
275 $result = $object->delete_resource($lineid, $element);
278 setEventMessages($langs->trans(
'RessourceLineSuccessfullyDeleted'), null,
'mesgs');
279 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?element=".$element.
"&element_id=".$element_id);
287 $parameters = array(
'resource_id'=>$resource_id);
288 $reshook = $hookmanager->executeHooks(
'getElementResources', $parameters, $object, $action);
301 $pagetitle = $langs->trans(
'ResourceElementPage');
305 $delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60;
308 $ret = count($object->available_resources);
314 print
'<div class="warning">'.$langs->trans(
'NoResourceInDatabase').
'</div>';
317 if ($action ==
'delete_resource') {
318 print
$form->formconfirm(
"element_resource.php?element=".$element.
"&element_id=".$element_id.
"&id=".$id.
"&lineid=".$lineid, $langs->trans(
"DeleteResource"), $langs->trans(
"ConfirmDeleteResourceElement"),
"confirm_delete_linked_resource",
'',
'', 1);
323 if (($element_id || $element_ref) && $element ==
'action') {
324 require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
327 if (is_object($act)) {
332 $linkback =
img_picto($langs->trans(
"BackToList"),
'object_list',
'class="hideonsmartphone pictoactionview"');
333 $linkback .=
'<a href="'.DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list">'.$langs->trans(
"BackToList").
'</a>';
337 $out .=
'</li><li class="noborder litext">'.img_picto($langs->trans(
"ViewPerUser"),
'object_calendarperuser',
'class="hideonsmartphone pictoactionview"');
338 $out .=
'<a href="'.DOL_URL_ROOT.
'/comm/action/peruser.php?mode=show_peruser&year='.
dol_print_date($act->datep,
'%Y').
'&month='.
dol_print_date($act->datep,
'%m').
'&day='.
dol_print_date($act->datep,
'%d').
'">'.$langs->trans(
"ViewPerUser").
'</a>';
339 $out .=
'</li><li class="noborder litext">'.img_picto($langs->trans(
"ViewCal"),
'object_calendar',
'class="hideonsmartphone pictoactionview"');
340 $out .=
'<a href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_month&year='.
dol_print_date($act->datep,
'%Y').
'&month='.
dol_print_date($act->datep,
'%m').
'&day='.
dol_print_date($act->datep,
'%d').
'">'.$langs->trans(
"ViewCal").
'</a>';
341 $out .=
'</li><li class="noborder litext">'.img_picto($langs->trans(
"ViewWeek"),
'object_calendarweek',
'class="hideonsmartphone pictoactionview"');
342 $out .=
'<a href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_day&year='.
dol_print_date($act->datep,
'%Y').
'&month='.
dol_print_date($act->datep,
'%m').
'&day='.
dol_print_date($act->datep,
'%d').
'">'.$langs->trans(
"ViewWeek").
'</a>';
343 $out .=
'</li><li class="noborder litext">'.img_picto($langs->trans(
"ViewDay"),
'object_calendarday',
'class="hideonsmartphone pictoactionview"');
344 $out .=
'<a href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_day&year='.
dol_print_date($act->datep,
'%Y').
'&month='.
dol_print_date($act->datep,
'%m').
'&day='.
dol_print_date($act->datep,
'%d').
'">'.$langs->trans(
"ViewDay").
'</a>';
348 $morehtmlref =
'<div class="refidno">';
353 $langs->load(
"projects");
355 $morehtmlref .= $langs->trans(
'Project').
': ';
356 if (!empty($act->fk_project)) {
358 $proj->fetch($act->fk_project);
359 $morehtmlref .=
' : '.$proj->getNomUrl(1);
361 $morehtmlref .=
' - '.$proj->title;
367 $morehtmlref .=
'</div>';
369 dol_banner_tab($act,
'element_id', $linkback, ($user->socid ? 0 : 1),
'id',
'ref', $morehtmlref,
'&element='.$element, 0,
'',
'');
371 print
'<div class="fichecenter">';
373 print
'<div class="underbanner clearboth"></div>';
375 print
'<table class="border tableforfield centpercent">';
378 if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
379 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td><td>';
380 print $act->getTypePicto();
381 print $langs->trans(
"Action".$act->type_code);
386 print
'<tr><td class="titlefield">'.$langs->trans(
"EventOnFullDay").
'</td><td colspan="3">'.
yn($act->fulldayevent ? 1 : 0, 3).
'</td></tr>';
389 print
'<tr><td>'.$langs->trans(
"DateActionStart").
'</td><td colspan="3">';
390 if (empty($act->fulldayevent)) {
394 print
dol_print_date($act->datep,
'day', ($tzforfullday ? $tzforfullday :
'tzuser'));
396 if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) {
403 print
'<tr><td>'.$langs->trans(
"DateActionEnd").
'</td><td colspan="3">';
404 if (empty($act->fulldayevent)) {
408 print
dol_print_date($act->datef,
'day', ($tzforfullday ? $tzforfullday :
'tzuser'));
410 if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now - $delay_warning)) {
416 if (empty($conf->global->AGENDA_DISABLE_LOCATION)) {
417 print
'<tr><td>'.$langs->trans(
"Location").
'</td><td colspan="3">'.$act->location.
'</td></tr>';
421 print
'<tr><td class="nowrap">'.$langs->trans(
"ActionAffectedTo").
'</td><td colspan="3">';
422 $listofuserid = array();
423 if (empty($donotclearsession)) {
424 if ($act->userownerid > 0) {
425 $listofuserid[$act->userownerid] = array(
'id'=>$act->userownerid,
'transparency'=>$act->transparency);
427 if (!empty($act->userassigned)) {
429 $tmplist1 = $act->userassigned; $tmplist2 = array();
430 foreach ($tmplist1 as $key => $val) {
431 if ($val[
'id'] && $val[
'id'] != $act->userownerid) {
432 $listofuserid[$val[
'id']] = $val;
436 $_SESSION[
'assignedtouser'] = json_encode($listofuserid);
438 if (!empty($_SESSION[
'assignedtouser'])) {
439 $listofuserid = json_decode($_SESSION[
'assignedtouser'],
true);
442 $listofcontactid = array();
443 $listofotherid = array();
444 print
'<div class="assignedtouser">';
445 print
$form->select_dolusers_forevent(
'view',
'assignedtouser', 1,
'', 0,
'',
'', 0, 0, 0,
'', ($act->datep != $act->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid);
464 if (($element_id || $element_ref) && $element ==
'societe') {
466 if (is_object($socstatic)) {
467 $savobject = $object;
468 $object = $socstatic;
470 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
473 print
dol_get_fiche_head($head,
'resources', $langs->trans(
"ThirdParty"), -1,
'company');
475 dol_banner_tab($socstatic,
'socid',
'', ($user->socid ? 0 : 1),
'rowid',
'nom',
'',
'&element='.$element);
477 print
'<div class="fichecenter">';
479 print
'<div class="underbanner clearboth"></div>';
480 print
'<table class="border centpercent">';
483 print
'<tr><td class="titlefield">'.$langs->trans(
'AliasNames').
'</td><td colspan="3">';
484 print $socstatic->name_alias;
493 $object = $savobject;
498 if (($element_id || $element_ref) && $element ==
'fichinter') {
499 require_once DOL_DOCUMENT_ROOT.
'/core/lib/fichinter.lib.php';
502 $fichinter->fetch($element_id, $element_ref);
503 $fichinter->fetch_thirdparty();
505 if (is_object($fichinter)) {
507 print
dol_get_fiche_head($head,
'resource', $langs->trans(
"InterventionCard"), -1,
'intervention');
510 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fichinter/list.php'.(!empty($socid) ?
'?socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
513 $morehtmlref =
'<div class="refidno">';
518 $morehtmlref .= $langs->trans(
'ThirdParty').
' : '.$fichinter->thirdparty->getNomUrl(1);
521 $langs->load(
"projects");
522 $morehtmlref .=
'<br>'.$langs->trans(
'Project').
' ';
523 if ($user->rights->commande->creer) {
524 if ($action !=
'classify') {
526 $morehtmlref .=
' : ';
528 if ($action ==
'classify') {
530 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$fichinter->id.
'">';
531 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
532 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
533 $morehtmlref .= $formproject->select_projects($fichinter->socid, $fichinter->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
534 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
535 $morehtmlref .=
'</form>';
537 $morehtmlref .=
$form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$fichinter->id, $fichinter->socid, $fichinter->fk_project,
'none', 0, 0, 0, 1);
540 if (!empty($fichinter->fk_project)) {
542 $proj->fetch($fichinter->fk_project);
543 $morehtmlref .=
' : '.$proj->getNomUrl(1);
545 $morehtmlref .=
' - '.$proj->title;
552 $morehtmlref .=
'</div>';
554 dol_banner_tab($fichinter,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'&element='.$element, 0,
'',
'', 1);
561 if (($element_id || $element_ref) && ($element ==
'product' || $element ==
'service')) {
562 require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
565 $product->fetch($element_id, $element_ref);
567 if (is_object($product)) {
569 $titre = $langs->trans(
"CardProduct".$product->type);
575 if ($user->socid && !in_array(
'product', explode(
',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) {
578 dol_banner_tab($product,
'ref',
'', $shownav,
'ref',
'ref',
'',
'&element='.$element);
586 $parameters = array(
'element'=>$element,
'element_id'=>$element_id,
'element_ref'=>$element_ref);
587 $reshook = $hookmanager->executeHooks(
'printElementTab', $parameters, $object, $action);
598 foreach ($object->available_resources as $modresources => $resources) {
599 $resources = (array) $resources;
600 foreach ($resources as $resource_obj) {
606 if (strpos($resource_obj,
'@')) {
607 $path .=
'/'.$element_prop[
'module'];
610 $linked_resources = $object->getElementResources($element, $element_id, $resource_obj);
613 $defaulttpldir =
'/core/tpl';
614 $dirtpls = array_merge($conf->modules_parts[
'tpl'], array($defaulttpldir), array($path.$defaulttpldir));
616 foreach ($dirtpls as $module => $reldir) {
617 if (file_exists(
dol_buildpath($reldir.
'/resource_'.$element_prop[
'element'].
'_add.tpl.php'))) {
618 $tpl =
dol_buildpath($reldir.
'/resource_'.$element_prop[
'element'].
'_add.tpl.php');
620 $tpl = DOL_DOCUMENT_ROOT.$reldir.
'/resource_add.tpl.php';
622 if (empty($conf->file->strict_mode)) {
623 $res = @include $tpl;
632 if ($mode !=
'add' || $resource_obj != $resource_type) {
633 foreach ($dirtpls as $module => $reldir) {
634 if (file_exists(
dol_buildpath($reldir.
'/resource_'.$element_prop[
'element'].
'_view.tpl.php'))) {
635 $tpl =
dol_buildpath($reldir.
'/resource_'.$element_prop[
'element'].
'_view.tpl.php');
637 $tpl = DOL_DOCUMENT_ROOT.$reldir.
'/resource_view.tpl.php';
639 if (empty($conf->file->strict_mode)) {
640 $res = @include $tpl;
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm= 'auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
Class to manage products or services.
Class to manage interventions.
dol_now($mode= 'auto')
Return date for now.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default= '')
Return dolibarr global constant string value.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
const TYPE_SERVICE
Service.
fichinter_prepare_head($object)
Prepare array with list of tabs.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
actions_prepare_head($object)
Prepare array with list of tabs.
img_warning($titlealt= 'default', $moreatt= '', $morecss= 'pictowarning')
Show warning logo.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage projects.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_getdate($timestamp, $fast=false, $forcetimezone= '')
Return an array with locale date info.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
restrictedArea($user, $features, $objectid=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.
if(isModEnabled('facture')&&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur')&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)&&$user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice')&&$user->rights->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->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
getElementProperties($element_type)
Get an array with properties of an element.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
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_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
isModEnabled($module)
Is Dolibarr module enabled.
dol_banner_tab($object, $paramid, $morehtml= '', $shownav=1, $fieldid= 'rowid', $fieldref= 'ref', $morehtmlref= '', $moreparam= '', $nodbprefix=0, $morehtmlleft= '', $morehtmlstatus= '', $onlybanner=0, $morehtmlright= '')
Show tab footer of a card.
fetchObjectByElement($element_id, $element_type, $element_ref= '')
Fetch an object from its id and element_type Inclusion of classes is automatic.
product_prepare_head($object)
Prepare array with list of tabs.