32 require
'../../main.inc.php';
33 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
39 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
42 $langs->loadLangs(array(
"users",
"companies",
"agenda",
"commercial",
"other",
"orders",
"bills"));
45 $action =
GETPOST(
'action',
'aZ09');
46 $massaction =
GETPOST(
'massaction',
'alpha');
47 $confirm =
GETPOST(
'confirm',
'alpha');
48 $cancel =
GETPOST(
'cancel',
'alpha');
49 $toselect =
GETPOST(
'toselect',
'array');
50 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'actioncommlist';
51 $optioncss =
GETPOST(
'optioncss',
'alpha');
54 $disabledefaultvalues =
GETPOSTINT(
'disabledefaultvalues');
56 $mode =
GETPOST(
'mode',
'aZ09');
57 if (empty($mode) && preg_match(
'/show_/', $action)) {
62 $search_status = (
GETPOST(
"search_status",
'aZ09') !=
'') ?
GETPOST(
"search_status",
'aZ09') :
GETPOST(
"status",
'aZ09');
63 $type =
GETPOST(
'search_type',
'alphanohtml') ?
GETPOST(
'search_type',
'alphanohtml') :
GETPOST(
'type',
'alphanohtml');
69 if (
GETPOST(
'search_actioncode',
'array')) {
70 $actioncode =
GETPOST(
'search_actioncode',
'array', 3);
71 if (!count($actioncode)) {
75 $actioncode =
GETPOST(
"search_actioncode",
"alpha", 3) ?
GETPOST(
"search_actioncode",
"alpha", 3) : (
GETPOST(
"search_actioncode") ==
'0' ?
'0' : ((!
getDolGlobalString(
'AGENDA_DEFAULT_FILTER_TYPE') || $disabledefaultvalues) ?
'' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
79 $search_id =
GETPOST(
'search_id',
'alpha');
80 $search_title =
GETPOST(
'search_title',
'alpha');
81 $search_note =
GETPOST(
'search_note',
'alpha');
89 if ($search_status ==
'' && !
GETPOSTISSET(
'search_status')) {
90 $search_status = ((!
getDolGlobalString(
'AGENDA_DEFAULT_FILTER_STATUS') || $disabledefaultvalues) ?
'' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
93 $mode = (!
getDolGlobalString(
'AGENDA_DEFAULT_VIEW') ?
'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
96 $filter =
GETPOST(
"search_filter",
'alpha', 3) ?
GETPOST(
"search_filter",
'alpha', 3) :
GETPOST(
"filter",
'alpha', 3);
97 $filtert =
GETPOST(
"search_filtert",
"intcomma", 3) ?
GETPOST(
"search_filtert",
"intcomma", 3) :
GETPOST(
"filtert",
"intcomma", 3);
99 $showbirthday = empty($conf->use_javascript_ajax) ? (
GETPOSTINT(
"search_showbirthday") ?
GETPOSTINT(
"search_showbirthday") :
GETPOSTINT(
"showbirthday")) : 1;
100 $search_categ_cus =
GETPOST(
"search_categ_cus",
"intcomma", 3) ?
GETPOST(
"search_categ_cus",
"intcomma", 3) : 0;
104 $hookmanager->initHooks(array(
'agendalist'));
109 $extrafields->fetch_name_optionals_label(
$object->table_element);
111 $search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
114 $filtert = $user->id;
119 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
120 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
122 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
126 $offset = $limit * $page;
128 $sortorder =
"DESC,DESC";
129 if ($search_status ==
'todo') {
130 $sortorder =
"DESC,DESC";
134 $sortfield =
"a.datep,a.id";
135 if ($search_status ==
'todo') {
136 $sortfield =
"a.datep,a.id";
143 $socid = $user->socid;
150 if (!$user->hasRight(
'agenda',
'myactions',
'read')) {
153 if (!$user->hasRight(
'agenda',
'allactions',
'read')) {
156 if (!$user->hasRight(
'agenda',
'allactions',
'read') || $filter ==
'mine') {
157 $filtert = $user->id;
160 $arrayfields = array(
161 'a.id' => array(
'label' =>
"Ref",
'checked' => 1),
162 'owner' => array(
'label' =>
"Owner",
'checked' => 1),
163 'c.libelle' => array(
'label' =>
"Type",
'checked' => 1),
164 'a.label' => array(
'label' =>
"Title",
'checked' => 1),
165 'a.note' => array(
'label' =>
'Description',
'checked' => 0),
166 'a.datep' => array(
'label' =>
"DateStart",
'checked' => 1),
167 'a.datep2' => array(
'label' =>
"DateEnd",
'checked' => 1),
168 's.nom' => array(
'label' =>
"ThirdParty",
'checked' => 1),
169 'a.fk_contact' => array(
'label' =>
"Contact",
'checked' => 0),
170 'a.fk_element' => array(
'label' =>
"LinkedObject",
'checked' => 1,
'enabled' => (
getDolGlobalString(
'AGENDA_SHOW_LINKED_OBJECT'))),
171 'a.datec' => array(
'label' =>
'DateCreation',
'checked' => 0,
'position' => 510),
172 'a.tms' => array(
'label' =>
'DateModification',
'checked' => 0,
'position' => 520),
173 'a.percent' => array(
'label' =>
"Status",
'checked' => 1,
'position' => 1000)
176 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
180 '@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
183 if ($user->socid && $socid) {
192 if (
GETPOST(
'cancel',
'alpha')) {
199 if (is_array($_POST)) {
200 foreach ($_POST as $key => $val) {
201 $param .=
'&'.$key.
'='.urlencode($val);
205 header(
"Location: ".DOL_URL_ROOT.
'/comm/action/index.php?'.$param);
209 $parameters = array(
'id' => $socid);
210 $reshook = $hookmanager->executeHooks(
'doActions', $parameters,
$object, $action);
216 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
218 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
223 $datestart_dtstart =
'';
224 $datestart_dtend =
'';
225 $dateend_dtstart =
'';
236 $search_array_options = array();
239 if (empty($reshook) && !empty($massaction)) {
242 switch ($massaction) {
243 case 'set_all_events_to_todo':
247 case 'set_all_events_to_in_progress':
251 case 'set_all_events_to_finished':
256 if (isset($percent)) {
257 foreach ($toselect as $toselectid) {
258 $result =
$object->updatePercent($toselectid, $percent);
268 if (empty($reshook)) {
269 $objectclass =
'ActionComm';
270 $objectlabel =
'Events';
273 $permissiontodelete = $user->hasRight(
'agenda',
'allactions',
'delete');
274 $permissiontoadd = $user->hasRight(
'agenda',
'myactions',
'create');
275 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
282 $form =
new Form($db);
283 $userstatic =
new User($db);
287 $societestatic =
new Societe($db);
288 $contactstatic =
new Contact($db);
291 $nav .= $form->selectDate($dateselect,
'dateselect', 0, 0, 1,
'', 1, 0);
292 $nav .=
' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans(
"Refresh").
'">';
296 $help_url =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda|DE:Modul_Terminplanung';
297 $title = $langs->trans(
"Agenda");
301 $listofextcals = array();
304 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
305 $param .=
'&contextpage='.urlencode($contextpage);
307 if ($limit > 0 && $limit != $conf->liste_limit) {
308 $param .=
'&limit='.((int) $limit);
310 if ($actioncode !=
'') {
311 if (is_array($actioncode)) {
312 foreach ($actioncode as $str_action) {
313 $param .=
"&search_actioncode[]=".urlencode($str_action);
316 $param .=
"&search_actioncode=".urlencode($actioncode);
319 if ($resourceid > 0) {
320 $param .=
"&search_resourceid=".urlencode((
string) ($resourceid));
322 if ($search_status !=
'') {
323 $param .=
"&search_status=".urlencode($search_status);
326 $param .=
"&search_filter=".urlencode($filter);
329 $param .=
"&search_filtert=".urlencode($filtert);
331 if ($usergroup > 0) {
332 $param .=
"&search_usergroup=".urlencode((
string) ($usergroup));
335 $param .=
"&search_socid=".urlencode((
string) ($socid));
338 $param .=
"&search_showbirthday=1";
341 $param .=
"&search_projectid=".urlencode((
string) ($pid));
344 $param .=
"&search_type=".urlencode($type);
346 if ($search_id !=
'') {
347 $param .=
'&search_id='.urlencode($search_id);
349 if ($search_title !=
'') {
350 $param .=
'&search_title='.urlencode($search_title);
352 if ($search_note !=
'') {
353 $param .=
'&search_note='.urlencode($search_note);
356 $param .=
'&datestart_dtstartday='.GETPOSTINT(
'datestart_dtstartday');
359 $param .=
'&datestart_dtstartmonth='.GETPOSTINT(
'datestart_dtstartmonth');
362 $param .=
'&datestart_dtstartyear='.GETPOSTINT(
'datestart_dtstartyear');
365 $param .=
'&datestart_dtendday='.GETPOSTINT(
'datestart_dtendday');
368 $param .=
'&datestart_dtendmonth='.GETPOSTINT(
'datestart_dtendmonth');
371 $param .=
'&datestart_dtendyear='.GETPOSTINT(
'datestart_dtendyear');
374 $param .=
'&dateend_dtstartday='.GETPOSTINT(
'dateend_dtstartday');
377 $param .=
'&dateend_dtstartmonth='.GETPOSTINT(
'dateend_dtstartmonth');
380 $param .=
'&dateend_dtstartyear='.GETPOSTINT(
'dateend_dtstartyear');
383 $param .=
'&dateend_dtendday='.GETPOSTINT(
'dateend_dtendday');
386 $param .=
'&dateend_dtendmonth='.GETPOSTINT(
'dateend_dtendmonth');
389 $param .=
'&dateend_dtendyear='.GETPOSTINT(
'dateend_dtendyear');
391 if ($optioncss !=
'') {
392 $param .=
'&optioncss='.urlencode($optioncss);
394 if ($search_categ_cus != 0) {
395 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
399 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
401 $paramnoactionodate = $param;
404 $arrayofmassactions = array(
405 'set_all_events_to_todo' => $langs->trans(
"SetAllEventsToTodo"),
406 'set_all_events_to_in_progress' => $langs->trans(
"SetAllEventsToInProgress"),
407 'set_all_events_to_finished' => $langs->trans(
"SetAllEventsToFinished"),
409 if ($user->hasRight(
'agenda',
'allactions',
'delete')) {
410 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
412 if (
isModEnabled(
'category') && $user->hasRight(
'agenda',
'myactions',
'create')) {
413 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
415 if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
416 $arrayofmassactions = array();
418 $massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
421 if ($usergroup > 0) {
424 $sql .=
" s.nom as societe, s.rowid as socid, s.client, s.email as socemail,";
425 $sql .=
" a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,";
426 $sql .=
" a.fk_user_author, a.fk_user_action,";
427 $sql .=
" a.fk_contact, a.note, a.percent as percent,";
428 $sql .=
" a.fk_element, a.elementtype, a.datec, a.tms as datem,";
429 $sql .=
" c.code as type_code, c.libelle as type_label, c.color as type_color, c.type as type_type, c.picto as type_picto,";
430 $sql .=
" sp.lastname, sp.firstname, sp.email, sp.phone, sp.address, sp.phone as phone_pro, sp.phone_mobile, sp.phone_perso, sp.fk_pays as country_id";
433 if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
434 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
435 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
440 $parameters = array();
441 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters,
$object, $action);
442 $sql .= $hookmanager->resPrint;
446 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a";
447 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"actioncomm_extrafields as ef ON (a.id = ef.fk_object)";
448 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
449 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"socpeople as sp ON a.fk_contact = sp.rowid";
450 $sql .=
" ,".MAIN_DB_PREFIX.
"c_actioncomm as c";
452 if ($resourceid > 0) {
453 $sql .=
", ".MAIN_DB_PREFIX.
"element_resources as r";
456 if ($filtert > 0 || $usergroup > 0) {
457 $sql .=
", ".MAIN_DB_PREFIX.
"actioncomm_resources as ar";
459 if ($usergroup > 0) {
460 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
462 $sql .=
" WHERE c.id = a.fk_action";
463 $sql .=
' AND a.entity IN ('.getEntity(
'agenda').
')';
465 if (!empty($actioncode)) {
467 if ($actioncode ==
'AC_NON_AUTO') {
468 $sql .=
" AND c.type != 'systemauto'";
469 } elseif ($actioncode ==
'AC_ALL_AUTO') {
470 $sql .=
" AND c.type = 'systemauto'";
472 if ($actioncode ==
'AC_OTH') {
473 $sql .=
" AND c.type != 'systemauto'";
475 if ($actioncode ==
'AC_OTH_AUTO') {
476 $sql .=
" AND c.type = 'systemauto'";
480 if ($actioncode ==
'AC_NON_AUTO') {
481 $sql .=
" AND c.type != 'systemauto'";
482 } elseif ($actioncode ==
'AC_ALL_AUTO') {
483 $sql .=
" AND c.type = 'systemauto'";
485 if (is_array($actioncode)) {
486 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", $actioncode).
"'", 1).
")";
488 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", explode(
',', $actioncode)).
"'", 1).
")";
493 if ($resourceid > 0) {
494 $sql .=
" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".((int) $resourceid);
497 $sql .=
" AND a.fk_project=".((int) $pid);
501 if (!$user->hasRight(
'societe',
'client',
'voir')) {
502 $search_sale = $user->id;
505 if ($search_sale && $search_sale !=
'-1') {
506 if ($search_sale == -2) {
507 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc)";
508 } elseif ($search_sale > 0) {
509 $sql .=
" AND 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).
")";
514 $sql .=
" AND a.fk_soc = ".((int) $socid);
517 if ($filtert > 0 || $usergroup > 0) {
518 $sql .=
" AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
521 $sql .=
" AND c.id = ".((int) $type);
523 if ($search_status ==
'0') {
524 $sql .=
" AND a.percent = 0";
526 if ($search_status ==
'na') {
527 $sql .=
" AND a.percent = -1";
529 if ($search_status ==
'50') {
530 $sql .=
" AND (a.percent > 0 AND a.percent < 100)";
532 if ($search_status ==
'100') {
533 $sql .=
" AND a.percent = 100";
535 if ($search_status ==
'done') {
536 $sql .=
" AND (a.percent = 100)";
538 if ($search_status ==
'todo') {
539 $sql .=
" AND (a.percent >= 0 AND a.percent < 100)";
551 if ($filtert > 0 || $usergroup > 0) {
554 $sql .=
"(ar.fk_element = ".((int) $filtert).
" OR (ar.fk_element IS NULL AND a.fk_user_action = ".((int) $filtert).
"))";
556 if ($usergroup > 0) {
557 $sql .= ($filtert > 0 ?
" OR " :
"").
" ugu.fk_usergroup = ".((
int) $usergroup);
563 if ($dateselect > 0) {
564 $sql .=
" AND ((a.datep2 >= '".$db->idate($dateselect).
"' AND a.datep <= '".$db->idate($dateselect + 3600 * 24 - 1).
"') OR (a.datep2 IS NULL AND a.datep > '".$db->idate($dateselect - 3600).
"' AND a.datep <= '".$db->idate($dateselect + 3600 * 24 - 1).
"'))";
566 if ($datestart_dtstart > 0) {
567 $sql .=
" AND a.datep >= '".$db->idate($datestart_dtstart).
"'";
569 if ($datestart_dtend > 0) {
570 $sql .=
" AND a.datep <= '".$db->idate($datestart_dtend).
"'";
572 if ($dateend_dtstart > 0) {
573 $sql .=
" AND a.datep2 >= '".$db->idate($dateend_dtstart).
"'";
575 if ($dateend_dtend > 0) {
576 $sql .=
" AND a.datep2 <= '".$db->idate($dateend_dtend).
"'";
580 if ($search_categ_cus != -1) {
581 if ($search_categ_cus == -2) {
582 $sql .=
" AND NOT EXISTS (SELECT ca.fk_actioncomm FROM ".MAIN_DB_PREFIX.
"categorie_actioncomm as ca WHERE ca.fk_actioncomm = a.id)";
583 } elseif ($search_categ_cus > 0) {
584 $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($search_categ_cus).
"))";
589 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
592 $parameters = array();
593 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters,
$object, $action);
594 $sql .= $hookmanager->resPrint;
597 $nbtotalofrecords =
'';
600 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords',
$sql);
601 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
603 $resql = $db->query($sqlforcount);
605 $objforcount = $db->fetch_object($resql);
606 $nbtotalofrecords = $objforcount->nbtotalofrecords;
611 if (($page * $limit) > $nbtotalofrecords) {
619 $sql .= $db->order($sortfield, $sortorder);
621 $sql .= $db->plimit($limit + 1, $offset);
624 $resql = $db->query(
$sql);
630 $num = $db->num_rows($resql);
632 $arrayofselected = is_array($toselect) ? $toselect : array();
635 $newtitle =
'<div class="nowrap clear inline-block minheight30">';
636 $newtitle .=
'<input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans(
"LocalAgenda").
' ';
637 $newtitle .=
'</div>';
640 $tabactive =
'cardlist';
644 print
'<form method="POST" id="searchFormList" class="listactionsfilter" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
646 if ($optioncss !=
'') {
647 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
649 print
'<input type="hidden" name="token" value="'.newToken().
'">';
650 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
651 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
652 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
653 print
'<input type="hidden" name="type" value="'.$type.
'">';
657 $nav .=
'<input type="hidden" name="search_filter" value="'.$filter.
'">';
660 $nav .=
'<input type="hidden" name="search_showbirthday" value="1">';
672 $parameters = array();
673 $reshook = $hookmanager->executeHooks(
'addCalendarChoice', $parameters,
$object, $action);
674 if (empty($reshook)) {
675 $s .= $hookmanager->resPrint;
676 } elseif ($reshook > 1) {
677 $s = $hookmanager->resPrint;
683 $viewmode .=
'<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1'.$paramnoactionodate.
'">';
685 $viewmode .=
img_picto($langs->trans(
"List"),
'object_calendarlist',
'class="imgforviewmode pictoactionview block"');
687 $viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewList").
'</span></a>';
689 $viewmode .=
'<a class="btnTitle reposition" href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_month&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
691 $viewmode .=
img_picto($langs->trans(
"ViewCal"),
'object_calendarmonth',
'class="pictoactionview block"');
693 $viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewCal").
'</span></a>';
695 $viewmode .=
'<a class="btnTitle reposition" href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_week&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
697 $viewmode .=
img_picto($langs->trans(
"ViewWeek"),
'object_calendarweek',
'class="pictoactionview block"');
699 $viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewWeek").
'</span></a>';
701 $viewmode .=
'<a class="btnTitle reposition" href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_day&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
703 $viewmode .=
img_picto($langs->trans(
"ViewDay"),
'object_calendarday',
'class="pictoactionview block"');
705 $viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewDay").
'</span></a>';
707 $viewmode .=
'<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.
'/comm/action/peruser.php?mode=show_peruser&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
709 $viewmode .=
img_picto($langs->trans(
"ViewPerUser"),
'object_calendarperuser',
'class="pictoactionview block"');
711 $viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewPerUser").
'</span></a>';
713 $viewmode .=
'<span class="marginrightonly"></span>';
716 $parameters = array();
717 $reshook = $hookmanager->executeHooks(
'addCalendarView', $parameters,
$object, $action);
718 if (empty($reshook)) {
719 $viewmode .= $hookmanager->resPrint;
720 } elseif ($reshook > 1) {
721 $viewmode = $hookmanager->resPrint;
726 $newparam =
'&month='.str_pad((
string) $month, 2,
"0", STR_PAD_LEFT).
'&year='.$tmpforcreatebutton[
'year'];
728 $url = DOL_URL_ROOT.
'/comm/action/card.php?action=create';
729 $url .=
'&apyear='.$tmpforcreatebutton[
'year'].
'&apmonth='.$tmpforcreatebutton[
'mon'].
'&apday='.$tmpforcreatebutton[
'mday'].
'&aphour='.$tmpforcreatebutton[
'hours'].
'&apmin='.$tmpforcreatebutton[
'minutes'];
730 $url .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].($newparam ?
'?'.$newparam :
''));
732 $newcardbutton =
dolGetButtonTitle($langs->trans(
'AddAction'),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'agenda',
'myactions',
'create') || $user->hasRight(
'agenda',
'allactions',
'create'));
734 $param .=
'&mode='.urlencode($mode);
736 print_barre_liste($langs->trans(
"Agenda"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, is_numeric($nbtotalofrecords) ? -1 * $nbtotalofrecords : $nbtotalofrecords,
'object_action', 0, $nav.$newcardbutton,
'', $limit, 0, 0, 1, $viewmode);
741 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
745 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
746 $selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
747 if ($massactionbutton) {
748 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
752 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
753 print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup,
'', $resourceid, $search_categ_cus);
756 print
'<div class="div-table-responsive">';
757 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
759 print
'<tr class="liste_titre_filter">';
762 print
'<td class="liste_titre" align="middle">';
763 $searchpicto = $form->showFilterButtons(
'left');
767 if (!empty($arrayfields[
'a.id'][
'checked'])) {
768 print
'<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.
'"></td>';
770 if (!empty($arrayfields[
'owner'][
'checked'])) {
771 print
'<td class="liste_titre"></td>';
773 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
774 print
'<td class="liste_titre"></td>';
776 if (!empty($arrayfields[
'a.label'][
'checked'])) {
777 print
'<td class="liste_titre"><input type="text" class="maxwidth75" name="search_title" value="'.$search_title.
'"></td>';
779 if (!empty($arrayfields[
'a.note'][
'checked'])) {
780 print
'<td class="liste_titre"><input type="text" class="maxwidth75" name="search_note" value="'.$search_note.
'"></td>';
782 if (!empty($arrayfields[
'a.datep'][
'checked'])) {
783 print
'<td class="liste_titre nowraponall" align="center">';
784 print
'<div class="nowrap">';
785 print $form->selectDate($datestart_dtstart,
'datestart_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
787 print
'<div class="nowrap">';
788 print $form->selectDate($datestart_dtend,
'datestart_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
792 if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
793 print
'<td class="liste_titre nowraponall" align="center">';
794 print
'<div class="nowrap">';
795 print $form->selectDate($dateend_dtstart,
'dateend_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
797 print
'<div class="nowrap">';
798 print $form->selectDate($dateend_dtend,
'dateend_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
802 if (!empty($arrayfields[
's.nom'][
'checked'])) {
803 print
'<td class="liste_titre"></td>';
805 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
806 print
'<td class="liste_titre"></td>';
808 if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
809 print
'<td class="liste_titre"></td>';
813 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
816 $parameters = array(
'arrayfields' => $arrayfields);
817 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
818 print $hookmanager->resPrint;
820 if (!empty($arrayfields[
'a.datec'][
'checked'])) {
821 print
'<td class="liste_titre"></td>';
823 if (!empty($arrayfields[
'a.tms'][
'checked'])) {
824 print
'<td class="liste_titre"></td>';
826 if (!empty($arrayfields[
'a.percent'][
'checked'])) {
827 print
'<td class="liste_titre center parentonrightofpage">';
828 $formactions->form_select_status_action(
'formaction', $search_status, 1,
'search_status', 1, 2,
'search_status width100 onrightofpage');
833 print
'<td class="liste_titre center">';
834 $searchpicto = $form->showFilterButtons();
840 $totalarray = array();
841 $totalarray[
'nbfield'] = 0;
845 print
'<tr class="liste_titre">';
847 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
848 $totalarray[
'nbfield']++;
850 if (!empty($arrayfields[
'a.id'][
'checked'])) {
851 print_liste_field_titre($arrayfields[
'a.id'][
'label'], $_SERVER[
"PHP_SELF"],
"a.id", $param,
"",
"", $sortfield, $sortorder);
852 $totalarray[
'nbfield']++;
854 if (!empty($arrayfields[
'owner'][
'checked'])) {
855 print_liste_field_titre($arrayfields[
'owner'][
'label'], $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
856 $totalarray[
'nbfield']++;
858 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
859 print_liste_field_titre($arrayfields[
'c.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.libelle", $param,
"",
"", $sortfield, $sortorder);
860 $totalarray[
'nbfield']++;
862 if (!empty($arrayfields[
'a.label'][
'checked'])) {
863 print_liste_field_titre($arrayfields[
'a.label'][
'label'], $_SERVER[
"PHP_SELF"],
"a.label", $param,
"",
"", $sortfield, $sortorder);
864 $totalarray[
'nbfield']++;
866 if (!empty($arrayfields[
'a.note'][
'checked'])) {
867 print_liste_field_titre($arrayfields[
'a.note'][
'label'], $_SERVER[
"PHP_SELF"],
"a.note", $param,
"",
"", $sortfield, $sortorder);
868 $totalarray[
'nbfield']++;
871 if (!empty($arrayfields[
'a.datep'][
'checked'])) {
872 print_liste_field_titre($arrayfields[
'a.datep'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep,a.id", $param,
'',
'', $sortfield, $sortorder,
'center ');
873 $totalarray[
'nbfield']++;
875 if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
876 print_liste_field_titre($arrayfields[
'a.datep2'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep2", $param,
'',
'', $sortfield, $sortorder,
'center ');
877 $totalarray[
'nbfield']++;
879 if (!empty($arrayfields[
's.nom'][
'checked'])) {
880 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom", $param,
"",
"", $sortfield, $sortorder);
881 $totalarray[
'nbfield']++;
883 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
884 print_liste_field_titre($arrayfields[
'a.fk_contact'][
'label'], $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
885 $totalarray[
'nbfield']++;
887 if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
888 print_liste_field_titre($arrayfields[
'a.fk_element'][
'label'], $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
889 $totalarray[
'nbfield']++;
892 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
894 $parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
895 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
896 print $hookmanager->resPrint;
898 if (!empty($arrayfields[
'a.datec'][
'checked'])) {
899 print_liste_field_titre($arrayfields[
'a.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datec,a.id", $param,
"",
'', $sortfield, $sortorder,
'center ');
900 $totalarray[
'nbfield']++;
902 if (!empty($arrayfields[
'a.tms'][
'checked'])) {
903 print_liste_field_titre($arrayfields[
'a.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"a.tms,a.id", $param,
"",
'', $sortfield, $sortorder,
'center ');
904 $totalarray[
'nbfield']++;
907 if (!empty($arrayfields[
'a.percent'][
'checked'])) {
908 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"a.percent", $param,
"",
'', $sortfield, $sortorder,
'center ');
909 $totalarray[
'nbfield']++;
912 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
913 $totalarray[
'nbfield']++;
918 $delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60;
919 $today_start_time =
dol_mktime(0, 0, 0, date(
'm', $now), date(
'd', $now), date(
'Y', $now));
921 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/cactioncomm.class.php';
923 $arraylist = $caction->liste_array(1,
'code',
'', (!
getDolGlobalString(
'AGENDA_USE_EVENT_TYPE') ? 1 : 0),
'', 1);
924 $contactListCache = array();
931 $imaxinloop = ($limit ? min($num, $limit) : $num);
932 $cache_user_list = array();
933 while ($i < $imaxinloop) {
934 $obj = $db->fetch_object($resql);
940 $object->setVarsFromFetchObj($obj);
943 if (
getDolGlobalString(
'AGENDA_ALWAYS_HIDE_AUTO') && $obj->type_code ==
'AC_OTH_AUTO') {
948 $actionstatic->id = $obj->id;
949 $actionstatic->ref = $obj->id;
950 $actionstatic->code = $obj->code;
951 $actionstatic->type_code = $obj->type_code;
952 $actionstatic->type_label = $obj->type_label;
953 $actionstatic->type_picto = $obj->type_picto;
954 $actionstatic->type_color = $obj->type_color;
955 $actionstatic->label = $obj->label;
956 $actionstatic->location = $obj->location;
958 $actionstatic->datep = $db->jdate($obj->dp);
959 $actionstatic->percentage = $obj->percent;
960 $actionstatic->authorid = $obj->fk_user_author;
961 $actionstatic->userownerid = $obj->fk_user_action;
965 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
966 $actionstatic->fetchResources();
970 if ($obj->fk_user_action > 0 && !isset($cache_user_list[$obj->fk_user_action])) {
971 $userstatic =
new User($db);
972 $res = $userstatic->fetch($obj->fk_user_action);
974 $cache_user_list[$obj->fk_user_action] = $userstatic;
979 $event_owner_style =
'';
981 if ($cache_user_list[$obj->fk_user_action]->color !=
'') {
982 $event_owner_style .=
'border-left: #' . $cache_user_list[$obj->fk_user_action]->color .
' 5px solid;';
986 $event_more_class =
'';
987 $event_start_date_css =
'';
988 $event_end_date_css =
'';
989 $event_start_date_time = $actionstatic->datep;
990 if ($event_start_date_time > $now) {
992 $event_more_class =
'event-future';
993 $event_start_date_css = $event_end_date_css = $event_more_class;
995 if ($obj->fulldayevent == 1) {
996 $today_start_date_time = $today_start_time;
998 $today_start_date_time = $now;
1002 $event_end_date_time = $db->jdate($obj->dp2);
1003 if ($event_end_date_time !=
null && $event_end_date_time < $today_start_date_time) {
1005 $event_more_class =
'event-past';
1006 } elseif ($event_end_date_time ==
null && $event_start_date_time < $today_start_date_time) {
1008 $event_more_class =
'event-past';
1011 $event_more_class =
'event-current';
1013 $event_start_date_css = $event_end_date_css = $event_more_class;
1015 $event_start_date_css = $event_end_date_css = $event_more_class;
1017 print
'<tr class="oddeven' . ($event_more_class !=
'' ?
' '.$event_more_class :
'') .
'">';
1020 print
'<td class="nowrap center">';
1021 if ($massactionbutton || $massaction) {
1023 if (in_array($obj->id, $arrayofselected)) {
1026 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1031 if (!empty($arrayfields[
'a.id'][
'checked'])) {
1032 print
'<td class="nowraponall">';
1033 print $actionstatic->getNomUrl(1, -1);
1038 if (!empty($arrayfields[
'owner'][
'checked'])) {
1040 print
'<td class="tdoverflowmax150">';
1041 if ($obj->fk_user_action > 0 && !isset($cache_user_list[$obj->fk_user_action])) {
1042 $userstatic =
new User($db);
1043 $res = $userstatic->fetch($obj->fk_user_action);
1045 $cache_user_list[$obj->fk_user_action] = $userstatic;
1048 if (isset($cache_user_list[$obj->fk_user_action])) {
1049 print $cache_user_list[$obj->fk_user_action]->getNomUrl(-1);
1057 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
1058 print
'<td class="nowraponall">';
1059 print $actionstatic->getTypePicto();
1060 $labeltype = $obj->type_code;
1062 $labeltype =
'AC_OTH';
1064 if (preg_match(
'/^TICKET_MSG/', $actionstatic->code)) {
1065 $labeltype = $langs->trans(
"Message");
1067 if (!empty($arraylist[$labeltype])) {
1068 $labeltype = $arraylist[$labeltype];
1070 if ($obj->type_code ==
'AC_OTH_AUTO' && ($obj->type_code != $obj->code) && $labeltype && !empty($arraylist[$obj->code])) {
1071 $labeltype .=
' - '.$arraylist[$obj->code];
1079 if (!empty($arrayfields[
'a.label'][
'checked'])) {
1080 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($actionstatic->label).
'">';
1081 print $actionstatic->label;
1086 if (!empty($arrayfields[
'a.note'][
'checked'])) {
1088 print
'<td class="tdoverflow200" title="'.dol_escape_htmltag($text).
'">';
1089 print $form->textwithtooltip(
dol_trunc($text, 48), $actionstatic->note_private);
1093 $formatToUse = $obj->fulldayevent ?
'day' :
'dayhour';
1096 if (!empty($arrayfields[
'a.datep'][
'checked'])) {
1097 print
'<td class="center nowraponall'.($event_start_date_css ?
' '.$event_start_date_css :
'').
'"><span>';
1098 if (empty($obj->fulldayevent)) {
1099 print
dol_print_date($db->jdate($obj->dp), $formatToUse,
'tzuserrel');
1102 print
dol_print_date($db->jdate($obj->dp), $formatToUse, ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1106 if ($actionstatic->hasDelay() && $actionstatic->percentage >= 0 && $actionstatic->percentage < 100) {
1116 if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
1117 print
'<td class="center nowraponall'.($event_end_date_css ?
' '.$event_end_date_css :
'').
'"><span>';
1118 if (empty($obj->fulldayevent)) {
1119 print
dol_print_date($db->jdate($obj->dp2), $formatToUse,
'tzuserrel');
1122 print
dol_print_date($db->jdate($obj->dp2), $formatToUse, ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1129 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1130 print
'<td class="tdoverflowmax150">';
1131 if ($obj->socid > 0) {
1132 $societestatic->id = $obj->socid;
1133 $societestatic->client = $obj->client;
1134 $societestatic->name = $obj->societe;
1135 $societestatic->email = $obj->socemail;
1137 print $societestatic->getNomUrl(1,
'', 28);
1145 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
1146 print
'<td class="tdoverflowmax100">';
1148 if (!empty($actionstatic->socpeopleassigned)) {
1149 $contactList = array();
1150 foreach ($actionstatic->socpeopleassigned as $socpeopleassigned) {
1151 if (!isset($contactListCache[$socpeopleassigned[
'id']])) {
1154 if ($contact->fetch($socpeopleassigned[
'id']) > 0) {
1155 $contactListCache[$socpeopleassigned[
'id']] = $contact->getNomUrl(1,
'', 0);
1156 $contactList[] = $contact->getNomUrl(1,
'', 0);
1160 $contactList[] = $contactListCache[$socpeopleassigned[
'id']];
1163 if (!empty($contactList)) {
1164 print implode(
', ', $contactList);
1166 } elseif ($obj->fk_contact > 0) {
1167 $contactstatic->id = $obj->fk_contact;
1168 $contactstatic->email = $obj->email;
1169 $contactstatic->lastname = $obj->lastname;
1170 $contactstatic->firstname = $obj->firstname;
1171 $contactstatic->phone_pro = $obj->phone_pro;
1172 $contactstatic->phone_mobile = $obj->phone_mobile;
1173 $contactstatic->phone_perso = $obj->phone_perso;
1174 $contactstatic->country_id = $obj->country_id;
1175 print $contactstatic->getNomUrl(1,
'', 0);
1183 if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
1184 print
'<td class="tdoverflowmax150">';
1186 if ($obj->fk_element > 0 && !empty($obj->elementtype)) {
1187 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1196 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1198 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
1199 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1200 print $hookmanager->resPrint;
1203 if (!empty($arrayfields[
'a.datec'][
'checked'])) {
1205 print
'<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datec),
'dayhour',
'tzuserrel').
'</td>';
1208 if (!empty($arrayfields[
'a.tms'][
'checked'])) {
1209 print
'<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datem),
'dayhour',
'tzuserrel').
'</td>';
1211 if (!empty($arrayfields[
'a.percent'][
'checked'])) {
1213 $datep = $db->jdate($obj->dp);
1214 print
'<td align="center" class="nowrap">'.$actionstatic->LibStatut($obj->percent, 5, 0, $datep).
'</td>';
1218 print
'<td class="nowrap center">';
1219 if ($massactionbutton || $massaction) {
1221 if (in_array($obj->id, $arrayofselected)) {
1224 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1235 print
'<tr><td colspan="'.$totalarray[
'nbfield'].
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1239 print
'</table>'.
"\n";
1240 print
'</div>'.
"\n";
1242 print
'</form>'.
"\n";
if($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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)
Show filter form in agenda view.
calendars_prepare_head($param)
Define head array for tabs of agenda setup pages.
if(preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) if(preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) if($action=='set') elseif($action=='specimen') elseif($action=='setmodel') elseif($action=='del') elseif($action=='setdoc') $formactions
View.
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)
const EVENT_FINISHED
Typical value for a event that is in a finished state.
const EVENT_IN_PROGRESS
Typical value for a event that is in a progress state.
const EVENT_TODO
Typical value for a event that is in a todo state.
Class to manage different types of events.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
if(isModEnabled('invoice') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) if(isModEnabled('invoice') &&isModEnabled('order') && $user->hasRight("commande", "lire") &&!getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) $sql
Social contributions to pay.
dolGetElementUrl($objectid, $objecttype, $withpicto=0, $option='')
Return link url to an object.
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...
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
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.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
print_barre_liste($title, $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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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.