32require
'../../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/user/class/usergroup.class.php';
43if (!isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) {
44 $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW = 3;
47$action =
GETPOST(
'action',
'aZ09');
49$disabledefaultvalues =
GETPOST(
'disabledefaultvalues',
'int');
51$filter =
GETPOST(
"search_filter",
'alpha', 3) ?
GETPOST(
"search_filter",
'alpha', 3) :
GETPOST(
"filter",
'alpha', 3);
52$filtert =
GETPOST(
"search_filtert",
"int", 3) ?
GETPOST(
"search_filtert",
"int", 3) :
GETPOST(
"filtert",
"int", 3);
53$usergroup =
GETPOST(
"search_usergroup",
"int", 3) ?
GETPOST(
"search_usergroup",
"int", 3) :
GETPOST(
"usergroup",
"int", 3);
65$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
66$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
67$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
68if (empty($page) || $page == -1) {
71$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
72$offset = $limit * $page;
77 $sortfield =
"a.datec";
84 $socid = $user->socid;
92if (!$user->hasRight(
'agenda',
'myactions',
'read')) {
95if (!$user->hasRight(
'agenda',
'allactions',
'read')) {
98if (!$user->hasRight(
'agenda',
'allactions',
'read') || $filter ==
'mine') {
102$mode =
'show_pertype';
103$resourceid =
GETPOST(
"search_resourceid",
"int") ?
GETPOST(
"search_resourceid",
"int") :
GETPOST(
"resourceid",
"int");
104$year =
GETPOST(
"year",
"int") ?
GETPOST(
"year",
"int") : date(
"Y");
105$month =
GETPOST(
"month",
"int") ?
GETPOST(
"month",
"int") : date(
"m");
106$week =
GETPOST(
"week",
"int") ?
GETPOST(
"week",
"int") : date(
"W");
108$pid = GETPOSTISSET(
"search_projectid") ?
GETPOST(
"search_projectid",
"int", 3) :
GETPOST(
"projectid",
"int", 3);
109$status = GETPOSTISSET(
"search_status") ?
GETPOST(
"search_status",
'aZ09') :
GETPOST(
"status",
'aZ09');
110$type = GETPOSTISSET(
"search_type") ?
GETPOST(
"search_type",
'alpha') :
GETPOST(
"type",
'alpha');
111$maxprint = ((
GETPOST(
"maxprint",
'int') !=
'') ?
GETPOST(
"maxprint",
'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
112$optioncss =
GETPOST(
'optioncss',
'aZ');
115if (
GETPOST(
'search_actioncode',
'array:aZ09')) {
116 $actioncode =
GETPOST(
'search_actioncode',
'array:aZ09', 3);
117 if (!count($actioncode)) {
121 $actioncode =
GETPOST(
"search_actioncode",
"alpha", 3) ?
GETPOST(
"search_actioncode",
"alpha", 3) : (
GETPOST(
"search_actioncode",
"alpha") ==
'0' ?
'0' : ((!
getDolGlobalString(
'AGENDA_DEFAULT_FILTER_TYPE') || $disabledefaultvalues) ?
'' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
125if ($dateselect > 0) {
126 $day =
GETPOST(
'dateselectday',
'int');
127 $month =
GETPOST(
'dateselectmonth',
'int');
128 $year =
GETPOST(
'dateselectyear',
'int');
132$tmp = !
getDolGlobalString(
'MAIN_DEFAULT_WORKING_HOURS') ?
'9-18' : $conf->global->MAIN_DEFAULT_WORKING_HOURS;
133$tmp = str_replace(
' ',
'', $tmp);
134$tmparray = explode(
'-', $tmp);
135$begin_h =
GETPOST(
'begin_h',
'int') !=
'' ?
GETPOST(
'begin_h',
'int') : ($tmparray[0] !=
'' ? $tmparray[0] : 9);
136$end_h =
GETPOST(
'end_h',
'int') ?
GETPOST(
'end_h',
'int') : ($tmparray[1] !=
'' ? $tmparray[1] : 18);
137if ($begin_h < 0 || $begin_h > 23) {
140if ($end_h < 1 || $end_h > 24) {
143if ($end_h <= $begin_h) {
144 $end_h = $begin_h + 1;
148$tmp = !
getDolGlobalString(
'MAIN_DEFAULT_WORKING_DAYS') ?
'1-5' : $conf->global->MAIN_DEFAULT_WORKING_DAYS;
149$tmp = str_replace(
' ',
'', $tmp);
150$tmparray = explode(
'-', $tmp);
154if ($status ==
'' && !GETPOSTISSET(
'search_status')) {
155 $status = ((!
getDolGlobalString(
'AGENDA_DEFAULT_FILTER_STATUS') || $disabledefaultvalues) ?
'' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
157if (empty($mode) && !GETPOSTISSET(
'mode')) {
158 $mode = (!
getDolGlobalString(
'AGENDA_DEFAULT_VIEW') ?
'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
162if (
GETPOST(
'viewcal',
'alpha') && $mode !=
'show_day' && $mode !=
'show_week' && $mode !=
'show_peruser') {
163 $mode =
'show_month';
167if (
GETPOST(
'viewweek',
'alpha') || $mode ==
'show_week') {
169 $week = ($week ? $week : date(
"W"));
170 $day = ($day ? $day : date(
"d"));
173if (
GETPOST(
'viewday',
'alpha') || $mode ==
'show_day') {
175 $day = ($day ? $day : date(
"d"));
178if (
GETPOST(
'viewyear',
'alpha') || $mode ==
'show_year') {
186$langs->loadLangs(array(
'users',
'agenda',
'other',
'commercial'));
189$hookmanager->initHooks(array(
'agenda'));
192if ($user->socid && $socid) {
196$search_status = $status;
217 'maxprint' => $maxprint,
219 'filtert' => $filtert,
220 'showbirthday' => $showbirthday,
221 'canedit' => $canedit,
222 'optioncss' => $optioncss,
223 'actioncode' => $actioncode,
225 'resourceid' => $resourceid,
226 'usergroup' => $usergroup,
229$reshook = $hookmanager->executeHooks(
'beforeAgendaPerType', $parameters, $object, $action);
234$form =
new Form($db);
235$companystatic =
new Societe($db);
237$help_url =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
238llxHeader(
'', $langs->trans(
"Agenda"), $help_url);
242$nowyear = $nowarray[
'year'];
243$nowmonth = $nowarray[
'mon'];
244$nowday = $nowarray[
'mday'];
248$listofextcals = array();
255$week = $prev[
'week'];
259$next_year = $year + 1;
263$max_day_in_month = date(
"t",
dol_mktime(0, 0, 0, $month, 1, $year));
269$title = $langs->trans(
"DoneAndToDoActions");
270if ($status ==
'done') {
271 $title = $langs->trans(
"DoneActions");
273if ($status ==
'todo') {
274 $title = $langs->trans(
"ToDoActions");
278if ($actioncode || GETPOSTISSET(
'search_actioncode')) {
279 if (is_array($actioncode)) {
280 foreach ($actioncode as $str_action) {
281 $param .=
"&search_actioncode[]=".urlencode($str_action);
284 $param .=
"&search_actioncode=".urlencode($actioncode);
287if ($resourceid > 0) {
288 $param .=
"&search_resourceid=".urlencode($resourceid);
290if ($status || GETPOSTISSET(
'status') || GETPOSTISSET(
'search_status')) {
291 $param .=
"&search_status=".urlencode($status);
294 $param .=
"&search_filter=".urlencode($filter);
297 $param .=
"&search_filtert=".urlencode($filtert);
300 $param .=
"&search_usergroup=".urlencode($usergroup);
303 $param .=
"&search_socid=".urlencode($socid);
306 $param .=
"&search_showbirthday=1";
309 $param .=
"&search_projectid=".urlencode($pid);
312 $param .=
"&search_type=".urlencode($type);
314if ($mode !=
'show_pertype') {
315 $param .=
'&mode='.urlencode($mode);
318 $param .=
'&begin_h='.urlencode($begin_h);
321 $param .=
'&end_h='.urlencode($end_h);
324 $param .=
'&begin_d='.urlencode($begin_d);
327 $param .=
'&end_d='.urlencode($end_d);
329$param .=
"&maxprint=".urlencode($maxprint);
331$paramnoactionodate = $param;
334$prev_year = $year - 1;
341$week = $prev[
'week'];
345$next_year = $year + 1;
351$firstdaytoshow =
dol_mktime(0, 0, 0, $first_month, $first_day, $first_year,
'tzuserrel');
357$max_day_in_month = date(
"t",
dol_mktime(0, 0, 0, $month, 1, $year,
'gmt'));
360$picto =
'calendarweek';
363$nav =
'<div class="navselectiondate inline-block nowraponall">';
364$nav .=
"<a href=\"?year=".$prev_year.
"&month=".$prev_month.
"&day=".$prev_day.$param.
"\">".
img_previous($langs->trans(
"Previous")).
"</a>\n";
365$nav .=
" <span id=\"month_name\">".dol_print_date(
dol_mktime(0, 0, 0, $first_month, $first_day, $first_year),
"%Y").
"</span> \n";
366$nav .=
"<a href=\"?year=".$next_year.
"&month=".$next_month.
"&day=".$next_day.$param.
"\">".
img_next($langs->trans(
"Next")).
"</a>\n";
367if (empty($conf->dol_optimize_smallscreen)) {
368 $nav .=
" (<a href=\"?year=".$nowyear.
"&month=".$nowmonth.
"&day=".$nowday.$param.
'" class="datenowlink">'.$langs->trans(
"Today").
"</a>)";
372$nav .= $form->selectDate($dateselect,
'dateselect', 0, 0, 1,
'', 1, 0);
373$nav .=
' <button type="submit" class="liste_titre button_search" name="button_search_x" value="x"><span class="fa fa-search"></span></button>';
376$param .=
'&year='.urlencode($year).
'&month='.urlencode($month).($day ?
'&day='.urlencode($day) :
'');
380$paramnoaction = preg_replace(
'/action=[a-z_]+/',
'', $param);
384print
'<form method="POST" id="searchFormList" class="listactionsfilter" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
386$showextcals = $listofextcals;
388if ($conf->use_javascript_ajax) {
390 $s .=
'<script type="text/javascript">'.
"\n";
391 $s .=
'jQuery(document).ready(function () {'.
"\n";
392 $s .=
'jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });'.
"\n";
393 $s .=
'jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });'.
"\n";
394 $s .=
'jQuery(".family_birthday").toggle();'.
"\n";
395 if ($mode ==
"show_week" || $mode ==
"show_month" || empty($mode)) {
396 $s .=
'jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {';
399 $s .=
'</script>'.
"\n";
400 if (!empty($conf->use_javascript_ajax)) {
401 $s .=
'<div class="nowrap clear float"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans(
"LocalAgenda").
' </div>';
402 if (is_array($showextcals) && count($showextcals) > 0) {
403 foreach ($showextcals as $val) {
404 $htmlname = md5($val[
'name']);
405 $s .=
'<script type="text/javascript">'.
"\n";
406 $s .=
'jQuery(document).ready(function () {'.
"\n";
407 $s .=
' jQuery("#check_ext'.$htmlname.
'").click(function() {';
408 $s .=
' /* alert("'.$htmlname.
'"); */';
409 $s .=
' jQuery(".family_ext'.$htmlname.
'").toggle();';
412 $s .=
'</script>'.
"\n";
413 $s .=
'<div class="nowrap float"><input type="checkbox" id="check_ext'.$htmlname.
'" name="check_ext'.$htmlname.
'" checked> '.$val [
'name'].
' </div>';
420 $parameters = array();
421 $reshook = $hookmanager->executeHooks(
'addCalendarChoice', $parameters, $object, $action);
422 if (empty($reshook)) {
423 $s .= $hookmanager->resPrint;
424 } elseif ($reshook > 1) {
425 $s = $hookmanager->resPrint;
430$massactionbutton =
'';
433$viewmode .=
'<a class="btnTitle reposition" href="'.DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1'.$paramnoactionodate.
'">';
435$viewmode .=
img_picto($langs->trans(
"List"),
'object_calendarlist',
'class="imgforviewmode pictoactionview block"');
437$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewList").
'</span></a>';
439$viewmode .=
'<a class="btnTitle reposition" href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_month&year='.
dol_print_date($object->datep,
'%Y').
'&month='.
dol_print_date($object->datep,
'%m').
'&day='.
dol_print_date($object->datep,
'%d').$paramnoactionodate.
'">';
441$viewmode .=
img_picto($langs->trans(
"ViewCal"),
'object_calendarmonth',
'class="pictoactionview block"');
443$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewCal").
'</span></a>';
445$viewmode .=
'<a class="btnTitle reposition" href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_week&year='.
dol_print_date($object->datep,
'%Y').
'&month='.
dol_print_date($object->datep,
'%m').
'&day='.
dol_print_date($object->datep,
'%d').$paramnoactionodate.
'">';
447$viewmode .=
img_picto($langs->trans(
"ViewWeek"),
'object_calendarweek',
'class="pictoactionview block"');
449$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewWeek").
'</span></a>';
451$viewmode .=
'<a class="btnTitle reposition" href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_day&year='.
dol_print_date($object->datep,
'%Y').
'&month='.
dol_print_date($object->datep,
'%m').
'&day='.
dol_print_date($object->datep,
'%d').$paramnoactionodate.
'">';
453$viewmode .=
img_picto($langs->trans(
"ViewDay"),
'object_calendarday',
'class="pictoactionview block"');
455$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewDay").
'</span></a>';
457$viewmode .=
'<a class="btnTitle btnTitleSelected reposition marginrightonly" href="'.DOL_URL_ROOT.
'/comm/action/peruser.php?mode=show_peruser&year='.
dol_print_date($object->datep,
'%Y').
'&month='.
dol_print_date($object->datep,
'%m').
'&day='.
dol_print_date($object->datep,
'%d').$paramnoactionodate.
'">';
459$viewmode .=
img_picto($langs->trans(
"ViewPerUser"),
'object_calendarperuser',
'class="pictoactionview block"');
461$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewPerUser").
'</span></a>';
463$viewmode .=
'<span class="marginrightonly"></span>';
466$parameters = array(); $object =
null;
467$reshook = $hookmanager->executeHooks(
'addCalendarView', $parameters, $object, $action);
468if (empty($reshook)) {
469 $viewmode .= $hookmanager->resPrint;
470} elseif ($reshook > 1) {
471 $viewmode = $hookmanager->resPrint;
476if ($user->hasRight(
'agenda',
'myactions',
'create') || $user->hasRight(
'agenda',
'allactions',
'create')) {
479 $newparam .=
'&month='.str_pad($month, 2,
"0", STR_PAD_LEFT).
'&year='.$tmpforcreatebutton[
'year'];
482 $hourminsec =
'100000';
483 $newcardbutton .=
dolGetButtonTitle($langs->trans(
"AddAction"),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/comm/action/card.php?action=create&datep='.sprintf(
"%04d%02d%02d", $tmpforcreatebutton[
'year'], $tmpforcreatebutton[
'mon'], $tmpforcreatebutton[
'mday']).$hourminsec.
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].($newparam ?
'?'.$newparam :
'')));
486print_barre_liste($langs->trans(
"Agenda"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1,
'object_action', 0, $nav.
'<span class="marginleftonly"></span>'.$newcardbutton,
'', $limit, 1, 0, 1, $viewmode);
493$newtitle =
'<div class="nowrap clear inline-block minheight30">';
494$newtitle .=
'<input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans(
"LocalAgenda").
' ';
495$newtitle .=
'</div>';
502print
'<div class="liste_titre liste_titre_bydiv centpercent">';
503print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup,
'', $resourceid);
508$eventarray = array();
516$sql .=
' a.id, a.label,';
519$sql .=
' a.percent,';
520$sql .=
' a.fk_user_author,a.fk_user_action,';
521$sql .=
' a.transparency, a.priority, a.fulldayevent, a.location,';
522$sql .=
' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,';
523$sql .=
' ca.code, ca.libelle as type_label, ca.color, ca.type as type_type, ca.picto as type_picto';
524$sql .=
' FROM '.MAIN_DB_PREFIX.
'c_actioncomm as ca, '.MAIN_DB_PREFIX.
"actioncomm as a";
525if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
526 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
529if ($resourceid > 0) {
530 $sql .=
", ".MAIN_DB_PREFIX.
"element_resources as r";
533if ($filtert > 0 || $usergroup > 0) {
534 $sql .=
", ".MAIN_DB_PREFIX.
"actioncomm_resources as ar";
537 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
539$sql .=
' WHERE a.fk_action = ca.id';
540$sql .=
' AND a.entity IN ('.getEntity(
'agenda').
')';
542if (!empty($actioncode)) {
544 if ($actioncode ==
'AC_NON_AUTO') {
545 $sql .=
" AND ca.type != 'systemauto'";
546 } elseif ($actioncode ==
'AC_ALL_AUTO') {
547 $sql .=
" AND ca.type = 'systemauto'";
549 if ($actioncode ==
'AC_OTH') {
550 $sql .=
" AND ca.type != 'systemauto'";
552 if ($actioncode ==
'AC_OTH_AUTO') {
553 $sql .=
" AND ca.type = 'systemauto'";
557 if ($actioncode ==
'AC_NON_AUTO') {
558 $sql .=
" AND ca.type != 'systemauto'";
559 } elseif ($actioncode ==
'AC_ALL_AUTO') {
560 $sql .=
" AND ca.type = 'systemauto'";
562 if (is_array($actioncode)) {
563 $sql .=
" AND ca.code IN (".$db->sanitize(
"'".implode(
"','", $actioncode).
"'", 1).
")";
565 $sql .=
" AND ca.code IN (".$db->sanitize(
"'".implode(
"','", explode(
',', $actioncode)).
"'", 1).
")";
570if ($resourceid > 0) {
571 $sql .=
" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".((int) $resourceid);
574 $sql .=
" AND a.fk_project=".((int) $pid);
576if (!$user->hasRight(
'societe',
'client',
'voir') && !$socid) {
577 $sql .=
" AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).
")";
580 $sql .=
' AND a.fk_soc = '.((int) $socid);
583if ($filtert > 0 || $usergroup > 0) {
584 $sql .=
" AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
586if ($mode ==
'show_day') {
588 $sql .=
" (a.datep BETWEEN '".$db->idate(
dol_mktime(0, 0, 0, $month, $day, $year,
'tzuserrel')).
"'";
589 $sql .=
" AND '".$db->idate(
dol_mktime(23, 59, 59, $month, $day, $year,
'tzuserrel')).
"')";
591 $sql .=
" (a.datep2 BETWEEN '".$db->idate(
dol_mktime(0, 0, 0, $month, $day, $year,
'tzuserrel')).
"'";
592 $sql .=
" AND '".$db->idate(
dol_mktime(23, 59, 59, $month, $day, $year,
'tzuserrel')).
"')";
594 $sql .=
" (a.datep < '".$db->idate(
dol_mktime(0, 0, 0, $month, $day, $year,
'tzuserrel')).
"'";
595 $sql .=
" AND a.datep2 > '".$db->idate(
dol_mktime(23, 59, 59, $month, $day, $year,
'tzuserrel')).
"')";
600 $sql .=
" (a.datep BETWEEN '".$db->idate(
dol_mktime(0, 0, 0, 1, 1, $year) - (60 * 60 * 24 * 7)).
"'";
601 $sql .=
" AND '".$db->idate(
dol_mktime(23, 59, 59, 12, 31, $year) + (60 * 60 * 24 * 7)).
"')";
603 $sql .=
" (a.datep2 BETWEEN '".$db->idate(
dol_mktime(0, 0, 0, 1, 1, $year) - (60 * 60 * 24 * 7)).
"'";
604 $sql .=
" AND '".$db->idate(
dol_mktime(23, 59, 59, 12, 31, $year) + (60 * 60 * 24 * 7)).
"')";
606 $sql .=
" (a.datep < '".$db->idate(
dol_mktime(0, 0, 0, 12, 1, $year) - (60 * 60 * 24 * 7)).
"'";
607 $sql .=
" AND a.datep2 > '".$db->idate(
dol_mktime(23, 59, 59, 12, 31, $year) + (60 * 60 * 24 * 7)).
"')";
611 $sql .=
" AND ca.id = ".((int) $type);
614 $sql .=
" AND a.percent = 0";
616if ($status ===
'na') {
618 $sql .=
" AND a.percent = -1";
620if ($status ==
'50') {
622 $sql .=
" AND (a.percent > 0 AND a.percent < 100)";
624if ($status ==
'done' || $status ==
'100') {
625 $sql .=
" AND (a.percent = 100)";
627if ($status ==
'todo') {
628 $sql .=
" AND (a.percent >= 0 AND a.percent < 100)";
631if ($filtert > 0 || $usergroup > 0) {
634 $sql .=
"ar.fk_element = ".$filtert;
636 if ($usergroup > 0) {
637 $sql .= ($filtert > 0 ?
" OR " :
"").
" ugu.fk_usergroup = ".((
int) $usergroup);
642$sql .=
' ORDER BY fk_user_action, datep';
645dol_syslog(
"comm/action/pertype.php", LOG_DEBUG);
646$resql = $db->query($sql);
648 $num = $db->num_rows($resql);
651 $obj = $db->fetch_object($resql);
659 $datep = $db->jdate($obj->datep);
660 $datep2 = $db->jdate($obj->datep2);
664 $event->id = $obj->id;
665 $event->datep = $datep;
666 $event->datef = $datep2;
667 $event->type_code = $obj->code;
668 $event->type_color = $obj->color;
669 $event->label = $obj->label;
670 $event->percentage = $obj->percent;
671 $event->authorid = $obj->fk_user_author;
672 $event->userownerid = $obj->fk_user_action;
673 $event->priority = $obj->priority;
674 $event->fulldayevent = $obj->fulldayevent;
675 $event->location = $obj->location;
676 $event->transparency = $obj->transparency;
678 $event->fk_project = $obj->fk_project;
680 $event->socid = $obj->fk_soc;
681 $event->contact_id = $obj->fk_contact;
683 $event->fk_element = $obj->fk_element;
684 $event->elementtype = $obj->elementtype;
688 if ($event->percentage <= 0) {
689 $event->date_start_in_calendar = $datep;
690 if ($datep2 !=
'' && $datep2 >= $datep) {
691 $event->date_end_in_calendar = $datep2;
693 $event->date_end_in_calendar = $datep;
696 $event->date_start_in_calendar = $datep;
697 if ($datep2 !=
'' && $datep2 >= $datep) {
698 $event->date_end_in_calendar = $datep2;
700 $event->date_end_in_calendar = $datep;
705 if ($event->date_end_in_calendar < $firstdaytoshow ||
706 $event->date_start_in_calendar >= $lastdaytoshow) {
711 $event->fetch_userassigned();
713 if ($event->date_start_in_calendar < $firstdaytoshow) {
714 $event->date_start_in_calendar = $firstdaytoshow;
716 if ($event->date_end_in_calendar >= $lastdaytoshow) {
717 $event->date_end_in_calendar = ($lastdaytoshow - 1);
721 $daycursor = $event->date_start_in_calendar;
729 $daykey =
dol_mktime(0, 0, 0, $mois, $jour, $annee,
'gmt');
733 $eventarray[$daykey][] = $event;
736 $daykey += 60 * 60 * 24;
737 if ($daykey > $event->date_end_in_calendar) {
753$cachethirdparties = array();
754$cachecontacts = array();
755$cacheusers = array();
758$color_file = DOL_DOCUMENT_ROOT.
"/theme/".$conf->theme.
"/theme_vars.inc.php";
759if (is_readable($color_file)) {
762if (!is_array($theme_datacolor)) {
763 $theme_datacolor = array(array(120, 130, 150), array(200, 160, 180), array(190, 190, 220));
768$newparam = preg_replace(
'/showbirthday=/i',
'showbirthday_=', $newparam);
769$newparam = preg_replace(
'/mode=show_month&?/i',
'', $newparam);
770$newparam = preg_replace(
'/mode=show_week&?/i',
'', $newparam);
771$newparam = preg_replace(
'/day=[0-9]+&?/i',
'', $newparam);
772$newparam = preg_replace(
'/month=[0-9]+&?/i',
'', $newparam);
773$newparam = preg_replace(
'/year=[0-9]+&?/i',
'', $newparam);
774$newparam = preg_replace(
'/viewweek=[0-9]+&?/i',
'', $newparam);
775$newparam = preg_replace(
'/showbirthday_=/i',
'showbirthday=', $newparam);
776$newparam .=
'&viewweek=1';
778print
'<input type="hidden" name="action" value="mupdate">';
779echo
'<input type="hidden" name="backtopage" value="'.dol_escape_htmltag($_SERVER[
'PHP_SELF']).
'?'.
dol_escape_htmltag($_SERVER[
'QUERY_STRING']).
'">';
780echo
'<input type="hidden" name="token" value="'.newToken().
'">';
781echo
'<input type="hidden" name="newdate" id="newdate">';
788echo
'<div class="div-table-responsive">';
790echo
'<table class="centpercent nocellnopadd cal_month">';
792echo
'<tr class="liste_titre">';
795echo
'<td align="center" colspan="'.($end_d - $begin_d).
'">';
796echo $langs->trans(
"Year");
802echo
'<tr class="liste_titre">';
805for ($h = $begin_d; $h < $end_d; $h++) {
806 echo
'<td class="center">';
807 print
'<small style="font-family: courier">'.sprintf(
"%02d", $h).
'</small>';
814$typeofevents = array();
817$colorsbytype = array();
818$labelbytype = array();
819$sql =
"SELECT code, color, libelle as label FROM ".MAIN_DB_PREFIX.
"c_actioncomm ORDER BY position";
820$resql = $db->query($sql);
821while ($obj = $db->fetch_object($resql)) {
822 $typeofevents[$obj->code] = $obj->code;
823 $colorsbytype[$obj->code] = $obj->color;
824 $labelbytype[$obj->code] = $obj->label;
832foreach ($typeofevents as $typeofevent) {
835 echo
'<td class="cal_current_month cal_peruserviewname'.($var ?
' cal_impair' :
'').
'">'.$typeofevent.
'</td>';
840 for ($iter_day = 0; $iter_day < 8; $iter_day++) {
841 if (($i + 1) < $begin_d || ($i + 1) > $end_d) {
854 $style =
'cal_current_month';
855 if ($iter_day == 6) {
856 $style .=
' cal_other_month';
859 if ($todayarray[
'mday'] == $tmpday && $todayarray[
'mon'] == $tmpmonth && $todayarray[
'year'] == $tmpyear) {
863 $style =
'cal_today_peruser';
866 show_day_events_pertype($typeofevent, $tmpday, $tmpmonth, $tmpyear, 0, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype, $var);
880 $langs->load(
"commercial");
881 print
'<br>'.$langs->trans(
"Legend").
': <br>';
882 foreach ($colorsbytype as $code => $color) {
884 print
'<div style="float: left; padding: 2px; margin-right: 6px;"><div style="'.($color ?
'background: #'.$color.
';' :
'').
'width:16px; float: left; margin-right: 4px;"> </div>';
885 print $langs->trans(
"Action".$code) !=
"Action".$code ? $langs->trans(
"Action".$code) : $labelbytype[$code];
891 print
'<div style="float: left; padding: 2px; margin-right: 6px;"><div class="peruser_busy" style="width:16px; float: left; margin-right: 4px;"> </div>';
892 print $langs->trans(
"Other");
905print
'<script type="text/javascript">
906jQuery(document).ready(function() {
907 jQuery(".onclickopenref").click(function() {
908 var ref=$(this).attr(\'ref\');
909 var res = ref.split("_");
917 if (ids == \'none\') /* No event */
919 /* alert(\'no event\'); */
920 url = "'.DOL_URL_ROOT.
'/comm/action/card.php?action=create&assignedtouser="+userid+"&datep="+year+month+day+hour+min+"00&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?year='.$year.
'&month='.$month.
'&day='.$day).
'"
921 window.location.href = url;
923 else if (ids.indexOf(",") > -1) /* There is several events */
925 /* alert(\'several events\'); */
926 url = "'.DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list&filtert="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day;
927 window.location.href = url;
931 /* alert(\'one event\'); */
932 url = "'.DOL_URL_ROOT.
'/comm/action/card.php?action=view&id="+ids
933 window.location.href = url;
966function show_day_events_pertype($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam =
'', $showinfo = 0, $minheight = 60, $showheader =
false, $colorsbytype = array(), $var =
false)
969 global $user, $conf, $langs, $hookmanager, $action;
970 global $filter, $filtert, $status, $actioncode;
971 global $theme_datacolor;
972 global $cachethirdparties, $cachecontacts, $cacheusers, $cacheprojects, $colorindexused;
973 global $begin_h, $end_h;
984 $ymd = sprintf(
"%04d", $year).sprintf(
"%02d", $month).sprintf(
"%02d", $day);
986 $nextindextouse = count($colorindexused);
992 foreach ($eventarray as $daykey => $notused) {
997 if ($day == $jour && (
int) $month == (
int) $mois && $year == $annee) {
999 foreach ($eventarray[$daykey] as $index => $event) {
1003 $keysofuserassigned = array_keys($event->userassigned);
1004 if (!in_array($username->id, $keysofuserassigned)) {
1009 $parameters = array();
1010 $reshook = $hookmanager->executeHooks(
'formatEvent', $parameters, $event, $action);
1015 $ponct = ($event->date_start_in_calendar == $event->date_end_in_calendar);
1021 if (in_array($user->id, $keysofuserassigned)) {
1023 $cssclass =
'family_mytasks';
1025 $color = $event->type_color;
1027 } elseif ($event->type_code ==
'ICALEVENT') {
1029 if (!empty($event->icalname)) {
1036 $color = $event->icalcolor;
1037 $cssclass = (!empty($event->icalname) ?
'family_ext'.md5($event->icalname) :
'family_other unsortable');
1038 } elseif ($event->type_code ==
'BIRTHDAY') {
1041 $cssclass =
'family_birthday unsortable';
1042 $color = sprintf(
"%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
1045 $cssclass =
'family_other';
1047 $color = $event->type_color;
1053 $idusertouse = ($event->userownerid ? $event->userownerid : 0);
1054 if (isset($colorindexused[$idusertouse])) {
1055 $colorindex = $colorindexused[$idusertouse];
1057 $colorindex = $nextindextouse;
1058 $colorindexused[$idusertouse] = $colorindex;
1059 if (!empty($theme_datacolor[$nextindextouse + 1])) {
1064 $color = sprintf(
"%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
1069 for ($h = $begin_h; $h < $end_h; $h++) {
1072 if (empty($event->fulldayevent)) {
1073 $a =
dol_mktime((
int) $h, 0, 0, $month, $day, $year,
'tzuserrel', 0);
1074 $b =
dol_mktime((
int) $h, 30, 0, $month, $day, $year,
'tzuserrel', 0);
1075 $c =
dol_mktime((
int) $h + 1, 0, 0, $month, $day, $year,
'tzuserrel', 0);
1077 $dateendtouse = $event->date_end_in_calendar;
1078 if ($dateendtouse == $event->date_start_in_calendar) {
1084 if ($event->date_start_in_calendar < $b && $dateendtouse > $a) {
1085 $busy = $event->transparency;
1086 $cases1[$h][$event->id][
'busy'] = $busy;
1087 $cases1[$h][$event->id][
'string'] =
dol_print_date($event->date_start_in_calendar,
'dayhour',
'tzuserrel');
1088 if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) {
1089 $tmpa =
dol_getdate($event->date_start_in_calendar,
true);
1090 $tmpb =
dol_getdate($event->date_end_in_calendar,
true);
1091 if ($tmpa[
'mday'] == $tmpb[
'mday'] && $tmpa[
'mon'] == $tmpb[
'mon'] && $tmpa[
'year'] == $tmpb[
'year']) {
1092 $cases1[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'hour',
'tzuserrel');
1094 $cases1[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'dayhour',
'tzuserrel');
1097 if ($event->label) {
1098 $cases1[$h][$event->id][
'string'] .=
' - '.$event->label;
1100 $cases1[$h][$event->id][
'typecode'] = $event->type_code;
1101 $cases1[$h][$event->id][
'color'] = $color;
1102 if ($event->fk_project > 0) {
1103 if (empty($cacheprojects[$event->fk_project])) {
1105 $tmpproj->fetch($event->fk_project);
1106 $cacheprojects[$event->fk_project] = $tmpproj;
1108 $cases1[$h][$event->id][
'string'] .=
', '.$langs->trans(
"Project").
': '.$cacheprojects[$event->fk_project]->ref.
' - '.$cacheprojects[$event->fk_project]->title;
1110 if ($event->socid > 0) {
1111 if (empty($cachethirdparties[$event->socid])) {
1112 $tmpthirdparty =
new Societe($db);
1113 $tmpthirdparty->fetch($event->socid);
1114 $cachethirdparties[$event->socid] = $tmpthirdparty;
1116 $cases1[$h][$event->id][
'string'] .=
', '.$cachethirdparties[$event->socid]->name;
1118 if ($event->contact_id > 0) {
1119 if (empty($cachecontacts[$event->contact_id])) {
1120 $tmpcontact =
new Contact($db);
1121 $tmpcontact->fetch($event->contact_id);
1122 $cachecontacts[$event->contact_id] = $tmpcontact;
1124 $cases1[$h][$event->id][
'string'] .=
', '.$cachecontacts[$event->contact_id]->getFullName($langs);
1127 if ($event->date_start_in_calendar < $c && $dateendtouse > $b) {
1128 $busy = $event->transparency;
1129 $cases2[$h][$event->id][
'busy'] = $busy;
1130 $cases2[$h][$event->id][
'string'] =
dol_print_date($event->date_start_in_calendar,
'dayhour',
'tzuserrel');
1131 if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) {
1132 $tmpa =
dol_getdate($event->date_start_in_calendar,
true);
1133 $tmpb =
dol_getdate($event->date_end_in_calendar,
true);
1134 if ($tmpa[
'mday'] == $tmpb[
'mday'] && $tmpa[
'mon'] == $tmpb[
'mon'] && $tmpa[
'year'] == $tmpb[
'year']) {
1135 $cases2[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'hour',
'tzuserrel');
1137 $cases2[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'dayhour',
'tzuserrel');
1140 if ($event->label) {
1141 $cases2[$h][$event->id][
'string'] .=
' - '.$event->label;
1143 $cases2[$h][$event->id][
'typecode'] = $event->type_code;
1144 $cases2[$h][$event->id][
'color'] = $color;
1145 if ($event->fk_project > 0) {
1146 if (empty($cacheprojects[$event->fk_project])) {
1148 $tmpproj->fetch($event->fk_project);
1149 $cacheprojects[$event->fk_project] = $tmpproj;
1151 $cases2[$h][$event->id][
'string'] .=
', '.$langs->trans(
"Project").
': '.$cacheprojects[$event->fk_project]->ref.
' - '.$cacheprojects[$event->fk_project]->title;
1153 if ($event->socid > 0) {
1154 if (empty($cachethirdparties[$event->socid])) {
1155 $tmpthirdparty =
new Societe($db);
1156 $tmpthirdparty->fetch($event->socid);
1157 $cachethirdparties[$event->socid] = $tmpthirdparty;
1159 $cases2[$h][$event->id][
'string'] .=
', '.$cachethirdparties[$event->socid]->name;
1161 if ($event->contact_id > 0) {
1162 if (empty($cachecontacts[$event->contact_id])) {
1163 $tmpcontact =
new Contact($db);
1164 $tmpcontact->fetch($event->contact_id);
1165 $cachecontacts[$event->contact_id] = $tmpcontact;
1167 $cases2[$h][$event->id][
'string'] .=
', '.$cachecontacts[$event->contact_id]->getFullName($langs);
1171 $busy = $event->transparency;
1172 $cases1[$h][$event->id][
'busy'] = $busy;
1173 $cases2[$h][$event->id][
'busy'] = $busy;
1174 $cases1[$h][$event->id][
'string'] = $event->label;
1175 $cases2[$h][$event->id][
'string'] = $event->label;
1176 $cases1[$h][$event->id][
'typecode'] = $event->type_code;
1177 $cases2[$h][$event->id][
'typecode'] = $event->type_code;
1178 $cases1[$h][$event->id][
'color'] = $color;
1179 $cases2[$h][$event->id][
'color'] = $color;
1190 for ($h = $begin_h; $h < $end_h; $h++) {
1195 $string1 =
' ';
1196 $string2 =
' ';
1199 if (isset($cases1[$h]) && $cases1[$h] !=
'') {
1201 if (count($cases1[$h]) > 1) {
1202 $title1 .= count($cases1[$h]).
' '.(count($cases1[$h]) == 1 ? $langs->trans(
"Event") : $langs->trans(
"Events"));
1204 $string1 =
' ';
1206 $style1 =
'peruser_notbusy';
1208 $style1 =
'peruser_busy';
1210 foreach ($cases1[$h] as $id => $ev) {
1212 $style1 =
'peruser_busy';
1216 if (isset($cases2[$h]) && $cases2[$h] !=
'') {
1218 if (count($cases2[$h]) > 1) {
1219 $title2 .= count($cases2[$h]).
' '.(count($cases2[$h]) == 1 ? $langs->trans(
"Event") : $langs->trans(
"Events"));
1221 $string2 =
' ';
1223 $style2 =
'peruser_notbusy';
1225 $style2 =
'peruser_busy';
1227 foreach ($cases2[$h] as $id => $ev) {
1229 $style2 =
'peruser_busy';
1236 if (!empty($cases1[$h]) && is_array($cases1[$h]) && count($cases1[$h]) && array_keys($cases1[$h])) {
1237 $ids1 = join(
',', array_keys($cases1[$h]));
1239 if (!empty($cases2[$h]) && is_array($cases2[$h]) && count($cases2[$h]) && array_keys($cases2[$h])) {
1240 $ids2 = join(
',', array_keys($cases2[$h]));
1243 if ($h == $begin_h) {
1244 echo
'<td class="'.$style.
'_peruserleft cal_peruser'.($var ?
' cal_impair '.$style.
'_impair' :
'').
'">';
1246 echo
'<td class="'.$style.
' cal_peruser'.($var ?
' cal_impair '.$style.
'_impair' :
'').
'">';
1248 if (!empty($cases1[$h]) && is_array($cases1[$h]) && count($cases1[$h]) == 1) {
1249 $output = array_slice($cases1[$h], 0, 1);
1250 $title1 = $langs->trans(
"Ref").
' '.$ids1.($title1 ?
' - '.$title1 :
'');
1251 if ($output[0][
'string']) {
1252 $title1 .= ($title1 ?
' - ' :
'').$output[0][
'string'];
1254 if ($output[0][
'color']) {
1255 $color1 = $output[0][
'color'];
1257 } elseif (!empty($cases1[$h]) && is_array($cases1[$h]) && count($cases1[$h]) > 1) {
1258 $title1 = $langs->trans(
"Ref").
' '.$ids1.($title1 ?
' - '.$title1 :
'');
1262 if (!empty($cases2[$h]) && is_array($cases2[$h]) && count($cases2[$h]) == 1) {
1263 $output = array_slice($cases2[$h], 0, 1);
1264 $title2 = $langs->trans(
"Ref").
' '.$ids2.($title2 ?
' - '.$title2 :
'');
1265 if ($output[0][
'string']) {
1266 $title2 .= ($title2 ?
' - ' :
'').$output[0][
'string'];
1268 if ($output[0][
'color']) {
1269 $color2 = $output[0][
'color'];
1271 } elseif (!empty($cases2[$h]) && is_array($cases2[$h]) && count($cases2[$h]) > 1) {
1272 $title2 = $langs->trans(
"Ref").
' '.$ids2.($title2 ?
' - '.$title2 :
'');
1275 print
'<table class="nobordernopadding" width="100%">';
1276 print
'<tr><td '.($color1 ?
'style="background: #'.$color1.
';"' :
'').
'class="'.($style1 ? $style1.
' ' :
'').
'onclickopenref center'.($title1 ?
' cursorpointer' :
'').
'" ref="ref_'.$username->id.
'_'.sprintf(
"%04d", $year).
'_'.sprintf(
"%02d", $month).
'_'.sprintf(
"%02d", $day).
'_'.sprintf(
"%02d", $h).
'_00_'.($ids1 ? $ids1 :
'none').
'"'.($title1 ?
' title="'.$title1.
'"' :
'').
'>';
1278 print
'</td><td '.($color2 ?
'style="background: #'.$color2.
';"' :
'').
'class="'.($style2 ? $style2.
' ' :
'').
'onclickopenref center'.($title1 ?
' cursorpointer' :
'').
'" ref="ref_'.$username->id.
'_'.sprintf(
"%04d", $year).
'_'.sprintf(
"%02d", $month).
'_'.sprintf(
"%02d", $day).
'_'.sprintf(
"%02d", $h).
'_30_'.($ids2 ? $ids2 :
'none').
'"'.($title2 ?
' title="'.$title2.
'"' :
'').
'>';
print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid='', $excludetype='', $resourceid=0)
Show filter form in agenda view.
calendars_prepare_head($param)
Define head array for tabs of agenda setup pages.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage agenda events (actions)
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
dol_get_next_day($day, $month, $year)
Return next day.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
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...
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_string_nospecial($str, $newstr='_', $badcharstoreplace='', $badcharstoremove='', $keepspaces=0)
Clean a string from all punctuation characters to use it as a ref or login.
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)
img_previous($titlealt='default', $moreatt='')
Show previous logo.
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.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_next($titlealt='default', $moreatt='')
Show next logo.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
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.