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';
43$langs->loadLangs(array(
"users",
"companies",
"agenda",
"commercial",
"other",
"orders",
"bills"));
46$action =
GETPOST(
'action',
'aZ09');
47$massaction =
GETPOST(
'massaction',
'alpha');
48$confirm =
GETPOST(
'confirm',
'alpha');
49$cancel =
GETPOST(
'cancel',
'alpha');
50$toselect =
GETPOST(
'toselect',
'array');
51$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'actioncommlist';
52$optioncss =
GETPOST(
'optioncss',
'alpha');
55$disabledefaultvalues =
GETPOSTINT(
'disabledefaultvalues');
58if (empty($mode) && preg_match(
'/show_/', $action)) {
63$search_status = (
GETPOST(
"search_status",
'aZ09') !=
'') ?
GETPOST(
"search_status",
'aZ09') :
GETPOST(
"status",
'aZ09');
64$type =
GETPOST(
'search_type',
'alphanohtml') ?
GETPOST(
'search_type',
'alphanohtml') :
GETPOST(
'type',
'alphanohtml');
70if (
GETPOST(
'search_actioncode',
'array')) {
71 $actioncode =
GETPOST(
'search_actioncode',
'array', 3);
72 if (!count($actioncode)) {
80$search_id =
GETPOST(
'search_id',
'alpha');
81$search_title =
GETPOST(
'search_title',
'alpha');
82$search_note =
GETPOST(
'search_note',
'alpha');
90if ($search_status ==
'' && !GETPOSTISSET(
'search_status')) {
91 $search_status = ((!
getDolGlobalString(
'AGENDA_DEFAULT_FILTER_STATUS') || $disabledefaultvalues) ?
'' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
93if (empty($mode) && !GETPOSTISSET(
'mode')) {
97$filter =
GETPOST(
"search_filter",
'alpha', 3) ?
GETPOST(
"search_filter",
'alpha', 3) :
GETPOST(
"filter",
'alpha', 3);
98$filtert =
GETPOST(
"search_filtert",
"intcomma", 3) ?
GETPOST(
"search_filtert",
"intcomma", 3) :
GETPOST(
"filtert",
"intcomma", 3);
100$showbirthday = empty($conf->use_javascript_ajax) ? (
GETPOSTINT(
"search_showbirthday") ?
GETPOSTINT(
"search_showbirthday") :
GETPOSTINT(
"showbirthday")) : 1;
101$search_categ_cus =
GETPOST(
"search_categ_cus",
"intcomma", 3) ?
GETPOST(
"search_categ_cus",
"intcomma", 3) : 0;
105$hookmanager->initHooks(array(
'agendalist'));
110$extrafields->fetch_name_optionals_label(
$object->table_element);
112$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
115 $filtert = $user->id;
120$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
121$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
123if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
127$offset = $limit * $page;
129 $sortorder =
"DESC,DESC";
130 if ($search_status ==
'todo') {
131 $sortorder =
"DESC,DESC";
135 $sortfield =
"a.datep,a.id";
136 if ($search_status ==
'todo') {
137 $sortfield =
"a.datep,a.id";
144 $socid = $user->socid;
151if (!$user->hasRight(
'agenda',
'myactions',
'read')) {
154if (!$user->hasRight(
'agenda',
'allactions',
'read')) {
157if (!$user->hasRight(
'agenda',
'allactions',
'read') || $filter ==
'mine') {
158 $filtert = $user->id;
162 'a.id' => array(
'label' =>
"Ref",
'checked' => 1),
163 'owner' => array(
'label' =>
"Owner",
'checked' => 1),
164 'c.libelle' => array(
'label' =>
"Type",
'checked' => 1),
165 'a.label' => array(
'label' =>
"Title",
'checked' => 1),
166 'a.note' => array(
'label' =>
'Description',
'checked' => 0),
167 'a.datep' => array(
'label' =>
"DateStart",
'checked' => 1),
168 'a.datep2' => array(
'label' =>
"DateEnd",
'checked' => 1),
169 's.nom' => array(
'label' =>
"ThirdParty",
'checked' => 1),
170 'a.fk_contact' => array(
'label' =>
"Contact",
'checked' => 0),
171 'a.fk_element' => array(
'label' =>
"LinkedObject",
'checked' => 1,
'enabled' => (
getDolGlobalString(
'AGENDA_SHOW_LINKED_OBJECT'))),
172 'a.datec' => array(
'label' =>
'DateCreation',
'checked' => 0,
'position' => 510),
173 'a.tms' => array(
'label' =>
'DateModification',
'checked' => 0,
'position' => 520),
174 'a.percent' => array(
'label' =>
"Status",
'checked' => 1,
'position' => 1000)
177include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
181'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
184if ($user->socid && $socid) {
193if (
GETPOST(
'cancel',
'alpha')) {
200 if (is_array($_POST)) {
201 foreach ($_POST as $key => $val) {
202 $param .=
'&'.$key.
'='.urlencode($val);
206 header(
"Location: ".DOL_URL_ROOT.
'/comm/action/index.php?'.$param);
210$parameters = array(
'id' => $socid);
211$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
217include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
219if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
224 $datestart_dtstart =
'';
225 $datestart_dtend =
'';
226 $dateend_dtstart =
'';
237 $search_array_options = array();
240if (empty($reshook) && !empty($massaction)) {
243 switch ($massaction) {
244 case 'set_all_events_to_todo':
248 case 'set_all_events_to_in_progress':
252 case 'set_all_events_to_finished':
257 if (isset($percent)) {
258 foreach ($toselect as $toselectid) {
259 $result =
$object->updatePercent($toselectid, $percent);
269if (empty($reshook)) {
270 $objectclass =
'ActionComm';
271 $objectlabel =
'Events';
274 $permissiontodelete = $user->hasRight(
'agenda',
'allactions',
'delete');
275 $permissiontoadd = $user->hasRight(
'agenda',
'myactions',
'create');
276 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
284$form =
new Form($db);
285$userstatic =
new User($db);
289$societestatic =
new Societe($db);
290$contactstatic =
new Contact($db);
293$nav .= $form->selectDate($dateselect,
'dateselect', 0, 0, 1,
'', 1, 0);
294$nav .=
' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans(
"Refresh").
'">';
298$help_url =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
299$title = $langs->trans(
"Agenda");
300llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist');
303$listofextcals = array();
306if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
307 $param .=
'&contextpage='.urlencode($contextpage);
309if ($limit > 0 && $limit != $conf->liste_limit) {
310 $param .=
'&limit='.((int) $limit);
312if ($actioncode !=
'') {
313 if (is_array($actioncode)) {
314 foreach ($actioncode as $str_action) {
315 $param .=
"&search_actioncode[]=".urlencode($str_action);
318 $param .=
"&search_actioncode=".urlencode($actioncode);
321if ($resourceid > 0) {
322 $param .=
"&search_resourceid=".urlencode((
string) ($resourceid));
324if ($search_status !=
'') {
325 $param .=
"&search_status=".urlencode($search_status);
328 $param .=
"&search_filter=".urlencode($filter);
331 $param .=
"&search_filtert=".urlencode($filtert);
334 $param .=
"&search_usergroup=".urlencode((
string) ($usergroup));
337 $param .=
"&search_socid=".urlencode((
string) ($socid));
340 $param .=
"&search_showbirthday=1";
343 $param .=
"&search_projectid=".urlencode((
string) ($pid));
346 $param .=
"&search_type=".urlencode($type);
348if ($search_id !=
'') {
349 $param .=
'&search_id='.urlencode($search_id);
351if ($search_title !=
'') {
352 $param .=
'&search_title='.urlencode($search_title);
354if ($search_note !=
'') {
355 $param .=
'&search_note='.urlencode($search_note);
358 $param .=
'&datestart_dtstartday='.GETPOSTINT(
'datestart_dtstartday');
361 $param .=
'&datestart_dtstartmonth='.GETPOSTINT(
'datestart_dtstartmonth');
364 $param .=
'&datestart_dtstartyear='.GETPOSTINT(
'datestart_dtstartyear');
367 $param .=
'&datestart_dtendday='.GETPOSTINT(
'datestart_dtendday');
370 $param .=
'&datestart_dtendmonth='.GETPOSTINT(
'datestart_dtendmonth');
373 $param .=
'&datestart_dtendyear='.GETPOSTINT(
'datestart_dtendyear');
376 $param .=
'&dateend_dtstartday='.GETPOSTINT(
'dateend_dtstartday');
379 $param .=
'&dateend_dtstartmonth='.GETPOSTINT(
'dateend_dtstartmonth');
382 $param .=
'&dateend_dtstartyear='.GETPOSTINT(
'dateend_dtstartyear');
385 $param .=
'&dateend_dtendday='.GETPOSTINT(
'dateend_dtendday');
388 $param .=
'&dateend_dtendmonth='.GETPOSTINT(
'dateend_dtendmonth');
391 $param .=
'&dateend_dtendyear='.GETPOSTINT(
'dateend_dtendyear');
393if ($optioncss !=
'') {
394 $param .=
'&optioncss='.urlencode($optioncss);
396if ($search_categ_cus != 0) {
397 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
401include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
403$paramnoactionodate = $param;
406$arrayofmassactions = array(
407 'set_all_events_to_todo' =>
img_picto(
'',
'circle',
'class="pictofixedwidth font-status1"').$langs->trans(
"SetAllEventsToTodo"),
408 'set_all_events_to_in_progress' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth font-status2"').$langs->trans(
"SetAllEventsToInProgress"),
409 'set_all_events_to_finished' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth badge-status5"').$langs->trans(
"SetAllEventsToFinished"),
411if ($user->hasRight(
'agenda',
'allactions',
'delete')) {
412 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
414if (isModEnabled(
'category') && $user->hasRight(
'agenda',
'myactions',
'create')) {
415 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
417if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
418 $arrayofmassactions = array();
420$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
426$sql .=
" s.nom as societe, s.rowid as socid, s.client, s.email as socemail,";
427$sql .=
" a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,";
428$sql .=
" a.fk_user_author, a.fk_user_action,";
429$sql .=
" a.fk_contact, a.note, a.percent as percent,";
430$sql .=
" a.fk_element, a.elementtype, a.datec, a.tms as datem,";
431$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,";
432$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";
435if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
436 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
437 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
442$parameters = array();
443$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
444$sql .= $hookmanager->resPrint;
448$sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a";
449$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"actioncomm_extrafields as ef ON (a.id = ef.fk_object)";
450$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
451$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"socpeople as sp ON a.fk_contact = sp.rowid";
452$sql .=
" ,".MAIN_DB_PREFIX.
"c_actioncomm as c";
454if ($resourceid > 0) {
455 $sql .=
", ".MAIN_DB_PREFIX.
"element_resources as r";
458if ($filtert > 0 || $usergroup > 0) {
459 $sql .=
", ".MAIN_DB_PREFIX.
"actioncomm_resources as ar";
462 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
464$sql .=
" WHERE c.id = a.fk_action";
465$sql .=
' AND a.entity IN ('.getEntity(
'agenda').
')';
467if (!empty($actioncode)) {
469 if ($actioncode ==
'AC_NON_AUTO') {
470 $sql .=
" AND c.type != 'systemauto'";
471 } elseif ($actioncode ==
'AC_ALL_AUTO') {
472 $sql .=
" AND c.type = 'systemauto'";
474 if ($actioncode ==
'AC_OTH') {
475 $sql .=
" AND c.type != 'systemauto'";
477 if ($actioncode ==
'AC_OTH_AUTO') {
478 $sql .=
" AND c.type = 'systemauto'";
482 if ($actioncode ==
'AC_NON_AUTO') {
483 $sql .=
" AND c.type != 'systemauto'";
484 } elseif ($actioncode ==
'AC_ALL_AUTO') {
485 $sql .=
" AND c.type = 'systemauto'";
487 if (is_array($actioncode)) {
488 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", $actioncode).
"'", 1).
")";
490 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", explode(
',', $actioncode)).
"'", 1).
")";
495if ($resourceid > 0) {
496 $sql .=
" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".((int) $resourceid);
499 $sql .=
" AND a.fk_project=".((int) $pid);
503if (isModEnabled(
"societe") && !$user->hasRight(
'societe',
'client',
'voir')) {
504 $search_sale = $user->id;
507if ($search_sale && $search_sale !=
'-1') {
508 if ($search_sale == -2) {
509 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc)";
510 } elseif ($search_sale > 0) {
511 $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).
")";
516 $sql .=
" AND a.fk_soc = ".((int) $socid);
519if ($filtert > 0 || $usergroup > 0) {
520 $sql .=
" AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
523 $sql .=
" AND c.id = ".((int) $type);
525if ($search_status ==
'0') {
526 $sql .=
" AND a.percent = 0";
528if ($search_status ==
'na') {
529 $sql .=
" AND a.percent = -1";
531if ($search_status ==
'50') {
532 $sql .=
" AND (a.percent > 0 AND a.percent < 100)";
534if ($search_status ==
'100') {
535 $sql .=
" AND a.percent = 100";
537if ($search_status ==
'done') {
538 $sql .=
" AND (a.percent = 100)";
540if ($search_status ==
'todo') {
541 $sql .=
" AND (a.percent >= 0 AND a.percent < 100)";
553if ($filtert > 0 || $usergroup > 0) {
556 $sql .=
"(ar.fk_element = ".((int) $filtert).
" OR (ar.fk_element IS NULL AND a.fk_user_action = ".((int) $filtert).
"))";
558 if ($usergroup > 0) {
559 $sql .= ($filtert > 0 ?
" OR " :
"").
" ugu.fk_usergroup = ".((
int) $usergroup);
565if ($dateselect > 0) {
566 $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).
"'))";
568if ($datestart_dtstart > 0) {
569 $sql .=
" AND a.datep >= '".$db->idate($datestart_dtstart).
"'";
571if ($datestart_dtend > 0) {
572 $sql .=
" AND a.datep <= '".$db->idate($datestart_dtend).
"'";
574if ($dateend_dtstart > 0) {
575 $sql .=
" AND a.datep2 >= '".$db->idate($dateend_dtstart).
"'";
577if ($dateend_dtend > 0) {
578 $sql .=
" AND a.datep2 <= '".$db->idate($dateend_dtend).
"'";
582if ($search_categ_cus != -1) {
583 if ($search_categ_cus == -2) {
584 $sql .=
" AND NOT EXISTS (SELECT ca.fk_actioncomm FROM ".MAIN_DB_PREFIX.
"categorie_actioncomm as ca WHERE ca.fk_actioncomm = a.id)";
585 } elseif ($search_categ_cus > 0) {
586 $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).
"))";
591include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
594$parameters = array();
595$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
596$sql .= $hookmanager->resPrint;
599$nbtotalofrecords =
'';
602 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
603 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
605 $resql = $db->query($sqlforcount);
607 $objforcount = $db->fetch_object($resql);
608 $nbtotalofrecords = $objforcount->nbtotalofrecords;
613 if (($page * $limit) > $nbtotalofrecords) {
621$sql .= $db->order($sortfield, $sortorder);
623 $sql .= $db->plimit($limit + 1, $offset);
626$resql = $db->query($sql);
632$num = $db->num_rows($resql);
634$arrayofselected = is_array($toselect) ? $toselect : array();
637$newtitle =
'<div class="nowrap clear inline-block minheight30">';
638$newtitle .=
'<input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans(
"LocalAgenda").
' ';
639$newtitle .=
'</div>';
642$tabactive =
'cardlist';
646print
'<form method="POST" id="searchFormList" class="listactionsfilter" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
648if ($optioncss !=
'') {
649 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
651print
'<input type="hidden" name="token" value="'.newToken().
'">';
652print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
653print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
654print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
655print
'<input type="hidden" name="type" value="'.$type.
'">';
659 $nav .=
'<input type="hidden" name="search_filter" value="'.$filter.
'">';
662 $nav .=
'<input type="hidden" name="search_showbirthday" value="1">';
674$parameters = array();
675$reshook = $hookmanager->executeHooks(
'addCalendarChoice', $parameters, $object, $action);
676if (empty($reshook)) {
677 $s .= $hookmanager->resPrint;
678} elseif ($reshook > 1) {
679 $s = $hookmanager->resPrint;
686$viewmode =
'<div class="navmode inline-block">';
688$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.
'">';
690$viewmode .=
img_picto($langs->trans(
"List"),
'object_calendarlist',
'class="imgforviewmode pictoactionview block"');
692$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewList").
'</span></a>';
694$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.
'">';
696$viewmode .=
img_picto($langs->trans(
"ViewCal"),
'object_calendarmonth',
'class="pictoactionview block"');
698$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewCal").
'</span></a>';
700$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.
'">';
702$viewmode .=
img_picto($langs->trans(
"ViewWeek"),
'object_calendarweek',
'class="pictoactionview block"');
704$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewWeek").
'</span></a>';
706$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.
'">';
708$viewmode .=
img_picto($langs->trans(
"ViewDay"),
'object_calendarday',
'class="pictoactionview block"');
710$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewDay").
'</span></a>';
712$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.
'">';
714$viewmode .=
img_picto($langs->trans(
"ViewPerUser"),
'object_calendarperuser',
'class="pictoactionview block"');
716$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow" title="'.dolPrintHTML($langs->trans(
"ViewPerUser")).
'">'.$langs->trans(
"ViewPerUser").
'</span></a>';
719$parameters = array();
720$reshook = $hookmanager->executeHooks(
'addCalendarView', $parameters, $object, $action);
721if (empty($reshook)) {
722 $viewmode .= $hookmanager->resPrint;
723} elseif ($reshook > 1) {
724 $viewmode = $hookmanager->resPrint;
727$viewmode .=
'</div>';
729$viewmode .=
'<span class="marginrightonly"></span>';
734$newparam =
'&month='.str_pad((
string) $month, 2,
"0", STR_PAD_LEFT).
'&year='.$tmpforcreatebutton[
'year'];
736$url = DOL_URL_ROOT.
'/comm/action/card.php?action=create';
737$url .=
'&apyear='.$tmpforcreatebutton[
'year'].
'&apmonth='.$tmpforcreatebutton[
'mon'].
'&apday='.$tmpforcreatebutton[
'mday'].
'&aphour='.$tmpforcreatebutton[
'hours'].
'&apmin='.$tmpforcreatebutton[
'minutes'];
738$url .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].($newparam ?
'?'.$newparam :
''));
740$newcardbutton =
dolGetButtonTitle($langs->trans(
'AddAction'),
'',
'fa fa-plus-circle', $url,
'', (
int) ($user->hasRight(
'agenda',
'myactions',
'create') || $user->hasRight(
'agenda',
'allactions',
'create')));
742$param .=
'&mode='.urlencode($mode);
744print_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);
749include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
753$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
754$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
755if ($massactionbutton) {
756 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
760print
'<div class="liste_titre liste_titre_bydiv centpercent">';
761print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday,
'', $filtert,
'', $pid, $socid, $action, -1, $actioncode, $usergroup,
'', $resourceid, $search_categ_cus);
766print
'<div class="div-table-responsive">';
767print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
769print
'<tr class="liste_titre_filter">';
772 print
'<td class="liste_titre" align="middle">';
773 $searchpicto = $form->showFilterButtons(
'left');
777if (!empty($arrayfields[
'a.id'][
'checked'])) {
778 print
'<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.
'"></td>';
780if (!empty($arrayfields[
'owner'][
'checked'])) {
781 print
'<td class="liste_titre"></td>';
783if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
784 print
'<td class="liste_titre"></td>';
786if (!empty($arrayfields[
'a.label'][
'checked'])) {
787 print
'<td class="liste_titre"><input type="text" class="maxwidth75" name="search_title" value="'.$search_title.
'"></td>';
789if (!empty($arrayfields[
'a.note'][
'checked'])) {
790 print
'<td class="liste_titre"><input type="text" class="maxwidth75" name="search_note" value="'.$search_note.
'"></td>';
792if (!empty($arrayfields[
'a.datep'][
'checked'])) {
793 print
'<td class="liste_titre nowraponall" align="center">';
794 print
'<div class="nowrap">';
795 print $form->selectDate($datestart_dtstart,
'datestart_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
797 print
'<div class="nowrap">';
798 print $form->selectDate($datestart_dtend,
'datestart_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
802if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
803 print
'<td class="liste_titre nowraponall" align="center">';
804 print
'<div class="nowrap">';
805 print $form->selectDate($dateend_dtstart,
'dateend_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
807 print
'<div class="nowrap">';
808 print $form->selectDate($dateend_dtend,
'dateend_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
812if (!empty($arrayfields[
's.nom'][
'checked'])) {
813 print
'<td class="liste_titre"></td>';
815if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
816 print
'<td class="liste_titre"></td>';
818if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
819 print
'<td class="liste_titre"></td>';
823include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
826$parameters = array(
'arrayfields' => $arrayfields);
827$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
828print $hookmanager->resPrint;
830if (!empty($arrayfields[
'a.datec'][
'checked'])) {
831 print
'<td class="liste_titre"></td>';
833if (!empty($arrayfields[
'a.tms'][
'checked'])) {
834 print
'<td class="liste_titre"></td>';
836if (!empty($arrayfields[
'a.percent'][
'checked'])) {
837 print
'<td class="liste_titre center parentonrightofpage">';
838 $formactions->form_select_status_action(
'formaction', $search_status, 1,
'search_status', 1, 2,
'search_status width100 onrightofpage');
843 print
'<td class="liste_titre center">';
844 $searchpicto = $form->showFilterButtons();
850$totalarray = array();
851$totalarray[
'nbfield'] = 0;
855print
'<tr class="liste_titre">';
857 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
858 $totalarray[
'nbfield']++;
860if (!empty($arrayfields[
'a.id'][
'checked'])) {
862 print_liste_field_titre($arrayfields[
'a.id'][
'label'], $_SERVER[
"PHP_SELF"],
"a.id", $param,
"",
"", $sortfield, $sortorder);
863 $totalarray[
'nbfield']++;
865if (!empty($arrayfields[
'owner'][
'checked'])) {
866 print_liste_field_titre($arrayfields[
'owner'][
'label'], $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
867 $totalarray[
'nbfield']++;
869if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
870 print_liste_field_titre($arrayfields[
'c.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.libelle", $param,
"",
"", $sortfield, $sortorder);
871 $totalarray[
'nbfield']++;
873if (!empty($arrayfields[
'a.label'][
'checked'])) {
874 print_liste_field_titre($arrayfields[
'a.label'][
'label'], $_SERVER[
"PHP_SELF"],
"a.label", $param,
"",
"", $sortfield, $sortorder);
875 $totalarray[
'nbfield']++;
877if (!empty($arrayfields[
'a.note'][
'checked'])) {
878 print_liste_field_titre($arrayfields[
'a.note'][
'label'], $_SERVER[
"PHP_SELF"],
"a.note", $param,
"",
"", $sortfield, $sortorder);
879 $totalarray[
'nbfield']++;
882if (!empty($arrayfields[
'a.datep'][
'checked'])) {
883 print_liste_field_titre($arrayfields[
'a.datep'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep,a.id", $param,
'',
'', $sortfield, $sortorder,
'center ');
884 $totalarray[
'nbfield']++;
886if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
887 print_liste_field_titre($arrayfields[
'a.datep2'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep2", $param,
'',
'', $sortfield, $sortorder,
'center ');
888 $totalarray[
'nbfield']++;
890if (!empty($arrayfields[
's.nom'][
'checked'])) {
891 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom", $param,
"",
"", $sortfield, $sortorder);
892 $totalarray[
'nbfield']++;
894if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
895 print_liste_field_titre($arrayfields[
'a.fk_contact'][
'label'], $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
896 $totalarray[
'nbfield']++;
898if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
899 print_liste_field_titre($arrayfields[
'a.fk_element'][
'label'], $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
900 $totalarray[
'nbfield']++;
903include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
905$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
906$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
907print $hookmanager->resPrint;
909if (!empty($arrayfields[
'a.datec'][
'checked'])) {
910 print_liste_field_titre($arrayfields[
'a.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datec,a.id", $param,
"",
'', $sortfield, $sortorder,
'center ');
911 $totalarray[
'nbfield']++;
913if (!empty($arrayfields[
'a.tms'][
'checked'])) {
914 print_liste_field_titre($arrayfields[
'a.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"a.tms,a.id", $param,
"",
'', $sortfield, $sortorder,
'center ');
915 $totalarray[
'nbfield']++;
918if (!empty($arrayfields[
'a.percent'][
'checked'])) {
919 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"a.percent", $param,
"",
'', $sortfield, $sortorder,
'center ');
920 $totalarray[
'nbfield']++;
923 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
924 $totalarray[
'nbfield']++;
929$delay_warning =
getDolGlobalInt(
'MAIN_DELAY_ACTIONS_TODO') * 24 * 60 * 60;
930$today_start_time =
dol_mktime(0, 0, 0, (
int) date(
'm', $now), (
int) date(
'd', $now), (
int) date(
'Y', $now));
932require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/cactioncomm.class.php';
934$arraylist = $caction->liste_array(1,
'code',
'', (!
getDolGlobalString(
'AGENDA_USE_EVENT_TYPE') ? 1 : 0),
'', 1);
935$contactListCache = array();
942$imaxinloop = ($limit ? min($num, $limit) : $num);
943$cache_user_list = array();
944while ($i < $imaxinloop) {
945 $obj = $db->fetch_object($resql);
951 $object->setVarsFromFetchObj($obj);
954 if (
getDolGlobalString(
'AGENDA_ALWAYS_HIDE_AUTO') && $obj->type_code ==
'AC_OTH_AUTO') {
959 $actionstatic->id = $obj->id;
960 $actionstatic->ref = $obj->id;
961 $actionstatic->code = $obj->code;
962 $actionstatic->type_code = $obj->type_code;
963 $actionstatic->type_label = $obj->type_label;
964 $actionstatic->type_picto = $obj->type_picto;
965 $actionstatic->type_color = $obj->type_color;
966 $actionstatic->label = $obj->label;
967 $actionstatic->location = $obj->location;
969 $actionstatic->datep = $db->jdate($obj->dp);
970 $actionstatic->percentage = $obj->percent;
971 $actionstatic->authorid = $obj->fk_user_author;
972 $actionstatic->userownerid = $obj->fk_user_action;
976 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
977 $actionstatic->fetchResources();
981 if ($obj->fk_user_action > 0 && !isset($cache_user_list[$obj->fk_user_action])) {
982 $userstatic =
new User($db);
983 $res = $userstatic->fetch($obj->fk_user_action);
985 $cache_user_list[$obj->fk_user_action] = $userstatic;
990 $event_owner_style =
'';
992 if ($obj->fk_user_action > 0 && $cache_user_list[$obj->fk_user_action]->color !=
'') {
993 $event_owner_style .=
'border-left: #' . $cache_user_list[$obj->fk_user_action]->color .
' 5px solid;';
997 $event_more_class =
'';
998 $event_start_date_css =
'';
999 $event_end_date_css =
'';
1000 $event_start_date_time = $actionstatic->datep;
1001 if ($event_start_date_time > $now) {
1003 $event_more_class =
'event-future';
1004 $event_start_date_css = $event_end_date_css = $event_more_class;
1006 if ($obj->fulldayevent == 1) {
1007 $today_start_date_time = $today_start_time;
1009 $today_start_date_time = $now;
1013 $event_end_date_time = $db->jdate($obj->dp2);
1014 if ($event_end_date_time !=
null && $event_end_date_time < $today_start_date_time) {
1016 $event_more_class =
'event-past';
1017 } elseif ($event_end_date_time ==
null && $event_start_date_time < $today_start_date_time) {
1019 $event_more_class =
'event-past';
1022 $event_more_class =
'event-current';
1024 $event_start_date_css = $event_end_date_css = $event_more_class;
1026 $event_start_date_css = $event_end_date_css = $event_more_class;
1028 print
'<tr class="oddeven' . ($event_more_class !=
'' ?
' '.$event_more_class :
'') .
'">';
1031 print
'<td class="nowrap center">';
1032 if ($massactionbutton || $massaction) {
1034 if (in_array($obj->id, $arrayofselected)) {
1037 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1042 if (!empty($arrayfields[
'a.id'][
'checked'])) {
1043 print
'<td class="nowraponall">';
1044 print $actionstatic->getNomUrl(1, -1);
1049 if (!empty($arrayfields[
'owner'][
'checked'])) {
1051 print
'<td class="tdoverflowmax150">';
1052 if ($obj->fk_user_action > 0 && !isset($cache_user_list[$obj->fk_user_action])) {
1053 $userstatic =
new User($db);
1054 $res = $userstatic->fetch($obj->fk_user_action);
1056 $cache_user_list[$obj->fk_user_action] = $userstatic;
1059 if (isset($cache_user_list[$obj->fk_user_action])) {
1060 print $cache_user_list[$obj->fk_user_action]->getNomUrl(-1);
1068 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
1069 print
'<td class="nowraponall">';
1070 print $actionstatic->getTypePicto();
1071 $labeltype = $obj->type_code;
1073 $labeltype =
'AC_OTH';
1075 if (!empty($actionstatic->code) && preg_match(
'/^TICKET_MSG/', $actionstatic->code)) {
1076 $labeltype = $langs->trans(
"Message");
1078 if (!empty($arraylist[$labeltype])) {
1079 $labeltype = $arraylist[$labeltype];
1081 if ($obj->type_code ==
'AC_OTH_AUTO' && ($obj->type_code != $obj->code) && $labeltype && !empty($arraylist[$obj->code])) {
1082 $labeltype .=
' - '.$arraylist[$obj->code];
1090 if (!empty($arrayfields[
'a.label'][
'checked'])) {
1091 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($actionstatic->label).
'">';
1092 print $actionstatic->label;
1097 if (!empty($arrayfields[
'a.note'][
'checked'])) {
1099 print
'<td class="tdoverflow200" title="'.dol_escape_htmltag($text).
'">';
1100 print $form->textwithtooltip(
dol_trunc($text, 48), $actionstatic->note_private);
1104 $formatToUse = $obj->fulldayevent ?
'day' :
'dayhour';
1107 if (!empty($arrayfields[
'a.datep'][
'checked'])) {
1108 print
'<td class="center nowraponall'.($event_start_date_css ?
' '.$event_start_date_css :
'').
'"><span>';
1109 if (empty($obj->fulldayevent)) {
1110 print
dol_print_date($db->jdate($obj->dp), $formatToUse,
'tzuserrel');
1113 print
dol_print_date($db->jdate($obj->dp), $formatToUse, ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1117 if ($actionstatic->hasDelay() && $actionstatic->percentage >= 0 && $actionstatic->percentage < 100) {
1127 if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
1128 print
'<td class="center nowraponall'.($event_end_date_css ?
' '.$event_end_date_css :
'').
'"><span>';
1129 if (empty($obj->fulldayevent)) {
1130 print
dol_print_date($db->jdate($obj->dp2), $formatToUse,
'tzuserrel');
1133 print
dol_print_date($db->jdate($obj->dp2), $formatToUse, ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1140 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1141 print
'<td class="tdoverflowmax150">';
1142 if ($obj->socid > 0) {
1143 $societestatic->id = $obj->socid;
1144 $societestatic->client = $obj->client;
1145 $societestatic->name = $obj->societe;
1146 $societestatic->email = $obj->socemail;
1148 print $societestatic->getNomUrl(1,
'', 28);
1156 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
1157 print
'<td class="tdoverflowmax100">';
1159 if (!empty($actionstatic->socpeopleassigned)) {
1160 $contactList = array();
1161 foreach ($actionstatic->socpeopleassigned as $socpeopleassigned) {
1162 if (!isset($contactListCache[$socpeopleassigned[
'id']])) {
1165 if ($contact->fetch($socpeopleassigned[
'id']) > 0) {
1166 $contactListCache[$socpeopleassigned[
'id']] = $contact->getNomUrl(1,
'', 0);
1167 $contactList[] = $contact->getNomUrl(1,
'', 0);
1171 $contactList[] = $contactListCache[$socpeopleassigned[
'id']];
1174 if (!empty($contactList)) {
1175 print implode(
', ', $contactList);
1177 } elseif ($obj->fk_contact > 0) {
1178 $contactstatic->id = $obj->fk_contact;
1179 $contactstatic->email = $obj->email;
1180 $contactstatic->lastname = $obj->lastname;
1181 $contactstatic->firstname = $obj->firstname;
1182 $contactstatic->phone_pro = $obj->phone_pro;
1183 $contactstatic->phone_mobile = $obj->phone_mobile;
1184 $contactstatic->phone_perso = $obj->phone_perso;
1185 $contactstatic->country_id = $obj->country_id;
1186 print $contactstatic->getNomUrl(1,
'', 0);
1194 if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
1195 print
'<td class="tdoverflowmax150">';
1197 if ($obj->fk_element > 0 && !empty($obj->elementtype)) {
1198 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1207 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1209 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
1210 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1211 print $hookmanager->resPrint;
1214 if (!empty($arrayfields[
'a.datec'][
'checked'])) {
1216 print
'<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datec),
'dayhour',
'tzuserrel').
'</td>';
1219 if (!empty($arrayfields[
'a.tms'][
'checked'])) {
1220 print
'<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datem),
'dayhour',
'tzuserrel').
'</td>';
1222 if (!empty($arrayfields[
'a.percent'][
'checked'])) {
1224 $datep = $db->jdate($obj->dp);
1225 print
'<td align="center" class="nowrap">'.$actionstatic->LibStatut($obj->percent, 5, 0, $datep).
'</td>';
1229 print
'<td class="nowrap center">';
1230 if ($massactionbutton || $massaction) {
1232 if (in_array($obj->id, $arrayofselected)) {
1235 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1246 print
'<tr><td colspan="'.$totalarray[
'nbfield'].
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1250print
'</table>'.
"\n";
1253print
'</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.
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.