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';
199$arrayfields = array_merge($arrayfields, array(
200 'owner' => array(
'label' =>
"Owner",
'checked' =>
'1',
'position' => 46),
201 'c.libelle' => array(
'label' =>
"Type",
'checked' =>
'1',
'position' => 47),
202 's.nom' => array(
'label' =>
"ThirdParty",
'checked' =>
'1',
'position' => 54),
203 'a.fk_element' => array(
'label' =>
"LinkedObject",
'checked' =>
'1',
'position' => 86),
211if ($user->socid && $socid) {
220if (
GETPOST(
'cancel',
'alpha')) {
227 if (is_array($_POST)) {
228 foreach ($_POST as $key => $val) {
229 $param .=
'&'.urlencode($key).
'='.urlencode($val);
233 header(
"Location: ".DOL_URL_ROOT.
'/comm/action/index.php?'.$param);
237$parameters = array(
'id' => $socid);
238$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
244include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
246if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
251 $datestart_dtstart =
'';
252 $datestart_dtend =
'';
253 $dateend_dtstart =
'';
257 $search_import_key =
'';
265 $search_array_options = array();
268if (empty($reshook) && !empty($massaction)) {
271 switch ($massaction) {
272 case 'set_all_events_to_todo':
276 case 'set_all_events_to_in_progress':
280 case 'set_all_events_to_finished':
285 if (isset($percent)) {
286 foreach ($toselect as $toselectid) {
287 $result =
$object->updatePercent($toselectid, $percent);
297if (empty($reshook)) {
298 $objectclass =
'ActionComm';
299 $objectlabel =
'Events';
302 $permissiontodelete = $user->hasRight(
'agenda',
'allactions',
'delete');
303 $permissiontoadd = $user->hasRight(
'agenda',
'myactions',
'create');
304 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
321$nav .= $form->selectDate($dateselect,
'dateselect', 0, 0, 1,
'', 1, 0);
322$nav .=
' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans(
"Refresh").
'">';
326$help_url =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
327$title = $langs->trans(
"Agenda");
328llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist');
334if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
335 $param .=
'&contextpage='.urlencode($contextpage);
337if ($limit > 0 && $limit !=
$conf->liste_limit) {
338 $param .=
'&limit='.((int) $limit);
340if ($actioncode !=
'') {
341 if (is_array($actioncode)) {
342 foreach ($actioncode as $str_action) {
343 $param .=
"&search_actioncode[]=".urlencode($str_action);
346 $param .=
"&search_actioncode=".urlencode($actioncode);
349if ($resourceid > 0) {
350 $param .=
"&search_resourceid=".urlencode((
string) ($resourceid));
352if ($search_status !=
'') {
353 $param .=
"&search_status=".urlencode($search_status);
355if ($search_import_key !=
'') {
356 $param .=
"&search_import_key=".urlencode($search_import_key);
359 $param .=
"&search_filter=".urlencode((
string) $filter);
362 $param .=
"&search_filtert=".urlencode((
string) $filtert);
365 $param .=
"&search_usergroup=".urlencode((
string) ($usergroup));
368 $param .=
"&search_socid=".urlencode((
string) ($socid));
371 $param .=
"&search_showbirthday=1";
374 $param .=
"&search_projectid=".urlencode((
string) ($pid));
377 $param .=
"&search_type=".urlencode($type);
379if ($search_id !=
'') {
380 $param .=
'&search_id='.urlencode($search_id);
382if ($search_title !=
'') {
383 $param .=
'&search_title='.urlencode($search_title);
385if ($search_note !=
'') {
386 $param .=
'&search_note='.urlencode($search_note);
389 $param .=
'&datestart_dtstartday='.GETPOSTINT(
'datestart_dtstartday');
392 $param .=
'&datestart_dtstartmonth='.GETPOSTINT(
'datestart_dtstartmonth');
395 $param .=
'&datestart_dtstartyear='.GETPOSTINT(
'datestart_dtstartyear');
398 $param .=
'&datestart_dtendday='.GETPOSTINT(
'datestart_dtendday');
401 $param .=
'&datestart_dtendmonth='.GETPOSTINT(
'datestart_dtendmonth');
404 $param .=
'&datestart_dtendyear='.GETPOSTINT(
'datestart_dtendyear');
407 $param .=
'&dateend_dtstartday='.GETPOSTINT(
'dateend_dtstartday');
410 $param .=
'&dateend_dtstartmonth='.GETPOSTINT(
'dateend_dtstartmonth');
413 $param .=
'&dateend_dtstartyear='.GETPOSTINT(
'dateend_dtstartyear');
416 $param .=
'&dateend_dtendday='.GETPOSTINT(
'dateend_dtendday');
419 $param .=
'&dateend_dtendmonth='.GETPOSTINT(
'dateend_dtendmonth');
422 $param .=
'&dateend_dtendyear='.GETPOSTINT(
'dateend_dtendyear');
424if ($optioncss !=
'') {
425 $param .=
'&optioncss='.urlencode($optioncss);
427if ($search_categ_cus != 0) {
428 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
432include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
434$paramnoactionodate = $param;
437$arrayofmassactions = array(
438 'set_all_events_to_todo' =>
img_picto(
'',
'circle',
'class="pictofixedwidth font-status1"').$langs->trans(
"SetAllEventsToTodo"),
439 'set_all_events_to_in_progress' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth font-status2"').$langs->trans(
"SetAllEventsToInProgress"),
440 'set_all_events_to_finished' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth badge-status5"').$langs->trans(
"SetAllEventsToFinished"),
442if ($user->hasRight(
'agenda',
'allactions',
'delete')) {
443 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
445if (
isModEnabled(
'category') && $user->hasRight(
'agenda',
'myactions',
'create')) {
446 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
448if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
449 $arrayofmassactions = array();
451$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
454$sql .=
" a.datep as dp, a.id, a.code, a.label, a.note, a.datep2 as dp2, a.fulldayevent, a.location, a.entity,";
455$sql .=
" a.fk_user_author, a.fk_user_action,";
456$sql .=
" a.fk_contact, a.note, a.percent as percent,";
457$sql .=
" a.fk_element, a.elementtype, a.datec, a.tms as datem,";
458$sql .=
" a.recurid, a.recurrule, a.recurdateend, a.import_key,";
459$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,";
460$sql .=
" s.nom as societe, s.rowid as socid, s.client, s.email as socemail";
464if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
465 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
466 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
471$parameters = array();
472$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
473$sql .= $hookmanager->resPrint;
477$sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a";
478$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"actioncomm_extrafields as ef ON a.id = ef.fk_object";
479$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
480$sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"c_actioncomm as c ON c.id = a.fk_action";
482if ($resourceid > 0) {
483 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"element_resources as r ON r.element_type = 'action' AND r.element_id = a.id";
486$parameters = array();
487$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
488$sql .= $hookmanager->resPrint;
490$sql .=
" WHERE a.entity IN (".getEntity(
'agenda').
")";
492if (!empty($actioncode)) {
494 if ((is_array($actioncode) && in_array(
'AC_NON_AUTO', $actioncode)) || $actioncode ==
'AC_NON_AUTO') {
495 $sql .=
" AND c.type != 'systemauto'";
496 } elseif ((is_array($actioncode) && in_array(
'AC_ALL_AUTO', $actioncode)) || $actioncode ==
'AC_ALL_AUTO') {
497 $sql .=
" AND c.type = 'systemauto'";
499 if ((is_array($actioncode) && in_array(
'AC_OTH', $actioncode)) || $actioncode ==
'AC_OTH') {
500 $sql .=
" AND c.type != 'systemauto'";
502 if ((is_array($actioncode) && in_array(
'AC_OTH_AUTO', $actioncode)) || $actioncode ==
'AC_OTH_AUTO') {
503 $sql .=
" AND c.type = 'systemauto'";
507 if ((is_array($actioncode) && in_array(
'AC_NON_AUTO', $actioncode)) || $actioncode ===
'AC_NON_AUTO') {
508 $sql .=
" AND c.type != 'systemauto'";
509 } elseif ((is_array($actioncode) && in_array(
'AC_ALL_AUTO', $actioncode)) || $actioncode ===
'AC_ALL_AUTO') {
510 $sql .=
" AND c.type = 'systemauto'";
512 if (is_array($actioncode)) {
514 $actioncode = array_filter(
521 return ((
string) $value !==
'-1');
524 if (count($actioncode)) {
525 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", $actioncode).
"'", 1).
")";
527 } elseif ($actioncode !==
'-1') {
528 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", explode(
',', $actioncode)).
"'", 1).
")";
533if ($resourceid > 0) {
534 $sql .=
" AND r.resource_id = ".((int) $resourceid);
537 $sql .=
" AND a.fk_project=".((int) $pid);
542if (
isModEnabled(
"societe") && !$user->hasRight(
'societe',
'client',
'voir')) {
543 $search_sale = $user->id;
546if ($search_sale && $search_sale !=
'-1') {
547 if ($search_sale == -2) {
548 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc)";
549 } elseif ($search_sale > 0) {
550 $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).
"))";
555 $sql .=
" AND a.fk_soc = ".((int) $socid);
558 $sql .=
" AND c.id = ".((int) $type);
560if ($search_status ==
'0') {
562 $sql .=
" AND a.percent = 0";
564if ($search_status ==
'na') {
566 $sql .=
" AND a.percent = -1";
568if ($search_status ==
'50') {
570 $sql .=
" AND (a.percent > 0 AND a.percent < 100)";
572if ($search_status ==
'done' || $search_status ==
'100') {
573 $sql .=
" AND (a.percent = 100)";
575if ($search_status ==
'todo') {
576 $sql .=
" AND (a.percent >= 0 AND a.percent < 100)";
578if ($search_import_key) {
592if ($dateselect > 0) {
593 $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).
"'))";
595if ($datestart_dtstart > 0) {
596 $sql .=
" AND a.datep >= '".$db->idate($datestart_dtstart).
"'";
598if ($datestart_dtend > 0) {
599 $sql .=
" AND a.datep <= '".$db->idate($datestart_dtend).
"'";
601if ($dateend_dtstart > 0) {
602 $sql .=
" AND a.datep2 >= '".$db->idate($dateend_dtstart).
"'";
604if ($dateend_dtend > 0) {
605 $sql .=
" AND a.datep2 <= '".$db->idate($dateend_dtend).
"'";
609if ($search_categ_cus != -1) {
610 if ($search_categ_cus == -2) {
611 $sql .=
" AND NOT EXISTS (SELECT ca.fk_actioncomm FROM ".MAIN_DB_PREFIX.
"categorie_actioncomm as ca WHERE ca.fk_actioncomm = a.id)";
612 } elseif ($search_categ_cus > 0) {
613 $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).
"))";
618include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
621$parameters = array();
622$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
623$sql .= $hookmanager->resPrint;
628if (($filtert !=
'-1' && $filtert !=
'-2') || $usergroup > 0) {
629 if ($filtert !=
'' && $filtert !=
'-1' && $filtert !=
'-2' && $filtert !=
'-3') {
630 $where1 =
"a.fk_user_action = ".((int) $filtert);
631 $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).
"))";
632 $sql1 = $sql .
" AND " . $where1;
633 $sql2 = $sql .
" AND " . $where2;
634 $sql .=
" AND ((" . $where1 .
") OR (" . $where2.
"))";
635 } elseif ($filtert ==
'-3') {
637 $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))).
"))";
638 } elseif ($usergroup > 0) {
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 (SELECT ugu.fk_user FROM ".MAIN_DB_PREFIX.
"usergroup_user as ugu WHERE ugu.fk_usergroup = ".((int) $usergroup).
"))";
646$nbtotalofrecords =
'';
649 if (empty($sql1) && empty($sql2)) {
650 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
651 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
655 $resql =
$db->query($sqlforcount);
657 $objforcount =
$db->fetch_object($resql);
658 $nbtotalofrecords = (int) $objforcount->nbtotalofrecords;
665 $sqlforcount1 = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql1);
666 $sqlforcount2 = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql2);
668 $resql1 =
$db->query($sqlforcount1);
669 $resql2 =
$db->query($sqlforcount2);
670 if ($resql1 && $resql2) {
671 $objforcount1 =
$db->fetch_object($resql1);
672 $objforcount2 =
$db->fetch_object($resql2);
673 $nbtotalofrecords = (int) $objforcount1->nbtotalofrecords + (
int) $objforcount2->nbtotalofrecords;
682 if (($page * $limit) > (
int) $nbtotalofrecords) {
689$sql .=
$db->order($sortfield, $sortorder);
691 $sql .=
$db->plimit($limit + 1, $offset);
694$resql =
$db->query($sql);
700$num =
$db->num_rows($resql);
702$arrayofselected = is_array($toselect) ? $toselect : array();
705$newtitle =
'<div class="nowrap clear inline-block minheight30 hideonsmartphone">';
706$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> ';
707$newtitle .=
'</div>';
710$tabactive =
'cardlist';
714print
'<form method="POST" id="searchFormList" class="listactionsfilter" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
716if ($optioncss !=
'') {
717 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
719print
'<input type="hidden" name="token" value="'.newToken().
'">';
720print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
721print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
722print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
723print
'<input type="hidden" name="type" value="'.$type.
'">';
727 $nav .=
'<input type="hidden" name="search_filter" value="'.$filter.
'">';
730 $nav .=
'<input type="hidden" name="search_showbirthday" value="1">';
738$parameters = array();
739$reshook = $hookmanager->executeHooks(
'addCalendarChoice', $parameters, $object, $action);
740if (empty($reshook)) {
741 $s .= $hookmanager->resPrint;
742} elseif ($reshook > 1) {
743 $s = $hookmanager->resPrint;
750$viewmode =
'<div class="navmode inline-block">';
752$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.
'">';
754$viewmode .=
img_picto($langs->trans(
"List"),
'object_calendarlist',
'class="imgforviewmode pictoactionview block"');
756$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewList").
'</span></a>';
758$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.
'">';
760$viewmode .=
img_picto($langs->trans(
"ViewCal"),
'object_calendarmonth',
'class="pictoactionview block"');
762$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewCal").
'</span></a>';
764$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.
'">';
766$viewmode .=
img_picto($langs->trans(
"ViewWeek"),
'object_calendarweek',
'class="pictoactionview block"');
768$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewWeek").
'</span></a>';
770$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.
'">';
772$viewmode .=
img_picto($langs->trans(
"ViewDay"),
'object_calendarday',
'class="pictoactionview block"');
774$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewDay").
'</span></a>';
776$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.
'">';
778$viewmode .=
img_picto($langs->trans(
"ViewPerUser"),
'object_calendarperuser',
'class="pictoactionview block"');
780$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow" title="'.dolPrintHTML($langs->trans(
"ViewPerUser")).
'">'.$langs->trans(
"ViewPerUser").
'</span></a>';
783$parameters = array();
784$reshook = $hookmanager->executeHooks(
'addCalendarView', $parameters, $object, $action);
785if (empty($reshook)) {
786 $viewmode .= $hookmanager->resPrint;
787} elseif ($reshook > 1) {
788 $viewmode = $hookmanager->resPrint;
791$viewmode .=
'</div>';
793$viewmode .=
'<span class="marginrightonly"></span>';
797$newparam =
'?month='.str_pad((
string) $month, 2,
"0", STR_PAD_LEFT).
'&year='.$tmpforcreatebutton[
'year'];
799$url = DOL_URL_ROOT.
'/comm/action/card.php?action=create';
800$url .=
'&apyear='.$tmpforcreatebutton[
'year'].
'&apmonth='.$tmpforcreatebutton[
'mon'].
'&apday='.$tmpforcreatebutton[
'mday'];
801$url .=
'&aphour='.$tmpforcreatebutton[
'hours'].
'&apmin='.$tmpforcreatebutton[
'minutes'];
802$url .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].$newparam);
804$newcardbutton = dolGetButtonTitle($langs->trans(
'AddAction'),
'',
'fa fa-plus-circle', $url,
'', (
int) ($user->hasRight(
'agenda',
'myactions',
'create') || $user->hasRight(
'agenda',
'allactions',
'create')));
806$param .=
'&mode='.urlencode($mode);
809print_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);
814include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
818$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
819$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
$conf->main_checkbox_left_column);
820if ($massactionbutton) {
821 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
825print
'<div class="liste_titre liste_titre_bydiv centpercent">';
826print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday,
'', $filtert,
'', $pid, $socid, $action, -1, $actioncode, $usergroup,
'', $resourceid, $search_categ_cus, $search_import_key);
831print
'<div class="div-table-responsive">';
832print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
834print
'<tr class="liste_titre_filter">';
836if (
$conf->main_checkbox_left_column) {
837 print
'<td class="liste_titre" align="middle">';
838 $searchpicto = $form->showFilterButtons(
'left');
842if (!empty($arrayfields[
'a.id'][
'checked'])) {
843 print
'<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.
'"></td>';
845if (!empty($arrayfields[
'a.datep'][
'checked'])) {
846 print
'<td class="liste_titre nowraponall center">';
847 print
'<div class="nowrap">';
848 print $form->selectDate($datestart_dtstart,
'datestart_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
850 print
'<div class="nowrap">';
851 print $form->selectDate($datestart_dtend,
'datestart_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
855if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
856 print
'<td class="liste_titre nowraponall center">';
857 print
'<div class="nowrap">';
858 print $form->selectDate($dateend_dtstart,
'dateend_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
860 print
'<div class="nowrap">';
861 print $form->selectDate($dateend_dtend,
'dateend_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
865if (!empty($arrayfields[
'owner'][
'checked'])) {
866 print
'<td class="liste_titre"></td>';
868if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
869 print
'<td class="liste_titre"></td>';
871if (!empty($arrayfields[
'a.label'][
'checked'])) {
872 print
'<td class="liste_titre"><input type="text" class="maxwidth125" name="search_title" value="'.$search_title.
'"></td>';
874if (!empty($arrayfields[
'a.note'][
'checked'])) {
875 print
'<td class="liste_titre"><input type="text" class="maxwidth75" name="search_note" value="'.$search_note.
'"></td>';
877if (!empty($arrayfields[
's.nom'][
'checked'])) {
878 print
'<td class="liste_titre"></td>';
880if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
881 print
'<td class="liste_titre"></td>';
883if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
884 print
'<td class="liste_titre"></td>';
888include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
891$parameters = array(
'arrayfields' => $arrayfields);
892$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
893print $hookmanager->resPrint;
895if (!empty($arrayfields[
'a.datec'][
'checked'])) {
896 print
'<td class="liste_titre"></td>';
898if (!empty($arrayfields[
'a.tms'][
'checked'])) {
899 print
'<td class="liste_titre"></td>';
901if (!empty($arrayfields[
'a.import_key'][
'checked'])) {
902 print
'<td class="liste_titre center"><input type="text" class="maxwidth75" name="search_import_key" value="'.$search_import_key.
'"></td>';
905if (!empty($arrayfields[
'a.percent'][
'checked'])) {
906 print
'<td class="liste_titre center parentonrightofpage">';
907 $formactions->form_select_status_action(
'formaction', $search_status, 1,
'search_status', 1, 2,
'search_status width100 onrightofpage');
911if (!
$conf->main_checkbox_left_column) {
912 print
'<td class="liste_titre center">';
913 $searchpicto = $form->showFilterButtons();
924print
'<tr class="liste_titre">';
925if (
$conf->main_checkbox_left_column) {
926 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
929if (!empty($arrayfields[
'a.id'][
'checked'])) {
931 print_liste_field_titre($arrayfields[
'a.id'][
'label'], $_SERVER[
"PHP_SELF"],
"a.id",
"", $param,
"", $sortfield, $sortorder);
934if (!empty($arrayfields[
'a.datep'][
'checked'])) {
935 print_liste_field_titre($arrayfields[
'a.datep'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep,a.id",
"", $param,
'', $sortfield, $sortorder,
'center ');
938if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
939 print_liste_field_titre($arrayfields[
'a.datep2'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep2",
"", $param,
'', $sortfield, $sortorder,
'center ');
942if (!empty($arrayfields[
'owner'][
'checked'])) {
943 print_liste_field_titre($arrayfields[
'owner'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder);
946if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
947 print_liste_field_titre($arrayfields[
'c.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.libelle",
"", $param,
"", $sortfield, $sortorder);
950if (!empty($arrayfields[
'a.label'][
'checked'])) {
951 print_liste_field_titre($arrayfields[
'a.label'][
'label'], $_SERVER[
"PHP_SELF"],
"a.label",
"", $param,
"", $sortfield, $sortorder);
954if (!empty($arrayfields[
'a.note'][
'checked'])) {
955 print_liste_field_titre($arrayfields[
'a.note'][
'label'], $_SERVER[
"PHP_SELF"],
"a.note",
"", $param,
"", $sortfield, $sortorder);
958if (!empty($arrayfields[
's.nom'][
'checked'])) {
959 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
"", $sortfield, $sortorder);
962if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
963 print_liste_field_titre($arrayfields[
'a.fk_contact'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder);
966if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
967 print_liste_field_titre($arrayfields[
'a.fk_element'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder);
971include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
973$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
974$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
975print $hookmanager->resPrint;
977if (!empty($arrayfields[
'a.datec'][
'checked'])) {
978 print_liste_field_titre($arrayfields[
'a.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datec,a.id",
"", $param,
'', $sortfield, $sortorder,
'center ');
981if (!empty($arrayfields[
'a.tms'][
'checked'])) {
982 print_liste_field_titre($arrayfields[
'a.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"a.tms,a.id",
"", $param,
'', $sortfield, $sortorder,
'center ');
986if (!empty($arrayfields[
'a.import_key'][
'checked'])) {
987 print_liste_field_titre(
"ImportId", $_SERVER[
"PHP_SELF"],
"a.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
991if (!empty($arrayfields[
'a.percent'][
'checked'])) {
992 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"a.percent",
"", $param,
'', $sortfield, $sortorder,
'center ');
995if (!
$conf->main_checkbox_left_column) {
996 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1002$delay_warning =
getDolGlobalInt(
'MAIN_DELAY_ACTIONS_TODO') * 24 * 60 * 60;
1003$today_start_time =
dol_mktime(0, 0, 0, (
int)
date(
'm', $now), (
int)
date(
'd', $now), (
int)
date(
'Y', $now));
1005require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/cactioncomm.class.php';
1007$arraylist = $caction->liste_array(1,
'code',
'', (!
getDolGlobalString(
'AGENDA_USE_EVENT_TYPE') ? 1 : 0),
'', 1);
1008$contactListCache = array();
1009$elementlinkcache = array();
1016$imaxinloop = ($limit ? min($num, $limit) : $num);
1017$cache_user_list = array();
1018while ($i < $imaxinloop) {
1019 $obj =
$db->fetch_object($resql);
1025 $object->setVarsFromFetchObj($obj);
1028 if (
getDolGlobalString(
'AGENDA_ALWAYS_HIDE_AUTO') && $obj->type_code ==
'AC_OTH_AUTO') {
1033 $actionstatic->id = $obj->id;
1034 $actionstatic->ref = $obj->id;
1035 $actionstatic->code = $obj->code;
1036 $actionstatic->label = $obj->label;
1037 $actionstatic->location = $obj->location;
1039 $actionstatic->datep =
$db->jdate($obj->dp);
1040 $actionstatic->percentage = $obj->percent;
1041 $actionstatic->authorid = $obj->fk_user_author;
1042 $actionstatic->userownerid = $obj->fk_user_action;
1043 $actionstatic->recurid = $obj->recurid;
1044 $actionstatic->recurrule = $obj->recurrule;
1045 $actionstatic->recurdateend =
$db->jdate($obj->recurdateend);
1047 $actionstatic->type = $obj->type_type;
1048 $actionstatic->type_code = $obj->type_code;
1049 $actionstatic->type_label = $obj->type_label;
1050 $actionstatic->type_picto = $obj->type_picto;
1051 $actionstatic->type_color = $obj->type_color;
1056 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
1057 $actionstatic->fetchResources();
1061 if ($obj->fk_user_action > 0 && !isset($cache_user_list[$obj->fk_user_action])) {
1063 $res = $userstatic->fetch($obj->fk_user_action);
1065 $cache_user_list[$obj->fk_user_action] = $userstatic;
1070 $event_owner_style =
'';
1072 if ($obj->fk_user_action > 0 && $cache_user_list[$obj->fk_user_action]->color !=
'') {
1073 $event_owner_style .=
'border-left: #' . $cache_user_list[$obj->fk_user_action]->color .
' 5px solid;';
1077 $event_more_class =
'';
1078 $event_start_date_css =
'';
1079 $event_end_date_css =
'';
1080 $event_start_date_time = $actionstatic->datep;
1081 if ($event_start_date_time > $now) {
1083 $event_more_class =
'event-future';
1084 $event_start_date_css = $event_end_date_css = $event_more_class;
1086 if ($obj->fulldayevent == 1) {
1087 $today_start_date_time = $today_start_time;
1089 $today_start_date_time = $now;
1093 $event_end_date_time =
$db->jdate($obj->dp2);
1094 if ($event_end_date_time !=
null && $event_end_date_time < $today_start_date_time) {
1096 $event_more_class =
'event-past';
1097 } elseif ($event_end_date_time ==
null && $event_start_date_time < $today_start_date_time) {
1099 $event_more_class =
'event-past';
1102 $event_more_class =
'event-current';
1104 $event_start_date_css = $event_end_date_css = $event_more_class;
1106 $event_start_date_css = $event_end_date_css = $event_more_class;
1108 print
'<tr class="oddeven row-with-select ' . ($event_more_class !=
'' ?
' '.$event_more_class :
'') .
'">';
1111 if (
$conf->main_checkbox_left_column) {
1112 print
'<td class="nowrap center">';
1113 if ($massactionbutton || $massaction) {
1115 if (in_array($obj->id, $arrayofselected)) {
1118 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1123 if (!empty($arrayfields[
'a.id'][
'checked'])) {
1124 print
'<td class="nowraponall">';
1125 print $actionstatic->getNomUrl(1, -1);
1130 if (!empty($arrayfields[
'a.datep'][
'checked'])) {
1131 print
'<td class="center nowraponall'.($event_start_date_css ?
' '.$event_start_date_css.
'x' :
'').
'"><span>';
1132 if (empty($obj->fulldayevent)) {
1133 print
'<div class="center inline-block lineheightsmall">';
1135 print
'<br><span class="opacitymedium hourspan">';
1141 print
'<div class="center inline-block lineheightsmall">';
1142 print
dol_print_date(
$db->jdate($obj->dp),
'day', ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1143 print
'<br><span class="opacitymedium hourspan">';
1150 if ($actionstatic->hasDelay() && $actionstatic->percentage >= 0 && $actionstatic->percentage < 100) {
1160 if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
1161 print
'<td class="center nowraponall'.($event_end_date_css ?
' '.$event_end_date_css.
'x' :
'').
'"><span>';
1162 if (empty($obj->fulldayevent)) {
1163 print
'<div class="center inline-block lineheightsmall">';
1165 print
'<br><span class="opacitymedium hourspan">';
1171 print
'<div class="center inline-block lineheightsmall">';
1172 print
dol_print_date(
$db->jdate($obj->dp2),
'day', ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1173 print
'<br><span class="opacitymedium hourspan">';
1174 print
dol_print_date(23*60*60+59*60+59,
'hourreduceformat',
'gmt');
1183 if (!empty($arrayfields[
'owner'][
'checked'])) {
1184 print
'<td class="tdoverflowmax125">';
1185 if ($obj->fk_user_action > 0 && !isset($cache_user_list[$obj->fk_user_action])) {
1187 $res = $userstatic->fetch($obj->fk_user_action);
1189 $cache_user_list[$obj->fk_user_action] = $userstatic;
1192 if (isset($cache_user_list[$obj->fk_user_action])) {
1193 print $cache_user_list[$obj->fk_user_action]->getNomUrl(-1,
'', 0, 0, 16, 0,
'firstelselast',
'');
1199 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
1200 print
'<td class="tdoverflowmax125 nowraponall">';
1202 print $actionstatic->getTypePicto();
1203 $labeltype = $obj->type_code;
1205 $labeltype =
'AC_OTH';
1207 if (!empty($actionstatic->code) && preg_match(
'/^TICKET_MSG/', $actionstatic->code)) {
1208 $labeltype = $langs->trans(
"Message");
1210 if (!empty($arraylist[$labeltype])) {
1211 $labeltype = $arraylist[$labeltype];
1213 if ($obj->type_code ==
'AC_OTH_AUTO' && ($obj->type_code != $obj->code) && $labeltype && !empty($arraylist[$obj->code])) {
1214 $labeltype .=
' - '.$arraylist[$obj->code];
1222 if (!empty($arrayfields[
'a.label'][
'checked'])) {
1223 print
'<td class="tdoverflowmax300" title="'.dolPrintHTMLForAttribute($actionstatic->label).
'">';
1229 if (!empty($arrayfields[
'a.note'][
'checked'])) {
1231 print
'<td class="minwidth150">';
1232 print
'<div class="small twolinesmax lineheightsmall minwidth150 maxwidth250 classfortooltip" title="'.dolPrintHTMLForAttribute($actionstatic->note_private).
'">';
1240 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1241 print
'<td class="tdoverflowmax150">';
1242 if ($obj->socid > 0) {
1243 $societestatic->id = $obj->socid;
1244 $societestatic->client = (int) $obj->client;
1245 $societestatic->name = (
string) $obj->societe;
1246 $societestatic->email = $obj->socemail;
1248 print $societestatic->getNomUrl(1,
'', 28);
1254 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
1255 print
'<td class="tdoverflowmax100">';
1256 if (!empty($actionstatic->socpeopleassigned)) {
1257 $contactList = array();
1258 foreach ($actionstatic->socpeopleassigned as $socpeopleassigned) {
1259 if (!isset($contactListCache[$socpeopleassigned[
'id']])) {
1262 if ($contact->fetch($socpeopleassigned[
'id']) > 0) {
1263 $contactListCache[$socpeopleassigned[
'id']] = $contact->getNomUrl(1,
'', 0);
1264 $contactList[] = $contact->getNomUrl(1,
'', 0);
1268 $contactList[] = $contactListCache[$socpeopleassigned[
'id']];
1271 if (!empty($contactList)) {
1272 print implode(
', ', $contactList);
1274 } elseif ($obj->fk_contact > 0) {
1276 $tmpcontact->fetch($obj->fk_contact);
1278 print $contactstatic->getNomUrl(1,
'', 0);
1284 if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
1285 print
'<td class="tdoverflowmax150 nowraponall">';
1286 if (isset($obj->elementtype) && !empty($obj->fk_element)) {
1287 if (isset($elementlinkcache[$obj->elementtype]) && isset($elementlinkcache[$obj->elementtype][$obj->fk_element])) {
1288 $link = $elementlinkcache[$obj->elementtype][$obj->fk_element];
1290 if (!isset($elementlinkcache[$obj->elementtype])) {
1291 $elementlinkcache[$obj->elementtype] = array();
1294 $elementlinkcache[$obj->elementtype][$obj->fk_element] = $link;
1302 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1304 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &
$totalarray);
1305 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1306 print $hookmanager->resPrint;
1309 if (!empty($arrayfields[
'a.datec'][
'checked'])) {
1311 print
'<td class="center nowrap">'.dol_print_date(
$db->jdate($obj->datec),
'dayhour',
'tzuserrel').
'</td>';
1314 if (!empty($arrayfields[
'a.tms'][
'checked'])) {
1315 print
'<td class="center nowrap">'.dol_print_date(
$db->jdate($obj->datem),
'dayhour',
'tzuserrel').
'</td>';
1318 if (!empty($arrayfields[
'a.import_key'][
'checked'])) {
1319 print
'<td class="center nowrap">'.dolPrintHTML($obj->import_key).
'</td>';
1322 if (!empty($arrayfields[
'a.percent'][
'checked'])) {
1323 $datep =
$db->jdate($obj->dp);
1324 print
'<td class="center nowrap">'.$actionstatic->LibStatut($obj->percent, 5, 0, $datep).
'</td>';
1327 if (!
$conf->main_checkbox_left_column) {
1328 print
'<td class="nowrap center">';
1329 if ($massactionbutton || $massaction) {
1331 if (in_array($obj->id, $arrayofselected)) {
1334 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1345 print
'<tr><td colspan="'.$totalarray[
'nbfield'].
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1349print
'</table>'.
"\n";
1352print
'</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...
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.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolPrintHTML($s, $allowiframe=0, $moreallowedtags=array())
Return a string (that can be on several lines) ready to be output on a HTML page.
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)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
print $langs trans('Date')." left Ref Label right Qty right Price right TotalHT right TotalTTC right right right right right right right right right centpercent right TotalHT right n right VAT right n right TotalVAT right n No sujeto a RE IRPF right TotalLT1 right n right TotalLT2 right n right TotalTTC right n takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency right TotalTTC takeposcustomercurrency right takeposcustomercurrency n right Paid right PaymentTypeShortLIQ right SELECT p pos_change as p datep as date
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.