32 require
'../../main.inc.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/user/class/usergroup.class.php';
43 if (!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);
60 if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS)) {
65 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
67 $sortfield =
"a.datec";
70 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
77 if (empty($page) || $page == -1) {
80 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
81 $offset = $limit * $page;
88 $socid = $user->socid;
96 if (empty($user->rights->agenda->myactions->read)) {
99 if (empty($user->rights->agenda->allactions->read)) {
102 if (empty($user->rights->agenda->allactions->read) || $filter ==
'mine') {
103 $filtert = $user->id;
106 $mode =
'show_pertype';
107 $resourceid =
GETPOST(
"search_resourceid",
"int") ?
GETPOST(
"search_resourceid",
"int") :
GETPOST(
"resourceid",
"int");
108 $year =
GETPOST(
"year",
"int") ?
GETPOST(
"year",
"int") : date(
"Y");
109 $month =
GETPOST(
"month",
"int") ?
GETPOST(
"month",
"int") : date(
"m");
110 $week =
GETPOST(
"week",
"int") ?
GETPOST(
"week",
"int") : date(
"W");
115 $maxprint = ((
GETPOST(
"maxprint",
'int') !=
'') ?
GETPOST(
"maxprint",
'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
116 $optioncss =
GETPOST(
'optioncss',
'aZ');
119 if (
GETPOST(
'search_actioncode',
'array')) {
120 $actioncode =
GETPOST(
'search_actioncode',
'array', 3);
121 if (!count($actioncode)) {
125 $actioncode =
GETPOST(
"search_actioncode",
"alpha", 3) ?
GETPOST(
"search_actioncode",
"alpha", 3) : (
GETPOST(
"search_actioncode",
"alpha") ==
'0' ?
'0' : ((empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) || $disabledefaultvalues) ?
'' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
129 if ($dateselect > 0) {
130 $day =
GETPOST(
'dateselectday',
'int');
131 $month =
GETPOST(
'dateselectmonth',
'int');
132 $year =
GETPOST(
'dateselectyear',
'int');
136 $tmp = empty($conf->global->MAIN_DEFAULT_WORKING_HOURS) ?
'9-18' : $conf->global->MAIN_DEFAULT_WORKING_HOURS;
137 $tmp = str_replace(
' ',
'', $tmp);
138 $tmparray = explode(
'-', $tmp);
139 $begin_h =
GETPOST(
'begin_h',
'int') !=
'' ?
GETPOST(
'begin_h',
'int') : ($tmparray[0] !=
'' ? $tmparray[0] : 9);
140 $end_h =
GETPOST(
'end_h',
'int') ?
GETPOST(
'end_h',
'int') : ($tmparray[1] !=
'' ? $tmparray[1] : 18);
141 if ($begin_h < 0 || $begin_h > 23) {
144 if ($end_h < 1 || $end_h > 24) {
147 if ($end_h <= $begin_h) {
148 $end_h = $begin_h + 1;
152 $tmp = empty($conf->global->MAIN_DEFAULT_WORKING_DAYS) ?
'1-5' : $conf->global->MAIN_DEFAULT_WORKING_DAYS;
153 $tmp = str_replace(
' ',
'', $tmp);
154 $tmparray = explode(
'-', $tmp);
159 $status = ((empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) || $disabledefaultvalues) ?
'' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
162 $mode = (empty($conf->global->AGENDA_DEFAULT_VIEW) ?
'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
166 if (
GETPOST(
'viewcal',
'alpha') && $mode !=
'show_day' && $mode !=
'show_week' && $mode !=
'show_peruser') {
167 $mode =
'show_month'; $day =
'';
170 if (
GETPOST(
'viewweek',
'alpha') || $mode ==
'show_week') {
171 $mode =
'show_week'; $week = ($week ? $week : date(
"W")); $day = ($day ? $day : date(
"d"));
174 if (
GETPOST(
'viewday',
'alpha') || $mode ==
'show_day') {
175 $mode =
'show_day'; $day = ($day ? $day : date(
"d"));
178 if (
GETPOST(
'viewyear',
'alpha') || $mode ==
'show_year') {
186 $langs->loadLangs(array(
'users',
'agenda',
'other',
'commercial'));
189 $hookmanager->initHooks(array(
'agenda'));
192 if ($user->socid && $socid) {
196 $search_status = $status;
227 'maxprint' => $maxprint,
229 'filtert' => $filtert,
230 'showbirthday' => $showbirthday,
231 'canedit' => $canedit,
232 'optioncss' => $optioncss,
233 'actioncode' => $actioncode,
235 'resourceid' => $resourceid,
236 'usergroup' => $usergroup,
239 $reshook = $hookmanager->executeHooks(
'beforeAgendaPerType', $parameters, $object, $action);
245 $companystatic =
new Societe($db);
247 $help_url =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
252 $nowyear = $nowarray[
'year'];
253 $nowmonth = $nowarray[
'mon'];
254 $nowday = $nowarray[
'mday'];
258 $listofextcals = array();
265 $week = $prev[
'week'];
269 $next_year = $year + 1;
270 $next_month = $month;
273 $max_day_in_month = date(
"t",
dol_mktime(0, 0, 0, $month, 1, $year));
275 $tmpday = $first_day;
279 $title = $langs->trans(
"DoneAndToDoActions");
280 if ($status ==
'done') {
281 $title = $langs->trans(
"DoneActions");
283 if ($status ==
'todo') {
284 $title = $langs->trans(
"ToDoActions");
289 if (is_array($actioncode)) {
290 foreach ($actioncode as $str_action) {
291 $param .=
"&search_actioncode[]=".urlencode($str_action);
294 $param .=
"&search_actioncode=".urlencode($actioncode);
297 if ($resourceid > 0) {
298 $param .=
"&search_resourceid=".urlencode($resourceid);
301 $param .=
"&search_status=".urlencode($status);
304 $param .=
"&search_filter=".urlencode($filter);
307 $param .=
"&search_filtert=".urlencode($filtert);
309 if ($usergroup > 0) {
310 $param .=
"&search_usergroup=".urlencode($usergroup);
313 $param .=
"&search_socid=".urlencode($socid);
316 $param .=
"&search_showbirthday=1";
319 $param .=
"&search_projectid=".urlencode($pid);
322 $param .=
"&search_type=".urlencode($type);
324 if ($mode ==
'show_day' || $mode ==
'show_week' || $mode ==
'show_month' || $mode !=
'show_peruser') {
325 $param .=
'&mode='.urlencode($mode);
327 if ($begin_h !=
'') {
328 $param .=
'&begin_h='.urlencode($begin_h);
331 $param .=
'&end_h='.urlencode($end_h);
333 if ($begin_d !=
'') {
334 $param .=
'&begin_d='.urlencode($begin_d);
337 $param .=
'&end_d='.urlencode($end_d);
339 $param .=
"&maxprint=".urlencode($maxprint);
341 $paramnoactionodate = $param;
344 $prev_year = $year - 1;
345 $prev_month = $month;
351 $week = $prev[
'week'];
355 $next_year = $year + 1;
356 $next_month = $month;
360 $firstdaytoshow =
dol_mktime(0, 0, 0, $first_month, $first_day, $first_year,
'tzuserrel');
366 $max_day_in_month = date(
"t",
dol_mktime(0, 0, 0, $month, 1, $year,
'gmt'));
368 $tmpday = $first_day;
369 $picto =
'calendarweek';
371 $nav =
"<a href=\"?year=".$prev_year.
"&month=".$prev_month.
"&day=".$prev_day.$param.
"\">".
img_previous($langs->trans(
"Previous")).
"</a>\n";
372 $nav .=
" <span id=\"month_name\">".dol_print_date(
dol_mktime(0, 0, 0, $first_month, $first_day, $first_year),
"%Y").
"</span> \n";
373 $nav .=
"<a href=\"?year=".$next_year.
"&month=".$next_month.
"&day=".$next_day.$param.
"\">".
img_next($langs->trans(
"Next")).
"</a>\n";
374 if (empty($conf->dol_optimize_smallscreen)) {
375 $nav .=
" (<a href=\"?year=".$nowyear.
"&month=".$nowmonth.
"&day=".$nowday.$param.
"\">".$langs->trans(
"Today").
"</a>)";
378 $nav .=
$form->selectDate($dateselect,
'dateselect', 0, 0, 1,
'', 1, 0);
379 $nav .=
' <button type="submit" class="liste_titre button_search" name="button_search_x" value="x"><span class="fa fa-search"></span></button>';
382 $param .=
'&year='.urlencode($year).
'&month='.urlencode($month).($day ?
'&day='.urlencode($day) :
'');
386 $paramnoaction = preg_replace(
'/action=[a-z_]+/',
'', $param);
390 print
'<form method="POST" id="searchFormList" class="listactionsfilter" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
392 $showextcals = $listofextcals;
394 if ($conf->use_javascript_ajax) {
396 $s .=
'<script type="text/javascript">'.
"\n";
397 $s .=
'jQuery(document).ready(function () {'.
"\n";
398 $s .=
'jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });'.
"\n";
399 $s .=
'jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });'.
"\n";
400 $s .=
'jQuery(".family_birthday").toggle();'.
"\n";
401 if ($mode ==
"show_week" || $mode ==
"show_month" || empty($mode)) {
402 $s .=
'jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {';
405 $s .=
'</script>'.
"\n";
406 if (!empty($conf->use_javascript_ajax)) {
407 $s .=
'<div class="nowrap clear float"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans(
"LocalAgenda").
' </div>';
408 if (is_array($showextcals) && count($showextcals) > 0) {
409 foreach ($showextcals as $val) {
410 $htmlname = md5($val[
'name']);
411 $s .=
'<script type="text/javascript">'.
"\n";
412 $s .=
'jQuery(document).ready(function () {'.
"\n";
413 $s .=
' jQuery("#check_ext'.$htmlname.
'").click(function() {';
414 $s .=
' /* alert("'.$htmlname.
'"); */';
415 $s .=
' jQuery(".family_ext'.$htmlname.
'").toggle();';
418 $s .=
'</script>'.
"\n";
419 $s .=
'<div class="nowrap float"><input type="checkbox" id="check_ext'.$htmlname.
'" name="check_ext'.$htmlname.
'" checked> '.$val [
'name'].
' </div>';
426 $parameters = array();
427 $reshook = $hookmanager->executeHooks(
'addCalendarChoice', $parameters, $object, $action);
428 if (empty($reshook)) {
429 $s .= $hookmanager->resPrint;
430 } elseif ($reshook > 1) {
431 $s = $hookmanager->resPrint;
436 $massactionbutton =
'';
439 $viewmode .=
'<a class="btnTitle reposition" href="'.DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1'.$paramnoactionodate.
'">';
441 $viewmode .=
img_picto($langs->trans(
"List"),
'object_calendarlist',
'class="imgforviewmode pictoactionview block"');
443 $viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewList").
'</span></a>';
445 $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.
'">';
447 $viewmode .=
img_picto($langs->trans(
"ViewCal"),
'object_calendarmonth',
'class="pictoactionview block"');
449 $viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewCal").
'</span></a>';
451 $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.
'">';
453 $viewmode .=
img_picto($langs->trans(
"ViewWeek"),
'object_calendarweek',
'class="pictoactionview block"');
455 $viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewWeek").
'</span></a>';
457 $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.
'">';
459 $viewmode .=
img_picto($langs->trans(
"ViewDay"),
'object_calendarday',
'class="pictoactionview block"');
461 $viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewDay").
'</span></a>';
463 $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.
'">';
465 $viewmode .=
img_picto($langs->trans(
"ViewPerUser"),
'object_calendarperuser',
'class="pictoactionview block"');
467 $viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewPerUser").
'</span></a>';
469 $viewmode .=
'<span class="marginrightonly"></span>';
472 $parameters = array(); $object =
null;
473 $reshook = $hookmanager->executeHooks(
'addCalendarView', $parameters, $object, $action);
474 if (empty($reshook)) {
475 $viewmode .= $hookmanager->resPrint;
476 } elseif ($reshook > 1) {
477 $viewmode = $hookmanager->resPrint;
482 if ($user->rights->agenda->myactions->create || $user->hasRight(
'agenda',
'allactions',
'create')) {
485 $newparam .=
'&month='.str_pad($month, 2,
"0", STR_PAD_LEFT).
'&year='.$tmpforcreatebutton[
'year'];
488 $hourminsec =
'100000';
489 $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 :
'')));
492 print_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);
499 $newtitle =
'<div class="nowrap clear inline-block minheight30">';
500 $newtitle .=
'<input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans(
"LocalAgenda").
' ';
501 $newtitle .=
'</div>';
508 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
509 print_actions_filter(
$form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup,
'', $resourceid);
514 $eventarray = array();
519 if ($usergroup > 0) {
522 $sql .=
' a.id, a.label,';
524 $sql .=
' a.datep2,';
525 $sql .=
' a.percent,';
526 $sql .=
' a.fk_user_author,a.fk_user_action,';
527 $sql .=
' a.transparency, a.priority, a.fulldayevent, a.location,';
528 $sql .=
' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,';
529 $sql .=
' ca.code, ca.libelle as type_label, ca.color, ca.type as type_type, ca.picto as type_picto';
530 $sql .=
' FROM '.MAIN_DB_PREFIX.
'c_actioncomm as ca, '.MAIN_DB_PREFIX.
"actioncomm as a";
531 if (empty($user->rights->societe->client->voir) && !$socid) {
532 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
535 if ($resourceid > 0) {
536 $sql .=
", ".MAIN_DB_PREFIX.
"element_resources as r";
539 if ($filtert > 0 || $usergroup > 0) {
540 $sql .=
", ".MAIN_DB_PREFIX.
"actioncomm_resources as ar";
542 if ($usergroup > 0) {
543 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
545 $sql .=
' WHERE a.fk_action = ca.id';
546 $sql .=
' AND a.entity IN ('.getEntity(
'agenda').
')';
548 if (!empty($actioncode)) {
549 if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
550 if ($actioncode ==
'AC_NON_AUTO') {
551 $sql .=
" AND ca.type != 'systemauto'";
552 } elseif ($actioncode ==
'AC_ALL_AUTO') {
553 $sql .=
" AND ca.type = 'systemauto'";
555 if ($actioncode ==
'AC_OTH') {
556 $sql .=
" AND ca.type != 'systemauto'";
558 if ($actioncode ==
'AC_OTH_AUTO') {
559 $sql .=
" AND ca.type = 'systemauto'";
563 if ($actioncode ==
'AC_NON_AUTO') {
564 $sql .=
" AND ca.type != 'systemauto'";
565 } elseif ($actioncode ==
'AC_ALL_AUTO') {
566 $sql .=
" AND ca.type = 'systemauto'";
568 if (is_array($actioncode)) {
569 $sql .=
" AND ca.code IN (".$db->sanitize(
"'".implode(
"','", $actioncode).
"'", 1).
")";
571 $sql .=
" AND ca.code IN (".$db->sanitize(
"'".implode(
"','", explode(
',', $actioncode)).
"'", 1).
")";
576 if ($resourceid > 0) {
577 $sql .=
" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".((int) $resourceid);
580 $sql .=
" AND a.fk_project=".((int) $pid);
582 if (empty($user->rights->societe->client->voir) && !$socid) {
583 $sql .=
" AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).
")";
586 $sql .=
' AND a.fk_soc = '.((int) $socid);
589 if ($filtert > 0 || $usergroup > 0) {
590 $sql .=
" AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
592 if ($mode ==
'show_day') {
594 $sql .=
" (a.datep BETWEEN '".$db->idate(
dol_mktime(0, 0, 0, $month, $day, $year,
'tzuserrel')).
"'";
595 $sql .=
" AND '".$db->idate(
dol_mktime(23, 59, 59, $month, $day, $year)).
"')";
597 $sql .=
" (a.datep2 BETWEEN '".$db->idate(
dol_mktime(0, 0, 0, $month, $day, $year,
'tzuserrel')).
"'";
598 $sql .=
" AND '".$db->idate(
dol_mktime(23, 59, 59, $month, $day, $year)).
"')";
600 $sql .=
" (a.datep < '".$db->idate(
dol_mktime(0, 0, 0, $month, $day, $year)).
"'";
601 $sql .=
" AND a.datep2 > '".$db->idate(
dol_mktime(23, 59, 59, $month, $day, $year,
'tzuserrel')).
"')";
606 $sql .=
" (a.datep BETWEEN '".$db->idate(
dol_mktime(0, 0, 0, 1, 1, $year) - (60 * 60 * 24 * 7)).
"'";
607 $sql .=
" AND '".$db->idate(
dol_mktime(23, 59, 59, 12, 31, $year) + (60 * 60 * 24 * 7)).
"')";
609 $sql .=
" (a.datep2 BETWEEN '".$db->idate(
dol_mktime(0, 0, 0, 1, 1, $year) - (60 * 60 * 24 * 7)).
"'";
610 $sql .=
" AND '".$db->idate(
dol_mktime(23, 59, 59, 12, 31, $year) + (60 * 60 * 24 * 7)).
"')";
612 $sql .=
" (a.datep < '".$db->idate(
dol_mktime(0, 0, 0, 12, 1, $year) - (60 * 60 * 24 * 7)).
"'";
613 $sql .=
" AND a.datep2 > '".$db->idate(
dol_mktime(23, 59, 59, 12, 31, $year) + (60 * 60 * 24 * 7)).
"')";
617 $sql .=
" AND ca.id = ".((int) $type);
619 if ($status ==
'0') {
620 $sql .=
" AND a.percent = 0";
622 if ($status ==
'-1') {
623 $sql .=
" AND a.percent = -1";
625 if ($status ==
'50') {
626 $sql .=
" AND (a.percent > 0 AND a.percent < 100)";
628 if ($status ==
'done' || $status ==
'100') {
629 $sql .=
" AND (a.percent = 100)";
631 if ($status ==
'todo') {
632 $sql .=
" AND (a.percent >= 0 AND a.percent < 100)";
635 if ($filtert > 0 || $usergroup > 0) {
638 $sql .=
"ar.fk_element = ".$filtert;
640 if ($usergroup > 0) {
641 $sql .= ($filtert > 0 ?
" OR " :
"").
" ugu.fk_usergroup = ".((
int) $usergroup);
646 $sql .=
' ORDER BY fk_user_action, datep';
649 dol_syslog(
"comm/action/pertype.php", LOG_DEBUG);
650 $resql = $db->query($sql);
652 $num = $db->num_rows(
$resql);
655 $obj = $db->fetch_object(
$resql);
658 if (!empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->code ==
'AC_OTH_AUTO') {
663 $datep = $db->jdate($obj->datep);
664 $datep2 = $db->jdate($obj->datep2);
668 $event->id = $obj->id;
669 $event->datep = $datep;
670 $event->datef = $datep2;
671 $event->type_code = $obj->code;
672 $event->type_color = $obj->color;
673 $event->label = $obj->label;
674 $event->percentage = $obj->percent;
675 $event->authorid = $obj->fk_user_author;
676 $event->userownerid = $obj->fk_user_action;
677 $event->priority = $obj->priority;
678 $event->fulldayevent = $obj->fulldayevent;
679 $event->location = $obj->location;
680 $event->transparency = $obj->transparency;
682 $event->fk_project = $obj->fk_project;
684 $event->socid = $obj->fk_soc;
685 $event->contact_id = $obj->fk_contact;
687 $event->fk_element = $obj->fk_element;
688 $event->elementtype = $obj->elementtype;
692 if ($event->percentage <= 0) {
693 $event->date_start_in_calendar = $datep;
694 if ($datep2 !=
'' && $datep2 >= $datep) {
695 $event->date_end_in_calendar = $datep2;
697 $event->date_end_in_calendar = $datep;
700 $event->date_start_in_calendar = $datep;
701 if ($datep2 !=
'' && $datep2 >= $datep) {
702 $event->date_end_in_calendar = $datep2;
704 $event->date_end_in_calendar = $datep;
709 if ($event->date_end_in_calendar < $firstdaytoshow ||
710 $event->date_start_in_calendar >= $lastdaytoshow) {
715 $event->fetch_userassigned();
717 if ($event->date_start_in_calendar < $firstdaytoshow) {
718 $event->date_start_in_calendar = $firstdaytoshow;
720 if ($event->date_end_in_calendar >= $lastdaytoshow) {
721 $event->date_end_in_calendar = ($lastdaytoshow - 1);
725 $daycursor = $event->date_start_in_calendar;
731 $loop =
true; $j = 0;
732 $daykey =
dol_mktime(0, 0, 0, $mois, $jour, $annee,
'gmt');
736 $eventarray[$daykey][] = $event;
739 $daykey += 60 * 60 * 24;
740 if ($daykey > $event->date_end_in_calendar) {
756 $cachethirdparties = array();
757 $cachecontacts = array();
758 $cacheusers = array();
761 $color_file = DOL_DOCUMENT_ROOT.
"/theme/".$conf->theme.
"/theme_vars.inc.php";
762 if (is_readable($color_file)) {
765 if (!is_array($theme_datacolor)) {
766 $theme_datacolor = array(array(120, 130, 150), array(200, 160, 180), array(190, 190, 220));
771 $newparam = preg_replace(
'/showbirthday=/i',
'showbirthday_=', $newparam);
772 $newparam = preg_replace(
'/mode=show_month&?/i',
'', $newparam);
773 $newparam = preg_replace(
'/mode=show_week&?/i',
'', $newparam);
774 $newparam = preg_replace(
'/day=[0-9]+&?/i',
'', $newparam);
775 $newparam = preg_replace(
'/month=[0-9]+&?/i',
'', $newparam);
776 $newparam = preg_replace(
'/year=[0-9]+&?/i',
'', $newparam);
777 $newparam = preg_replace(
'/viewweek=[0-9]+&?/i',
'', $newparam);
778 $newparam = preg_replace(
'/showbirthday_=/i',
'showbirthday=', $newparam);
779 $newparam .=
'&viewweek=1';
781 print
'<input type="hidden" name="action" value="mupdate">';
782 echo
'<input type="hidden" name="backtopage" value="'.dol_escape_htmltag($_SERVER[
'PHP_SELF']).
'?'.
dol_escape_htmltag($_SERVER[
'QUERY_STRING']).
'">';
783 echo
'<input type="hidden" name="token" value="'.newToken().
'">';
784 echo
'<input type="hidden" name="newdate" id="newdate">';
792 echo
'<table width="100%" class="nocellnopadd cal_month">';
794 echo
'<tr class="liste_titre">';
797 echo
'<td align="center" colspan="'.($end_d - $begin_d).
'">';
798 echo $langs->trans(
"Year");
804 echo
'<tr class="liste_titre">';
807 for ($h = $begin_d; $h < $end_d; $h++) {
808 echo
'<td class="center">';
809 print
'<small style="font-family: courier">'.sprintf(
"%02d", $h).
'</small>';
816 $typeofevents = array();
819 $colorsbytype = array();
820 $labelbytype = array();
821 $sql =
"SELECT code, color, libelle as label FROM ".MAIN_DB_PREFIX.
"c_actioncomm ORDER BY position";
822 $resql = $db->query($sql);
823 while ($obj = $db->fetch_object(
$resql)) {
824 $typeofevents[$obj->code] = $obj->code;
825 $colorsbytype[$obj->code] = $obj->color;
826 $labelbytype[$obj->code] = $obj->label;
834 foreach ($typeofevents as $typeofevent) {
837 echo
'<td class="cal_current_month cal_peruserviewname'.($var ?
' cal_impair' :
'').
'">'.$typeofevent.
'</td>';
842 for ($iter_day = 0; $iter_day < 8; $iter_day++) {
843 if (($i + 1) < $begin_d || ($i + 1) > $end_d) {
851 $tmpday = $tmparray[
'mday'];
852 $tmpmonth = $tmparray[
'mon'];
853 $tmpyear = $tmparray[
'year'];
855 $style =
'cal_current_month';
856 if ($iter_day == 6) {
857 $style .=
' cal_other_month';
860 if ($todayarray[
'mday'] == $tmpday && $todayarray[
'mon'] == $tmpmonth && $todayarray[
'year'] == $tmpyear) {
864 $style =
'cal_today_peruser';
867 show_day_events_pertype($typeofevent, $tmpday, $tmpmonth, $tmpyear, 0, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype, $var);
878 if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
879 $langs->load(
"commercial");
880 print
'<br>'.$langs->trans(
"Legend").
': <br>';
881 foreach ($colorsbytype as $code => $color) {
883 print
'<div style="float: left; padding: 2px; margin-right: 6px;"><div style="'.($color ?
'background: #'.$color.
';' :
'').
'width:16px; float: left; margin-right: 4px;"> </div>';
884 print $langs->trans(
"Action".$code) !=
"Action".$code ? $langs->trans(
"Action".$code) : $labelbytype[$code];
890 print
'<div style="float: left; padding: 2px; margin-right: 6px;"><div class="peruser_busy" style="width:16px; float: left; margin-right: 4px;"> </div>';
891 print $langs->trans(
"Other");
900 print
"\n".
'</form>';
904 print
'<script type="text/javascript">
905 jQuery(document).ready(function() {
906 jQuery(".onclickopenref").click(function() {
907 var ref=$(this).attr(\'ref\');
908 var res = ref.split("_");
916 if (ids == \'none\') /* No event */
918 /* alert(\'no event\'); */
919 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).
'"
920 window.location.href = url;
922 else if (ids.indexOf(",") > -1) /* There is several events */
924 /* alert(\'several events\'); */
925 url = "'.DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list&filtert="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day;
926 window.location.href = url;
930 /* alert(\'one event\'); */
931 url = "'.DOL_URL_ROOT.
'/comm/action/card.php?action=view&id="+ids
932 window.location.href = url;
965 function 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)
968 global $user, $conf, $langs, $hookmanager, $action;
969 global $filter, $filtert, $status, $actioncode;
970 global $theme_datacolor;
971 global $cachethirdparties, $cachecontacts, $cacheusers, $cacheprojects, $colorindexused;
972 global $begin_h, $end_h;
977 $i = 0; $nummytasks = 0; $numother = 0; $numbirthday = 0; $numical = 0; $numicals = array();
978 $ymd = sprintf(
"%04d", $year).sprintf(
"%02d", $month).sprintf(
"%02d", $day);
980 $nextindextouse = count($colorindexused);
986 foreach ($eventarray as $daykey => $notused) {
991 if ($day == $jour && $month == $mois && $year == $annee) {
993 foreach ($eventarray[$daykey] as $index => $event) {
997 $keysofuserassigned = array_keys($event->userassigned);
998 if (!in_array($username->id, $keysofuserassigned)) {
1003 $parameters = array();
1004 $reshook = $hookmanager->executeHooks(
'formatEvent', $parameters, $event, $action);
1009 $ponct = ($event->date_start_in_calendar == $event->date_end_in_calendar);
1012 $color = -1; $cssclass =
''; $colorindex = -1;
1013 if (in_array($user->id, $keysofuserassigned)) {
1014 $nummytasks++; $cssclass =
'family_mytasks';
1015 if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
1016 $color = $event->type_color;
1018 } elseif ($event->type_code ==
'ICALEVENT') {
1020 if (!empty($event->icalname)) {
1027 $color = $event->icalcolor;
1028 $cssclass = (!empty($event->icalname) ?
'family_ext'.md5($event->icalname) :
'family_other unsortable');
1029 } elseif ($event->type_code ==
'BIRTHDAY') {
1030 $numbirthday++; $colorindex = 2; $cssclass =
'family_birthday unsortable'; $color = sprintf(
"%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
1032 $numother++; $cssclass =
'family_other';
1033 if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
1034 $color = $event->type_color;
1040 $idusertouse = ($event->userownerid ? $event->userownerid : 0);
1041 if (isset($colorindexused[$idusertouse])) {
1042 $colorindex = $colorindexused[$idusertouse];
1044 $colorindex = $nextindextouse;
1045 $colorindexused[$idusertouse] = $colorindex;
1046 if (!empty($theme_datacolor[$nextindextouse + 1])) {
1051 $color = sprintf(
"%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
1056 for ($h = $begin_h; $h < $end_h; $h++) {
1059 if (empty($event->fulldayevent)) {
1060 $a =
dol_mktime((
int) $h, 0, 0, $month, $day, $year,
'tzuserrel', 0);
1061 $b =
dol_mktime((
int) $h, 30, 0, $month, $day, $year,
'tzuserrel', 0);
1062 $c =
dol_mktime((
int) $h + 1, 0, 0, $month, $day, $year,
'tzuserrel', 0);
1064 $dateendtouse = $event->date_end_in_calendar;
1065 if ($dateendtouse == $event->date_start_in_calendar) {
1071 if ($event->date_start_in_calendar < $b && $dateendtouse > $a) {
1072 $busy = $event->transparency;
1073 $cases1[$h][$event->id][
'busy'] = $busy;
1074 $cases1[$h][$event->id][
'string'] =
dol_print_date($event->date_start_in_calendar,
'dayhour',
'tzuserrel');
1075 if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) {
1076 $tmpa =
dol_getdate($event->date_start_in_calendar,
true);
1077 $tmpb =
dol_getdate($event->date_end_in_calendar,
true);
1078 if ($tmpa[
'mday'] == $tmpb[
'mday'] && $tmpa[
'mon'] == $tmpb[
'mon'] && $tmpa[
'year'] == $tmpb[
'year']) {
1079 $cases1[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'hour',
'tzuserrel');
1081 $cases1[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'dayhour',
'tzuserrel');
1084 if ($event->label) {
1085 $cases1[$h][$event->id][
'string'] .=
' - '.$event->label;
1087 $cases1[$h][$event->id][
'typecode'] = $event->type_code;
1088 $cases1[$h][$event->id][
'color'] = $color;
1089 if ($event->fk_project > 0) {
1090 if (empty($cacheprojects[$event->fk_project])) {
1092 $tmpproj->fetch($event->fk_project);
1093 $cacheprojects[$event->fk_project] = $tmpproj;
1095 $cases1[$h][$event->id][
'string'] .=
', '.$langs->trans(
"Project").
': '.$cacheprojects[$event->fk_project]->ref.
' - '.$cacheprojects[$event->fk_project]->title;
1097 if ($event->socid > 0) {
1098 if (empty($cachethirdparties[$event->socid])) {
1099 $tmpthirdparty =
new Societe($db);
1100 $tmpthirdparty->fetch($event->socid);
1101 $cachethirdparties[$event->socid] = $tmpthirdparty;
1103 $cases1[$h][$event->id][
'string'] .=
', '.$cachethirdparties[$event->socid]->name;
1105 if ($event->contact_id > 0) {
1106 if (empty($cachecontacts[$event->contact_id])) {
1107 $tmpcontact =
new Contact($db);
1108 $tmpcontact->fetch($event->contact_id);
1109 $cachecontacts[$event->contact_id] = $tmpcontact;
1111 $cases1[$h][$event->id][
'string'] .=
', '.$cachecontacts[$event->contact_id]->getFullName($langs);
1114 if ($event->date_start_in_calendar < $c && $dateendtouse > $b) {
1115 $busy = $event->transparency;
1116 $cases2[$h][$event->id][
'busy'] = $busy;
1117 $cases2[$h][$event->id][
'string'] =
dol_print_date($event->date_start_in_calendar,
'dayhour',
'tzuserrel');
1118 if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) {
1119 $tmpa =
dol_getdate($event->date_start_in_calendar,
true);
1120 $tmpb =
dol_getdate($event->date_end_in_calendar,
true);
1121 if ($tmpa[
'mday'] == $tmpb[
'mday'] && $tmpa[
'mon'] == $tmpb[
'mon'] && $tmpa[
'year'] == $tmpb[
'year']) {
1122 $cases2[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'hour',
'tzuserrel');
1124 $cases2[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'dayhour',
'tzuserrel');
1127 if ($event->label) {
1128 $cases2[$h][$event->id][
'string'] .=
' - '.$event->label;
1130 $cases2[$h][$event->id][
'typecode'] = $event->type_code;
1131 $cases2[$h][$event->id][
'color'] = $color;
1132 if ($event->fk_project > 0) {
1133 if (empty($cacheprojects[$event->fk_project])) {
1135 $tmpproj->fetch($event->fk_project);
1136 $cacheprojects[$event->fk_project] = $tmpproj;
1138 $cases2[$h][$event->id][
'string'] .=
', '.$langs->trans(
"Project").
': '.$cacheprojects[$event->fk_project]->ref.
' - '.$cacheprojects[$event->fk_project]->title;
1140 if ($event->socid > 0) {
1141 if (empty($cachethirdparties[$event->socid])) {
1142 $tmpthirdparty =
new Societe($db);
1143 $tmpthirdparty->fetch($event->socid);
1144 $cachethirdparties[$event->socid] = $tmpthirdparty;
1146 $cases2[$h][$event->id][
'string'] .=
', '.$cachethirdparties[$event->socid]->name;
1148 if ($event->contact_id > 0) {
1149 if (empty($cachecontacts[$event->contact_id])) {
1150 $tmpcontact =
new Contact($db);
1151 $tmpcontact->fetch($event->contact_id);
1152 $cachecontacts[$event->contact_id] = $tmpcontact;
1154 $cases2[$h][$event->id][
'string'] .=
', '.$cachecontacts[$event->contact_id]->getFullName($langs);
1158 $busy = $event->transparency;
1159 $cases1[$h][$event->id][
'busy'] = $busy;
1160 $cases2[$h][$event->id][
'busy'] = $busy;
1161 $cases1[$h][$event->id][
'string'] = $event->label;
1162 $cases2[$h][$event->id][
'string'] = $event->label;
1163 $cases1[$h][$event->id][
'typecode'] = $event->type_code;
1164 $cases2[$h][$event->id][
'typecode'] = $event->type_code;
1165 $cases1[$h][$event->id][
'color'] = $color;
1166 $cases2[$h][$event->id][
'color'] = $color;
1177 for ($h = $begin_h; $h < $end_h; $h++) {
1178 $color1 =
''; $color2 =
'';
1179 $style1 =
''; $style2 =
'';
1180 $string1 =
' '; $string2 =
' ';
1181 $title1 =
''; $title2 =
'';
1182 if (isset($cases1[$h]) && $cases1[$h] !=
'') {
1184 if (count($cases1[$h]) > 1) {
1185 $title1 .= count($cases1[$h]).
' '.(count($cases1[$h]) == 1 ? $langs->trans(
"Event") : $langs->trans(
"Events"));
1187 $string1 =
' ';
1188 if (empty($conf->global->AGENDA_NO_TRANSPARENT_ON_NOT_BUSY)) {
1189 $style1 =
'peruser_notbusy';
1191 $style1 =
'peruser_busy';
1193 foreach ($cases1[$h] as $id => $ev) {
1195 $style1 =
'peruser_busy';
1199 if (isset($cases2[$h]) && $cases2[$h] !=
'') {
1201 if (count($cases2[$h]) > 1) {
1202 $title2 .= count($cases2[$h]).
' '.(count($cases2[$h]) == 1 ? $langs->trans(
"Event") : $langs->trans(
"Events"));
1204 $string2 =
' ';
1205 if (empty($conf->global->AGENDA_NO_TRANSPARENT_ON_NOT_BUSY)) {
1206 $style2 =
'peruser_notbusy';
1208 $style2 =
'peruser_busy';
1210 foreach ($cases2[$h] as $id => $ev) {
1212 $style2 =
'peruser_busy';
1217 $ids1 =
''; $ids2 =
'';
1218 if (count($cases1[$h]) && array_keys($cases1[$h])) {
1219 $ids1 = join(
',', array_keys($cases1[$h]));
1221 if (count($cases2[$h]) && array_keys($cases2[$h])) {
1222 $ids2 = join(
',', array_keys($cases2[$h]));
1225 if ($h == $begin_h) {
1226 echo
'<td class="'.$style.
'_peruserleft cal_peruser'.($var ?
' cal_impair '.$style.
'_impair' :
'').
'">';
1228 echo
'<td class="'.$style.
' cal_peruser'.($var ?
' cal_impair '.$style.
'_impair' :
'').
'">';
1230 if (count($cases1[$h]) == 1) {
1231 $output = array_slice($cases1[$h], 0, 1);
1232 $title1 = $langs->trans(
"Ref").
' '.$ids1.($title1 ?
' - '.$title1 :
'');
1233 if ($output[0][
'string']) {
1234 $title1 .= ($title1 ?
' - ' :
'').$output[0][
'string'];
1236 if ($output[0][
'color']) {
1237 $color1 = $output[0][
'color'];
1239 } elseif (count($cases1[$h]) > 1) {
1240 $title1 = $langs->trans(
"Ref").
' '.$ids1.($title1 ?
' - '.$title1 :
'');
1244 if (count($cases2[$h]) == 1) {
1245 $output = array_slice($cases2[$h], 0, 1);
1246 $title2 = $langs->trans(
"Ref").
' '.$ids2.($title2 ?
' - '.$title2 :
'');
1247 if ($output[0][
'string']) {
1248 $title2 .= ($title2 ?
' - ' :
'').$output[0][
'string'];
1250 if ($output[0][
'color']) {
1251 $color2 = $output[0][
'color'];
1253 } elseif (count($cases2[$h]) > 1) {
1254 $title2 = $langs->trans(
"Ref").
' '.$ids2.($title2 ?
' - '.$title2 :
'');
1257 print
'<table class="nobordernopadding" width="100%">';
1258 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.
'"' :
'').
'>';
1260 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.
'"' :
'').
'>';
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
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...)
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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.
dol_string_nospecial($str, $newstr='_', $badcharstoreplace='', $badcharstoremove='')
Clean a string from all punctuation characters to use it as a ref or login.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
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.
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.