33require
'../../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
40include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
51$langs->loadLangs(array(
"users",
"companies",
"agenda",
"commercial",
"other",
"orders",
"bills"));
54$action =
GETPOST(
'action',
'aZ09');
55$massaction =
GETPOST(
'massaction',
'alpha');
56$confirm =
GETPOST(
'confirm',
'alpha');
57$cancel =
GETPOST(
'cancel',
'alpha');
58$toselect =
GETPOST(
'toselect',
'array');
59$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'actioncommlist';
60$optioncss =
GETPOST(
'optioncss',
'alpha');
63$disabledefaultvalues =
GETPOSTINT(
'disabledefaultvalues');
66if (empty($mode) && preg_match(
'/show_/', $action)) {
71$search_status = (
GETPOST(
"search_status",
'aZ09') !=
'') ?
GETPOST(
"search_status",
'aZ09') :
GETPOST(
"status",
'aZ09');
72$type =
GETPOST(
'search_type',
'alphanohtml') ?
GETPOST(
'search_type',
'alphanohtml') :
GETPOST(
'type',
'alphanohtml');
78if (
GETPOST(
'search_actioncode',
'array')) {
79 $actioncode =
GETPOST(
'search_actioncode',
'array', 3);
80 if (!count($actioncode)) {
88$search_id =
GETPOST(
'search_id',
'alpha');
89$search_title =
GETPOST(
'search_title',
'alpha');
90$search_note =
GETPOST(
'search_note',
'alpha');
98if ($search_status ==
'' && !GETPOSTISSET(
'search_status')) {
99 $search_status = ((!
getDolGlobalString(
'AGENDA_DEFAULT_FILTER_STATUS') || $disabledefaultvalues) ?
'' :
$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
101if (empty($mode) && !GETPOSTISSET(
'mode')) {
105$filter =
GETPOST(
"search_filter",
'alpha', 3) ?
GETPOST(
"search_filter",
'alpha', 3) :
GETPOST(
"filter",
'alpha', 3);
106$filtert =
GETPOST(
"search_filtert",
"intcomma", 3) ?
GETPOST(
"search_filtert",
"intcomma", 3) :
GETPOST(
"filtert",
"intcomma", 3);
109$search_categ_cus =
GETPOST(
"search_categ_cus",
"intcomma", 3) ?
GETPOST(
"search_categ_cus",
"intcomma", 3) : 0;
113$hookmanager->initHooks(array(
'agendalist'));
118$extrafields->fetch_name_optionals_label(
$object->table_element);
120$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
123 $filtert = $user->id;
128$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
129$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
131if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
135$offset = $limit * $page;
137 $sortorder =
"DESC,DESC";
138 if ($search_status ==
'todo') {
139 $sortorder =
"DESC,DESC";
143 $sortfield =
"a.datep,a.id";
144 if ($search_status ==
'todo') {
145 $sortfield =
"a.datep,a.id";
152 $socid = $user->socid;
159if (!$user->hasRight(
'agenda',
'myactions',
'read')) {
162if (!$user->hasRight(
'agenda',
'allactions',
'read')) {
165if (!$user->hasRight(
'agenda',
'allactions',
'read') || $filter ==
'mine') {
166 $filtert = $user->id;
170 'a.id' => array(
'label' =>
"Ref",
'checked' => 1),
171 'owner' => array(
'label' =>
"Owner",
'checked' => 1),
172 'c.libelle' => array(
'label' =>
"Type",
'checked' => 1),
173 'a.label' => array(
'label' =>
"Title",
'checked' => 1),
174 'a.note' => array(
'label' =>
'Description',
'checked' => 0),
175 'a.datep' => array(
'label' =>
"DateStart",
'checked' => 1),
176 'a.datep2' => array(
'label' =>
"DateEnd",
'checked' => 1),
177 's.nom' => array(
'label' =>
"ThirdParty",
'checked' => 1),
178 'a.fk_contact' => array(
'label' =>
"Contact",
'checked' => 0),
179 'a.fk_element' => array(
'label' =>
"LinkedObject",
'checked' => 1,
'enabled' => (
getDolGlobalString(
'AGENDA_SHOW_LINKED_OBJECT'))),
180 'a.datec' => array(
'label' =>
'DateCreation',
'checked' => 0,
'position' => 510),
181 'a.tms' => array(
'label' =>
'DateModification',
'checked' => 0,
'position' => 520),
182 'a.percent' => array(
'label' =>
"Status",
'checked' => 1,
'position' => 1000)
185include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
189'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
192if ($user->socid && $socid) {
201if (
GETPOST(
'cancel',
'alpha')) {
208 if (is_array($_POST)) {
209 foreach ($_POST as $key => $val) {
210 $param .=
'&'.$key.
'='.urlencode($val);
214 header(
"Location: ".DOL_URL_ROOT.
'/comm/action/index.php?'.$param);
218$parameters = array(
'id' => $socid);
219$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
225include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
227if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
232 $datestart_dtstart =
'';
233 $datestart_dtend =
'';
234 $dateend_dtstart =
'';
245 $search_array_options = array();
248if (empty($reshook) && !empty($massaction)) {
251 switch ($massaction) {
252 case 'set_all_events_to_todo':
256 case 'set_all_events_to_in_progress':
260 case 'set_all_events_to_finished':
265 if (isset($percent)) {
266 foreach ($toselect as $toselectid) {
267 $result =
$object->updatePercent($toselectid, $percent);
277if (empty($reshook)) {
278 $objectclass =
'ActionComm';
279 $objectlabel =
'Events';
282 $permissiontodelete = $user->hasRight(
'agenda',
'allactions',
'delete');
283 $permissiontoadd = $user->hasRight(
'agenda',
'myactions',
'create');
284 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
292$form =
new Form($db);
293$userstatic =
new User($db);
297$societestatic =
new Societe($db);
298$contactstatic =
new Contact($db);
301$nav .= $form->selectDate($dateselect,
'dateselect', 0, 0, 1,
'', 1, 0);
302$nav .=
' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans(
"Refresh").
'">';
306$help_url =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
307$title = $langs->trans(
"Agenda");
308llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist');
314if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
315 $param .=
'&contextpage='.urlencode($contextpage);
317if ($limit > 0 && $limit !=
$conf->liste_limit) {
318 $param .=
'&limit='.((int) $limit);
320if ($actioncode !=
'') {
321 if (is_array($actioncode)) {
322 foreach ($actioncode as $str_action) {
323 $param .=
"&search_actioncode[]=".urlencode($str_action);
326 $param .=
"&search_actioncode=".urlencode($actioncode);
329if ($resourceid > 0) {
330 $param .=
"&search_resourceid=".urlencode((
string) ($resourceid));
332if ($search_status !=
'') {
333 $param .=
"&search_status=".urlencode($search_status);
336 $param .=
"&search_filter=".urlencode($filter);
339 $param .=
"&search_filtert=".urlencode($filtert);
342 $param .=
"&search_usergroup=".urlencode((
string) ($usergroup));
345 $param .=
"&search_socid=".urlencode((
string) ($socid));
348 $param .=
"&search_showbirthday=1";
351 $param .=
"&search_projectid=".urlencode((
string) ($pid));
354 $param .=
"&search_type=".urlencode($type);
356if ($search_id !=
'') {
357 $param .=
'&search_id='.urlencode($search_id);
359if ($search_title !=
'') {
360 $param .=
'&search_title='.urlencode($search_title);
362if ($search_note !=
'') {
363 $param .=
'&search_note='.urlencode($search_note);
366 $param .=
'&datestart_dtstartday='.GETPOSTINT(
'datestart_dtstartday');
369 $param .=
'&datestart_dtstartmonth='.GETPOSTINT(
'datestart_dtstartmonth');
372 $param .=
'&datestart_dtstartyear='.GETPOSTINT(
'datestart_dtstartyear');
375 $param .=
'&datestart_dtendday='.GETPOSTINT(
'datestart_dtendday');
378 $param .=
'&datestart_dtendmonth='.GETPOSTINT(
'datestart_dtendmonth');
381 $param .=
'&datestart_dtendyear='.GETPOSTINT(
'datestart_dtendyear');
384 $param .=
'&dateend_dtstartday='.GETPOSTINT(
'dateend_dtstartday');
387 $param .=
'&dateend_dtstartmonth='.GETPOSTINT(
'dateend_dtstartmonth');
390 $param .=
'&dateend_dtstartyear='.GETPOSTINT(
'dateend_dtstartyear');
393 $param .=
'&dateend_dtendday='.GETPOSTINT(
'dateend_dtendday');
396 $param .=
'&dateend_dtendmonth='.GETPOSTINT(
'dateend_dtendmonth');
399 $param .=
'&dateend_dtendyear='.GETPOSTINT(
'dateend_dtendyear');
401if ($optioncss !=
'') {
402 $param .=
'&optioncss='.urlencode($optioncss);
404if ($search_categ_cus != 0) {
405 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
409include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
411$paramnoactionodate = $param;
414$arrayofmassactions = array(
415 'set_all_events_to_todo' =>
img_picto(
'',
'circle',
'class="pictofixedwidth font-status1"').$langs->trans(
"SetAllEventsToTodo"),
416 'set_all_events_to_in_progress' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth font-status2"').$langs->trans(
"SetAllEventsToInProgress"),
417 'set_all_events_to_finished' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth badge-status5"').$langs->trans(
"SetAllEventsToFinished"),
419if ($user->hasRight(
'agenda',
'allactions',
'delete')) {
420 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
422if (isModEnabled(
'category') && $user->hasRight(
'agenda',
'myactions',
'create')) {
423 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
425if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
426 $arrayofmassactions = array();
428$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
434$sql .=
" s.nom as societe, s.rowid as socid, s.client, s.email as socemail,";
435$sql .=
" a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,";
436$sql .=
" a.fk_user_author, a.fk_user_action,";
437$sql .=
" a.fk_contact, a.note, a.percent as percent,";
438$sql .=
" a.fk_element, a.elementtype, a.datec, a.tms as datem,";
439$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,";
440$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";
443if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
444 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
445 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
450$parameters = array();
451$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
452$sql .= $hookmanager->resPrint;
456$sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a";
457$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"actioncomm_extrafields as ef ON (a.id = ef.fk_object)";
458$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
459$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"socpeople as sp ON a.fk_contact = sp.rowid";
460$sql .=
" ,".MAIN_DB_PREFIX.
"c_actioncomm as c";
462if ($resourceid > 0) {
463 $sql .=
", ".MAIN_DB_PREFIX.
"element_resources as r";
466if ($filtert > 0 || $usergroup > 0) {
467 $sql .=
", ".MAIN_DB_PREFIX.
"actioncomm_resources as ar";
470 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
472$sql .=
" WHERE c.id = a.fk_action";
473$sql .=
' AND a.entity IN ('.getEntity(
'agenda').
')';
475if (!empty($actioncode)) {
477 if ($actioncode ==
'AC_NON_AUTO') {
478 $sql .=
" AND c.type != 'systemauto'";
479 } elseif ($actioncode ==
'AC_ALL_AUTO') {
480 $sql .=
" AND c.type = 'systemauto'";
482 if ($actioncode ==
'AC_OTH') {
483 $sql .=
" AND c.type != 'systemauto'";
485 if ($actioncode ==
'AC_OTH_AUTO') {
486 $sql .=
" AND c.type = 'systemauto'";
490 if ($actioncode ==
'AC_NON_AUTO') {
491 $sql .=
" AND c.type != 'systemauto'";
492 } elseif ($actioncode ==
'AC_ALL_AUTO') {
493 $sql .=
" AND c.type = 'systemauto'";
495 if (is_array($actioncode)) {
496 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", $actioncode).
"'", 1).
")";
497 } elseif ($actioncode !==
'-1') {
498 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", explode(
',', $actioncode)).
"'", 1).
")";
503if ($resourceid > 0) {
504 $sql .=
" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".((int) $resourceid);
507 $sql .=
" AND a.fk_project=".((int) $pid);
511if (isModEnabled(
"societe") && !$user->hasRight(
'societe',
'client',
'voir')) {
512 $search_sale = $user->id;
515if ($search_sale && $search_sale !=
'-1') {
516 if ($search_sale == -2) {
517 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc)";
518 } elseif ($search_sale > 0) {
519 $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).
")";
524 $sql .=
" AND a.fk_soc = ".((int) $socid);
527if ($filtert > 0 || $usergroup > 0) {
528 $sql .=
" AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
531 $sql .=
" AND c.id = ".((int) $type);
533if ($search_status ==
'0') {
534 $sql .=
" AND a.percent = 0";
536if ($search_status ==
'na') {
537 $sql .=
" AND a.percent = -1";
539if ($search_status ==
'50') {
540 $sql .=
" AND (a.percent > 0 AND a.percent < 100)";
542if ($search_status ==
'100') {
543 $sql .=
" AND a.percent = 100";
545if ($search_status ==
'done') {
546 $sql .=
" AND (a.percent = 100)";
548if ($search_status ==
'todo') {
549 $sql .=
" AND (a.percent >= 0 AND a.percent < 100)";
561if ($filtert > 0 || $usergroup > 0) {
564 $sql .=
"(ar.fk_element = ".((int) $filtert).
" OR (ar.fk_element IS NULL AND a.fk_user_action = ".((int) $filtert).
"))";
566 if ($usergroup > 0) {
567 $sql .= ($filtert > 0 ?
" OR " :
"").
" ugu.fk_usergroup = ".((
int) $usergroup);
573if ($dateselect > 0) {
574 $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).
"'))";
576if ($datestart_dtstart > 0) {
577 $sql .=
" AND a.datep >= '".$db->idate($datestart_dtstart).
"'";
579if ($datestart_dtend > 0) {
580 $sql .=
" AND a.datep <= '".$db->idate($datestart_dtend).
"'";
582if ($dateend_dtstart > 0) {
583 $sql .=
" AND a.datep2 >= '".$db->idate($dateend_dtstart).
"'";
585if ($dateend_dtend > 0) {
586 $sql .=
" AND a.datep2 <= '".$db->idate($dateend_dtend).
"'";
590if ($search_categ_cus != -1) {
591 if ($search_categ_cus == -2) {
592 $sql .=
" AND NOT EXISTS (SELECT ca.fk_actioncomm FROM ".MAIN_DB_PREFIX.
"categorie_actioncomm as ca WHERE ca.fk_actioncomm = a.id)";
593 } elseif ($search_categ_cus > 0) {
594 $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).
"))";
599include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
602$parameters = array();
603$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
604$sql .= $hookmanager->resPrint;
607$nbtotalofrecords =
'';
610 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
611 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
613 $resql = $db->query($sqlforcount);
615 $objforcount = $db->fetch_object($resql);
616 $nbtotalofrecords = $objforcount->nbtotalofrecords;
621 if (($page * $limit) > $nbtotalofrecords) {
629$sql .= $db->order($sortfield, $sortorder);
631 $sql .= $db->plimit($limit + 1, $offset);
634$resql = $db->query($sql);
640$num = $db->num_rows($resql);
642$arrayofselected = is_array($toselect) ? $toselect : array();
645$newtitle =
'<div class="nowrap clear inline-block minheight30">';
646$newtitle .=
'<input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans(
"LocalAgenda").
' ';
647$newtitle .=
'</div>';
650$tabactive =
'cardlist';
654print
'<form method="POST" id="searchFormList" class="listactionsfilter" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
656if ($optioncss !=
'') {
657 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
659print
'<input type="hidden" name="token" value="'.newToken().
'">';
660print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
661print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
662print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
663print
'<input type="hidden" name="type" value="'.$type.
'">';
667 $nav .=
'<input type="hidden" name="search_filter" value="'.$filter.
'">';
670 $nav .=
'<input type="hidden" name="search_showbirthday" value="1">';
682$parameters = array();
683$reshook = $hookmanager->executeHooks(
'addCalendarChoice', $parameters, $object, $action);
684if (empty($reshook)) {
685 $s .= $hookmanager->resPrint;
686} elseif ($reshook > 1) {
687 $s = $hookmanager->resPrint;
694$viewmode =
'<div class="navmode inline-block">';
696$viewmode .=
'<a class="btnTitle'.(($mode ==
'list' || $mode ==
'show_list') ?
' btnTitleSelected' :
'').
' btnTitleSelected reposition" href="'.DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1'.$paramnoactionodate.
'">';
698$viewmode .=
img_picto($langs->trans(
"List"),
'object_calendarlist',
'class="imgforviewmode pictoactionview block"');
700$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewList").
'</span></a>';
702$viewmode .=
'<a class="btnTitle'.($mode ==
'show_month' ?
' btnTitleSelected' :
'').
' reposition" href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_month&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
704$viewmode .=
img_picto($langs->trans(
"ViewCal"),
'object_calendarmonth',
'class="pictoactionview block"');
706$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewCal").
'</span></a>';
708$viewmode .=
'<a class="btnTitle'.($mode ==
'show_week' ?
' btnTitleSelected' :
'').
' reposition" href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_week&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
710$viewmode .=
img_picto($langs->trans(
"ViewWeek"),
'object_calendarweek',
'class="pictoactionview block"');
712$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewWeek").
'</span></a>';
714$viewmode .=
'<a class="btnTitle'.($mode ==
'show_day' ?
' btnTitleSelected' :
'').
' reposition" href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_day&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
716$viewmode .=
img_picto($langs->trans(
"ViewDay"),
'object_calendarday',
'class="pictoactionview block"');
718$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewDay").
'</span></a>';
720$viewmode .=
'<a class="btnTitle'.($mode ==
'show_peruser' ?
' btnTitleSelected' :
'').
' reposition marginrightonly" href="'.DOL_URL_ROOT.
'/comm/action/peruser.php?mode=show_peruser&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
722$viewmode .=
img_picto($langs->trans(
"ViewPerUser"),
'object_calendarperuser',
'class="pictoactionview block"');
724$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow" title="'.dolPrintHTML($langs->trans(
"ViewPerUser")).
'">'.$langs->trans(
"ViewPerUser").
'</span></a>';
727$parameters = array();
728$reshook = $hookmanager->executeHooks(
'addCalendarView', $parameters, $object, $action);
729if (empty($reshook)) {
730 $viewmode .= $hookmanager->resPrint;
731} elseif ($reshook > 1) {
732 $viewmode = $hookmanager->resPrint;
735$viewmode .=
'</div>';
737$viewmode .=
'<span class="marginrightonly"></span>';
742$newparam =
'&month='.str_pad((
string) $month, 2,
"0", STR_PAD_LEFT).
'&year='.$tmpforcreatebutton[
'year'];
744$url = DOL_URL_ROOT.
'/comm/action/card.php?action=create';
745$url .=
'&apyear='.$tmpforcreatebutton[
'year'].
'&apmonth='.$tmpforcreatebutton[
'mon'].
'&apday='.$tmpforcreatebutton[
'mday'].
'&aphour='.$tmpforcreatebutton[
'hours'].
'&apmin='.$tmpforcreatebutton[
'minutes'];
746$url .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].($newparam ?
'?'.$newparam :
''));
748$newcardbutton =
dolGetButtonTitle($langs->trans(
'AddAction'),
'',
'fa fa-plus-circle', $url,
'', (
int) ($user->hasRight(
'agenda',
'myactions',
'create') || $user->hasRight(
'agenda',
'allactions',
'create')));
750$param .=
'&mode='.urlencode($mode);
752print_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);
757include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
761$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
762$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
763if ($massactionbutton) {
764 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
768print
'<div class="liste_titre liste_titre_bydiv centpercent">';
769print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday,
'', $filtert,
'', $pid, $socid, $action, -1, $actioncode, $usergroup,
'', $resourceid, $search_categ_cus);
774print
'<div class="div-table-responsive">';
775print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
777print
'<tr class="liste_titre_filter">';
780 print
'<td class="liste_titre" align="middle">';
781 $searchpicto = $form->showFilterButtons(
'left');
785if (!empty($arrayfields[
'a.id'][
'checked'])) {
786 print
'<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.
'"></td>';
788if (!empty($arrayfields[
'owner'][
'checked'])) {
789 print
'<td class="liste_titre"></td>';
791if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
792 print
'<td class="liste_titre"></td>';
794if (!empty($arrayfields[
'a.label'][
'checked'])) {
795 print
'<td class="liste_titre"><input type="text" class="maxwidth75" name="search_title" value="'.$search_title.
'"></td>';
797if (!empty($arrayfields[
'a.note'][
'checked'])) {
798 print
'<td class="liste_titre"><input type="text" class="maxwidth75" name="search_note" value="'.$search_note.
'"></td>';
800if (!empty($arrayfields[
'a.datep'][
'checked'])) {
801 print
'<td class="liste_titre nowraponall" align="center">';
802 print
'<div class="nowrap">';
803 print $form->selectDate($datestart_dtstart,
'datestart_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
805 print
'<div class="nowrap">';
806 print $form->selectDate($datestart_dtend,
'datestart_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
810if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
811 print
'<td class="liste_titre nowraponall" align="center">';
812 print
'<div class="nowrap">';
813 print $form->selectDate($dateend_dtstart,
'dateend_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
815 print
'<div class="nowrap">';
816 print $form->selectDate($dateend_dtend,
'dateend_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
820if (!empty($arrayfields[
's.nom'][
'checked'])) {
821 print
'<td class="liste_titre"></td>';
823if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
824 print
'<td class="liste_titre"></td>';
826if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
827 print
'<td class="liste_titre"></td>';
831include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
834$parameters = array(
'arrayfields' => $arrayfields);
835$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
836print $hookmanager->resPrint;
838if (!empty($arrayfields[
'a.datec'][
'checked'])) {
839 print
'<td class="liste_titre"></td>';
841if (!empty($arrayfields[
'a.tms'][
'checked'])) {
842 print
'<td class="liste_titre"></td>';
844if (!empty($arrayfields[
'a.percent'][
'checked'])) {
845 print
'<td class="liste_titre center parentonrightofpage">';
846 $formactions->form_select_status_action(
'formaction', $search_status, 1,
'search_status', 1, 2,
'search_status width100 onrightofpage');
851 print
'<td class="liste_titre center">';
852 $searchpicto = $form->showFilterButtons();
858$totalarray = array();
859$totalarray[
'nbfield'] = 0;
863print
'<tr class="liste_titre">';
865 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
866 $totalarray[
'nbfield']++;
868if (!empty($arrayfields[
'a.id'][
'checked'])) {
870 print_liste_field_titre($arrayfields[
'a.id'][
'label'], $_SERVER[
"PHP_SELF"],
"a.id", $param,
"",
"", $sortfield, $sortorder);
871 $totalarray[
'nbfield']++;
873if (!empty($arrayfields[
'owner'][
'checked'])) {
874 print_liste_field_titre($arrayfields[
'owner'][
'label'], $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
875 $totalarray[
'nbfield']++;
877if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
878 print_liste_field_titre($arrayfields[
'c.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.libelle", $param,
"",
"", $sortfield, $sortorder);
879 $totalarray[
'nbfield']++;
881if (!empty($arrayfields[
'a.label'][
'checked'])) {
882 print_liste_field_titre($arrayfields[
'a.label'][
'label'], $_SERVER[
"PHP_SELF"],
"a.label", $param,
"",
"", $sortfield, $sortorder);
883 $totalarray[
'nbfield']++;
885if (!empty($arrayfields[
'a.note'][
'checked'])) {
886 print_liste_field_titre($arrayfields[
'a.note'][
'label'], $_SERVER[
"PHP_SELF"],
"a.note", $param,
"",
"", $sortfield, $sortorder);
887 $totalarray[
'nbfield']++;
890if (!empty($arrayfields[
'a.datep'][
'checked'])) {
891 print_liste_field_titre($arrayfields[
'a.datep'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep,a.id", $param,
'',
'', $sortfield, $sortorder,
'center ');
892 $totalarray[
'nbfield']++;
894if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
895 print_liste_field_titre($arrayfields[
'a.datep2'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep2", $param,
'',
'', $sortfield, $sortorder,
'center ');
896 $totalarray[
'nbfield']++;
898if (!empty($arrayfields[
's.nom'][
'checked'])) {
899 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom", $param,
"",
"", $sortfield, $sortorder);
900 $totalarray[
'nbfield']++;
902if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
903 print_liste_field_titre($arrayfields[
'a.fk_contact'][
'label'], $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
904 $totalarray[
'nbfield']++;
906if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
907 print_liste_field_titre($arrayfields[
'a.fk_element'][
'label'], $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
908 $totalarray[
'nbfield']++;
911include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
913$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
914$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
915print $hookmanager->resPrint;
917if (!empty($arrayfields[
'a.datec'][
'checked'])) {
918 print_liste_field_titre($arrayfields[
'a.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datec,a.id", $param,
"",
'', $sortfield, $sortorder,
'center ');
919 $totalarray[
'nbfield']++;
921if (!empty($arrayfields[
'a.tms'][
'checked'])) {
922 print_liste_field_titre($arrayfields[
'a.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"a.tms,a.id", $param,
"",
'', $sortfield, $sortorder,
'center ');
923 $totalarray[
'nbfield']++;
926if (!empty($arrayfields[
'a.percent'][
'checked'])) {
927 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"a.percent", $param,
"",
'', $sortfield, $sortorder,
'center ');
928 $totalarray[
'nbfield']++;
931 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
932 $totalarray[
'nbfield']++;
937$delay_warning =
getDolGlobalInt(
'MAIN_DELAY_ACTIONS_TODO') * 24 * 60 * 60;
938$today_start_time =
dol_mktime(0, 0, 0, (
int) date(
'm', $now), (
int) date(
'd', $now), (
int) date(
'Y', $now));
940require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/cactioncomm.class.php';
942$arraylist = $caction->liste_array(1,
'code',
'', (!
getDolGlobalString(
'AGENDA_USE_EVENT_TYPE') ? 1 : 0),
'', 1);
943$contactListCache = array();
950$imaxinloop = ($limit ? min($num, $limit) : $num);
951$cache_user_list = array();
952while ($i < $imaxinloop) {
953 $obj = $db->fetch_object($resql);
959 $object->setVarsFromFetchObj($obj);
962 if (
getDolGlobalString(
'AGENDA_ALWAYS_HIDE_AUTO') && $obj->type_code ==
'AC_OTH_AUTO') {
967 $actionstatic->id = $obj->id;
968 $actionstatic->ref = $obj->id;
969 $actionstatic->code = $obj->code;
970 $actionstatic->type_code = $obj->type_code;
971 $actionstatic->type_label = $obj->type_label;
972 $actionstatic->type_picto = $obj->type_picto;
973 $actionstatic->type_color = $obj->type_color;
974 $actionstatic->label = $obj->label;
975 $actionstatic->location = $obj->location;
977 $actionstatic->datep = $db->jdate($obj->dp);
978 $actionstatic->percentage = $obj->percent;
979 $actionstatic->authorid = $obj->fk_user_author;
980 $actionstatic->userownerid = $obj->fk_user_action;
984 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
985 $actionstatic->fetchResources();
989 if ($obj->fk_user_action > 0 && !isset($cache_user_list[$obj->fk_user_action])) {
990 $userstatic =
new User($db);
991 $res = $userstatic->fetch($obj->fk_user_action);
993 $cache_user_list[$obj->fk_user_action] = $userstatic;
998 $event_owner_style =
'';
1000 if ($obj->fk_user_action > 0 && $cache_user_list[$obj->fk_user_action]->color !=
'') {
1001 $event_owner_style .=
'border-left: #' . $cache_user_list[$obj->fk_user_action]->color .
' 5px solid;';
1005 $event_more_class =
'';
1006 $event_start_date_css =
'';
1007 $event_end_date_css =
'';
1008 $event_start_date_time = $actionstatic->datep;
1009 if ($event_start_date_time > $now) {
1011 $event_more_class =
'event-future';
1012 $event_start_date_css = $event_end_date_css = $event_more_class;
1014 if ($obj->fulldayevent == 1) {
1015 $today_start_date_time = $today_start_time;
1017 $today_start_date_time = $now;
1021 $event_end_date_time = $db->jdate($obj->dp2);
1022 if ($event_end_date_time !=
null && $event_end_date_time < $today_start_date_time) {
1024 $event_more_class =
'event-past';
1025 } elseif ($event_end_date_time ==
null && $event_start_date_time < $today_start_date_time) {
1027 $event_more_class =
'event-past';
1030 $event_more_class =
'event-current';
1032 $event_start_date_css = $event_end_date_css = $event_more_class;
1034 $event_start_date_css = $event_end_date_css = $event_more_class;
1036 print
'<tr class="oddeven' . ($event_more_class !=
'' ?
' '.$event_more_class :
'') .
'">';
1039 print
'<td class="nowrap center">';
1040 if ($massactionbutton || $massaction) {
1042 if (in_array($obj->id, $arrayofselected)) {
1045 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1050 if (!empty($arrayfields[
'a.id'][
'checked'])) {
1051 print
'<td class="nowraponall">';
1052 print $actionstatic->getNomUrl(1, -1);
1057 if (!empty($arrayfields[
'owner'][
'checked'])) {
1059 print
'<td class="tdoverflowmax150">';
1060 if ($obj->fk_user_action > 0 && !isset($cache_user_list[$obj->fk_user_action])) {
1061 $userstatic =
new User($db);
1062 $res = $userstatic->fetch($obj->fk_user_action);
1064 $cache_user_list[$obj->fk_user_action] = $userstatic;
1067 if (isset($cache_user_list[$obj->fk_user_action])) {
1068 print $cache_user_list[$obj->fk_user_action]->getNomUrl(-1);
1076 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
1077 print
'<td class="nowraponall">';
1078 print $actionstatic->getTypePicto();
1079 $labeltype = $obj->type_code;
1081 $labeltype =
'AC_OTH';
1083 if (!empty($actionstatic->code) && preg_match(
'/^TICKET_MSG/', $actionstatic->code)) {
1084 $labeltype = $langs->trans(
"Message");
1086 if (!empty($arraylist[$labeltype])) {
1087 $labeltype = $arraylist[$labeltype];
1089 if ($obj->type_code ==
'AC_OTH_AUTO' && ($obj->type_code != $obj->code) && $labeltype && !empty($arraylist[$obj->code])) {
1090 $labeltype .=
' - '.$arraylist[$obj->code];
1098 if (!empty($arrayfields[
'a.label'][
'checked'])) {
1099 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($actionstatic->label).
'">';
1100 print $actionstatic->label;
1105 if (!empty($arrayfields[
'a.note'][
'checked'])) {
1107 print
'<td class="tdoverflow200" title="'.dol_escape_htmltag($text).
'">';
1108 print $form->textwithtooltip(
dol_trunc($text, 48), $actionstatic->note_private);
1112 $formatToUse = $obj->fulldayevent ?
'day' :
'dayhour';
1115 if (!empty($arrayfields[
'a.datep'][
'checked'])) {
1116 print
'<td class="center nowraponall'.($event_start_date_css ?
' '.$event_start_date_css :
'').
'"><span>';
1117 if (empty($obj->fulldayevent)) {
1118 print
dol_print_date($db->jdate($obj->dp), $formatToUse,
'tzuserrel');
1121 print
dol_print_date($db->jdate($obj->dp), $formatToUse, ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1125 if ($actionstatic->hasDelay() && $actionstatic->percentage >= 0 && $actionstatic->percentage < 100) {
1135 if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
1136 print
'<td class="center nowraponall'.($event_end_date_css ?
' '.$event_end_date_css :
'').
'"><span>';
1137 if (empty($obj->fulldayevent)) {
1138 print
dol_print_date($db->jdate($obj->dp2), $formatToUse,
'tzuserrel');
1141 print
dol_print_date($db->jdate($obj->dp2), $formatToUse, ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1148 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1149 print
'<td class="tdoverflowmax150">';
1150 if ($obj->socid > 0) {
1151 $societestatic->id = $obj->socid;
1152 $societestatic->client = (int) $obj->client;
1153 $societestatic->name = (string) $obj->societe;
1154 $societestatic->email = $obj->socemail;
1156 print $societestatic->getNomUrl(1,
'', 28);
1164 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
1165 print
'<td class="tdoverflowmax100">';
1167 if (!empty($actionstatic->socpeopleassigned)) {
1168 $contactList = array();
1169 foreach ($actionstatic->socpeopleassigned as $socpeopleassigned) {
1170 if (!isset($contactListCache[$socpeopleassigned[
'id']])) {
1173 if ($contact->fetch($socpeopleassigned[
'id']) > 0) {
1174 $contactListCache[$socpeopleassigned[
'id']] = $contact->getNomUrl(1,
'', 0);
1175 $contactList[] = $contact->getNomUrl(1,
'', 0);
1179 $contactList[] = $contactListCache[$socpeopleassigned[
'id']];
1182 if (!empty($contactList)) {
1183 print implode(
', ', $contactList);
1185 } elseif ($obj->fk_contact > 0) {
1186 $contactstatic->id = $obj->fk_contact;
1187 $contactstatic->email = $obj->email;
1188 $contactstatic->lastname = $obj->lastname;
1189 $contactstatic->firstname = $obj->firstname;
1190 $contactstatic->phone_pro = $obj->phone_pro;
1191 $contactstatic->phone_mobile = $obj->phone_mobile;
1192 $contactstatic->phone_perso = $obj->phone_perso;
1193 $contactstatic->country_id = $obj->country_id;
1194 print $contactstatic->getNomUrl(1,
'', 0);
1202 if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
1203 print
'<td class="tdoverflowmax150">';
1205 if ($obj->fk_element > 0 && !empty($obj->elementtype)) {
1206 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1215 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1217 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
1218 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1219 print $hookmanager->resPrint;
1222 if (!empty($arrayfields[
'a.datec'][
'checked'])) {
1224 print
'<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datec),
'dayhour',
'tzuserrel').
'</td>';
1227 if (!empty($arrayfields[
'a.tms'][
'checked'])) {
1228 print
'<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datem),
'dayhour',
'tzuserrel').
'</td>';
1230 if (!empty($arrayfields[
'a.percent'][
'checked'])) {
1232 $datep = $db->jdate($obj->dp);
1233 print
'<td align="center" class="nowrap">'.$actionstatic->LibStatut($obj->percent, 5, 0, $datep).
'</td>';
1237 print
'<td class="nowrap center">';
1238 if ($massactionbutton || $massaction) {
1240 if (in_array($obj->id, $arrayofselected)) {
1243 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1254 print
'<tr><td colspan="'.$totalarray[
'nbfield'].
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1258print
'</table>'.
"\n";
1261print
'</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(!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)
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.
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...
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_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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
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 a Dolibarr global constant string value.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.