29require
'../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
'/resource/class/dolresource.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/fichinter/class/fichinter.class.php';
33if (isModEnabled(
'project')) {
34 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
37if (isModEnabled(
"product") || isModEnabled(
"service")) {
38 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
42$langs->loadLangs(array(
'resource',
'other',
'interventions'));
52$hookmanager->initHooks(array(
'element_resource'));
53$object->available_resources = array(
'dolresource');
57$element_id =
GETPOST(
'element_id',
'int');
58$element_ref =
GETPOST(
'ref',
'alpha');
59$element =
GETPOST(
'element',
'alpha');
60$action =
GETPOST(
'action',
'alpha');
61$mode =
GETPOST(
'mode',
'alpha');
62$lineid =
GETPOST(
'lineid',
'int');
63$resource_id =
GETPOST(
'fk_resource',
'int');
64$resource_type =
GETPOST(
'resource_type',
'alpha');
66$mandatory =
GETPOST(
'mandatory',
'int');
67$cancel =
GETPOST(
'cancel',
'alpha');
68$confirm =
GETPOST(
'confirm',
'alpha');
69$socid =
GETPOST(
'socid',
'int');
71if (empty($mandatory)) {
83if (!$user->hasRight(
'resource',
'read')) {
88if ($element ==
'action') {
89 $result =
restrictedArea($user,
'agenda', $element_id,
'actioncomm&societe',
'myactions|allactions',
'fk_soc',
'id');
91if ($element ==
'fichinter') {
92 $result =
restrictedArea($user,
'ficheinter', $element_id,
'fichinter');
94if ($element ==
'product' || $element ==
'service') {
96 $tmpobject->fetch($element_id);
97 $fieldtype = $tmpobject->type;
98 $result =
restrictedArea($user,
'produit|service', $element_id,
'product&product',
'',
'', $fieldtype);
106$parameters = array(
'resource_id' => $resource_id);
107$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
112if (empty($reshook)) {
115 if ($action ==
'add_element_resource' && !$cancel) {
117 if (!($resource_id > 0)) {
119 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Resource")),
null,
'errors');
123 $objstat->element = $element;
127 if (
getDolGlobalString(
'RESOURCE_USED_IN_EVENT_CHECK') && $objstat->element ==
'action' && $resource_type ==
'dolresource' && intval($busy) == 1) {
128 $eventDateStart = $objstat->datep;
129 $eventDateEnd = $objstat->datef;
130 $isFullDayEvent = $objstat->fulldayevent;
131 if (empty($eventDateEnd)) {
132 if ($isFullDayEvent) {
134 $eventDateStart =
dol_mktime(0, 0, 0, $eventDateStartArr[
'mon'], $eventDateStartArr[
'mday'], $eventDateStartArr[
'year']);
135 $eventDateEnd =
dol_mktime(23, 59, 59, $eventDateStartArr[
'mon'], $eventDateStartArr[
'mday'], $eventDateStartArr[
'year']);
139 $sql =
"SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label";
140 $sql .=
" FROM ".MAIN_DB_PREFIX.
"element_resources as er";
141 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"resource as r ON r.rowid = er.resource_id AND er.resource_type = '".$db->escape($resource_type).
"'";
142 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"actioncomm as ac ON ac.id = er.element_id AND er.element_type = '".$db->escape($objstat->element).
"'";
143 $sql .=
" WHERE er.resource_id = ".((int) $resource_id);
144 $sql .=
" AND er.busy = 1";
148 $sql .=
" (ac.datep <= '".$db->idate($eventDateStart).
"' AND (ac.datep2 IS NULL OR ac.datep2 >= '".$db->idate($eventDateStart).
"'))";
150 if (!empty($eventDateEnd)) {
151 $sql .=
" OR (ac.datep <= '".$db->idate($eventDateEnd).
"' AND (ac.datep2 >= '".$db->idate($eventDateEnd).
"'))";
155 $sql .=
"ac.datep >= '".$db->idate($eventDateStart).
"'";
156 if (!empty($eventDateEnd)) {
157 $sql .=
" AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '".$db->idate($eventDateEnd).
"')";
162 $resql = $db->query($sql);
165 $objstat->error = $db->lasterror();
166 $objstat->errors[] = $objstat->error;
168 if ($db->num_rows($resql) > 0) {
171 $objstat->error = $langs->trans(
'ErrorResourcesAlreadyInUse').
' : ';
172 while ($obj = $db->fetch_object($resql)) {
173 $objstat->error .=
'<br> - '.$langs->trans(
'ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label.
' ['.$obj->ac_id.
']');
175 $objstat->errors[] = $objstat->error;
182 $res = $objstat->add_element_resource($resource_id, $resource_type, $busy, $mandatory);
186 if (!$error && $res > 0) {
187 setEventMessages($langs->trans(
'ResourceLinkedWithSuccess'),
null,
'mesgs');
188 header(
"Location: ".$_SERVER[
'PHP_SELF'].
'?element='.$element.
'&element_id='.$objstat->id);
190 } elseif ($objstat) {
196 if ($action ==
'update_linked_resource' && $user->hasRight(
'resource',
'write') && !
GETPOST(
'cancel',
'alpha')) {
197 $res = $object->fetch_element_resource($lineid);
199 $object->busy = $busy;
200 $object->mandatory = $mandatory;
202 if (
getDolGlobalString(
'RESOURCE_USED_IN_EVENT_CHECK') && $object->element_type ==
'action' && $object->resource_type ==
'dolresource' && intval($object->busy) == 1) {
203 $eventDateStart = $object->objelement->datep;
204 $eventDateEnd = $object->objelement->datef;
205 $isFullDayEvent = $objstat->fulldayevent;
206 if (empty($eventDateEnd)) {
207 if ($isFullDayEvent) {
209 $eventDateStart =
dol_mktime(0, 0, 0, $eventDateStartArr[
'mon'], $eventDateStartArr[
'mday'], $eventDateStartArr[
'year']);
210 $eventDateEnd =
dol_mktime(23, 59, 59, $eventDateStartArr[
'mon'], $eventDateStartArr[
'mday'], $eventDateStartArr[
'year']);
214 $sql =
"SELECT er.rowid, r.ref as r_ref, ac.id as ac_id, ac.label as ac_label";
215 $sql .=
" FROM ".MAIN_DB_PREFIX.
"element_resources as er";
216 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"resource as r ON r.rowid = er.resource_id AND er.resource_type = '".$db->escape($object->resource_type).
"'";
217 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"actioncomm as ac ON ac.id = er.element_id AND er.element_type = '".$db->escape($object->element_type).
"'";
218 $sql .=
" WHERE er.resource_id = ".((int) $object->resource_id);
219 $sql .=
" AND ac.id <> ".((int) $object->element_id);
220 $sql .=
" AND er.busy = 1";
224 $sql .=
" (ac.datep <= '".$db->idate($eventDateStart).
"' AND (ac.datep2 IS NULL OR ac.datep2 >= '".$db->idate($eventDateStart).
"'))";
226 if (!empty($eventDateEnd)) {
227 $sql .=
" OR (ac.datep <= '".$db->idate($eventDateEnd).
"' AND (ac.datep2 IS NULL OR ac.datep2 >= '".$db->idate($eventDateEnd).
"'))";
231 $sql .=
"ac.datep >= '".$db->idate($eventDateStart).
"'";
232 if (!empty($eventDateEnd)) {
233 $sql .=
" AND (ac.datep2 IS NOT NULL AND ac.datep2 <= '".$db->idate($eventDateEnd).
"')";
238 $resql = $db->query($sql);
241 $object->error = $db->lasterror();
242 $object->errors[] = $object->error;
244 if ($db->num_rows($resql) > 0) {
247 $object->error = $langs->trans(
'ErrorResourcesAlreadyInUse').
' : ';
248 while ($obj = $db->fetch_object($resql)) {
249 $object->error .=
'<br> - '.$langs->trans(
'ErrorResourceUseInEvent', $obj->r_ref, $obj->ac_label.
' ['.$obj->ac_id.
']');
251 $object->errors[] = $objstat->error;
258 $result = $object->update_element_resource($user);
267 setEventMessages($langs->trans(
'RessourceLineSuccessfullyUpdated'),
null,
'mesgs');
268 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?element=".$element.
"&element_id=".$element_id);
275 if ($action ==
'confirm_delete_linked_resource' && $user->hasRight(
'resource',
'delete') && $confirm ===
'yes') {
276 $result = $object->delete_resource($lineid, $element);
279 setEventMessages($langs->trans(
'RessourceLineSuccessfullyDeleted'),
null,
'mesgs');
280 header(
"Location: ".$_SERVER[
'PHP_SELF'].
"?element=".$element.
"&element_id=".$element_id);
288$parameters = array(
'resource_id'=>$resource_id);
289$reshook = $hookmanager->executeHooks(
'getElementResources', $parameters, $object, $action);
300$form =
new Form($db);
302$pagetitle = $langs->trans(
'ResourceElementPage');
306$delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60;
309$ret = count($object->available_resources);
315 print
'<div class="warning">'.$langs->trans(
'NoResourceInDatabase').
'</div>';
318 if ($action ==
'delete_resource') {
319 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);
324 if (($element_id || $element_ref) && $element ==
'action') {
325 require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
328 $hookmanager->initHooks(array(
'actioncard',
'globalcard'));
331 if (is_object($act)) {
336 $linkback =
'<a href="'.DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">';
337 $linkback .=
img_picto($langs->trans(
"BackToList"),
'object_calendarlist',
'class="pictoactionview pictofixedwidth"');
338 $linkback .=
'<span class="hideonsmartphone">'.$langs->trans(
"BackToList").
'</span>';
343 $out .=
'</li><li class="noborder litext">';
345 $out .=
img_picto($langs->trans(
"ViewCal"),
'object_calendar',
'class="pictofixedwidth pictoactionview"');
346 $out .=
'<span class="hideonsmartphone">'.$langs->trans(
"ViewCal").
'</span>';
348 $out .=
'</li><li class="noborder litext">';
350 $out .=
img_picto($langs->trans(
"ViewWeek"),
'object_calendarweek',
'class="pictofixedwidth pictoactionview"');
351 $out .=
'<span class="hideonsmartphone">'.$langs->trans(
"ViewWeek").
'</span>';
353 $out .=
'</li><li class="noborder litext">';
355 $out .=
img_picto($langs->trans(
"ViewDay"),
'object_calendarday',
'class="pictofixedwidth pictoactionview"');
356 $out .=
'<span class="hideonsmartphone">'.$langs->trans(
"ViewDay").
'</span>';
358 $out .=
'</li><li class="noborder litext">';
359 $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').
'">';
360 $out .=
img_picto($langs->trans(
"ViewPerUser"),
'object_calendarperuser',
'class="pictofixedwidth pictoactionview"');
361 $out .=
'<span class="hideonsmartphone">'.$langs->trans(
"ViewPerUser").
'</span>';
365 $parameters = array();
366 $reshook = $hookmanager->executeHooks(
'addCalendarView', $parameters, $object, $action);
367 if (empty($reshook)) {
368 $out .= $hookmanager->resPrint;
369 } elseif ($reshook > 1) {
370 $out = $hookmanager->resPrint;
375 $morehtmlref =
'<div class="refidno">';
379 $savobject = $object;
381 if (isModEnabled(
'project')) {
382 $langs->load(
"projects");
385 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
386 if ($action !=
'classify') {
387 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.newToken().
'&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
389 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
391 if (!empty($object->fk_project)) {
393 $proj->fetch($object->fk_project);
394 $morehtmlref .= $proj->getNomUrl(1);
396 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
401 $object = $savobject;
402 $morehtmlref .=
'</div>';
404 dol_banner_tab($act,
'element_id', $linkback, ($user->socid ? 0 : 1),
'id',
'ref', $morehtmlref,
'&element='.$element, 0,
'',
'');
406 print
'<div class="fichecenter">';
408 print
'<div class="underbanner clearboth"></div>';
410 print
'<table class="border tableforfield centpercent">';
414 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td><td>';
415 print $act->getTypePicto();
416 print $langs->trans(
"Action".$act->type_code);
421 print
'<tr><td class="titlefield">'.$langs->trans(
"EventOnFullDay").
'</td><td colspan="3">'.
yn($act->fulldayevent ? 1 : 0, 3).
'</td></tr>';
424 print
'<tr><td>'.$langs->trans(
"DateActionStart").
'</td><td colspan="3">';
425 if (empty($act->fulldayevent)) {
429 print
dol_print_date($act->datep,
'day', ($tzforfullday ? $tzforfullday :
'tzuser'));
431 if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) {
438 print
'<tr><td>'.$langs->trans(
"DateActionEnd").
'</td><td colspan="3">';
439 if (empty($act->fulldayevent)) {
443 print
dol_print_date($act->datef,
'day', ($tzforfullday ? $tzforfullday :
'tzuser'));
445 if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now - $delay_warning)) {
452 print
'<tr><td>'.$langs->trans(
"Location").
'</td><td colspan="3">'.$act->location.
'</td></tr>';
456 print
'<tr><td class="nowrap">'.$langs->trans(
"ActionAffectedTo").
'</td><td colspan="3">';
457 $listofuserid = array();
458 if (empty($donotclearsession)) {
459 if ($act->userownerid > 0) {
460 $listofuserid[$act->userownerid] = array(
'id'=>$act->userownerid,
'transparency'=>$act->transparency);
462 if (!empty($act->userassigned)) {
464 $tmplist1 = $act->userassigned;
466 foreach ($tmplist1 as $key => $val) {
467 if ($val[
'id'] && $val[
'id'] != $act->userownerid) {
468 $listofuserid[$val[
'id']] = $val;
472 $_SESSION[
'assignedtouser'] = json_encode($listofuserid);
474 if (!empty($_SESSION[
'assignedtouser'])) {
475 $listofuserid = json_decode($_SESSION[
'assignedtouser'],
true);
478 $listofcontactid = array();
479 $listofotherid = array();
480 print
'<div class="assignedtouser">';
481 print $form->select_dolusers_forevent(
'view',
'assignedtouser', 1,
'', 0,
'',
'', 0, 0, 0,
'', ($act->datep != $act->datef) ? 1 : 0, $listofuserid, $listofcontactid, $listofotherid);
500 if (($element_id || $element_ref) && $element ==
'societe') {
502 if (is_object($socstatic)) {
503 $savobject = $object;
504 $object = $socstatic;
506 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
509 print
dol_get_fiche_head($head,
'resources', $langs->trans(
"ThirdParty"), -1,
'company');
511 dol_banner_tab($socstatic,
'socid',
'', ($user->socid ? 0 : 1),
'rowid',
'nom',
'',
'&element='.$element);
513 print
'<div class="fichecenter">';
515 print
'<div class="underbanner clearboth"></div>';
516 print
'<table class="border centpercent">';
519 print
'<tr><td class="titlefield">'.$langs->trans(
'AliasNames').
'</td><td colspan="3">';
520 print $socstatic->name_alias;
529 $object = $savobject;
534 if (($element_id || $element_ref) && $element ==
'fichinter') {
535 require_once DOL_DOCUMENT_ROOT.
'/core/lib/fichinter.lib.php';
538 $fichinter->fetch($element_id, $element_ref);
539 $fichinter->fetch_thirdparty();
541 $usercancreate = $user->hasRight(
'fichinter',
'creer');
543 if (is_object($fichinter)) {
545 print
dol_get_fiche_head($head,
'resource', $langs->trans(
"InterventionCard"), -1,
'intervention');
548 $linkback =
'<a href="'.DOL_URL_ROOT.
'/fichinter/list.php'.(!empty($socid) ?
'?socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
551 $morehtmlref =
'<div class="refidno">';
555 $morehtmlref.=$form->editfieldkey(
"RefCustomer",
'ref_client', $fichinter->ref_client, $fichinter, 0,
'string',
'', 0, 1);
556 $morehtmlref.=$form->editfieldval(
"RefCustomer",
'ref_client', $fichinter->ref_client, $fichinter, 0,
'string',
'',
null,
null,
'', 1);
558 $morehtmlref .=
'<br>'.$fichinter->thirdparty->getNomUrl(1,
'customer');
560 if (isModEnabled(
'project')) {
561 $langs->load(
"projects");
562 $morehtmlref .=
'<br>';
563 if ($usercancreate && 0) {
564 $morehtmlref .=
img_picto($langs->trans(
"Project"),
'project',
'class="pictofixedwidth"');
565 if ($action !=
'classify') {
566 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.newToken().
'&id='.$fichinter->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a> ';
568 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$fichinter->id, $fichinter->socid, $fichinter->fk_project, ($action ==
'classify' ?
'projectid' :
'none'), 0, 0, 0, 1,
'',
'maxwidth300');
570 if (!empty($fichinter->fk_project)) {
572 $proj->fetch($fichinter->fk_project);
573 $morehtmlref .= $proj->getNomUrl(1);
575 $morehtmlref .=
'<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).
'</span>';
580 $morehtmlref .=
'</div>';
582 dol_banner_tab($fichinter,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref,
'&element='.$element, 0,
'',
'', 1);
589 if (($element_id || $element_ref) && ($element ==
'product' || $element ==
'service')) {
590 require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
593 $product->fetch($element_id, $element_ref);
595 if (is_object($product)) {
597 $titre = $langs->trans(
"CardProduct".$product->type);
603 if ($user->socid && !in_array(
'product', explode(
',',
getDolGlobalString(
'MAIN_MODULES_FOR_EXTERNAL')))) {
606 dol_banner_tab($product,
'ref',
'', $shownav,
'ref',
'ref',
'',
'&element='.$element);
614 $parameters = array(
'element'=>$element,
'element_id'=>$element_id,
'element_ref'=>$element_ref);
615 $reshook = $hookmanager->executeHooks(
'printElementTab', $parameters, $object, $action);
626 foreach ($object->available_resources as $modresources => $resources) {
627 $resources = (array) $resources;
628 foreach ($resources as $resource_obj) {
634 if (strpos($resource_obj,
'@')) {
635 $path .=
'/'.$element_prop[
'module'];
638 $linked_resources = $object->getElementResources($element, $element_id, $resource_obj);
641 $defaulttpldir =
'/core/tpl';
642 $dirtpls = array_merge($conf->modules_parts[
'tpl'], array($defaulttpldir), array($path.$defaulttpldir));
644 foreach ($dirtpls as $module => $reldir) {
645 if (file_exists(
dol_buildpath($reldir.
'/resource_'.$element_prop[
'element'].
'_add.tpl.php'))) {
646 $tpl =
dol_buildpath($reldir.
'/resource_'.$element_prop[
'element'].
'_add.tpl.php');
648 $tpl = DOL_DOCUMENT_ROOT.$reldir.
'/resource_add.tpl.php';
650 if (empty($conf->file->strict_mode)) {
651 $res = @include $tpl;
660 if ($mode !=
'add' || $resource_obj != $resource_type) {
661 foreach ($dirtpls as $module => $reldir) {
662 if (file_exists(
dol_buildpath($reldir.
'/resource_'.$element_prop[
'element'].
'_view.tpl.php'))) {
663 $tpl =
dol_buildpath($reldir.
'/resource_'.$element_prop[
'element'].
'_view.tpl.php');
665 $tpl = DOL_DOCUMENT_ROOT.$reldir.
'/resource_view.tpl.php';
667 if (empty($conf->file->strict_mode)) {
668 $res = @include $tpl;
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()
Empty header.
Class to manage interventions.
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_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.
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...
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
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_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.
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.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
getElementProperties($element_type)
Get an array with properties of an element.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
fetchObjectByElement($element_id, $element_type, $element_ref='')
Fetch an object from its id and element_type Inclusion of classes is automatic.
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier 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.