33require
'../../main.inc.php';
42require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
47require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
50$langs->loadLangs(array(
"users",
"companies",
"agenda",
"commercial",
"other",
"orders",
"bills"));
53$action =
GETPOST(
'action',
'aZ09');
54$massaction =
GETPOST(
'massaction',
'alpha');
55$confirm =
GETPOST(
'confirm',
'alpha');
56$cancel =
GETPOST(
'cancel',
'alpha');
57$toselect =
GETPOST(
'toselect',
'array:int');
58$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'actioncommlist';
59$optioncss =
GETPOST(
'optioncss',
'alpha');
61if (empty($mode) && preg_match(
'/show_/', $action)) {
65$disabledefaultvalues =
GETPOSTINT(
'disabledefaultvalues');
69$search_status = (
GETPOST(
"search_status",
'aZ09') !=
'') ?
GETPOST(
"search_status",
'aZ09') :
GETPOST(
"status",
'aZ09');
70$search_import_key =
GETPOST(
"search_import_key");
71$type =
GETPOST(
'search_type',
'alphanohtml') ?
GETPOST(
'search_type',
'alphanohtml') :
GETPOST(
'type',
'alphanohtml');
76if (
GETPOST(
'search_actioncode',
'array:aZ09')) {
77 $actioncode =
GETPOST(
'search_actioncode',
'array:aZ09', 3);
78 if (!count($actioncode)) {
84if (is_array($actioncode)) {
86 $actioncode = array_filter(
93 return ((
string) $value !==
'-1');
99$search_id =
GETPOST(
'search_id',
'alpha');
100$search_title =
GETPOST(
'search_title',
'alpha');
101$search_note =
GETPOST(
'search_note',
'alpha');
109if ($search_status ==
'' && !GETPOSTISSET(
'search_status')) {
110 $search_status = ((!
getDolGlobalString(
'AGENDA_DEFAULT_FILTER_STATUS') || $disabledefaultvalues) ?
'' :
$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
112if (empty($mode) && !GETPOSTISSET(
'mode')) {
116$filter =
GETPOST(
"search_filter",
'alpha', 3) ?
GETPOST(
"search_filter",
'alpha', 3) :
GETPOST(
"filter",
'alpha', 3);
117$filtert =
GETPOST(
"search_filtert",
"intcomma", 3) ?
GETPOST(
"search_filtert",
"intcomma", 3) :
GETPOST(
"filtert",
"intcomma", 3);
120$search_categ_cus =
GETPOST(
"search_categ_cus",
"intcomma", 3) ?
GETPOST(
"search_categ_cus",
"intcomma", 3) : 0;
124$hookmanager->initHooks(array(
'agendalist'));
127$extrafields->fetch_name_optionals_label(
$object->table_element);
129$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
132 $filtert = (
string) $user->id;
137$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
138$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
140if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
144$offset = $limit * $page;
146 $sortorder =
"DESC,DESC";
147 if ($search_status ==
'todo') {
148 $sortorder =
"DESC,DESC";
152 $sortfield =
"a.datep,a.id";
153 if ($search_status ==
'todo') {
154 $sortfield =
"a.datep,a.id";
161 $socid = $user->socid;
168if (!$user->hasRight(
'agenda',
'myactions',
'read')) {
171if (!$user->hasRight(
'agenda',
'allactions',
'read')) {
174if (!$user->hasRight(
'agenda',
'allactions',
'read') || $filter ==
'mine') {
175 $filtert = (
string) $user->id;
180$arrayfields = array();
181foreach (
$object->fields as $key => $val) {
183 if (!empty($val[
'visible'])) {
184 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
185 $arrayfields[$tableprefix.
'.'.$key] = array(
186 'label' => $val[
'label'],
187 'checked' => (($visible < 0) ?
'0' :
'1'),
188 'enabled' => (
string) (int) (abs($visible) != 3 && (bool)
dol_eval((
string) $val[
'enabled'], 1)),
189 'position' => $val[
'position'],
190 'help' => isset($val[
'help']) ? $val[
'help'] :
''
196include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
198$parameters = array(
'arrayfields' => &$arrayfields);
199$reshook = $hookmanager->executeHooks(
'completeArrayFields', $parameters, $object, $action);
202$arrayfields = array_merge($arrayfields, array(
203 'owner' => array(
'label' =>
"Owner",
'checked' =>
'1',
'position' => 46),
204 'c.libelle' => array(
'label' =>
"Type",
'checked' =>
'1',
'position' => 47),
205 's.nom' => array(
'label' =>
"ThirdParty",
'checked' =>
'1',
'position' => 54),
206 'a.fk_element' => array(
'label' =>
"LinkedObject",
'checked' =>
'1',
'position' => 86),
214if ($user->socid && $socid) {
223if (
GETPOST(
'cancel',
'alpha')) {
230 if (is_array($_POST)) {
231 foreach ($_POST as $key => $val) {
232 $param .=
'&'.urlencode($key).
'='.urlencode($val);
236 header(
"Location: ".DOL_URL_ROOT.
'/comm/action/index.php?'.$param);
240$parameters = array(
'id' => $socid);
241$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
247include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
249if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
254 $datestart_dtstart =
'';
255 $datestart_dtend =
'';
256 $dateend_dtstart =
'';
260 $search_import_key =
'';
268 $search_array_options = array();
271if (empty($reshook) && !empty($massaction)) {
274 switch ($massaction) {
275 case 'set_all_events_to_todo':
279 case 'set_all_events_to_in_progress':
283 case 'set_all_events_to_finished':
288 if (isset($percent)) {
289 foreach ($toselect as $toselectid) {
290 $result =
$object->updatePercent($toselectid, $percent);
300if (empty($reshook)) {
301 $objectclass =
'ActionComm';
302 $objectlabel =
'Events';
305 $permissiontodelete = $user->hasRight(
'agenda',
'allactions',
'delete');
306 $permissiontoadd = $user->hasRight(
'agenda',
'myactions',
'create');
307 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
324$nav .= $form->selectDate($dateselect,
'dateselect', 0, 0, 1,
'', 1, 0);
325$nav .=
' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans(
"Refresh").
'">';
329$help_url =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
330$title = $langs->trans(
"Agenda");
331llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist');
337if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
338 $param .=
'&contextpage='.urlencode($contextpage);
340if ($limit > 0 && $limit !=
$conf->liste_limit) {
341 $param .=
'&limit='.((int) $limit);
343if ($actioncode !=
'') {
344 if (is_array($actioncode)) {
345 foreach ($actioncode as $str_action) {
346 $param .=
"&search_actioncode[]=".urlencode($str_action);
349 $param .=
"&search_actioncode=".urlencode($actioncode);
352if ($resourceid > 0) {
353 $param .=
"&search_resourceid=".urlencode((
string) ($resourceid));
355if ($search_status !=
'') {
356 $param .=
"&search_status=".urlencode($search_status);
358if ($search_import_key !=
'') {
359 $param .=
"&search_import_key=".urlencode($search_import_key);
362 $param .=
"&search_filter=".urlencode((
string) $filter);
365 $param .=
"&search_filtert=".urlencode((
string) $filtert);
368 $param .=
"&search_usergroup=".urlencode((
string) ($usergroup));
371 $param .=
"&search_socid=".urlencode((
string) ($socid));
374 $param .=
"&search_showbirthday=1";
377 $param .=
"&search_projectid=".urlencode((
string) ($pid));
380 $param .=
"&search_type=".urlencode($type);
382if ($search_id !=
'') {
383 $param .=
'&search_id='.urlencode($search_id);
385if ($search_title !=
'') {
386 $param .=
'&search_title='.urlencode($search_title);
388if ($search_note !=
'') {
389 $param .=
'&search_note='.urlencode($search_note);
392 $param .=
'&datestart_dtstartday='.GETPOSTINT(
'datestart_dtstartday');
395 $param .=
'&datestart_dtstartmonth='.GETPOSTINT(
'datestart_dtstartmonth');
398 $param .=
'&datestart_dtstartyear='.GETPOSTINT(
'datestart_dtstartyear');
401 $param .=
'&datestart_dtendday='.GETPOSTINT(
'datestart_dtendday');
404 $param .=
'&datestart_dtendmonth='.GETPOSTINT(
'datestart_dtendmonth');
407 $param .=
'&datestart_dtendyear='.GETPOSTINT(
'datestart_dtendyear');
410 $param .=
'&dateend_dtstartday='.GETPOSTINT(
'dateend_dtstartday');
413 $param .=
'&dateend_dtstartmonth='.GETPOSTINT(
'dateend_dtstartmonth');
416 $param .=
'&dateend_dtstartyear='.GETPOSTINT(
'dateend_dtstartyear');
419 $param .=
'&dateend_dtendday='.GETPOSTINT(
'dateend_dtendday');
422 $param .=
'&dateend_dtendmonth='.GETPOSTINT(
'dateend_dtendmonth');
425 $param .=
'&dateend_dtendyear='.GETPOSTINT(
'dateend_dtendyear');
427if ($optioncss !=
'') {
428 $param .=
'&optioncss='.urlencode($optioncss);
430if ($search_categ_cus != 0) {
431 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
435include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
437$paramnoactionodate = $param;
440$arrayofmassactions = array(
441 'set_all_events_to_todo' =>
img_picto(
'',
'circle',
'class="pictofixedwidth font-status1"').$langs->trans(
"SetAllEventsToTodo"),
442 'set_all_events_to_in_progress' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth font-status2"').$langs->trans(
"SetAllEventsToInProgress"),
443 'set_all_events_to_finished' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth badge-status5"').$langs->trans(
"SetAllEventsToFinished"),
445if ($user->hasRight(
'agenda',
'allactions',
'delete')) {
446 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
448if (
isModEnabled(
'category') && $user->hasRight(
'agenda',
'myactions',
'create')) {
449 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
451if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
452 $arrayofmassactions = array();
454$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
457$sql .=
" a.datep as dp, a.id, a.code, a.label, a.note, a.datep2 as dp2, a.fulldayevent, a.location, a.entity,";
458$sql .=
" a.fk_user_author, a.fk_user_action,";
459$sql .=
" a.fk_contact, a.note, a.percent as percent,";
460$sql .=
" a.fk_element, a.elementtype, a.datec, a.tms as datem,";
461$sql .=
" a.recurid, a.recurrule, a.recurdateend, a.import_key,";
462$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,";
463$sql .=
" s.nom as societe, s.rowid as socid, s.client, s.email as socemail";
467if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
468 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
469 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
474$parameters = array();
475$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
476$sql .= $hookmanager->resPrint;
480$sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a";
481$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"actioncomm_extrafields as ef ON a.id = ef.fk_object";
482$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
483$sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"c_actioncomm as c ON c.id = a.fk_action";
485if ($resourceid > 0) {
486 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"element_resources as r ON r.element_type = 'action' AND r.element_id = a.id";
489$parameters = array();
490$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
491$sql .= $hookmanager->resPrint;
493$sql .=
" WHERE a.entity IN (".getEntity(
'agenda').
")";
495if (!empty($actioncode)) {
497 if ((is_array($actioncode) && in_array(
'AC_NON_AUTO', $actioncode)) || $actioncode ==
'AC_NON_AUTO') {
498 $sql .=
" AND c.type != 'systemauto'";
499 } elseif ((is_array($actioncode) && in_array(
'AC_ALL_AUTO', $actioncode)) || $actioncode ==
'AC_ALL_AUTO') {
500 $sql .=
" AND c.type = 'systemauto'";
502 if ((is_array($actioncode) && in_array(
'AC_OTH', $actioncode)) || $actioncode ==
'AC_OTH') {
503 $sql .=
" AND c.type != 'systemauto'";
505 if ((is_array($actioncode) && in_array(
'AC_OTH_AUTO', $actioncode)) || $actioncode ==
'AC_OTH_AUTO') {
506 $sql .=
" AND c.type = 'systemauto'";
510 if ((is_array($actioncode) && in_array(
'AC_NON_AUTO', $actioncode)) || $actioncode ===
'AC_NON_AUTO') {
511 $sql .=
" AND c.type != 'systemauto'";
512 } elseif ((is_array($actioncode) && in_array(
'AC_ALL_AUTO', $actioncode)) || $actioncode ===
'AC_ALL_AUTO') {
513 $sql .=
" AND c.type = 'systemauto'";
515 if (is_array($actioncode)) {
517 $actioncode = array_filter(
524 return ((
string) $value !==
'-1');
527 if (count($actioncode)) {
528 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", $actioncode).
"'", 1).
")";
530 } elseif ($actioncode !==
'-1') {
531 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", explode(
',', $actioncode)).
"'", 1).
")";
536if ($resourceid > 0) {
537 $sql .=
" AND r.resource_id = ".((int) $resourceid);
540 $sql .=
" AND a.fk_project=".((int) $pid);
545if (
isModEnabled(
"societe") && !$user->hasRight(
'societe',
'client',
'voir')) {
546 $search_sale = $user->id;
549if ($search_sale && $search_sale !=
'-1') {
550 if ($search_sale == -2) {
551 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc)";
552 } elseif ($search_sale > 0) {
553 $sql .=
" AND (a.fk_soc IS NULL OR EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc AND sc.fk_user = ".((int) $search_sale).
"))";
558 $sql .=
" AND a.fk_soc = ".((int) $socid);
561 $sql .=
" AND c.id = ".((int) $type);
563if ($search_status ==
'0') {
565 $sql .=
" AND a.percent = 0";
567if ($search_status ==
'na') {
569 $sql .=
" AND a.percent = -1";
571if ($search_status ==
'50') {
573 $sql .=
" AND (a.percent > 0 AND a.percent < 100)";
575if ($search_status ==
'done' || $search_status ==
'100') {
576 $sql .=
" AND (a.percent = 100)";
578if ($search_status ==
'todo') {
579 $sql .=
" AND (a.percent >= 0 AND a.percent < 100)";
581if ($search_import_key) {
595if ($dateselect > 0) {
596 $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).
"'))";
598if ($datestart_dtstart > 0) {
599 $sql .=
" AND a.datep >= '".$db->idate($datestart_dtstart).
"'";
601if ($datestart_dtend > 0) {
602 $sql .=
" AND a.datep <= '".$db->idate($datestart_dtend).
"'";
604if ($dateend_dtstart > 0) {
605 $sql .=
" AND a.datep2 >= '".$db->idate($dateend_dtstart).
"'";
607if ($dateend_dtend > 0) {
608 $sql .=
" AND a.datep2 <= '".$db->idate($dateend_dtend).
"'";
612if ($search_categ_cus != -1) {
613 if ($search_categ_cus == -2) {
614 $sql .=
" AND NOT EXISTS (SELECT ca.fk_actioncomm FROM ".MAIN_DB_PREFIX.
"categorie_actioncomm as ca WHERE ca.fk_actioncomm = a.id)";
615 } elseif ($search_categ_cus > 0) {
616 $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).
"))";
621include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
624$parameters = array();
625$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
626$sql .= $hookmanager->resPrint;
631if (($filtert !=
'-1' && $filtert !=
'-2') || $usergroup > 0) {
632 if ($filtert !=
'' && $filtert !=
'-1' && $filtert !=
'-2' && $filtert !=
'-3') {
633 $where1 =
"a.fk_user_action = ".((int) $filtert);
634 $where2 =
"a.fk_user_action <> ".((int) $filtert).
" AND EXISTS (SELECT ar.rowid FROM ".MAIN_DB_PREFIX.
"actioncomm_resources as ar WHERE ar.fk_actioncomm = a.id AND ar.element_type = 'user' AND ar.fk_element IN (".
$db->sanitize($filtert).
"))";
635 $sql1 = $sql .
" AND " . $where1;
636 $sql2 = $sql .
" AND " . $where2;
637 $sql .=
" AND ((" . $where1 .
") OR (" . $where2.
"))";
638 } elseif ($filtert ==
'-3') {
640 $sql .=
" AND EXISTS (SELECT ar.rowid FROM ".MAIN_DB_PREFIX.
"actioncomm_resources as ar WHERE ar.fk_actioncomm = a.id AND ar.element_type = 'user' AND ar.fk_element IN (".
$db->sanitize(implode(
',', $user->getAllChildIds(1))).
"))";
641 } elseif ($usergroup > 0) {
643 $sql .=
" AND EXISTS (SELECT ar.rowid FROM ".MAIN_DB_PREFIX.
"actioncomm_resources as ar WHERE ar.fk_actioncomm = a.id AND ar.element_type = 'user' AND ar.fk_element IN (SELECT ugu.fk_user FROM ".MAIN_DB_PREFIX.
"usergroup_user as ugu WHERE ugu.fk_usergroup = ".((int) $usergroup).
"))";
649$nbtotalofrecords =
'';
652 if (empty($sql1) && empty($sql2)) {
653 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
654 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
658 $resql =
$db->query($sqlforcount);
660 $objforcount =
$db->fetch_object($resql);
661 $nbtotalofrecords = (int) $objforcount->nbtotalofrecords;
668 $sqlforcount1 = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql1);
669 $sqlforcount2 = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql2);
671 $resql1 =
$db->query($sqlforcount1);
672 $resql2 =
$db->query($sqlforcount2);
673 if ($resql1 && $resql2) {
674 $objforcount1 =
$db->fetch_object($resql1);
675 $objforcount2 =
$db->fetch_object($resql2);
676 $nbtotalofrecords = (int) $objforcount1->nbtotalofrecords + (
int) $objforcount2->nbtotalofrecords;
685 if (($page * $limit) > (
int) $nbtotalofrecords) {
692$sql .=
$db->order($sortfield, $sortorder);
694 $sql .=
$db->plimit($limit + 1, $offset);
697$resql =
$db->query($sql);
703$num =
$db->num_rows($resql);
705$arrayofselected = is_array($toselect) ? $toselect : array();
708$newtitle =
'<div class="nowrap clear inline-block minheight30 hideonsmartphone">';
709$newtitle .=
'<input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled><label class="labelcalendar"><span class="check_local_text small"> '.$langs->trans(
"LocalAgenda").
'</span></label> ';
710$newtitle .=
'</div>';
713$tabactive =
'cardlist';
717print
'<form method="POST" id="searchFormList" class="listactionsfilter" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
719if ($optioncss !=
'') {
720 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
722print
'<input type="hidden" name="token" value="'.newToken().
'">';
723print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
724print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
725print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
726print
'<input type="hidden" name="type" value="'.$type.
'">';
730 $nav .=
'<input type="hidden" name="search_filter" value="'.$filter.
'">';
733 $nav .=
'<input type="hidden" name="search_showbirthday" value="1">';
741$parameters = array();
742$reshook = $hookmanager->executeHooks(
'addCalendarChoice', $parameters, $object, $action);
743if (empty($reshook)) {
744 $s .= $hookmanager->resPrint;
745} elseif ($reshook > 1) {
746 $s = $hookmanager->resPrint;
753$viewmode =
'<div class="navmode inline-block">';
755$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.
'">';
757$viewmode .=
img_picto($langs->trans(
"List"),
'object_calendarlist',
'class="imgforviewmode pictoactionview block"');
759$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewList").
'</span></a>';
761$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.
'">';
763$viewmode .=
img_picto($langs->trans(
"ViewCal"),
'object_calendarmonth',
'class="pictoactionview block"');
765$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewCal").
'</span></a>';
767$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.
'">';
769$viewmode .=
img_picto($langs->trans(
"ViewWeek"),
'object_calendarweek',
'class="pictoactionview block"');
771$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewWeek").
'</span></a>';
773$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.
'">';
775$viewmode .=
img_picto($langs->trans(
"ViewDay"),
'object_calendarday',
'class="pictoactionview block"');
777$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewDay").
'</span></a>';
779$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.
'">';
781$viewmode .=
img_picto($langs->trans(
"ViewPerUser"),
'object_calendarperuser',
'class="pictoactionview block"');
783$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow" title="'.dolPrintHTML($langs->trans(
"ViewPerUser")).
'">'.$langs->trans(
"ViewPerUser").
'</span></a>';
786$parameters = array();
787$reshook = $hookmanager->executeHooks(
'addCalendarView', $parameters, $object, $action);
788if (empty($reshook)) {
789 $viewmode .= $hookmanager->resPrint;
790} elseif ($reshook > 1) {
791 $viewmode = $hookmanager->resPrint;
794$viewmode .=
'</div>';
796$viewmode .=
'<span class="marginrightonly"></span>';
800$newparam =
'?month='.str_pad((
string) $month, 2,
"0", STR_PAD_LEFT).
'&year='.$tmpforcreatebutton[
'year'];
802$url = DOL_URL_ROOT.
'/comm/action/card.php?action=create';
803$url .=
'&apyear='.$tmpforcreatebutton[
'year'].
'&apmonth='.$tmpforcreatebutton[
'mon'].
'&apday='.$tmpforcreatebutton[
'mday'];
804$url .=
'&aphour='.$tmpforcreatebutton[
'hours'].
'&apmin='.$tmpforcreatebutton[
'minutes'];
805$url .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].$newparam);
807$newcardbutton =
dolGetButtonTitle($langs->trans(
'AddAction'),
'',
'fa fa-plus-circle', $url,
'', (
int) ($user->hasRight(
'agenda',
'myactions',
'create') || $user->hasRight(
'agenda',
'allactions',
'create')));
809$param .=
'&mode='.urlencode($mode);
812print_barre_liste($langs->trans(
"Agenda"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'object_action', 0, $nav.$newcardbutton,
'', $limit, 0, 0, 1, $viewmode);
817include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
821$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
822$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
823if ($massactionbutton) {
824 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
828print
'<div class="liste_titre liste_titre_bydiv centpercent">';
829print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday,
'', $filtert,
'', $pid, $socid, $action, -1, $actioncode, $usergroup,
'', $resourceid, $search_categ_cus, $search_import_key);
834print
'<div class="div-table-responsive">';
835print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
837print
'<tr class="liste_titre_filter">';
839if (
$conf->main_checkbox_left_column) {
840 print
'<td class="liste_titre" align="middle">';
841 $searchpicto = $form->showFilterButtons(
'left');
845if (!empty($arrayfields[
'a.id'][
'checked'])) {
846 print
'<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.
'"></td>';
848if (!empty($arrayfields[
'a.datep'][
'checked'])) {
849 print
'<td class="liste_titre nowraponall center">';
850 print
'<div class="nowrap">';
851 print $form->selectDate($datestart_dtstart,
'datestart_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
853 print
'<div class="nowrap">';
854 print $form->selectDate($datestart_dtend,
'datestart_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
858if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
859 print
'<td class="liste_titre nowraponall center">';
860 print
'<div class="nowrap">';
861 print $form->selectDate($dateend_dtstart,
'dateend_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
863 print
'<div class="nowrap">';
864 print $form->selectDate($dateend_dtend,
'dateend_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
868if (!empty($arrayfields[
'owner'][
'checked'])) {
869 print
'<td class="liste_titre"></td>';
871if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
872 print
'<td class="liste_titre"></td>';
874if (!empty($arrayfields[
'a.label'][
'checked'])) {
875 print
'<td class="liste_titre"><input type="text" class="maxwidth125" name="search_title" value="'.$search_title.
'"></td>';
877if (!empty($arrayfields[
'a.note'][
'checked'])) {
878 print
'<td class="liste_titre"><input type="text" class="maxwidth75" name="search_note" value="'.$search_note.
'"></td>';
880if (!empty($arrayfields[
's.nom'][
'checked'])) {
881 print
'<td class="liste_titre"></td>';
883if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
884 print
'<td class="liste_titre"></td>';
886if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
887 print
'<td class="liste_titre"></td>';
891include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
894$parameters = array(
'arrayfields' => $arrayfields);
895$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
896print $hookmanager->resPrint;
898if (!empty($arrayfields[
'a.datec'][
'checked'])) {
899 print
'<td class="liste_titre"></td>';
901if (!empty($arrayfields[
'a.tms'][
'checked'])) {
902 print
'<td class="liste_titre"></td>';
904if (!empty($arrayfields[
'a.import_key'][
'checked'])) {
905 print
'<td class="liste_titre center"><input type="text" class="maxwidth75" name="search_import_key" value="'.$search_import_key.
'"></td>';
908if (!empty($arrayfields[
'a.percent'][
'checked'])) {
909 print
'<td class="liste_titre center parentonrightofpage">';
910 $formactions->form_select_status_action(
'formaction', $search_status, 1,
'search_status', 1, 2,
'search_status width100 onrightofpage');
914if (!
$conf->main_checkbox_left_column) {
915 print
'<td class="liste_titre center">';
916 $searchpicto = $form->showFilterButtons();
927print
'<tr class="liste_titre">';
928if (
$conf->main_checkbox_left_column) {
929 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
932if (!empty($arrayfields[
'a.id'][
'checked'])) {
934 print_liste_field_titre($arrayfields[
'a.id'][
'label'], $_SERVER[
"PHP_SELF"],
"a.id",
"", $param,
"", $sortfield, $sortorder);
937if (!empty($arrayfields[
'a.datep'][
'checked'])) {
938 print_liste_field_titre($arrayfields[
'a.datep'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep,a.id",
"", $param,
'', $sortfield, $sortorder,
'center ');
941if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
942 print_liste_field_titre($arrayfields[
'a.datep2'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep2",
"", $param,
'', $sortfield, $sortorder,
'center ');
945if (!empty($arrayfields[
'owner'][
'checked'])) {
946 print_liste_field_titre($arrayfields[
'owner'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder);
949if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
950 print_liste_field_titre($arrayfields[
'c.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.libelle",
"", $param,
"", $sortfield, $sortorder);
953if (!empty($arrayfields[
'a.label'][
'checked'])) {
954 print_liste_field_titre($arrayfields[
'a.label'][
'label'], $_SERVER[
"PHP_SELF"],
"a.label",
"", $param,
"", $sortfield, $sortorder);
957if (!empty($arrayfields[
'a.note'][
'checked'])) {
958 print_liste_field_titre($arrayfields[
'a.note'][
'label'], $_SERVER[
"PHP_SELF"],
"a.note",
"", $param,
"", $sortfield, $sortorder);
961if (!empty($arrayfields[
's.nom'][
'checked'])) {
962 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
"", $sortfield, $sortorder);
965if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
966 print_liste_field_titre($arrayfields[
'a.fk_contact'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder);
969if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
970 print_liste_field_titre($arrayfields[
'a.fk_element'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder);
974include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
976$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
977$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
978print $hookmanager->resPrint;
980if (!empty($arrayfields[
'a.datec'][
'checked'])) {
981 print_liste_field_titre($arrayfields[
'a.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datec,a.id",
"", $param,
'', $sortfield, $sortorder,
'center ');
984if (!empty($arrayfields[
'a.tms'][
'checked'])) {
985 print_liste_field_titre($arrayfields[
'a.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"a.tms,a.id",
"", $param,
'', $sortfield, $sortorder,
'center ');
989if (!empty($arrayfields[
'a.import_key'][
'checked'])) {
990 print_liste_field_titre(
"ImportId", $_SERVER[
"PHP_SELF"],
"a.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
994if (!empty($arrayfields[
'a.percent'][
'checked'])) {
995 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"a.percent",
"", $param,
'', $sortfield, $sortorder,
'center ');
998if (!
$conf->main_checkbox_left_column) {
999 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1005$delay_warning =
getDolGlobalInt(
'MAIN_DELAY_ACTIONS_TODO') * 24 * 60 * 60;
1006$today_start_time =
dol_mktime(0, 0, 0, (
int)
date(
'm', $now), (
int)
date(
'd', $now), (
int)
date(
'Y', $now));
1008require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/cactioncomm.class.php';
1010$arraylist = $caction->liste_array(1,
'code',
'', (!
getDolGlobalString(
'AGENDA_USE_EVENT_TYPE') ? 1 : 0),
'', 1);
1011$contactListCache = array();
1012$elementlinkcache = array();
1019$imaxinloop = ($limit ? min($num, $limit) : $num);
1020$cache_user_list = array();
1021while ($i < $imaxinloop) {
1022 $obj =
$db->fetch_object($resql);
1028 $object->setVarsFromFetchObj($obj);
1031 if (
getDolGlobalString(
'AGENDA_ALWAYS_HIDE_AUTO') && $obj->type_code ==
'AC_OTH_AUTO') {
1036 $actionstatic->id = $obj->id;
1037 $actionstatic->ref = $obj->id;
1038 $actionstatic->code = $obj->code;
1039 $actionstatic->label = $obj->label;
1040 $actionstatic->location = $obj->location;
1042 $actionstatic->datep =
$db->jdate($obj->dp);
1043 $actionstatic->percentage = $obj->percent;
1044 $actionstatic->authorid = $obj->fk_user_author;
1045 $actionstatic->userownerid = $obj->fk_user_action;
1046 $actionstatic->recurid = $obj->recurid;
1047 $actionstatic->recurrule = $obj->recurrule;
1048 $actionstatic->recurdateend =
$db->jdate($obj->recurdateend);
1050 $actionstatic->type = $obj->type_type;
1051 $actionstatic->type_code = $obj->type_code;
1052 $actionstatic->type_label = $obj->type_label;
1053 $actionstatic->type_picto = $obj->type_picto;
1054 $actionstatic->type_color = $obj->type_color;
1059 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
1060 $actionstatic->fetchResources();
1064 if ($obj->fk_user_action > 0 && !isset($cache_user_list[$obj->fk_user_action])) {
1066 $res = $userstatic->fetch($obj->fk_user_action);
1068 $cache_user_list[$obj->fk_user_action] = $userstatic;
1073 $event_owner_style =
'';
1075 if ($obj->fk_user_action > 0 && $cache_user_list[$obj->fk_user_action]->color !=
'') {
1076 $event_owner_style .=
'border-left: #' . $cache_user_list[$obj->fk_user_action]->color .
' 5px solid;';
1080 $event_more_class =
'';
1081 $event_start_date_css =
'';
1082 $event_end_date_css =
'';
1083 $event_start_date_time = $actionstatic->datep;
1084 if ($event_start_date_time > $now) {
1086 $event_more_class =
'event-future';
1087 $event_start_date_css = $event_end_date_css = $event_more_class;
1089 if ($obj->fulldayevent == 1) {
1090 $today_start_date_time = $today_start_time;
1092 $today_start_date_time = $now;
1096 $event_end_date_time =
$db->jdate($obj->dp2);
1097 if ($event_end_date_time !=
null && $event_end_date_time < $today_start_date_time) {
1099 $event_more_class =
'event-past';
1100 } elseif ($event_end_date_time ==
null && $event_start_date_time < $today_start_date_time) {
1102 $event_more_class =
'event-past';
1105 $event_more_class =
'event-current';
1107 $event_start_date_css = $event_end_date_css = $event_more_class;
1109 $event_start_date_css = $event_end_date_css = $event_more_class;
1111 print
'<tr class="oddeven row-with-select ' . ($event_more_class !=
'' ?
' '.$event_more_class :
'') .
'">';
1114 if (
$conf->main_checkbox_left_column) {
1115 print
'<td class="nowrap center">';
1116 if ($massactionbutton || $massaction) {
1118 if (in_array($obj->id, $arrayofselected)) {
1121 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1126 if (!empty($arrayfields[
'a.id'][
'checked'])) {
1127 print
'<td class="nowraponall">';
1128 print $actionstatic->getNomUrl(1, -1);
1133 if (!empty($arrayfields[
'a.datep'][
'checked'])) {
1134 print
'<td class="center nowraponall'.($event_start_date_css ?
' '.$event_start_date_css.
'x' :
'').
'"><span>';
1135 if (empty($obj->fulldayevent)) {
1136 print
'<div class="center inline-block lineheightsmall">';
1138 print
'<br><span class="opacitymedium hourspan">';
1144 print
'<div class="center inline-block lineheightsmall">';
1145 print
dol_print_date(
$db->jdate($obj->dp),
'day', ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1146 print
'<br><span class="opacitymedium hourspan">';
1153 if ($actionstatic->hasDelay() && $actionstatic->percentage >= 0 && $actionstatic->percentage < 100) {
1163 if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
1164 print
'<td class="center nowraponall'.($event_end_date_css ?
' '.$event_end_date_css.
'x' :
'').
'"><span>';
1165 if (empty($obj->fulldayevent)) {
1166 print
'<div class="center inline-block lineheightsmall">';
1168 print
'<br><span class="opacitymedium hourspan">';
1174 print
'<div class="center inline-block lineheightsmall">';
1175 print
dol_print_date(
$db->jdate($obj->dp2),
'day', ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1176 print
'<br><span class="opacitymedium hourspan">';
1177 print
dol_print_date(23*60*60+59*60+59,
'hourreduceformat',
'gmt');
1186 if (!empty($arrayfields[
'owner'][
'checked'])) {
1187 print
'<td class="tdoverflowmax125">';
1188 if ($obj->fk_user_action > 0 && !isset($cache_user_list[$obj->fk_user_action])) {
1190 $res = $userstatic->fetch($obj->fk_user_action);
1192 $cache_user_list[$obj->fk_user_action] = $userstatic;
1195 if (isset($cache_user_list[$obj->fk_user_action])) {
1196 print $cache_user_list[$obj->fk_user_action]->getNomUrl(-1,
'', 0, 0, 16, 0,
'firstelselast',
'');
1202 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
1203 print
'<td class="tdoverflowmax125 nowraponall">';
1205 print $actionstatic->getTypePicto();
1206 $labeltype = $obj->type_code;
1208 $labeltype =
'AC_OTH';
1210 if (!empty($actionstatic->code) && preg_match(
'/^TICKET_MSG/', $actionstatic->code)) {
1211 $labeltype = $langs->trans(
"Message");
1213 if (!empty($arraylist[$labeltype])) {
1214 $labeltype = $arraylist[$labeltype];
1216 if ($obj->type_code ==
'AC_OTH_AUTO' && ($obj->type_code != $obj->code) && $labeltype && !empty($arraylist[$obj->code])) {
1217 $labeltype .=
' - '.$arraylist[$obj->code];
1225 if (!empty($arrayfields[
'a.label'][
'checked'])) {
1226 print
'<td class="tdoverflowmax300" title="'.dolPrintHTMLForAttribute($actionstatic->label).
'">';
1232 if (!empty($arrayfields[
'a.note'][
'checked'])) {
1234 print
'<td class="minwidth150">';
1235 print
'<div class="small twolinesmax lineheightsmall minwidth150 maxwidth250 classfortooltip" title="'.dolPrintHTMLForAttribute($actionstatic->note_private).
'">';
1243 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1244 print
'<td class="tdoverflowmax150">';
1245 if ($obj->socid > 0) {
1246 $societestatic->id = $obj->socid;
1247 $societestatic->client = (int) $obj->client;
1248 $societestatic->name = (
string) $obj->societe;
1249 $societestatic->email = $obj->socemail;
1251 print $societestatic->getNomUrl(1,
'', 28);
1257 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
1258 print
'<td class="tdoverflowmax100">';
1259 if (!empty($actionstatic->socpeopleassigned)) {
1260 $contactList = array();
1261 foreach ($actionstatic->socpeopleassigned as $socpeopleassigned) {
1262 if (!isset($contactListCache[$socpeopleassigned[
'id']])) {
1265 if ($contact->fetch($socpeopleassigned[
'id']) > 0) {
1266 $contactListCache[$socpeopleassigned[
'id']] = $contact->getNomUrl(1,
'', 0);
1267 $contactList[] = $contact->getNomUrl(1,
'', 0);
1271 $contactList[] = $contactListCache[$socpeopleassigned[
'id']];
1274 if (!empty($contactList)) {
1275 print implode(
', ', $contactList);
1277 } elseif ($obj->fk_contact > 0) {
1279 $tmpcontact->fetch($obj->fk_contact);
1281 print $contactstatic->getNomUrl(1,
'', 0);
1287 if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
1288 print
'<td class="tdoverflowmax150 nowraponall">';
1289 if (isset($obj->elementtype) && !empty($obj->fk_element)) {
1290 if (isset($elementlinkcache[$obj->elementtype]) && isset($elementlinkcache[$obj->elementtype][$obj->fk_element])) {
1291 $link = $elementlinkcache[$obj->elementtype][$obj->fk_element];
1293 if (!isset($elementlinkcache[$obj->elementtype])) {
1294 $elementlinkcache[$obj->elementtype] = array();
1297 $elementlinkcache[$obj->elementtype][$obj->fk_element] = $link;
1305 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1307 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &
$totalarray);
1308 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1309 print $hookmanager->resPrint;
1312 if (!empty($arrayfields[
'a.datec'][
'checked'])) {
1314 print
'<td class="center nowrap">'.dol_print_date(
$db->jdate($obj->datec),
'dayhour',
'tzuserrel').
'</td>';
1317 if (!empty($arrayfields[
'a.tms'][
'checked'])) {
1318 print
'<td class="center nowrap">'.dol_print_date(
$db->jdate($obj->datem),
'dayhour',
'tzuserrel').
'</td>';
1321 if (!empty($arrayfields[
'a.import_key'][
'checked'])) {
1322 print
'<td class="center nowrap">'.dolPrintHTML($obj->import_key).
'</td>';
1325 if (!empty($arrayfields[
'a.percent'][
'checked'])) {
1326 $datep =
$db->jdate($obj->dp);
1327 print
'<td class="center nowrap">'.$actionstatic->LibStatut($obj->percent, 5, 0, $datep).
'</td>';
1330 if (!
$conf->main_checkbox_left_column) {
1331 print
'<td class="nowrap center">';
1332 if ($massactionbutton || $massaction) {
1334 if (in_array($obj->id, $arrayofselected)) {
1337 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1348 print
'<tr><td colspan="'.$totalarray[
'nbfield'].
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1352print
'</table>'.
"\n";
1355print
'</form>'.
"\n";
if(! $sortfield) if(! $sortorder) $object
print_actions_filter( $form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filtered, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid=0, $excludetype='', $resourceid=0, $search_categ_cus=0, $search_import_key='')
Show filter form in agenda view.
calendars_prepare_head($param)
Define head array for tabs of agenda setup pages.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage agenda events (actions)
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_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
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.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_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.
isModEnabled($module)
Is Dolibarr module enabled.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $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, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
dolPrintHTML($s, $allowiframe=0, $moreallowedtags=array())
Return a string (that can be on several lines) ready to be output on a HTML page.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
print $langs trans('Date')." left Ref Label right Qty right Price right TotalHT right TotalTTC right right right right right right right right right centpercent right TotalHT right n right VAT right n right TotalVAT right n No sujeto a RE IRPF right TotalLT1 right n right TotalLT2 right n right TotalTTC right n takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency right TotalTTC takeposcustomercurrency right takeposcustomercurrency n right Paid right PaymentTypeShortLIQ right SELECT p pos_change as p datep as date
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.