34require
'../../main.inc.php';
42require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
45require_once DOL_DOCUMENT_ROOT.
'/user/class/usergroup.class.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
49require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
54$disabledefaultvalues =
GETPOSTINT(
'disabledefaultvalues');
56$action =
GETPOST(
'action',
'aZ09');
59$filter =
GETPOST(
"search_filter",
'alpha', 3) ?
GETPOST(
"search_filter",
'alpha', 3) :
GETPOST(
"filter",
'alpha', 3);
60$filtert =
GETPOST(
"search_filtert",
"intcomma", 3) ?
GETPOST(
"search_filtert",
"intcomma", 3) :
GETPOST(
"filtert",
"intcomma", 3);
66$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
67$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
69if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
73$offset = $limit * $page;
78 $sortfield =
"a.datec";
84 $socid = $user->socid;
91if (!$user->hasRight(
'agenda',
'myactions',
'read')) {
94if (!$user->hasRight(
'agenda',
'allactions',
'read')) {
97if (!$user->hasRight(
'agenda',
'allactions',
'read') || $filter ==
'mine') {
98 $filtert = (
string) $user->id;
101$mode =
'show_peruser';
107$pid = GETPOSTISSET(
"search_projectid") ?
GETPOSTINT(
"search_projectid", 3) :
GETPOSTINT(
"projectid", 3);
108$status = GETPOSTISSET(
"search_status") ?
GETPOST(
"search_status",
'aZ09') :
GETPOST(
"status",
'aZ09');
109$type = GETPOSTISSET(
"search_type") ?
GETPOST(
"search_type",
'aZ09') :
GETPOST(
"type",
'aZ09');
111$optioncss =
GETPOST(
'optioncss',
'aZ');
114if (
GETPOST(
'search_actioncode',
'array:aZ09')) {
115 $actioncode =
GETPOST(
'search_actioncode',
'array:aZ09', 3);
116 if (!count($actioncode)) {
120 $actioncode =
GETPOST(
"search_actioncode",
"alpha", 3) ?
GETPOST(
"search_actioncode",
"alpha", 3) : (
GETPOST(
"search_actioncode",
"alpha") ==
'0' ?
'0' : ((!
getDolGlobalString(
'AGENDA_DEFAULT_FILTER_TYPE') || $disabledefaultvalues) ?
'' :
getDolGlobalString(
'AGENDA_DEFAULT_FILTER_TYPE')));
124if ($dateselect > 0) {
132$tmp = str_replace(
' ',
'', $tmp);
133$tmparray = explode(
'-', $tmp);
134$begin_h = GETPOSTISSET(
'begin_h') ?
GETPOSTINT(
'begin_h') : ($tmparray[0] !=
'' ? $tmparray[0] : 9);
135$end_h = GETPOSTISSET(
'end_h') ?
GETPOSTINT(
'end_h') : ($tmparray[1] !=
'' ? $tmparray[1] : 18);
136if ($begin_h < 0 || $begin_h > 23) {
139if ($end_h < 1 || $end_h > 24) {
142if ($end_h <= $begin_h) {
143 $end_h = $begin_h + 1;
148$tmp = str_replace(
' ',
'', $tmp);
149$tmparray = explode(
'-', $tmp);
150$begin_d = GETPOSTISSET(
'begin_d') ?
GETPOSTINT(
'begin_d') : ($tmparray[0] !=
'' ? $tmparray[0] : 1);
151$end_d = GETPOSTISSET(
'end_d') ?
GETPOSTINT(
'end_d') : ($tmparray[1] !=
'' ? $tmparray[1] : 5);
152if ($begin_d < 1 || $begin_d > 7) {
155if ($end_d < 1 || $end_d > 7) {
158if ($end_d < $begin_d) {
159 $end_d = $begin_d + 1;
162if ($status ==
'' && !GETPOSTISSET(
'search_status')) {
166if (empty($mode) && !GETPOSTISSET(
'mode')) {
171if (
GETPOST(
'viewcal',
'alpha') && $mode !=
'show_day' && $mode !=
'show_week' && $mode !=
'show_peruser') {
172 $mode =
'show_month';
176if (
GETPOST(
'viewweek',
'alpha') || $mode ==
'show_week') {
178 $week = ($week ? $week :
date(
"W"));
179 $day = ($day ? $day :
date(
"d"));
182if (
GETPOST(
'viewday',
'alpha') || $mode ==
'show_day') {
184 $day = ($day ? $day :
date(
"d"));
187$labelbytype = array();
192$langs->loadLangs(array(
'users',
'agenda',
'other',
'commercial'));
195$hookmanager->initHooks(array(
'agenda'));
197$result =
restrictedArea($user,
'agenda', 0,
'actioncomm&societe',
'myactions|allactions',
'fk_soc',
'id');
198if ($user->socid && $socid) {
202$search_status = $status;
223 'maxprint' => $maxprint,
225 'filtert' => $filtert,
226 'showbirthday' => $showbirthday,
227 'canedit' => $canedit,
228 'optioncss' => $optioncss,
229 'actioncode' => $actioncode,
231 'resourceid' => $resourceid,
232 'usergroup' => $usergroup,
234$reshook = $hookmanager->executeHooks(
'beforeAgendaPerUser', $parameters, $object, $action);
242$help_url =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
243llxHeader(
'', $langs->trans(
"Agenda"), $help_url);
247$nowyear = $nowarray[
'year'];
248$nowmonth = $nowarray[
'mon'];
249$nowday = $nowarray[
'mday'];
252$listofextcals = array();
256while ($i < $MAXAGENDA) {
258 $source =
'AGENDA_EXT_SRC'.$i;
259 $name =
'AGENDA_EXT_NAME'.$i;
260 $offsettz =
'AGENDA_EXT_OFFSETTZ'.$i;
261 $color =
'AGENDA_EXT_COLOR'.$i;
262 $enabled =
'AGENDA_EXT_ENABLED'.$i;
263 $default =
'AGENDA_EXT_ACTIVEBYDEFAULT'.$i;
264 $buggedfile =
'AGENDA_EXT_BUGGEDFILE'.$i;
267 $listofextcals[] = array(
268 'type' =>
'globalsetup',
282while ($i < $MAXAGENDA) {
284 $source =
'AGENDA_EXT_SRC_'.$user->id.
'_'.$i;
285 $name =
'AGENDA_EXT_NAME_'.$user->id.
'_'.$i;
286 $offsettz =
'AGENDA_EXT_OFFSETTZ_'.$user->id.
'_'.$i;
287 $color =
'AGENDA_EXT_COLOR_'.$user->id.
'_'.$i;
288 $enabled =
'AGENDA_EXT_ENABLED_'.$user->id.
'_'.$i;
289 $default =
'AGENDA_EXT_ACTIVEBYDEFAULT_'.$user->id.
'_'.$i;
290 $buggedfile =
'AGENDA_EXT_BUGGEDFILE_'.$user->id.
'_'.$i;
294 $listofextcals[] = array(
295 'type' =>
'usersetup',
298 'offsettz' => (
int) (empty($user->conf->$offsettz) ? 0 : $user->
conf->$offsettz),
309$first_day = $prev[
'first_day'];
310$first_month = $prev[
'first_month'];
311$first_year = $prev[
'first_year'];
313$week = $prev[
'week'];
317$next_year = $next[
'year'];
318$next_month = $next[
'month'];
319$next_day = $next[
'day'];
321$max_day_in_month =
date(
"t",
dol_mktime(0, 0, 0, $month, 1, $year));
327$title = $langs->trans(
"DoneAndToDoActions");
328if ($status ==
'done') {
329 $title = $langs->trans(
"DoneActions");
331if ($status ==
'todo') {
332 $title = $langs->trans(
"ToDoActions");
336if (($actioncode && $actioncode !==
'-1') || GETPOSTISSET(
'search_actioncode')) {
337 if (is_array($actioncode)) {
338 foreach ($actioncode as $str_action) {
339 if ($str_action !=
'-1') {
340 $param .=
"&search_actioncode[]=".urlencode($str_action);
344 $param .=
"&search_actioncode=".urlencode($actioncode);
347if ($resourceid > 0) {
348 $param .=
"&search_resourceid=".urlencode((
string) ($resourceid));
351if ($status || GETPOSTISSET(
'status') || GETPOSTISSET(
'search_status')) {
352 $param .=
"&search_status=".urlencode($status);
355 $param .=
"&search_filter=".urlencode((
string) $filter);
358 $param .=
"&search_filtert=".urlencode((
string) $filtert);
361 $param .=
"&search_usergroup=".urlencode((
string) ($usergroup));
364 $param .=
"&search_socid=".urlencode((
string) ($socid));
367 $param .=
"&search_showbirthday=1";
370 $param .=
"&search_projectid=".urlencode((
string) ($pid));
373 $param .=
"&search_type=".urlencode($type);
375if ($mode !=
'show_peruser') {
376 $param .=
'&mode='.urlencode((
string) $mode);
379 $param .=
'&begin_h='.((int) $begin_h);
382 $param .=
'&end_h='.((int) $end_h);
385 $param .=
'&begin_d='.((int) $begin_d);
388 $param .=
'&end_d='.((int) $end_d);
390if ($search_categ_cus != 0) {
391 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
394 $param .=
'&check_holiday=1';
396$param .=
"&maxprint=".urlencode((
string) ($maxprint));
398$paramnoactionodate = $param;
403$prev_year = $prev[
'prev_year'];
404$prev_month = $prev[
'prev_month'];
405$prev_day = $prev[
'prev_day'];
406$first_day = $prev[
'first_day'];
407$first_month = $prev[
'first_month'];
408$first_year = $prev[
'first_year'];
410$week = $prev[
'week'];
414$next_year = $next[
'year'];
415$next_month = $next[
'month'];
416$next_day = $next[
'day'];
420$firstdaytoshow =
dol_mktime(0, 0, 0, $first_month, $first_day, $first_year,
'tzuserrel');
421$nb_weeks_to_show = (
getDolGlobalString(
'AGENDA_NB_WEEKS_IN_VIEW_PER_USER')) ? ((
int)
$conf->global->AGENDA_NB_WEEKS_IN_VIEW_PER_USER * 7) : 7;
427$max_day_in_month = idate(
"t",
dol_mktime(0, 0, 0, $month, 1, $year,
'gmt'));
430$picto =
'calendarweek';
433$nav =
'<div class="navselectiondate inline-block nowraponall">';
434$nav .=
"<a href=\"?year=".$prev_year.
"&month=".$prev_month.
"&day=".$prev_day.$param.
"\"><i class=\"fa fa-chevron-left\" title=\"".
dol_escape_htmltag($langs->trans(
"Previous")).
"\"></i></a> \n";
435$nav .=
" <span id=\"month_name\">".dol_print_date(
dol_mktime(0, 0, 0, $first_month, $first_day, $first_year),
"%Y").
", ".$langs->trans(
"WeekShort").
" ".$week;
437$nav .=
" <a href=\"?year=".$next_year.
"&month=".$next_month.
"&day=".$next_day.$param.
"\"><i class=\"fa fa-chevron-right\" title=\"".
dol_escape_htmltag($langs->trans(
"Next")).
"\"></i></a>\n";
438if (empty(
$conf->dol_optimize_smallscreen)) {
439 $nav .=
' <a href="?year='.$nowyear.
'&month='.$nowmonth.
'&day='.$nowday.$param.
'" class="datenowlink marginleftonly marginrightonly">'.$langs->trans(
"Today").
'</a> ';
442$nav .= $form->selectDate($dateselect,
'dateselect', 0, 0, 1,
'', 1, 0);
444$nav .=
'<button type="submit" class="liste_titre button_search valignmiddle" name="button_search_x" value="x"><span class="fa fa-search"></span></button>';
447$paramnodate = $param;
448$param .=
'&year='.$year.
'&month='.$month.($day ?
'&day='.$day :
'');
452$paramnoaction = preg_replace(
'/mode=[a-z_]+/',
'', preg_replace(
'/action=[a-z_]+/',
'', $param));
453$paramnoactionodate = preg_replace(
'/mode=[a-z_]+/',
'', preg_replace(
'/action=[a-z_]+/',
'', $paramnodate));
457print
'<form method="POST" id="searchFormList" class="listactionsfilter" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
458if ($optioncss !=
'') {
459 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
461print
'<input type="hidden" name="token" value="'.newToken().
'">';
462print
'<input type="hidden" name="mode" value="'.$mode.
'">';
465$mode =
'show_peruser';
466$massactionbutton =
'';
469$viewmode =
'<div class="navmode inline-block">';
471$viewmode .=
'<a class="btnTitle reposition" href="'.DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1'.$paramnoactionodate.
'">';
473$viewmode .=
img_picto($langs->trans(
"List"),
'object_calendarlist',
'class="imgforviewmode pictoactionview block"');
475$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewList").
'</span></a>';
479$viewmode .=
img_picto($langs->trans(
"ViewCal"),
'object_calendarmonth',
'class="pictoactionview block"');
481$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewCal").
'</span></a>';
485$viewmode .=
img_picto($langs->trans(
"ViewWeek"),
'object_calendarweek',
'class="pictoactionview block"');
487$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewWeek").
'</span></a>';
491$viewmode .=
img_picto($langs->trans(
"ViewDay"),
'object_calendarday',
'class="pictoactionview block"');
493$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewDay").
'</span></a>';
497$viewmode .=
img_picto($langs->trans(
"ViewPerUser"),
'object_calendarperuser',
'class="pictoactionview block"');
499$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow" title="'.dolPrintHTML($langs->trans(
"ViewPerUser")).
'">'.$langs->trans(
"ViewPerUser").
'</span></a>';
502$parameters = array();
504$reshook = $hookmanager->executeHooks(
'addCalendarView', $parameters, $object, $action);
505if (empty($reshook)) {
506 $viewmode .= $hookmanager->resPrint;
507} elseif ($reshook > 1) {
508 $viewmode = $hookmanager->resPrint;
511$viewmode .=
'</div>';
513$viewmode .=
'<span class="marginrightonly"></span>';
518if ($user->hasRight(
'agenda',
'myactions',
'create') || $user->hasRight(
'agenda',
'allactions',
'create')) {
521 $newparam .=
'&month='.urlencode(str_pad((
string) $month, 2,
"0", STR_PAD_LEFT)).
'&year='.((int) $tmpforcreatebutton[
'year']);
522 if ($begin_h !==
'') {
523 $newparam .=
'&begin_h='.((int) $begin_h);
526 $newparam .=
'&end_h='.((int) $end_h);
528 if ($begin_d !==
'') {
529 $newparam .=
'&begin_d='.((int) $begin_d);
532 $newparam .=
'&end_d='.((int) $end_d);
535 $urltocreateaction = DOL_URL_ROOT.
'/comm/action/card.php?action=create';
536 $urltocreateaction .=
'&apyear='.$tmpforcreatebutton[
'year'].
'&apmonth='.$tmpforcreatebutton[
'mon'].
'&apday='.$tmpforcreatebutton[
'mday'].
'&aphour='.$tmpforcreatebutton[
'hours'].
'&apmin='.$tmpforcreatebutton[
'minutes'];
537 $urltocreateaction .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].
'?'.$newparam);
539 $newcardbutton .=
dolGetButtonTitle($langs->trans(
"AddAction"),
'',
'fa fa-plus-circle', $urltocreateaction);
548$showextcals = $listofextcals;
549$bookcalcalendars = array();
553 $sql =
"SELECT ba.rowid, bc.label, bc.ref, bc.rowid as id_cal";
554 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bookcal_availabilities as ba";
555 $sql .=
" JOIN ".MAIN_DB_PREFIX.
"bookcal_calendar as bc";
556 $sql .=
" ON bc.rowid = ba.fk_bookcal_calendar";
557 $sql .=
" WHERE bc.status = 1";
558 $sql .=
" AND ba.status = 1";
559 $sql .=
" AND bc.entity IN (".getEntity(
'agenda').
")";
560 if (!empty($filtert) && $filtert !=
'-1' && $filtert !=
'-2') {
561 $sql .=
" AND bc.visibility IN (".$db->sanitize($filtert, 0, 0, 0, 0).
")";
563 $resql =
$db->query($sql);
565 $num =
$db->num_rows($resql);
568 $objp =
$db->fetch_object($resql);
569 $label = !empty($objp->label) ? $objp->label : $objp->ref;
570 $bookcalcalendars[
"calendars"][$objp->id_cal] = array(
"id" => $objp->id_cal,
"label" => $label);
571 $bookcalcalendars[
"availabilitieslink"][$objp->rowid] = $objp->id_cal;
579if (!empty(
$conf->use_javascript_ajax)) {
580 $s .=
"\n".
'<!-- Div to calendars selectors -->'.
"\n";
582 $s .=
'<script type="text/javascript">'.
"\n";
583 $s .=
'jQuery(document).ready(function () {'.
"\n";
584 $s .=
'jQuery(".check_birthday").click(function() { console.log("Click on .check_birthday so we toggle class .peruser_birthday"); jQuery(".peruser_birthday").addClass("peruser_birthday_imp"); });'.
"\n";
586 $s .=
'jQuery(".check_holiday").click(function() {';
587 $s .=
' console.log("Click on .check_holiday so we toggle class .peruser_holiday");';
588 $s .=
' if (jQuery(".peruser_holiday").hasClass("peruser_holiday_imp")) {';
589 $s .=
' jQuery(".peruser_holiday").removeClass("peruser_holiday_imp");';
591 $s .=
' jQuery(".peruser_holiday").addClass("peruser_holiday_imp");';
594 $s .=
' var checkHoliday = jQuery(this).is(":checked") ? 1 : 0;';
595 $s .=
' jQuery(".navselectiondate a, .navmode a").each(function(index, elem) { ';
596 $s .=
' var navLinkElem = jQuery(elem);';
597 $s .=
' var navLinkHref = navLinkElem.attr("href");';
598 $s .=
' var navLinkParts = navLinkHref.split("?");';
599 $s .=
' var navLinkPath = navLinkParts[0];';
600 $s .=
' var navLinkParams = new URLSearchParams(navLinkParts[1] || "");';
601 $s .=
' navLinkParams.set("check_holiday", checkHoliday);';
602 $s .=
' navLinkElem.attr("href", navLinkPath + "?" + navLinkParams.toString());';
606 if (
isModEnabled(
"bookcal") && !empty($bookcalcalendars[
"calendars"])) {
607 foreach ($bookcalcalendars[
"calendars"] as $key => $value) {
608 $s .=
'jQuery(".check_bookcal_calendar_'.$value[
'id'].
'").click(function() { console.log("Toggle Bookcal Calendar '.$value[
'id'].
'"); jQuery(".family_bookcal_calendar_'.$value[
'id'].
'").toggle(); });'.
"\n";
612 $s .=
'</script>'.
"\n";
615 $s .=
'<div class="nowrap inline-block minheight30 hideonsmartphone"><input type="checkbox" id="check_mytasks" name="check_mytasks" value="1" class="check_mytasks" checked disabled><label class="labelcalendar"><span class="check_local_text small"> '.$langs->trans(
"LocalAgenda").
' </span></label></div>';
618 if ($user->hasRight(
"holiday",
"read")) {
620 <div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday small" value="1" class="marginleftonly check_holiday"' . ($check_holiday ?
' checked' :
'') .
'>
621 <label for="check_holiday" class="labelcalendar">
622 <span class="check_holiday_text small">' . $langs->trans(
"Holidays") .
'</span>
628 if (is_array($showextcals) && count($showextcals) > 0) {
629 $s .=
'<script type="text/javascript">'.
"\n";
630 $s .=
'jQuery(document).ready(function () {
631 jQuery("div input[name^=\"check_ext\"]").each(function(index, elem) {
632 var name = jQuery(elem).attr("name");
633 if (jQuery(elem).is(":checked")) {
634 jQuery(".family_ext" + name.replace("check_ext", "")).show();
636 jQuery(".family_ext" + name.replace("check_ext", "")).hide();
640 jQuery("div input[name^=\"check_ext\"]").click(function() {
641 var name = $(this).attr("name");
642 jQuery(".family_ext" + name.replace("check_ext", "")).toggle();
645 $s .=
'</script>'.
"\n";
647 foreach ($showextcals as $val) {
648 $htmlname = md5($val[
'name']);
650 if (!empty($val[
'default']) ||
GETPOSTINT(
'check_ext'.$htmlname)) {
651 $default =
"checked";
656 $tooltip = $langs->trans(
"Cache").
' '.round($DELAYFORCACHE / 60).
'mn';
658 $s .=
'<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_ext'.$htmlname.
'" class="marginleftonly check_ext_'.$htmlname.
'" name="check_ext'.$htmlname.
'" value="1" '.$default.
'><label for="check_ext'.$htmlname.
'" title="'.
dol_escape_htmltag($tooltip).
'" class="labelcalendar"><span class="check_ext_text small">'.
dol_escape_htmltag($val[
'name']).
'</small></label> </div>';
682 $parameters = array();
683 $reshook = $hookmanager->executeHooks(
'addCalendarChoice', $parameters, $object, $action);
684 if (empty($reshook)) {
685 $s .= $hookmanager->resPrint;
686 } elseif ($reshook > 1) {
687 $s = $hookmanager->resPrint;
690 $s .=
"\n".
'<!-- End div to calendars selectors -->'.
"\n";
693 $newparam = preg_replace(
'/showbirthday=[0-1]/i',
'showbirthday='.($showbirthday ?
'1' :
'0'), $newparam);
694 if (!preg_match(
'/showbirthday=/i', $newparam)) {
695 $newparam .=
'&showbirthday=1';
700 $link .= $langs->trans(
"AgendaShowBirthdayEvents");
702 $link .= $langs->trans(
"AgendaHideBirthdayEvents");
709$eventarray = array();
717$sql .=
" a.id, a.label,";
720$sql .=
" a.percent,";
721$sql .=
" a.fk_user_author, a.fk_user_action,";
722$sql .=
" a.transparency, a.priority, a.fulldayevent, a.location,";
723$sql .=
" a.fk_soc, a.fk_contact, a.fk_project, a.fk_bookcal_calendar,";
724$sql .=
" a.fk_element, a.elementtype,";
725$sql .=
" ca.code as type_code, ca.libelle as type_label, ca.color as type_color, ca.type as type_type, ca.picto as type_picto";
728$parameters = array();
729$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
730$sql .= $hookmanager->resPrint;
734$sql .=
" FROM ".MAIN_DB_PREFIX.
"c_actioncomm as ca, ".MAIN_DB_PREFIX.
"actioncomm as a";
736if ($resourceid > 0) {
737 $sql .=
", ".MAIN_DB_PREFIX.
"element_resources as r";
741if (($filtert !=
'-1' && $filtert !=
'-2') || $usergroup > 0) {
743 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"actioncomm_resources as ar";
744 $sql .=
" ON ar.fk_actioncomm = a.id AND ar.element_type = 'user'";
745 if ($filtert !=
'' && $filtert !=
'-1' && $filtert !=
'-2' && $filtert !=
'-3') {
746 $sql .=
" AND ar.fk_element IN (".$db->sanitize($filtert).
")";
747 } elseif ($filtert ==
'-3') {
748 $sql .=
" AND ar.fk_element IN (".$db->sanitize(implode(
',', $user->getAllChildIds(1))).
")";
750 if ($usergroup > 0) {
751 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"usergroup_user as ugu ON ugu.fk_user = ar.fk_element AND ugu.fk_usergroup = ".((int) $usergroup);
755$sql .=
" WHERE a.fk_action = ca.id";
756$sql .=
" AND a.entity IN (".getEntity(
'agenda').
")";
759if (!empty($actioncode)) {
761 if ((is_array($actioncode) && in_array(
'AC_NON_AUTO', $actioncode)) || $actioncode ==
'AC_NON_AUTO') {
762 $sql .=
" AND ca.type != 'systemauto'";
763 } elseif ((is_array($actioncode) && in_array(
'AC_ALL_AUTO', $actioncode)) || $actioncode ==
'AC_ALL_AUTO') {
764 $sql .=
" AND ca.type = 'systemauto'";
766 if ((is_array($actioncode) && in_array(
'AC_OTH', $actioncode)) || $actioncode ==
'AC_OTH') {
767 $sql .=
" AND ca.type != 'systemauto'";
769 if ((is_array($actioncode) && in_array(
'AC_OTH_AUTO', $actioncode)) || $actioncode ==
'AC_OTH_AUTO') {
770 $sql .=
" AND ca.type = 'systemauto'";
774 if ((is_array($actioncode) && in_array(
'AC_NON_AUTO', $actioncode)) || $actioncode ===
'AC_NON_AUTO') {
775 $sql .=
" AND ca.type != 'systemauto'";
776 } elseif ((is_array($actioncode) && in_array(
'AC_ALL_AUTO', $actioncode)) || $actioncode ===
'AC_ALL_AUTO') {
777 $sql .=
" AND ca.type = 'systemauto'";
778 } elseif ((is_array($actioncode) && !in_array(
'-1', $actioncode) && !in_array(
'-3', $actioncode)) || ($actioncode !==
'-1' && $actioncode !==
'-3')) {
779 if (is_array($actioncode)) {
780 foreach ($actioncode as $key => $val) {
781 if ($val ==
'-1' || $val ==
'-2') {
782 unset($actioncode[$key]);
785 if (!empty($actioncode)) {
786 $sql .=
" AND ca.code IN (".$db->sanitize(
"'".implode(
"','", $actioncode).
"'", 1).
")";
789 $sql .=
" AND ca.code IN (".$db->sanitize(
"'".implode(
"','", explode(
',', $actioncode)).
"'", 1).
")";
794if ($resourceid > 0) {
795 $sql .=
" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".((int) $resourceid);
798 $sql .=
" AND a.fk_project = ".((int) $pid);
802if (
isModEnabled(
"societe") && !$user->hasRight(
'societe',
'client',
'voir')) {
803 $search_sale = $user->id;
806if ($search_sale && $search_sale !=
'-1') {
807 if ($search_sale == -2) {
808 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc)";
809 } elseif ($search_sale > 0) {
810 $sql .=
" AND (a.fk_soc IS NULL OR EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = ".((int) $search_sale).
"))";
815 $sql .=
" AND a.fk_soc = ".((int) $socid);
818if ($mode ==
'show_day') {
820 $sql .=
" (a.datep BETWEEN '".$db->idate(
dol_mktime(0, 0, 0, $month, $day, $year,
'tzuserrel')).
"'";
821 $sql .=
" AND '".$db->idate(
dol_mktime(23, 59, 59, $month, $day, $year,
'tzuserrel')).
"')";
823 $sql .=
" (a.datep2 BETWEEN '".$db->idate(
dol_mktime(0, 0, 0, $month, $day, $year,
'tzuserrel')).
"'";
824 $sql .=
" AND '".$db->idate(
dol_mktime(23, 59, 59, $month, $day, $year,
'tzuserrel')).
"')";
826 $sql .=
" (a.datep < '".$db->idate(
dol_mktime(0, 0, 0, $month, $day, $year,
'tzuserrel')).
"'";
827 $sql .=
" AND a.datep2 > '".$db->idate(
dol_mktime(23, 59, 59, $month, $day, $year,
'tzuserrel')).
"')";
832 $sql .=
" (a.datep BETWEEN '".$db->idate($firstdaytoshow - (60 * 60 * 24 * 2)).
"'";
833 $sql .=
" AND '".$db->idate($lastdaytoshow + (60 * 60 * 24 * 2)).
"')";
835 $sql .=
" (a.datep2 BETWEEN '".$db->idate($firstdaytoshow - (60 * 60 * 24 * 2)).
"'";
836 $sql .=
" AND '".$db->idate($lastdaytoshow + (60 * 60 * 24 * 2)).
"')";
838 $sql .=
" (a.datep < '".$db->idate($firstdaytoshow - (60 * 60 * 24 * 2)).
"'";
839 $sql .=
" AND a.datep2 > '".$db->idate($lastdaytoshow + (60 * 60 * 24 * 2)).
"')";
843 $sql .=
" AND ca.id = ".((int) $type);
847 $sql .=
" AND a.percent = 0";
849if ($status ===
'na') {
851 $sql .=
" AND a.percent = -1";
853if ($status ==
'50') {
855 $sql .=
" AND (a.percent > 0 AND a.percent < 100)";
857if ($status ==
'done' || $status ==
'100') {
858 $sql .=
" AND (a.percent = 100)";
860if ($status ==
'todo') {
861 $sql .=
" AND (a.percent >= 0 AND a.percent < 100)";
864if (($filtert > 0 || $filtert == -3) || $usergroup > 0) {
868 $sql .=
"ar.fk_element = ".((int) $filtert);
869 } elseif ($filtert == -3) {
870 $sql .=
"ar.fk_element IN (".$db->sanitize(implode(
',', $user->getAllChildIds(1))).
")";
872 if ($usergroup > 0) {
873 $sql .= ($filtert > 0 ?
" OR " :
"").
" ugu.fk_usergroup = ".((
int) $usergroup);
879if ($search_categ_cus != -1) {
880 if ($search_categ_cus == -2) {
881 $sql .=
" AND NOT EXISTS (SELECT ca.fk_actioncomm FROM ".MAIN_DB_PREFIX.
"categorie_actioncomm as ca WHERE ca.fk_actioncomm = a.id)";
882 } elseif ($search_categ_cus > 0) {
883 $sql .=
" AND EXISTS (SELECT ca.fk_actioncomm FROM ".MAIN_DB_PREFIX.
"categorie_actioncomm as ca WHERE ca.fk_actioncomm = a.id AND ca.fk_categorie IN (".
$db->sanitize((
string) $search_categ_cus).
"))";
887$sql .=
$db->order(
"fk_user_action, datep");
890dol_syslog(
"comm/action/peruser.php", LOG_DEBUG);
891$resql =
$db->query($sql);
893 $num =
$db->num_rows($resql);
895 $MAXONSAMEPAGE = 10000;
897 while ($i < $num && $i < $MAXONSAMEPAGE) {
898 $obj =
$db->fetch_object($resql);
902 if (
getDolGlobalString(
'AGENDA_ALWAYS_HIDE_AUTO') && $obj->type_code ==
'AC_OTH_AUTO') {
907 $datep =
$db->jdate($obj->datep);
908 $datep2 =
$db->jdate($obj->datep2);
914 $event->id = $obj->id;
915 $event->ref = (
string) $event->id;
917 $event->fulldayevent = $obj->fulldayevent;
920 if ($event->fulldayevent) {
922 $event->datep =
$db->jdate($obj->datep, $tzforfullday ?
'tzuser' :
'tzserver');
923 $event->datef =
$db->jdate($obj->datep2, $tzforfullday ?
'tzuser' :
'tzserver');
926 $event->datep =
$db->jdate($obj->datep,
'tzserver');
927 $event->datef =
$db->jdate($obj->datep2,
'tzserver');
933 $event->type_code = $obj->type_code;
934 $event->type_label = $obj->type_label;
935 $event->type_color = $obj->type_color;
936 $event->type = $obj->type_type;
937 $event->type_picto = $obj->type_picto;
939 $event->label = $obj->label;
940 $event->percentage = $obj->percent;
941 $event->authorid = $obj->fk_user_author;
942 $event->userownerid = $obj->fk_user_action;
943 $event->fetch_userassigned();
945 $event->priority = $obj->priority;
946 $event->location = $obj->location;
947 $event->transparency = $obj->transparency;
948 $event->fk_element = $obj->fk_element;
949 $event->elementid = $obj->fk_element;
950 $event->elementtype = $obj->elementtype;
952 $event->fk_project = $obj->fk_project;
954 $event->socid = $obj->fk_soc;
955 $event->contact_id = $obj->fk_contact;
956 $event->fk_bookcal_calendar = $obj->fk_bookcal_calendar;
957 if (!empty($event->fk_bookcal_calendar)) {
958 $event->type =
"bookcal_calendar";
963 $event->date_start_in_calendar = $event->datep;
964 if ($event->datef !=
'' && $event->datef >= $event->datep) {
965 $event->date_end_in_calendar = $event->datef;
967 $event->date_end_in_calendar = $event->datep;
973 if ($event->date_end_in_calendar < $firstdaytoshow || $event->date_start_in_calendar >= $lastdaytoshow) {
977 if ($event->date_start_in_calendar < $firstdaytoshow) {
978 $event->date_start_in_calendar = $firstdaytoshow;
980 if ($event->date_end_in_calendar >= $lastdaytoshow) {
981 $event->date_end_in_calendar = ($lastdaytoshow - 1);
985 $daycursor = $event->date_start_in_calendar;
990 $daycursorend = $event->date_end_in_calendar;
991 $anneeend = (int)
dol_print_date($daycursorend,
'%Y',
'tzuserrel');
992 $moisend = (int)
dol_print_date($daycursorend,
'%m',
'tzuserrel');
993 $jourend = (int)
dol_print_date($daycursorend,
'%d',
'tzuserrel');
998 $daykey =
dol_mktime(0, 0, 0, $mois, $jour, $annee,
'gmt');
999 $daykeyend =
dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend,
'gmt');
1013 $eventarray[$daykey][] = $event;
1016 $daykey += 60 * 60 * 24;
1018 if ($daykey > $daykeyend) {
1027 $parameters[
'obj'] = $obj;
1028 $reshook = $hookmanager->executeHooks(
'hookEventElements', $parameters, $event, $action);
1029 $event = $hookmanager->resPrint;
1047 $sql =
'SELECT sp.rowid, sp.lastname, sp.firstname, sp.birthday';
1048 $sql .=
' FROM '.MAIN_DB_PREFIX.
'socpeople as sp';
1049 $sql .=
' WHERE (priv=0 OR (priv=1 AND fk_user_creat='.((int) $user->id).
'))';
1050 $sql .=
" AND sp.entity IN (".getEntity(
'contact').
")";
1051 if ($mode ==
'show_day') {
1052 $sql .=
' AND MONTH(birthday) = '.((int) $month);
1053 $sql .=
' AND DAY(birthday) = '.((int) $day);
1055 $sql .=
' AND MONTH(birthday) = '.((int) $month);
1057 $sql .=
' ORDER BY birthday';
1059 dol_syslog(
"comm/action/index.php", LOG_DEBUG);
1060 $resql =
$db->query($sql);
1062 $num =
$db->num_rows($resql);
1065 $obj =
$db->fetch_object($resql);
1069 $event->id = $obj->rowid;
1070 $event->ref = (
string) $event->id;
1075 $event->datep =
dol_mktime(0, 0, 0, $datearray[
'mon'], $datearray[
'mday'], $year,
true);
1076 $event->datef = $event->datep;
1078 $event->type_code =
'BIRTHDAY';
1079 $event->type_label =
'';
1080 $event->type_color =
'';
1081 $event->type =
'birthdate';
1082 $event->type_picto =
'birthdate';
1084 $event->label = $langs->trans(
"Birthday").
' '.
dolGetFirstLastname($obj->firstname, $obj->lastname);
1085 $event->percentage = 100;
1086 $event->fulldayevent = 1;
1088 $event->contact_id = $obj->rowid;
1090 $event->date_start_in_calendar =
$db->jdate($event->datep);
1091 $event->date_end_in_calendar =
$db->jdate($event->datef);
1094 $daycursor = $event->datep;
1099 $daykey =
dol_mktime(0, 0, 0, $mois, $jour, $annee,
'gmt');
1101 $eventarray[$daykey][] = $event;
1119if ($user->hasRight(
"holiday",
"read")) {
1120 $sql =
"SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
1121 $sql .=
" FROM ".MAIN_DB_PREFIX.
"holiday as x, ".MAIN_DB_PREFIX.
"user as u";
1122 $sql .=
" WHERE u.rowid = x.fk_user";
1123 $sql .=
" AND u.statut = '1'";
1124 $sql .=
" AND (x.statut = '2' OR x.statut = '3')";
1126 $sql .=
" AND x.date_debut < '".$db->idate(
dol_get_last_day($year, $month)).
"'";
1127 $sql .=
" AND x.date_fin >= '".$db->idate(
dol_get_first_day($year, $month)).
"'";
1128 if (!$user->hasRight(
'holiday',
'readall')) {
1129 $sql .=
" AND x.fk_user IN(".$db->sanitize(implode(
", ", $user->getAllChildIds(1))).
") ";
1132 $resql =
$db->query($sql);
1134 $num =
$db->num_rows($resql);
1138 $obj =
$db->fetch_object($resql);
1143 $event->id = $obj->rowid;
1144 $event->ref = (
string) $event->id;
1146 $event->type_code =
'HOLIDAY';
1147 $event->type_label =
'';
1148 $event->type_color =
'';
1149 $event->type =
'holiday';
1150 $event->type_picto =
'holiday';
1152 $event->datep =
$db->jdate($obj->date_start) + (int) ((empty($obj->halfday) || $obj->halfday == 1 ? 0 : 12) * 60 * 60);
1153 $event->datef =
$db->jdate($obj->date_end) + (int) ((empty($obj->halfday) || $obj->halfday == -1 ? 24 : 12) * 60 * 60 - 1);
1154 $event->date_start_in_calendar = $event->datep;
1155 $event->date_end_in_calendar = $event->datef;
1157 $event->transparency = 1;
1159 $event->userownerid = $obj->uid;
1160 $event->userassigned = array($obj->uid => array(
'id' => $obj->uid,
'transparency' => 1));
1162 if ($obj->status == 3) {
1164 $event->percentage = -1;
1165 } elseif ($obj->status == 2) {
1167 $event->percentage = 0;
1171 $daycursor = $event->date_start_in_calendar;
1176 $daycursorend = $event->date_end_in_calendar;
1177 $anneeend = (int)
dol_print_date($daycursorend,
'%Y',
'tzuserrel');
1178 $moisend = (int)
dol_print_date($daycursorend,
'%m',
'tzuserrel');
1179 $jourend = (int)
dol_print_date($daycursorend,
'%d',
'tzuserrel');
1182 $daykey =
dol_mktime(0, 0, 0, $mois, $jour, $annee,
'gmt');
1183 $daykeygmt =
dol_mktime(0, 0, 0, $mois, $jour, $annee,
'gmt');
1188 $firstdayofholiday = ($ifornbofdays == 1);
1189 $lastdayofholiday = ($daykeygmt ==
dol_get_first_hour($event->date_end_in_calendar,
'gmt'));
1193 if ((in_array($obj->halfday, array(1, 2)) == 1 && $lastdayofholiday) || (in_array($obj->halfday, array(-1, 2)) && $firstdayofholiday)) {
1196 if (in_array($obj->halfday, array(1, 2)) && $lastdayofholiday) {
1197 $newevent->label .=
' ('.$langs->trans(
"Morning").
')';
1198 } elseif (in_array($obj->halfday, array(-1, 2)) && $firstdayofholiday) {
1199 $newevent->label .=
' ('.$langs->trans(
"Afternoon").
')';
1201 $eventarray[$daykey][] = $newevent;
1203 $eventarray[$daykey][] = $event;
1206 $daykey += 60 * 60 * 24;
1207 $daykeygmt += 60 * 60 * 24;
1208 }
while ($daykey <= $event->date_end_in_calendar);
1217if (count($listofextcals)) {
1218 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/ical.class.php';
1220 foreach ($listofextcals as $key => $extcal) {
1221 $url = $extcal[
'src'];
1222 $namecal = $extcal[
'name'];
1223 $offsettz = $extcal[
'offsettz'];
1224 $colorcal = $extcal[
'color'];
1225 $buggedfile = $extcal[
'buggedfile'];
1231 $ical->parse($url, $pathforcachefile, $DELAYFORCACHE);
1234 $listofextcals[$key][
'error'] = $ical->error;
1235 $s .=
'<br><div class="warning">'.dol_escape_htmltag($listofextcals[$key][
'name']).
': '.$url.
'<br>Error message: '.
dol_escape_htmltag($ical->error).
'</div>';
1240 $icalevents = array();
1241 if (is_array($ical->get_event_list())) {
1242 $icalevents = array_merge($icalevents, $ical->get_event_list());
1244 if (is_array($ical->get_freebusy_list())) {
1245 $icalevents = array_merge($icalevents, $ical->get_freebusy_list());
1248 if (count($icalevents) > 0) {
1250 $moreicalevents = array();
1251 foreach ($icalevents as $icalevent) {
1252 if (isset($icalevent[
'RRULE']) && is_array($icalevent[
'RRULE'])) {
1255 if ($icalevent[
'DTSTART;VALUE=DATE']) {
1258 } elseif (is_array($icalevent[
'DTSTART']) && !empty($icalevent[
'DTSTART'][
'unixtime'])) {
1259 $datecurstart = $icalevent[
'DTSTART'][
'unixtime'];
1260 $datecurend = $icalevent[
'DTEND'][
'unixtime'];
1261 if (!empty($ical->cal[
'DAYLIGHT'][
'DTSTART']) ) {
1263 $tmpcurstart = $datecurstart;
1264 $tmpcurend = $datecurend;
1265 $tmpdaylightstart =
dol_mktime(0, 0, 0, 1, 1, 1970, 1) + (int) $ical->cal[
'DAYLIGHT'][
'DTSTART'];
1266 $tmpdaylightend =
dol_mktime(0, 0, 0, 1, 1, 1970, 1) + (int) $ical->cal[
'STANDARD'][
'DTSTART'];
1269 if ($tmpcurstart >= $tmpdaylightstart && $tmpcurstart < $tmpdaylightend) {
1270 $datecurstart -= ((int) $ical->cal[
'DAYLIGHT'][
'TZOFFSETTO']) * 36;
1272 $datecurstart -= ((int) $ical->cal[
'STANDARD'][
'TZOFFSETTO']) * 36;
1274 if ($tmpcurend >= $tmpdaylightstart && $tmpcurstart < $tmpdaylightend) {
1275 $datecurend -= ((int) $ical->cal[
'DAYLIGHT'][
'TZOFFSETTO']) * 36;
1277 $datecurend -= ((int) $ical->cal[
'STANDARD'][
'TZOFFSETTO']) * 36;
1284 dol_syslog(
"Found a not recognized repeatable record with unknown date start", LOG_ERR);
1289 $interval = (empty($icalevent[
'RRULE'][
'INTERVAL']) ? 1 : $icalevent[
'RRULE'][
'INTERVAL']);
1290 $until = empty($icalevent[
'RRULE'][
'UNTIL']) ? 0 :
dol_stringtotime($icalevent[
'RRULE'][
'UNTIL'], 1);
1291 $maxrepeat = empty($icalevent[
'RRULE'][
'COUNT']) ? 0 : $icalevent[
'RRULE'][
'COUNT'];
1292 if ($until && ($until + ($datecurend - $datecurstart)) < $firstdaytoshow) {
1295 if ($datecurstart >= $lastdaytoshow) {
1300 while (($datecurstart < $lastdaytoshow) && (empty($maxrepeat) || ($numofevent < $maxrepeat))) {
1301 if ($datecurend >= $firstdaytoshow) {
1302 $newevent = $icalevent;
1303 unset($newevent[
'RRULE']);
1304 if ($icalevent[
'DTSTART;VALUE=DATE']) {
1305 $newevent[
'DTSTART;VALUE=DATE'] =
dol_print_date($datecurstart,
'%Y%m%d');
1306 $newevent[
'DTEND;VALUE=DATE'] =
dol_print_date($datecurend + 1,
'%Y%m%d');
1308 $newevent[
'DTSTART'] = $datecurstart;
1309 $newevent[
'DTEND'] = $datecurend;
1311 $moreicalevents[] = $newevent;
1315 $savdatecurstart = $datecurstart;
1316 if ($icalevent[
'RRULE'][
'FREQ'] ==
'DAILY') {
1320 if ($icalevent[
'RRULE'][
'FREQ'] ==
'WEEKLY') {
1323 } elseif ($icalevent[
'RRULE'][
'FREQ'] ==
'MONTHLY') {
1326 } elseif ($icalevent[
'RRULE'][
'FREQ'] ==
'YEARLY') {
1331 if ($savdatecurstart >= $datecurstart) {
1332 dol_syslog(
"Found a rule freq ".$icalevent[
'RRULE'][
'FREQ'].
" not managed by dolibarr code. Assume 1 week frequency.", LOG_ERR);
1333 $datecurstart += 3600 * 24 * 7;
1334 $datecurend += 3600 * 24 * 7;
1339 $icalevents = array_merge($icalevents, $moreicalevents);
1342 foreach ($icalevents as $icalevent) {
1347 if (!empty($icalevent[
'RRULE'])) {
1356 if (isset($icalevent[
'DTSTART;VALUE=DATE'])) {
1359 if (empty($icalevent[
'DTEND;VALUE=DATE'])) {
1360 $dateend = $datestart + 86400 - 1;
1366 $event->fulldayevent = 1;
1368 } elseif (!is_array($icalevent[
'DTSTART'])) {
1369 $datestart = $icalevent[
'DTSTART'];
1370 $dateend = empty($icalevent[
'DTEND']) ? $datestart : $icalevent[
'DTEND'];
1372 $datestart += +($offsettz * 3600);
1373 $dateend += +($offsettz * 3600);
1378 } elseif (isset($icalevent[
'DTSTART'][
'unixtime'])) {
1379 $datestart = $icalevent[
'DTSTART'][
'unixtime'];
1380 $dateend = $icalevent[
'DTEND'][
'unixtime'];
1382 $datestart += +($offsettz * 3600);
1383 $dateend += +($offsettz * 3600);
1386 if ($buggedfile ===
'uselocalandtznodaylight') {
1390 if ($buggedfile ===
'uselocalandtzdaylight') {
1391 $localtzs =
new DateTimeZone((
string) preg_replace(
'/"/',
'', $icalevent[
'DTSTART'][
'TZID']));
1392 $localtze =
new DateTimeZone((
string) preg_replace(
'/"/',
'', $icalevent[
'DTEND'][
'TZID']));
1393 $localdts =
new DateTime(
dol_print_date($datestart,
'dayrfc',
'gmt'), $localtzs);
1394 $localdte =
new DateTime(
dol_print_date($dateend,
'dayrfc',
'gmt'), $localtze);
1395 $tmps = -1 * $localtzs->getOffset($localdts);
1396 $tmpe = -1 * $localtze->getOffset($localdte);
1397 $datestart += $tmps;
1404 if ($addevent && $datestart !==
null && $dateend !==
null) {
1405 $event->id = $icalevent[
'UID'];
1406 $event->ref = (
string) $event->id;
1408 $userId = $userstatic->findUserIdByEmail($namecal);
1409 if (!empty($userId) && $userId > 0) {
1410 $event->userassigned[$userId] = [
1412 'transparency' => 1,
1414 $event->percentage = -1;
1417 $event->type_code =
"ICALEVENT";
1418 $event->type_label = $namecal;
1419 $event->type_color = $colorcal;
1420 $event->type =
'icalevent';
1421 $event->type_picto =
'rss';
1423 $event->icalname = $namecal;
1424 $event->icalcolor = $colorcal;
1426 $event->datep = (int) ($datestart + $usertime);
1427 $event->datef = (int) ($dateend + $usertime);
1429 if (isset($icalevent[
'SUMMARY']) && $icalevent[
'SUMMARY']) {
1431 } elseif (isset($icalevent[
'DESCRIPTION']) && $icalevent[
'DESCRIPTION']) {
1434 $event->label = $langs->trans(
"ExtSiteNoLabel");
1441 if (!empty($icalevent[
'PRIORITY'])) {
1442 $event->priority = $icalevent[
'PRIORITY'];
1446 if (!empty($icalevent[
'TRANSP'])) {
1447 if ($icalevent[
'TRANSP'] ==
"TRANSPARENT") {
1448 $event->transparency = 0;
1450 if ($icalevent[
'TRANSP'] ==
"OPAQUE") {
1451 $event->transparency = 1;
1462 if (!empty($icalevent[
'LOCATION'])) {
1463 $event->location = $icalevent[
'LOCATION'];
1466 $event->date_start_in_calendar = $event->datep;
1468 if ((
int) $event->datef != 0 && $event->datef >= $event->datep) {
1469 $event->date_end_in_calendar = $event->datef;
1471 $event->date_end_in_calendar = $event->datep;
1475 if ($event->date_end_in_calendar < $firstdaytoshow || $event->date_start_in_calendar >= $lastdaytoshow) {
1481 if ($event->date_start_in_calendar < $firstdaytoshow) {
1482 $event->date_start_in_calendar = $firstdaytoshow;
1484 if ($event->date_end_in_calendar >= $lastdaytoshow) {
1485 $event->date_end_in_calendar = ($lastdaytoshow - 1);
1489 $daycursor = $event->date_start_in_calendar;
1498 $daykey =
dol_mktime(0, 0, 0, $mois, $jour, $annee,
'gmt');
1499 $daykeygmt =
dol_mktime(0, 0, 0, $mois, $jour, $annee,
'gmt');
1502 $eventarray[$daykey][] = $event;
1503 $daykey += 60 * 60 * 24;
1504 $daykeygmt += 60 * 60 * 24;
1505 if (($event->fulldayevent ? $daykeygmt : $daykey) > $event->date_end_in_calendar) {
1517$parameters = array();
1519$reshook = $hookmanager->executeHooks(
'getCalendarEvents', $parameters, $object, $action);
1520if (!empty($hookmanager->resArray[
'eventarray'])) {
1521 foreach ($hookmanager->resArray[
'eventarray'] as $keyDate => $events) {
1522 if (!isset($eventarray[$keyDate])) {
1523 $eventarray[$keyDate] = array();
1525 $eventarray[$keyDate] = array_merge($eventarray[$keyDate], $events);
1537$cachethirdparties = array();
1538$cachecontacts = array();
1542 array(137, 86, 161),
1543 array(60, 147, 183),
1544 array(250, 190, 80),
1546 array(190, 190, 100),
1547 array(91, 115, 247),
1548 array(140, 140, 220),
1549 array(190, 120, 120),
1550 array(115, 125, 150),
1551 array(100, 170, 20),
1552 array(150, 135, 125),
1553 array(85, 135, 150),
1554 array(150, 135, 80),
1558$color_file = DOL_DOCUMENT_ROOT.
"/theme/".
$conf->theme.
"/theme_vars.inc.php";
1559if (is_readable($color_file)) {
1560 include $color_file;
1564$massactionbutton =
'';
1568print_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);
1576print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1577print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday,
'', (
string) $filtert,
'', $pid, $socid, $action, -1, $actioncode, $usergroup,
'', $resourceid, $search_categ_cus);
1582$newparam = preg_replace(
'/showbirthday=/i',
'showbirthday_=', $newparam);
1583$newparam = preg_replace(
'/mode=show_month&?/i',
'', $newparam);
1584$newparam = preg_replace(
'/mode=show_week&?/i',
'', $newparam);
1585$newparam = preg_replace(
'/day=[0-9]+&?/i',
'', $newparam);
1586$newparam = preg_replace(
'/month=[0-9]+&?/i',
'', $newparam);
1587$newparam = preg_replace(
'/year=[0-9]+&?/i',
'', $newparam);
1588$newparam = preg_replace(
'/viewweek=[0-9]+&?/i',
'', $newparam);
1589$newparam = preg_replace(
'/showbirthday_=/i',
'showbirthday=', $newparam);
1590$newparam .=
'&viewweek=1';
1592echo
'<input type="hidden" name="actionmove" value="mupdate">';
1593echo
'<input type="hidden" name="backtopage" value="'.dol_escape_htmltag($_SERVER[
'PHP_SELF']).
'?'.
dol_escape_htmltag($_SERVER[
'QUERY_STRING']).
'">';
1594echo
'<input type="hidden" name="newdate" id="newdate">';
1601$currentdaytoshow = $firstdaytoshow;
1602echo
'<div class="div-table-responsive">';
1605$colorsbytype = array();
1607while ($currentdaytoshow < $lastdaytoshow) {
1608 echo
'<table class="centpercent noborder nocellnopadd cal_month cal_peruser listwithfilterbefore">';
1610 echo
'<tr class="liste_titre">';
1611 echo
'<td class="nopaddingtopimp nopaddingbottomimp nowraponsmartphone">';
1615 print
'<span class="hideonsmartphone" title="'.$langs->trans(
"VisibleDaysRange").
'">';
1616 print
img_picto(
'',
'clock',
'class="fawidth30 inline-block marginleftonly"');
1617 print $langs->trans(
"DaysOfWeek").
'</span>';
1619 print
'<div class="ui-grid-a inline-block"><div class="ui-block-a nowraponall">';
1620 print
'<input type="number" class="shortbis" name="begin_d" value="'.$begin_d.
'" min="1" max="7">';
1621 if (empty(
$conf->dol_use_jmobile)) {
1624 print
'</div><div class="ui-block-b">';
1626 print
'<input type="number" class="shortbis" name="end_d" value="'.$end_d.
'" min="1" max="7">';
1627 print
'</div></div>';
1633 if (($i + 1) < $begin_d || ($i + 1) > $end_d) {
1637 echo
'<td align="center" colspan="'.($end_h - $begin_h).
'">';
1638 echo
'<span class="bold spandayofweek">'.$langs->trans(
"Day".(($i +
getDolGlobalInt(
'MAIN_START_WEEK', 1)) % 7)).
'</span>';
1643 $valtoshow = $currentdaytoshow;
1646 echo
'<span class="badgeliketopmenu">';
1648 print
dol_print_date($valtoshow,
'dayreduceformat',
'tzuserrel');
1657 echo
'<tr class="liste_titre">';
1661 print
'<span class="hideonsmartphone" title="'.$langs->trans(
"VisibleTimeRange").
'">';
1662 print
img_picto(
'',
'clock',
'class="fawidth30 inline-block marginleftonly"');
1663 print $langs->trans(
"Hours").
'</span>';
1665 print
'<div class="ui-grid-a inline-block"><div class="ui-block-a nowraponall">';
1666 print
'<input type="number" class="shortbis" name="begin_h" value="'.$begin_h.
'" min="0" max="23">';
1667 if (empty(
$conf->dol_use_jmobile)) {
1670 print
'</div><div class="ui-block-b">';
1672 print
'<input type="number" class="shortbis" name="end_h" value="'.$end_h.
'" min="1" max="24">';
1673 if (empty(
$conf->dol_use_jmobile)) {
1674 print
' '.$langs->trans(
"HourShort");
1676 print
'</div></div>';
1681 if (($i + 1) < $begin_d || ($i + 1) > $end_d) {
1685 for ($h = $begin_h; $h < $end_h; $h++) {
1686 echo
'<td class="center">';
1687 print
'<small style="font-family: courier">'.sprintf(
"%02d", $h).
'</small>';
1697 $usernames = array();
1698 $usernamesid = array();
1701 foreach ($eventarray as $daykey => $notused) {
1703 foreach ($eventarray[$daykey] as $index => $event) {
1704 $event->fetch_userassigned();
1705 $listofuserid = $event->userassigned;
1706 foreach ($listofuserid as $userid => $tmp) {
1707 if (!in_array($userid, $usernamesid)) {
1708 $usernamesid[$userid] = $userid;
1715 $sql =
"SELECT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
1716 $sql .=
" FROM ".$db->prefix().
"user as u";
1718 $sql .=
" WHERE u.rowid IN (";
1719 $sql .=
" SELECT ug.fk_user FROM ".$db->prefix().
"usergroup_user as ug";
1720 $sql .=
" WHERE ug.entity IN (".getEntity(
'usergroup').
")";
1721 if ($usergroup > 0) {
1722 $sql .=
" AND ug.fk_usergroup = ".((int) $usergroup);
1726 if ($usergroup > 0) {
1727 $sql .=
" LEFT JOIN ".$db->prefix().
"usergroup_user as ug ON u.rowid = ug.fk_user";
1729 $sql .=
" WHERE u.entity IN (".getEntity(
'user').
")";
1730 if ($usergroup > 0) {
1731 $sql .=
" AND ug.fk_usergroup = ".((int) $usergroup);
1734 $sql .=
" AND u.statut = 1";
1736 $sql .=
" AND u.rowid = ".((int) $filtert);
1738 if ($usergroup > 0) {
1739 $sql .=
" AND ug.fk_usergroup = ".((int) $usergroup);
1741 if ($user->socid > 0) {
1743 $sql .=
" AND u.fk_soc = ".((int) $user->socid);
1746 if (!$canedit || $filtert ==
'-3') {
1747 if (!$user->hasRight(
'user',
'user',
'lire') || $filtert ==
'-3') {
1748 $usersInHierarchy = $user->getAllChildIds(1);
1749 $sql .=
" AND u.rowid IN (".$db->sanitize(implode(
',', $usersInHierarchy)).
")";
1754 $resql =
$db->query($sql);
1756 $num =
$db->num_rows($resql);
1760 $obj =
$db->fetch_object($resql);
1761 $usernamesid[$obj->rowid] = $obj->rowid;
1770 foreach ($usernamesid as
$id) {
1772 $result = $tmpuser->fetch(
$id);
1773 $usernames[] = $tmpuser;
1777 $labelbytype = array();
1778 $sql =
"SELECT code, color, libelle as label FROM ".MAIN_DB_PREFIX.
"c_actioncomm ORDER BY position";
1779 $resql =
$db->query($sql);
1780 while ($obj =
$db->fetch_object($resql)) {
1781 $colorsbytype[$obj->code] = $obj->color;
1782 $labelbytype[$obj->code] = $obj->label;
1790 foreach ($usernames as $username) {
1796 echo
'<td class="tdoverflowmax100 cal_current_month cal_peruserviewname'.($var ?
' cal_impair' :
'').
' nopaddingtopimp nopaddingbottomimp noheightimp">';
1797 print
'<span class="paddingrightimp">';
1798 print $username->getNomUrl(-1,
'', 0, 0, 20, 1,
'',
'paddingleft');
1805 for ($iter_day = 0; $iter_day < 8; $iter_day++) {
1806 if (($i + 1) < $begin_d || ($i + 1) > $end_d) {
1819 $style =
'cal_current_month';
1820 if ($iter_day == 6) {
1821 $style .=
' cal_other_month';
1824 if ($todayarray[
'mday'] == $tmpday && $todayarray[
'mon'] == $tmpmonth && $todayarray[
'year'] == $tmpyear) {
1828 $style =
'cal_today_peruser';
1831 show_day_events2($username, $tmpday, $tmpmonth, $tmpyear, 0, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype, $var);
1836 $showheader =
false;
1848 $langs->load(
"commercial");
1849 print
'<br>'.$langs->trans(
"Legend").
': <br>';
1850 foreach ($colorsbytype as $code => $color) {
1852 print
'<div style="float: left; padding: 2px; margin-right: 6px;"><div style="background: #'.$color.
'; width:16px; float: left; margin-right: 4px;"> </div>';
1853 print $langs->trans(
"Action".$code) !=
"Action".$code ? $langs->trans(
"Action".$code) : $labelbytype[$code];
1859 print
'<div style="float: left; padding: 2px; margin-right: 6px;"><div class="peruser_busy" style="width:16px; float: left; margin-right: 4px;"> </div>';
1860 print $langs->trans(
"Other");
1869print
"\n".
'</form>';
1874print
'<script type="text/javascript">
1875jQuery(document).ready(function() {
1876 jQuery(".onclickopenref").click(function() {
1877 var ref=$(this).attr(\'ref\');
1878 var res = ref.split("_");
1880 var userid = res[1];
1888 console.log("We click on a class onclickopenref in page peruser with ref="+ref+" type="+type);
1890 if (ids == \'none\') /* No event */
1892 /* alert(\'no event\'); */
1893 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.($begin_h !==
'' ?
'&begin_h='.$begin_h :
'').($end_h !==
'' ?
'&end_h='.$end_h :
'').($begin_d !==
'' ?
'&begin_d='.$begin_d :
'').($end_d !==
'' ?
'&end_d='.$end_d :
'')).
'"
1894 window.location.href = url;
1896 else if (ids.indexOf(",") > -1) /* There is several events */
1898 /* alert(\'several events\'); */
1899 url = "'.DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list&search_actioncode="+jQuery("#search_actioncode").val()+"&search_status="+jQuery("#selectsearch_status").val()+"&filtert="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day;
1900 window.location.href = url;
1901 } else { /* One event */
1902 /* alert(\'one event\'); */
1903 if (type == \'holiday\') {
1904 url = "'.DOL_URL_ROOT.
'/holiday/card.php?id="+ids
1906 url = "'.DOL_URL_ROOT.
'/comm/action/card.php?action=view&id="+ids
1908 window.location.href = url;
1941function show_day_events2($username, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint = 0, $maxnbofchar = 16, $newparam =
'', $showinfo = 0, $minheight = 60, $showheader =
false, $colorsbytype = array(), $var =
false)
1944 global $user,
$conf, $langs, $hookmanager, $action;
1945 global $filter, $filtert, $status, $actioncode;
1947 global $cachethirdparties, $cachecontacts,
$cacheusers, $cacheprojects, $colorindexused;
1948 global $begin_h, $end_h;
1962 @phan-var-force array<int,array<int,array<string,string|int|bool>>> $cases1
1963 @phan-var-force array<int,array<int,array<string,string|int|bool>>> $cases2
1964 @phan-var-force array<int,array<int,array<string,string|int|bool>>> $cases3
1965 @phan-var-force array<int,array<int,array<string,string|int|bool>>> $cases4
1972 $numicals = array();
1975 $colorindexused[$user->id] = 0;
1976 $nextindextouse = count($colorindexused);
1983 foreach ($eventarray as $daykey => $notused) {
1990 if ($day == $jour && (
int) $month == $mois && $year == $annee) {
1994 foreach ($eventarray[$daykey] as $index => $event) {
1998 $keysofuserassigned = array_keys($event->userassigned);
2000 if (!in_array($username->id, $keysofuserassigned)) {
2005 $parameters = array();
2006 $reshook = $hookmanager->executeHooks(
'formatEvent', $parameters, $event, $action);
2016 if ($event->type_code ==
'HOLIDAY') {
2017 $cssclass =
'family_holiday';
2020 if (in_array($user->id, $keysofuserassigned)) {
2021 $cssclass =
'family_mytasks';
2023 if (empty($cacheusers[$event->userownerid])) {
2025 $newuser->fetch($event->userownerid);
2031 if (!empty($cacheusers[$event->userownerid]->color)) {
2036 $color = $event->type_color;
2038 } elseif ($event->type_code ==
'ICALEVENT') {
2040 if (!empty($event->icalname)) {
2047 $color = $event->icalcolor;
2048 $cssclass = (!empty($event->icalname) ?
'family_ext'.md5($event->icalname) :
'family_other unsortable');
2049 } elseif ($event->type_code ==
'BIRTHDAY') {
2052 $cssclass =
'family_birthday unsortable';
2053 $color = sprintf(
"%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
2056 $color = ($event->icalcolor ? $event->icalcolor : -1);
2057 $cssclass = (!empty($event->icalname) ?
'family_ext'.md5($event->icalname) :
'family_other');
2059 if (empty($cacheusers[$event->userownerid])) {
2061 $newuser->fetch($event->userownerid);
2067 if (!empty($cacheusers[$event->userownerid]->color)) {
2072 $color = $event->type_color;
2078 $idusertouse = ($event->userownerid ? $event->userownerid : 0);
2079 if (isset($colorindexused[$idusertouse])) {
2080 $colorindex = $colorindexused[$idusertouse];
2082 $colorindex = $nextindextouse;
2083 $colorindexused[$idusertouse] = $colorindex;
2084 if (!empty($theme_datacolor[$nextindextouse + 1])) {
2089 $color = sprintf(
"%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
2093 for ($h = $begin_h; $h < $end_h; $h++) {
2096 if (empty($event->fulldayevent)) {
2097 $a =
dol_mktime((
int) $h, 0, 0, $month, $day, $year,
'tzuserrel', 0);
2098 $b =
dol_mktime((
int) $h, 15, 0, $month, $day, $year,
'tzuserrel', 0);
2099 $b1 =
dol_mktime((
int) $h, 30, 0, $month, $day, $year,
'tzuserrel', 0);
2100 $b2 =
dol_mktime((
int) $h, 45, 0, $month, $day, $year,
'tzuserrel', 0);
2101 $c =
dol_mktime((
int) $h + 1, 0, 0, $month, $day, $year,
'tzuserrel', 0);
2103 $dateendtouse = $event->date_end_in_calendar;
2104 if ($dateendtouse == $event->date_start_in_calendar) {
2109 if ($event->date_start_in_calendar < $b && $dateendtouse > $a) {
2110 $busy = $event->transparency;
2111 $cases1[$h][$event->id][
'busy'] = $busy;
2112 $cases1[$h][$event->id][
'string'] =
dol_print_date($event->date_start_in_calendar,
'dayhour',
'tzuserrel');
2113 if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) {
2114 $tmpa =
dol_getdate($event->date_start_in_calendar,
true);
2115 $tmpb =
dol_getdate($event->date_end_in_calendar,
true);
2116 if ($tmpa[
'mday'] == $tmpb[
'mday'] && $tmpa[
'mon'] == $tmpb[
'mon'] && $tmpa[
'year'] == $tmpb[
'year']) {
2117 $cases1[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'hour',
'tzuserrel');
2119 $cases1[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'dayhour',
'tzuserrel');
2122 if ($event->label) {
2123 $cases1[$h][$event->id][
'string'] .=
' - '.$event->label;
2125 $cases1[$h][$event->id][
'typecode'] = $event->type_code;
2126 if ($event->type_code ==
'HOLIDAY') {
2127 $cases1[$h][$event->id][
'css'] =
'peruser_holiday ';
2129 $cases1[$h][$event->id][
'css'] .=
'peruser_holiday_imp ';
2132 $cases1[$h][$event->id][
'color'] = $color;
2134 if ($event->fk_project > 0) {
2135 if (empty($cacheprojects[$event->fk_project])) {
2137 $tmpproj->fetch($event->fk_project);
2138 $cacheprojects[$event->fk_project] = $tmpproj;
2140 $cases1[$h][$event->id][
'string'] .=
', '.$langs->trans(
"Project").
': '.$cacheprojects[$event->fk_project]->ref.
' - '.$cacheprojects[$event->fk_project]->title;
2142 if ($event->socid > 0) {
2143 if (empty($cachethirdparties[$event->socid])) {
2145 $tmpthirdparty->fetch($event->socid);
2146 $cachethirdparties[$event->socid] = $tmpthirdparty;
2148 $cases1[$h][$event->id][
'string'] .=
', '.$cachethirdparties[$event->socid]->name;
2150 if ($event->contact_id > 0) {
2151 if (empty($cachecontacts[$event->contact_id])) {
2153 $tmpcontact->fetch($event->contact_id);
2154 $cachecontacts[$event->contact_id] = $tmpcontact;
2156 $cases1[$h][$event->id][
'string'] .=
', '.$cachecontacts[$event->contact_id]->getFullName($langs);
2160 if ($event->date_start_in_calendar < $b1 && $dateendtouse > $b) {
2161 $busy = $event->transparency;
2162 $cases2[$h][$event->id][
'busy'] = $busy;
2163 $cases2[$h][$event->id][
'string'] =
dol_print_date($event->date_start_in_calendar,
'dayhour',
'tzuserrel');
2164 if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) {
2165 $tmpa =
dol_getdate($event->date_start_in_calendar,
true);
2166 $tmpb =
dol_getdate($event->date_end_in_calendar,
true);
2167 if ($tmpa[
'mday'] == $tmpb[
'mday'] && $tmpa[
'mon'] == $tmpb[
'mon'] && $tmpa[
'year'] == $tmpb[
'year']) {
2168 $cases2[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'hour',
'tzuserrel');
2170 $cases2[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'dayhour',
'tzuserrel');
2173 if ($event->label) {
2174 $cases2[$h][$event->id][
'string'] .=
' - '.$event->label;
2176 $cases2[$h][$event->id][
'typecode'] = $event->type_code;
2177 if ($event->type_code ==
'HOLIDAY') {
2178 $cases2[$h][$event->id][
'css'] =
'peruser_holiday ';
2180 $cases2[$h][$event->id][
'css'] .=
'peruser_holiday_imp ';
2183 $cases2[$h][$event->id][
'color'] = $color;
2185 if ($event->fk_project > 0) {
2186 if (empty($cacheprojects[$event->fk_project])) {
2188 $tmpproj->fetch($event->fk_project);
2189 $cacheprojects[$event->fk_project] = $tmpproj;
2191 $cases2[$h][$event->id][
'string'] .=
', '.$langs->trans(
"Project").
': '.$cacheprojects[$event->fk_project]->ref.
' - '.$cacheprojects[$event->fk_project]->title;
2193 if ($event->socid > 0) {
2194 if (empty($cachethirdparties[$event->socid])) {
2196 $tmpthirdparty->fetch($event->socid);
2197 $cachethirdparties[$event->socid] = $tmpthirdparty;
2199 $cases2[$h][$event->id][
'string'] .=
', '.$cachethirdparties[$event->socid]->name;
2201 if ($event->contact_id > 0) {
2202 if (empty($cachecontacts[$event->contact_id])) {
2204 $tmpcontact->fetch($event->contact_id);
2205 $cachecontacts[$event->contact_id] = $tmpcontact;
2207 $cases2[$h][$event->id][
'string'] .=
', '.$cachecontacts[$event->contact_id]->getFullName($langs);
2211 if ($event->date_start_in_calendar < $b2 && $dateendtouse > $b1) {
2212 $busy = $event->transparency;
2213 $cases3[$h][$event->id][
'busy'] = $busy;
2214 $cases3[$h][$event->id][
'string'] =
dol_print_date($event->date_start_in_calendar,
'dayhour',
'tzuserrel');
2215 if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) {
2216 $tmpa =
dol_getdate($event->date_start_in_calendar,
true);
2217 $tmpb =
dol_getdate($event->date_end_in_calendar,
true);
2218 if ($tmpa[
'mday'] == $tmpb[
'mday'] && $tmpa[
'mon'] == $tmpb[
'mon'] && $tmpa[
'year'] == $tmpb[
'year']) {
2219 $cases3[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'hour',
'tzuserrel');
2221 $cases3[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'dayhour',
'tzuserrel');
2224 if ($event->label) {
2225 $cases3[$h][$event->id][
'string'] .=
' - '.$event->label;
2227 $cases3[$h][$event->id][
'typecode'] = $event->type_code;
2228 if ($event->type_code ==
'HOLIDAY') {
2229 $cases3[$h][$event->id][
'css'] .=
'peruser_holiday ';
2231 $cases3[$h][$event->id][
'css'] .=
'peruser_holiday_imp ';
2234 $cases3[$h][$event->id][
'color'] = $color;
2236 if ($event->fk_project > 0) {
2237 if (empty($cacheprojects[$event->fk_project])) {
2239 $tmpproj->fetch($event->fk_project);
2240 $cacheprojects[$event->fk_project] = $tmpproj;
2242 $cases3[$h][$event->id][
'string'] .=
', '.$langs->trans(
"Project").
': '.$cacheprojects[$event->fk_project]->ref.
' - '.$cacheprojects[$event->fk_project]->title;
2244 if ($event->socid > 0) {
2245 if (empty($cachethirdparties[$event->socid])) {
2247 $tmpthirdparty->fetch($event->socid);
2248 $cachethirdparties[$event->socid] = $tmpthirdparty;
2250 $cases3[$h][$event->id][
'string'] .=
', '.$cachethirdparties[$event->socid]->name;
2252 if ($event->contact_id > 0) {
2253 if (empty($cachecontacts[$event->contact_id])) {
2255 $tmpcontact->fetch($event->contact_id);
2256 $cachecontacts[$event->contact_id] = $tmpcontact;
2258 $cases3[$h][$event->id][
'string'] .=
', '.$cachecontacts[$event->contact_id]->getFullName($langs);
2262 if ($event->date_start_in_calendar <
$c && $dateendtouse > $b2) {
2263 $busy = $event->transparency;
2264 $cases4[$h][$event->id][
'busy'] = $busy;
2265 $cases4[$h][$event->id][
'string'] =
dol_print_date($event->date_start_in_calendar,
'dayhour',
'tzuserrel');
2266 if ($event->date_end_in_calendar && $event->date_end_in_calendar != $event->date_start_in_calendar) {
2267 $tmpa =
dol_getdate($event->date_start_in_calendar,
true);
2268 $tmpb =
dol_getdate($event->date_end_in_calendar,
true);
2269 if ($tmpa[
'mday'] == $tmpb[
'mday'] && $tmpa[
'mon'] == $tmpb[
'mon'] && $tmpa[
'year'] == $tmpb[
'year']) {
2270 $cases4[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'hour',
'tzuserrel');
2272 $cases4[$h][$event->id][
'string'] .=
'-'.dol_print_date($event->date_end_in_calendar,
'dayhour',
'tzuserrel');
2275 if ($event->label) {
2276 $cases4[$h][$event->id][
'string'] .=
' - '.$event->label;
2278 $cases4[$h][$event->id][
'typecode'] = $event->type_code;
2279 if ($event->type_code ==
'HOLIDAY') {
2280 $cases4[$h][$event->id][
'css'] =
'peruser_holiday ';
2282 $cases4[$h][$event->id][
'css'] .=
'peruser_holiday_imp ';
2285 $cases4[$h][$event->id][
'color'] = $color;
2287 if ($event->fk_project > 0) {
2288 if (empty($cacheprojects[$event->fk_project])) {
2290 $tmpproj->fetch($event->fk_project);
2291 $cacheprojects[$event->fk_project] = $tmpproj;
2293 $cases4[$h][$event->id][
'string'] .=
', '.$langs->trans(
"Project").
': '.$cacheprojects[$event->fk_project]->ref.
' - '.$cacheprojects[$event->fk_project]->title;
2295 if ($event->socid > 0) {
2296 if (empty($cachethirdparties[$event->socid])) {
2298 $tmpthirdparty->fetch($event->socid);
2299 $cachethirdparties[$event->socid] = $tmpthirdparty;
2301 $cases4[$h][$event->id][
'string'] .=
', '.$cachethirdparties[$event->socid]->name;
2303 if ($event->contact_id > 0) {
2304 if (empty($cachecontacts[$event->contact_id])) {
2306 $tmpcontact->fetch($event->contact_id);
2307 $cachecontacts[$event->contact_id] = $tmpcontact;
2309 $cases4[$h][$event->id][
'string'] .=
', '.$cachecontacts[$event->contact_id]->getFullName($langs);
2314 $busy = $event->transparency;
2315 $cases1[$h][$event->id][
'busy'] = $busy;
2316 $cases2[$h][$event->id][
'busy'] = $busy;
2317 $cases3[$h][$event->id][
'busy'] = $busy;
2318 $cases4[$h][$event->id][
'busy'] = $busy;
2319 $cases1[$h][$event->id][
'string'] = $event->label;
2320 $cases2[$h][$event->id][
'string'] = $event->label;
2321 $cases3[$h][$event->id][
'string'] = $event->label;
2322 $cases4[$h][$event->id][
'string'] = $event->label;
2323 $cases1[$h][$event->id][
'typecode'] = $event->type_code;
2324 $cases2[$h][$event->id][
'typecode'] = $event->type_code;
2325 $cases3[$h][$event->id][
'typecode'] = $event->type_code;
2326 $cases4[$h][$event->id][
'typecode'] = $event->type_code;
2327 $cases1[$h][$event->id][
'color'] = $color;
2328 $cases2[$h][$event->id][
'color'] = $color;
2329 $cases3[$h][$event->id][
'color'] = $color;
2330 $cases4[$h][$event->id][
'color'] = $color;
2331 $cases1[$h][$event->id][
'css'] =
'';
2332 $cases2[$h][$event->id][
'css'] =
'';
2333 $cases3[$h][$event->id][
'css'] =
'';
2334 $cases4[$h][$event->id][
'css'] =
'';
2345 for ($h = $begin_h; $h < $end_h; $h++) {
2350 $style1 =
'onclickopenref ';
2351 $style2 =
'onclickopenref ';
2352 $style3 =
'onclickopenref ';
2353 $style4 =
'onclickopenref ';
2354 $string1 =
' ';
2355 $string2 =
' ';
2356 $string3 =
' ';
2357 $string4 =
' ';
2362 if (isset($cases1[$h])) {
2364 if (count($cases1[$h]) > 1) {
2365 $title1 .= count($cases1[$h]).
' '.(count($cases1[$h]) == 1 ? $langs->trans(
"Event") : $langs->trans(
"Events"));
2368 $peruserbusyadded = 0;
2369 $perusernotbusyadded = 0;
2370 foreach ($cases1[$h] as
$id => $ev) {
2371 if (!empty($ev[
'busy']) && !
getDolGlobalString(
'AGENDA_NO_TRANSPARENT_ON_NOT_BUSY')) {
2372 $style1 .= $peruserbusyadded ?
'' :
' peruser_busy';
2373 $peruserbusyadded++;
2375 $style1 .= $perusernotbusyadded ?
'' :
'peruser_notbusy ';
2376 $perusernotbusyadded++;
2378 if (!empty($ev[
'css'])) {
2379 $style1 .= $ev[
'css'].
' ';
2383 if (isset($cases2[$h])) {
2385 if (count($cases2[$h]) > 1) {
2386 $title2 .= count($cases2[$h]).
' '.(count($cases2[$h]) == 1 ? $langs->trans(
"Event") : $langs->trans(
"Events"));
2389 $peruserbusyadded = 0;
2390 $perusernotbusyadded = 0;
2391 foreach ($cases2[$h] as
$id => $ev) {
2392 if (!empty($ev[
'busy']) && !
getDolGlobalString(
'AGENDA_NO_TRANSPARENT_ON_NOT_BUSY')) {
2393 $style2 .= $peruserbusyadded ?
'' :
' peruser_busy';
2394 $peruserbusyadded++;
2396 $style2 .= $perusernotbusyadded ?
'' :
'peruser_notbusy ';
2397 $perusernotbusyadded++;
2399 if (!empty($ev[
'css'])) {
2400 $style2 .= $ev[
'css'].
' ';
2404 if (isset($cases3[$h])) {
2406 if (count($cases3[$h]) > 1) {
2407 $title3 .= count($cases3[$h]).
' '.(count($cases3[$h]) == 1 ? $langs->trans(
"Event") : $langs->trans(
"Events"));
2410 $peruserbusyadded = 0;
2411 $perusernotbusyadded = 0;
2412 foreach ($cases3[$h] as
$id => $ev) {
2413 if (!empty($ev[
'busy']) && !
getDolGlobalString(
'AGENDA_NO_TRANSPARENT_ON_NOT_BUSY')) {
2414 $style3 .= $peruserbusyadded ?
'' :
' peruser_busy';
2415 $peruserbusyadded++;
2417 $style3 .= $perusernotbusyadded ?
'' :
'peruser_notbusy ';
2418 $perusernotbusyadded++;
2420 if (!empty($ev[
'css'])) {
2421 $style3 .= $ev[
'css'].
' ';
2425 if (isset($cases4[$h])) {
2427 if (count($cases4[$h]) > 1) {
2428 $title4 .= count($cases4[$h]).
' '.(count($cases4[$h]) == 1 ? $langs->trans(
"Event") : $langs->trans(
"Events"));
2431 $peruserbusyadded = 0;
2432 $perusernotbusyadded = 0;
2433 foreach ($cases4[$h] as
$id => $ev) {
2434 if (!empty($ev[
'busy']) && !
getDolGlobalString(
'AGENDA_NO_TRANSPARENT_ON_NOT_BUSY')) {
2435 $style4 .= $peruserbusyadded ?
'' :
' peruser_busy';
2436 $peruserbusyadded++;
2438 $style4 .= $perusernotbusyadded ?
'' :
'peruser_notbusy ';
2439 $perusernotbusyadded++;
2441 if (!empty($ev[
'css'])) {
2442 $style4 .= $ev[
'css'].
' ';
2451 if (!empty($cases1[$h]) && is_array($cases1[$h]) && count($cases1[$h]) && array_keys($cases1[$h])) {
2452 $ids1 = implode(
', ', array_keys($cases1[$h]));
2454 if (!empty($cases2[$h]) && is_array($cases2[$h]) && count($cases2[$h]) && array_keys($cases2[$h])) {
2455 $ids2 = implode(
', ', array_keys($cases2[$h]));
2457 if (!empty($cases3[$h]) && is_array($cases3[$h]) && count($cases3[$h]) && array_keys($cases3[$h])) {
2458 $ids3 = implode(
',', array_keys($cases3[$h]));
2460 if (!empty($cases4[$h]) && is_array($cases4[$h]) && count($cases4[$h]) && array_keys($cases4[$h])) {
2461 $ids4 = implode(
',', array_keys($cases4[$h]));
2464 if ($h == $begin_h) {
2465 echo
'<td class="'.$style.
'_peruserleft cal_peruser'.($var ?
' cal_impair '.$style.
'_impair' :
'').
'">';
2467 echo
'<td class="'.$style.
' cal_peruser'.($var ?
' cal_impair '.$style.
'_impair' :
'').
'">';
2472 if (!empty($cases1[$h]) && is_array($cases1[$h]) && count($cases1[$h]) == 1) {
2473 $output = array_slice($cases1[$h], 0, 1);
2474 if ($output[0][
'typecode'] ==
'HOLIDAY') {
2476 $title1 = $langs->trans(
"Holiday");
2478 $title1 = $langs->trans(
"Ref").
' '.$ids1.($title1 ?
' - '.$title1 :
'');
2479 if ($output[0][
'string']) {
2480 $title1 .=
' - '.$output[0][
'string'];
2483 if ($output[0][
'color']) {
2484 $color1 = $output[0][
'color'];
2486 } elseif (!empty($cases1[$h]) && is_array($cases1[$h]) && count($cases1[$h]) > 1) {
2487 $title1 = $langs->trans(
"Ref").
' '.$ids1.($title1 ?
' - '.$title1 :
'');
2493 if (!empty($cases2[$h]) && is_array($cases2[$h]) && count($cases2[$h]) == 1) {
2494 $output = array_slice($cases2[$h], 0, 1);
2495 if ($output[0][
'typecode'] ==
'HOLIDAY') {
2497 $title2 = $langs->trans(
"Holiday");
2499 $title2 = $langs->trans(
"Ref").
' '.$ids2.($title2 ?
' - '.$title2 :
'');
2500 if ($output[0][
'string']) {
2501 $title2 .=
' - '.$output[0][
'string'];
2504 if ($output[0][
'color']) {
2505 $color2 = $output[0][
'color'];
2507 } elseif (!empty($cases2[$h]) && is_array($cases2[$h]) && count($cases2[$h]) > 1) {
2508 $title2 = $langs->trans(
"Ref").
' '.$ids2.($title2 ?
' - '.$title2 :
'');
2514 if (!empty($cases3[$h]) && is_array($cases3[$h]) && count($cases3[$h]) == 1) {
2515 $output = array_slice($cases3[$h], 0, 1);
2516 if ($output[0][
'typecode'] ==
'HOLIDAY') {
2518 $title3 = $langs->trans(
"Holiday");
2520 $title3 = $langs->trans(
"Ref").
' '.$ids3.($title3 ?
' - '.$title3 :
'');
2521 if ($output[0][
'string']) {
2522 $title3 .=
' - '.$output[0][
'string'];
2525 if ($output[0][
'color']) {
2526 $color3 = $output[0][
'color'];
2528 } elseif (!empty($cases3[$h]) && is_array($cases3[$h]) && count($cases3[$h]) > 1) {
2529 $title3 = $langs->trans(
"Ref").
' '.$ids3.($title3 ?
' - '.$title3 :
'');
2535 if (!empty($cases4[$h]) && is_array($cases4[$h]) && count($cases4[$h]) == 1) {
2536 $output = array_slice($cases4[$h], 0, 1);
2537 if ($output[0][
'typecode'] ==
'HOLIDAY') {
2539 $title4 = $langs->trans(
"Holiday");
2541 $title4 = $langs->trans(
"Ref").
' '.$ids4.($title4 ?
' - '.$title4 :
'');
2542 if ($output[0][
'string']) {
2543 $title4 .=
' - '.$output[0][
'string'];
2546 if ($output[0][
'color']) {
2547 $color4 = $output[0][
'color'];
2549 } elseif (!empty($cases4[$h]) && is_array($cases4[$h]) && count($cases4[$h]) > 1) {
2550 $title4 = $langs->trans(
"Ref").
' '.$ids4.($title4 ?
' - '.$title4 :
'');
2554 print
'<table class="nobordernopadding case centpercent">';
2557 if (preg_match(
'/peruser_notbusy/', $style1)) {
2558 print
'style="border: 1px solid #'.($color1 ? $color1 :
"888").
' !important" ';
2559 } elseif ($color1) {
2560 print
'style="background: #'.$color1.
'; "';
2564 print
'center'.($title1 ?
' classfortooltip' :
'').($title1 ?
' cursorpointer' :
'').
'"';
2565 print
'ref="'.$ref1.
'_'.$username->id.
'_'.sprintf(
"%04d", $year).
'_'.sprintf(
"%02d", $month).
'_'.sprintf(
"%02d", $day).
'_'.sprintf(
"%02d", $h).
'_00_'.($ids1 ? $ids1 :
'none').
'"';
2566 print ($title1 ?
' title="'.$title1.
'"' :
'').
'>';
2571 if (preg_match(
'/peruser_notbusy/', $style2)) {
2572 print
'style="border: 1px solid #'.($color2 ? $color2 :
"888").
' !important" ';
2573 } elseif ($color2) {
2574 print
'style="background: #'.$color2.
'; "';
2578 print
'center'.($title2 ?
' classfortooltip' :
'').($title2 ?
' cursorpointer' :
'').
'"';
2579 print
' ref="'.$ref2.
'_'.$username->id.
'_'.sprintf(
"%04d", $year).
'_'.sprintf(
"%02d", $month).
'_'.sprintf(
"%02d", $day).
'_'.sprintf(
"%02d", $h).
'_15_'.($ids2 ? $ids2 :
'none').
'"';
2580 print ($title2 ?
' title="'.$title2.
'"' :
'').
'>';
2585 if (preg_match(
'/peruser_notbusy/', $style3)) {
2586 print
'style="border: 1px solid #'.($color3 ? $color3 :
"888").
' !important" ';
2587 } elseif ($color3) {
2588 print
'style="background: #'.$color3.
'; "';
2592 print
'center'.($title3 ?
' classfortooltip' :
'').($title3 ?
' cursorpointer' :
'').
'"';
2593 print
' ref="'.$ref3.
'_'.$username->id.
'_'.sprintf(
"%04d", $year).
'_'.sprintf(
"%02d", $month).
'_'.sprintf(
"%02d", $day).
'_'.sprintf(
"%02d", $h).
'_30_'.($ids3 ? $ids3 :
'none').
'"';
2594 print ($title3 ?
' title="'.$title3.
'"' :
'').
'>';
2599 if (preg_match(
'/peruser_notbusy/', $style4)) {
2600 print
'style="border: 1px solid #'.($color4 ? $color4 :
"888").
' !important" ';
2601 } elseif ($color4) {
2602 print
'style="background: #'.$color4.
'; "';
2606 print
'center'.($title4 ?
' classfortooltip' :
'').($title4 ?
' cursorpointer' :
'').
'"';
2607 print
' ref="'.$ref4.
'_'.$username->id.
'_'.sprintf(
"%04d", $year).
'_'.sprintf(
"%02d", $month).
'_'.sprintf(
"%02d", $day).
'_'.sprintf(
"%02d", $h).
'_45_'.($ids4 ? $ids4 :
'none').
'"';
2608 print ($title4 ?
' title="'.$title4.
'"' :
'').
'>';
$id
Support class for third parties, contacts, members, users or resources.
if(! $sortfield) if(! $sortorder) $object
print_actions_filter( $form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filtered, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid=0, $excludetype='', $resourceid=0, $search_categ_cus=0, $search_import_key='')
Show filter form in agenda view.
calendars_prepare_head($param)
Define head array for tabs of agenda setup pages.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage agenda events (actions)
Class to read/parse ICal calendars.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
dol_get_first_hour($date, $gm='tzserver')
Return GMT time for first hour of a given GMT date (it removes hours, min and second part)
dol_get_next_week($day, $week, $month, $year)
Return next week.
dol_get_first_day_week($day, $month, $year, $gm=false)
Return first day of week for a date.
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_stringtotime($string, $gm=1)
Convert a string date into a GM Timestamps date Warning: YYYY-MM-DDTHH:MM:SS+02:00 (RFC3339) is not s...
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
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_nl2br($stringtoencode, $nl2brmode=0, $forxml=false)
Replace CRLF in string with a HTML BR tag.
dol_sanitizePathName($str, $newstr='_', $unaccent=0, $allowdash=0)
Clean a string to use it as a path name.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
getDolUserString($key, $default='', $tmpuser=null)
Return Dolibarr user constant string value.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dolGetFirstLastname($firstname, $lastname, $nameorder=-1)
Return firstname and lastname in correct order.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_clone($srcobject, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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...
conf($dolibarr_main_document_root)
Load conf file (file must exists)
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
print $langs trans('Date')." left Ref Label right Qty right Price right TotalHT right TotalTTC right right right right right right right right right centpercent right TotalHT right n right VAT right n right TotalVAT right n No sujeto a RE IRPF right TotalLT1 right n right TotalLT2 right n right TotalTTC right n takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency right TotalTTC takeposcustomercurrency right takeposcustomercurrency n right Paid right PaymentTypeShortLIQ right SELECT p pos_change as p datep as date
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.