31require
'../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/resource/class/dolresource.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
35if (isModEnabled(
'project')) {
36 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
39if (isModEnabled(
"product") || isModEnabled(
"service")) {
40 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
44$langs->loadLangs(array(
'resource',
'other',
'interventions'));
54$hookmanager->initHooks(array(
'element_resource'));
55$object->available_resources = array(
'dolresource');
60$element_ref =
GETPOST(
'ref',
'alpha');
61$element =
GETPOST(
'element',
'alpha');
62$action =
GETPOST(
'action',
'alpha');
63$mode =
GETPOST(
'mode',
'alpha');
66$resource_type =
GETPOST(
'resource_type',
'alpha');
69$cancel =
GETPOST(
'cancel',
'alpha');
70$confirm =
GETPOST(
'confirm',
'alpha');
73if (empty($mandatory)) {
85if (!$user->hasRight(
'resource',
'read')) {
90if ($element ==
'action') {
91 $result =
restrictedArea($user,
'agenda', $element_id,
'actioncomm&societe',
'myactions|allactions',
'fk_soc',
'id');
93if ($element ==
'fichinter') {
94 $result =
restrictedArea($user,
'ficheinter', $element_id,
'fichinter');
96if ($element ==
'product' || $element ==
'service') {
98 $tmpobject->fetch($element_id);
99 $fieldtype = $tmpobject->type;
100 $result =
restrictedArea($user,
'produit|service', $element_id,
'product&product',
'',
'', (
string) $fieldtype);
108$parameters = array(
'resource_id' => $resource_id);
109$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
114if (empty($reshook)) {
118 if ($action ==
'add_element_resource' && !$cancel) {
120 if (!($resource_id > 0)) {
122 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Resource")),
null,
'errors');
126 $objstat->element = $element;
130 if (
getDolGlobalString(
'RESOURCE_USED_IN_EVENT_CHECK') && $objstat->element ==
'action' && $resource_type ==
'dolresource' && intval($busy) == 1) {
131 $eventDateStart = $objstat->datep;
132 $eventDateEnd = $objstat->datef;
133 $isFullDayEvent = $objstat->fulldayevent;
134 if (empty($eventDateEnd)) {
135 if ($isFullDayEvent) {
137 $eventDateStart =
dol_mktime(0, 0, 0, $eventDateStartArr[
'mon'], $eventDateStartArr[
'mday'], $eventDateStartArr[
'year']);
138 $eventDateEnd =
dol_mktime(23, 59, 59, $eventDateStartArr[
'mon'], $eventDateStartArr[
'mday'], $eventDateStartArr[
'year']);
142 $sql =
"SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label";
143 $sql .=
" FROM ".MAIN_DB_PREFIX.
"element_resources as er";
144 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"resource as r ON r.rowid = er.resource_id AND er.resource_type = '".$db->escape($resource_type).
"'";
145 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"actioncomm as ac ON ac.id = er.element_id AND er.element_type = '".$db->escape($objstat->element).
"'";
146 $sql .=
" WHERE er.resource_id = ".((int) $resource_id);
147 $sql .=
" AND er.busy = 1";
151 $sql .=
" (ac.datep <= '".$db->idate($eventDateStart).
"' AND (ac.datep2 IS NULL OR ac.datep2 >= '".$db->idate($eventDateStart).
"'))";
153 if (!empty($eventDateEnd)) {
154 $sql .=
" OR (ac.datep <= '".$db->idate($eventDateEnd).
"' AND (ac.datep2 >= '".$db->idate($eventDateEnd).
"'))";
158 $sql .=
"ac.datep >= '".$db->idate($eventDateStart).
"'";
159 if (!empty($eventDateEnd)) {
160 $sql .=
" AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '".$db->idate($eventDateEnd).
"')";
165 $resql = $db->query($sql);
168 $objstat->error = $db->lasterror();
169 $objstat->errors[] = $objstat->error;
171 if ($db->num_rows($resql) > 0) {
174 $objstat->error = $langs->trans(
'ErrorResourcesAlreadyInUse').
' : ';
175 while ($obj = $db->fetch_object($resql)) {
176 $objstat->error .=
'<br> - '.$langs->trans(
'ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label.
' ['.$obj->ac_id.
']');
178 $objstat->errors[] = $objstat->error;
185 $res = $objstat->add_element_resource($resource_id, $resource_type, $busy, $mandatory);
189 if (!$error && $res > 0 && is_object($objstat)) {
190 setEventMessages($langs->trans(
'ResourceLinkedWithSuccess'),
null,
'mesgs');
191 header(
"Location: ".$_SERVER[
'PHP_SELF'].
'?element='.$element.
'&element_id='.$objstat->id);
193 } elseif ($objstat) {
199 if ($action ==
'update_linked_resource' && $user->hasRight(
'resource',
'write') && !
GETPOST(
'cancel',
'alpha') && is_object($objstat)) {
200 $res =
$object->fetchElementResource($lineid);
203 $object->mandatory = $mandatory;
206 $eventDateStart =
$object->objelement->datep;
207 $eventDateEnd =
$object->objelement->datef;
208 $isFullDayEvent = $objstat->fulldayevent;
209 if (empty($eventDateEnd)) {
210 if ($isFullDayEvent) {
212 $eventDateStart =
dol_mktime(0, 0, 0, $eventDateStartArr[
'mon'], $eventDateStartArr[
'mday'], $eventDateStartArr[
'year']);
213 $eventDateEnd =
dol_mktime(23, 59, 59, $eventDateStartArr[
'mon'], $eventDateStartArr[
'mday'], $eventDateStartArr[
'year']);
217 $sql =
"SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label";
218 $sql .=
" FROM ".MAIN_DB_PREFIX.
"element_resources as er";
219 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"resource as r ON r.rowid = er.resource_id AND er.resource_type = '".$db->escape(
$object->resource_type).
"'";
220 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"actioncomm as ac ON ac.id = er.element_id AND er.element_type = '".$db->escape(
$object->element_type).
"'";
221 $sql .=
" WHERE er.resource_id = ".((int)
$object->resource_id);
222 $sql .=
" AND ac.id <> ".((int)
$object->element_id);
223 $sql .=
" AND er.busy = 1";
227 $sql .=
" (ac.datep <= '".$db->idate($eventDateStart).
"' AND (ac.datep2 IS NULL OR ac.datep2 >= '".$db->idate($eventDateStart).
"'))";
229 if (!empty($eventDateEnd)) {
230 $sql .=
" OR (ac.datep <= '".$db->idate($eventDateEnd).
"' AND (ac.datep2 IS NULL OR ac.datep2 >= '".$db->idate($eventDateEnd).
"'))";
234 $sql .=
"ac.datep >= '".$db->idate($eventDateStart).
"'";
235 if (!empty($eventDateEnd)) {
236 $sql .=
" AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '".$db->idate($eventDateEnd).
"')";
241 $resql = $db->query($sql);
244 $object->error = $db->lasterror();
247 if ($db->num_rows($resql) > 0) {
250 $object->error = $langs->trans(
'ErrorResourcesAlreadyInUse').
' : ';
251 while ($obj = $db->fetch_object($resql)) {
252 $object->error .=
'<br> - '.$langs->trans(
'ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label.
' ['.$obj->ac_id.
']');
254 $object->errors[] = $objstat->error;
261 $result =
$object->updateElementResource($user);
270 setEventMessages($langs->trans(
'RessourceLineSuccessfullyUpdated'),
null,
'mesgs');
271 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?element=".$element.
"&element_id=".$element_id);
278 if ($action ==
'confirm_delete_linked_resource' && $user->hasRight(
'resource',
'delete') && $confirm ===
'yes') {
279 $result =
$object->delete_resource($lineid, $element);
282 setEventMessages($langs->trans(
'RessourceLineSuccessfullyDeleted'),
null,
'mesgs');
283 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?element=".$element.
"&element_id=".$element_id);
291$parameters = array(
'resource_id' => $resource_id);
292$reshook = $hookmanager->executeHooks(
'getElementResources', $parameters, $object, $action);
303$form =
new Form($db);
305$pagetitle = $langs->trans(
'ResourceElementPage');
307llxHeader(
'', $pagetitle, $help_url,
'', 0, 0,
'',
'',
'',
'mod-resource page-element_resource');
310$delay_warning =
getDolGlobalInt(
'MAIN_DELAY_ACTIONS_TODO') * 24 * 60 * 60;
313$ret = count(
$object->available_resources);
319 print
'<div class="warning">'.$langs->trans(
'NoResourceInDatabase').
'</div>';
322 if ($action ==
'delete_resource') {
323 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);
328 if (($element_id || $element_ref) && $element ==
'action') {
329 require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
332 $hookmanager->initHooks(array(
'actioncard',
'globalcard'));
335 if (is_object($act)) {
336 '@phan-var-force ActionComm $act';
341 $linkback =
'<a href="'.DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">';
342 $linkback .=
img_picto($langs->trans(
"BackToList"),
'object_calendarlist',
'class="pictoactionview pictofixedwidth"');
343 $linkback .=
'<span class="hideonsmartphone">'.$langs->trans(
"BackToList").
'</span>';
348 $out .=
'</li><li class="noborder litext">';
350 $out .=
img_picto($langs->trans(
"ViewCal"),
'object_calendar',
'class="pictofixedwidth pictoactionview"');
351 $out .=
'<span class="hideonsmartphone">'.$langs->trans(
"ViewCal").
'</span>';
353 $out .=
'</li><li class="noborder litext">';
355 $out .=
img_picto($langs->trans(
"ViewWeek"),
'object_calendarweek',
'class="pictofixedwidth pictoactionview"');
356 $out .=
'<span class="hideonsmartphone">'.$langs->trans(
"ViewWeek").
'</span>';
358 $out .=
'</li><li class="noborder litext">';
360 $out .=
img_picto($langs->trans(
"ViewDay"),
'object_calendarday',
'class="pictofixedwidth pictoactionview"');
361 $out .=
'<span class="hideonsmartphone">'.$langs->trans(
"ViewDay").
'</span>';
363 $out .=
'</li><li class="noborder litext">';
364 $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').
'">';
365 $out .=
img_picto($langs->trans(
"ViewPerUser"),
'object_calendarperuser',
'class="pictofixedwidth pictoactionview"');
366 $out .=
'<span class="hideonsmartphone">'.$langs->trans(
"ViewPerUser").
'</span>';
370 $parameters = array();
371 $reshook = $hookmanager->executeHooks(
'addCalendarView', $parameters, $object, $action);
372 if (empty($reshook)) {
373 $out .= $hookmanager->resPrint;
374 } elseif ($reshook > 1) {
375 $out = $hookmanager->resPrint;
380 $morehtmlref =
'<div class="refidno">';
386 if (isModEnabled(
'project')) {
387 $langs->load(
"projects");
390 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
391 if ($action !=
'classify') {
392 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
394 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->socid,
$object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
396 if (!empty(
$object->fk_project)) {
398 $proj->fetch(
$object->fk_project);
399 $morehtmlref .= $proj->getNomUrl(1);
401 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
407 $morehtmlref .=
'</div>';
409 dol_banner_tab($act,
'element_id', $linkback, ($user->socid ? 0 : 1),
'id',
'ref', $morehtmlref,
'&element='.$element, 0,
'',
'');
411 print
'<div class="fichecenter">';
413 print
'<div class="underbanner clearboth"></div>';
415 print
'<table class="border tableforfield centpercent">';
419 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td><td>';
420 print $act->getTypePicto();
421 print $langs->trans(
"Action".$act->type_code);
426 print
'<tr><td class="titlefield">'.$langs->trans(
"EventOnFullDay").
'</td><td colspan="3">'.
yn($act->fulldayevent ? 1 : 0, 3).
'</td></tr>';
429 print
'<tr><td>'.$langs->trans(
"DateActionStart").
'</td><td colspan="3">';
430 if (empty($act->fulldayevent)) {
434 print
dol_print_date($act->datep,
'day', ($tzforfullday ? $tzforfullday :
'tzuser'));
436 if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) {
443 print
'<tr><td>'.$langs->trans(
"DateActionEnd").
'</td><td colspan="3">';
444 if (empty($act->fulldayevent)) {
448 print
dol_print_date($act->datef,
'day', ($tzforfullday ? $tzforfullday :
'tzuser'));
450 if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now - $delay_warning)) {
457 print
'<tr><td>'.$langs->trans(
"Location").
'</td><td colspan="3">'.$act->location.
'</td></tr>';
461 print
'<tr><td class="nowrap">'.$langs->trans(
"ActionAffectedTo").
'</td><td colspan="3">';
462 $listofuserid = array();
463 if (empty($donotclearsession)) {
464 if ($act->userownerid > 0) {
465 $listofuserid[$act->userownerid] = array(
'id' => $act->userownerid,
'transparency' => $act->transparency);
467 if (!empty($act->userassigned)) {
469 $tmplist1 = $act->userassigned;
471 foreach ($tmplist1 as $key => $val) {
472 if ($val[
'id'] && $val[
'id'] != $act->userownerid) {
473 $listofuserid[$val[
'id']] = $val;
477 $_SESSION[
'assignedtouser'] = json_encode($listofuserid);
479 if (!empty($_SESSION[
'assignedtouser'])) {
480 $listofuserid = json_decode($_SESSION[
'assignedtouser'],
true);
483 $listofcontactid = array();
484 $listofotherid = array();
485 print
'<div class="assignedtouser">';
486 print $form->select_dolusers_forevent(
'view',
'assignedtouser', 1, array(), 0,
'', array(), 0, 0, 0,
'', ($act->datep != $act->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid);
505 if (($element_id || $element_ref) && $element ==
'societe') {
507 if (is_object($socstatic)) {
508 '@phan-var-force Societe $socstatic';
513 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
516 print
dol_get_fiche_head($head,
'resources', $langs->trans(
"ThirdParty"), -1,
'company');
518 dol_banner_tab($socstatic,
'socid',
'', ($user->socid ? 0 : 1),
'rowid',
'nom',
'',
'&element='.$element);
520 print
'<div class="fichecenter">';
522 print
'<div class="underbanner clearboth"></div>';
523 print
'<table class="border centpercent">';
526 print
'<tr><td class="titlefield">'.$langs->trans(
'AliasNames').
'</td><td colspan="3">';
527 print $socstatic->name_alias;
541 if (($element_id || $element_ref) && $element ==
'fichinter') {
542 require_once DOL_DOCUMENT_ROOT.
'/core/lib/fichinter.lib.php';
545 $fichinter->fetch($element_id, $element_ref);
546 $fichinter->fetch_thirdparty();
548 $usercancreate = $user->hasRight(
'fichinter',
'creer');
550 if (is_object($fichinter)) {
552 print
dol_get_fiche_head($head,
'resource', $langs->trans(
"InterventionCard"), -1,
'intervention');
555 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fichinter/list.php'.(!empty($socid) ?
'?socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
558 $morehtmlref =
'<div class="refidno">';
562 $morehtmlref .= $form->editfieldkey(
"RefCustomer",
'ref_client', $fichinter->ref_client, $fichinter, 0,
'string',
'', 0, 1);
563 $morehtmlref .= $form->editfieldval(
"RefCustomer",
'ref_client', $fichinter->ref_client, $fichinter, 0,
'string',
'',
null,
null,
'', 1);
565 $morehtmlref .=
'<br>'.$fichinter->thirdparty->getNomUrl(1,
'customer');
567 if (isModEnabled(
'project')) {
568 $langs->load(
"projects");
569 $morehtmlref .=
'<br>';
570 if ($usercancreate && 0) {
571 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
572 if ($action !=
'classify') {
573 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.$fichinter->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
575 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$fichinter->id, $fichinter->socid, $fichinter->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
577 if (!empty($fichinter->fk_project)) {
579 $proj->fetch($fichinter->fk_project);
580 $morehtmlref .= $proj->getNomUrl(1);
582 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
587 $morehtmlref .=
'</div>';
589 dol_banner_tab($fichinter,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'&element='.$element, 0,
'',
'', 1);
596 if (($element_id || $element_ref) && ($element ==
'product' || $element ==
'service')) {
597 require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
600 $product->fetch($element_id, $element_ref);
602 if (is_object($product)) {
604 $titre = $langs->trans(
"CardProduct".$product->type);
610 if ($user->socid && !in_array(
'product', explode(
',',
getDolGlobalString(
'MAIN_MODULES_FOR_EXTERNAL')))) {
613 dol_banner_tab($product,
'ref',
'', $shownav,
'ref',
'ref',
'',
'&element='.$element);
621 $parameters = array(
'element' => $element,
'element_id' => $element_id,
'element_ref' => $element_ref);
622 $reshook = $hookmanager->executeHooks(
'printElementTab', $parameters, $object, $action);
633 foreach (
$object->available_resources as $modresources => $resources) {
634 $resources = (array) $resources;
635 foreach ($resources as $resource_obj) {
641 if (strpos($resource_obj,
'@')) {
642 $path .=
'/'.$element_prop[
'module'];
645 $linked_resources =
$object->getElementResources($element, $element_id, $resource_obj);
648 $defaulttpldir =
'/core/tpl';
649 $dirtpls = array_merge($conf->modules_parts[
'tpl'], array($defaulttpldir), array($path.$defaulttpldir));
651 foreach ($dirtpls as $module => $reldir) {
652 if (file_exists(
dol_buildpath($reldir.
'/resource_'.$element_prop[
'element'].
'_add.tpl.php'))) {
653 $tpl =
dol_buildpath($reldir.
'/resource_'.$element_prop[
'element'].
'_add.tpl.php');
655 $tpl = DOL_DOCUMENT_ROOT.$reldir.
'/resource_add.tpl.php';
657 if (empty($conf->file->strict_mode)) {
658 $res = @include $tpl;
667 if ($mode !=
'add' || $resource_obj != $resource_type) {
668 foreach ($dirtpls as $module => $reldir) {
669 if (file_exists(
dol_buildpath($reldir.
'/resource_'.$element_prop[
'element'].
'_view.tpl.php'))) {
670 $tpl =
dol_buildpath($reldir.
'/resource_'.$element_prop[
'element'].
'_view.tpl.php');
672 $tpl = DOL_DOCUMENT_ROOT.$reldir.
'/resource_view.tpl.php';
674 if (empty($conf->file->strict_mode)) {
675 $res = @include $tpl;
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
actions_prepare_head($object)
Prepare array with list of tabs.
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 products or services.
const TYPE_SERVICE
Service.
Class to manage projects.
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
fichinter_prepare_head($object)
Prepare array with list of tabs.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
getElementProperties($elementType)
Get an array with properties of an element.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
fetchObjectByElement($element_id, $element_type, $element_ref='', $useCache=0, $maxCacheByType=10)
Fetch an object from its id and element_type Inclusion of classes is automatic.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
product_prepare_head($object)
Prepare array with list of tabs.
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.