33require
'../../main.inc.php';
41require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
46include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
47include_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);
119$showbirthday = empty($conf->use_javascript_ajax) ? (
GETPOSTINT(
"search_showbirthday") ?
GETPOSTINT(
"search_showbirthday") :
GETPOSTINT(
"showbirthday")) : 1;
120$search_categ_cus =
GETPOST(
"search_categ_cus",
"intcomma", 3) ?
GETPOST(
"search_categ_cus",
"intcomma", 3) : 0;
124$hookmanager->initHooks(array(
'agendalist'));
129$extrafields->fetch_name_optionals_label(
$object->table_element);
131$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
134 $filtert = (string) $user->id;
139$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
140$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
142if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
146$offset = $limit * $page;
148 $sortorder =
"DESC,DESC";
149 if ($search_status ==
'todo') {
150 $sortorder =
"DESC,DESC";
154 $sortfield =
"a.datep,a.id";
155 if ($search_status ==
'todo') {
156 $sortfield =
"a.datep,a.id";
163 $socid = $user->socid;
170if (!$user->hasRight(
'agenda',
'myactions',
'read')) {
173if (!$user->hasRight(
'agenda',
'allactions',
'read')) {
176if (!$user->hasRight(
'agenda',
'allactions',
'read') || $filter ==
'mine') {
177 $filtert = (string) $user->id;
182$arrayfields = array();
183foreach (
$object->fields as $key => $val) {
185 if (!empty($val[
'visible'])) {
186 $visible = (int)
dol_eval((
string) $val[
'visible'], 1);
187 $arrayfields[$tableprefix.
'.'.$key] = array(
188 'label' => $val[
'label'],
189 'checked' => (($visible < 0) ?
'0' :
'1'),
190 'enabled' => (string) (int) (abs($visible) != 3 && (bool)
dol_eval((string) $val[
'enabled'], 1)),
191 'position' => $val[
'position'],
192 'help' => isset($val[
'help']) ? $val[
'help'] :
''
198include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
201$arrayfields = array_merge($arrayfields, array(
202 'owner' => array(
'label' =>
"Owner",
'checked' =>
'1',
'position' => 46),
203 'c.libelle' => array(
'label' =>
"Type",
'checked' =>
'1',
'position' => 47),
204 's.nom' => array(
'label' =>
"ThirdParty",
'checked' =>
'1',
'position' => 54),
205 'a.fk_element' => array(
'label' =>
"LinkedObject",
'checked' =>
'1',
'position' => 86),
213if ($user->socid && $socid) {
222if (
GETPOST(
'cancel',
'alpha')) {
229 if (is_array($_POST)) {
230 foreach ($_POST as $key => $val) {
231 $param .=
'&'.urlencode($key).
'='.urlencode($val);
235 header(
"Location: ".DOL_URL_ROOT.
'/comm/action/index.php?'.$param);
239$parameters = array(
'id' => $socid);
240$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
246include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
248if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
253 $datestart_dtstart =
'';
254 $datestart_dtend =
'';
255 $dateend_dtstart =
'';
259 $search_import_key =
'';
267 $search_array_options = array();
270if (empty($reshook) && !empty($massaction)) {
273 switch ($massaction) {
274 case 'set_all_events_to_todo':
278 case 'set_all_events_to_in_progress':
282 case 'set_all_events_to_finished':
287 if (isset($percent)) {
288 foreach ($toselect as $toselectid) {
289 $result =
$object->updatePercent($toselectid, $percent);
299if (empty($reshook)) {
300 $objectclass =
'ActionComm';
301 $objectlabel =
'Events';
304 $permissiontodelete = $user->hasRight(
'agenda',
'allactions',
'delete');
305 $permissiontoadd = $user->hasRight(
'agenda',
'myactions',
'create');
306 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
314$form =
new Form($db);
315$userstatic =
new User($db);
319$societestatic =
new Societe($db);
320$contactstatic =
new Contact($db);
323$nav .= $form->selectDate($dateselect,
'dateselect', 0, 0, 1,
'', 1, 0);
324$nav .=
' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans(
"Refresh").
'">';
328$help_url =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
329$title = $langs->trans(
"Agenda");
330llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist');
336if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
337 $param .=
'&contextpage='.urlencode($contextpage);
339if ($limit > 0 && $limit != $conf->liste_limit) {
340 $param .=
'&limit='.((int) $limit);
342if ($actioncode !=
'') {
343 if (is_array($actioncode)) {
344 foreach ($actioncode as $str_action) {
345 $param .=
"&search_actioncode[]=".urlencode($str_action);
348 $param .=
"&search_actioncode=".urlencode($actioncode);
351if ($resourceid > 0) {
352 $param .=
"&search_resourceid=".urlencode((
string) ($resourceid));
354if ($search_status !=
'') {
355 $param .=
"&search_status=".urlencode($search_status);
357if ($search_import_key !=
'') {
358 $param .=
"&search_import_key=".urlencode($search_import_key);
361 $param .=
"&search_filter=".urlencode((
string) $filter);
364 $param .=
"&search_filtert=".urlencode((
string) $filtert);
367 $param .=
"&search_usergroup=".urlencode((
string) ($usergroup));
370 $param .=
"&search_socid=".urlencode((
string) ($socid));
373 $param .=
"&search_showbirthday=1";
376 $param .=
"&search_projectid=".urlencode((
string) ($pid));
379 $param .=
"&search_type=".urlencode($type);
381if ($search_id !=
'') {
382 $param .=
'&search_id='.urlencode($search_id);
384if ($search_title !=
'') {
385 $param .=
'&search_title='.urlencode($search_title);
387if ($search_note !=
'') {
388 $param .=
'&search_note='.urlencode($search_note);
391 $param .=
'&datestart_dtstartday='.GETPOSTINT(
'datestart_dtstartday');
394 $param .=
'&datestart_dtstartmonth='.GETPOSTINT(
'datestart_dtstartmonth');
397 $param .=
'&datestart_dtstartyear='.GETPOSTINT(
'datestart_dtstartyear');
400 $param .=
'&datestart_dtendday='.GETPOSTINT(
'datestart_dtendday');
403 $param .=
'&datestart_dtendmonth='.GETPOSTINT(
'datestart_dtendmonth');
406 $param .=
'&datestart_dtendyear='.GETPOSTINT(
'datestart_dtendyear');
409 $param .=
'&dateend_dtstartday='.GETPOSTINT(
'dateend_dtstartday');
412 $param .=
'&dateend_dtstartmonth='.GETPOSTINT(
'dateend_dtstartmonth');
415 $param .=
'&dateend_dtstartyear='.GETPOSTINT(
'dateend_dtstartyear');
418 $param .=
'&dateend_dtendday='.GETPOSTINT(
'dateend_dtendday');
421 $param .=
'&dateend_dtendmonth='.GETPOSTINT(
'dateend_dtendmonth');
424 $param .=
'&dateend_dtendyear='.GETPOSTINT(
'dateend_dtendyear');
426if ($optioncss !=
'') {
427 $param .=
'&optioncss='.urlencode($optioncss);
429if ($search_categ_cus != 0) {
430 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
434include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
436$paramnoactionodate = $param;
439$arrayofmassactions = array(
440 'set_all_events_to_todo' =>
img_picto(
'',
'circle',
'class="pictofixedwidth font-status1"').$langs->trans(
"SetAllEventsToTodo"),
441 'set_all_events_to_in_progress' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth font-status2"').$langs->trans(
"SetAllEventsToInProgress"),
442 'set_all_events_to_finished' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth badge-status5"').$langs->trans(
"SetAllEventsToFinished"),
444if ($user->hasRight(
'agenda',
'allactions',
'delete')) {
445 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
447if (
isModEnabled(
'category') && $user->hasRight(
'agenda',
'myactions',
'create')) {
448 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
450if (
GETPOSTINT(
'nomassaction') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
451 $arrayofmassactions = array();
453$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
456$sql .=
" a.datep as dp, a.id, a.code, a.label, a.note, a.datep2 as dp2, a.fulldayevent, a.location, a.entity,";
457$sql .=
" a.fk_user_author, a.fk_user_action,";
458$sql .=
" a.fk_contact, a.note, a.percent as percent,";
459$sql .=
" a.fk_element, a.elementtype, a.datec, a.tms as datem,";
460$sql .=
" a.recurid, a.recurrule, a.recurdateend, a.import_key,";
461$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,";
462$sql .=
" s.nom as societe, s.rowid as socid, s.client, s.email as socemail";
466if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
467 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
468 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
473$parameters = array();
474$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
475$sql .= $hookmanager->resPrint;
479$sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a";
480$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"actioncomm_extrafields as ef ON a.id = ef.fk_object";
481$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
482$sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"c_actioncomm as c ON c.id = a.fk_action";
484if ($resourceid > 0) {
485 $sql .=
" INNER JOIN ".MAIN_DB_PREFIX.
"element_resources as r ON r.element_type = 'action' AND r.element_id = a.id";
488$parameters = array();
489$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
490$sql .= $hookmanager->resPrint;
492$sql .=
" WHERE a.entity IN (".getEntity(
'agenda').
")";
494if (!empty($actioncode)) {
496 if ((is_array($actioncode) && in_array(
'AC_NON_AUTO', $actioncode)) || $actioncode ==
'AC_NON_AUTO') {
497 $sql .=
" AND c.type != 'systemauto'";
498 } elseif ((is_array($actioncode) && in_array(
'AC_ALL_AUTO', $actioncode)) || $actioncode ==
'AC_ALL_AUTO') {
499 $sql .=
" AND c.type = 'systemauto'";
501 if ((is_array($actioncode) && in_array(
'AC_OTH', $actioncode)) || $actioncode ==
'AC_OTH') {
502 $sql .=
" AND c.type != 'systemauto'";
504 if ((is_array($actioncode) && in_array(
'AC_OTH_AUTO', $actioncode)) || $actioncode ==
'AC_OTH_AUTO') {
505 $sql .=
" AND c.type = 'systemauto'";
509 if ((is_array($actioncode) && in_array(
'AC_NON_AUTO', $actioncode)) || $actioncode ===
'AC_NON_AUTO') {
510 $sql .=
" AND c.type != 'systemauto'";
511 } elseif ((is_array($actioncode) && in_array(
'AC_ALL_AUTO', $actioncode)) || $actioncode ===
'AC_ALL_AUTO') {
512 $sql .=
" AND c.type = 'systemauto'";
514 if (is_array($actioncode)) {
516 $actioncode = array_filter(
523 return ((
string) $value !==
'-1');
526 if (count($actioncode)) {
527 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", $actioncode).
"'", 1).
")";
529 } elseif ($actioncode !==
'-1') {
530 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", explode(
',', $actioncode)).
"'", 1).
")";
535if ($resourceid > 0) {
536 $sql .=
" AND r.resource_id = ".((int) $resourceid);
539 $sql .=
" AND a.fk_project=".((int) $pid);
544if (
isModEnabled(
"societe") && !$user->hasRight(
'societe',
'client',
'voir')) {
545 $search_sale = $user->id;
548if ($search_sale && $search_sale !=
'-1') {
549 if ($search_sale == -2) {
550 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = a.fk_soc)";
551 } elseif ($search_sale > 0) {
552 $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).
"))";
557 $sql .=
" AND a.fk_soc = ".((int) $socid);
560 $sql .=
" AND c.id = ".((int) $type);
562if ($search_status ==
'0') {
564 $sql .=
" AND a.percent = 0";
566if ($search_status ==
'na') {
568 $sql .=
" AND a.percent = -1";
570if ($search_status ==
'50') {
572 $sql .=
" AND (a.percent > 0 AND a.percent < 100)";
574if ($search_status ==
'done' || $search_status ==
'100') {
575 $sql .=
" AND (a.percent = 100)";
577if ($search_status ==
'todo') {
578 $sql .=
" AND (a.percent >= 0 AND a.percent < 100)";
580if ($search_import_key) {
594if ($dateselect > 0) {
595 $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).
"'))";
597if ($datestart_dtstart > 0) {
598 $sql .=
" AND a.datep >= '".$db->idate($datestart_dtstart).
"'";
600if ($datestart_dtend > 0) {
601 $sql .=
" AND a.datep <= '".$db->idate($datestart_dtend).
"'";
603if ($dateend_dtstart > 0) {
604 $sql .=
" AND a.datep2 >= '".$db->idate($dateend_dtstart).
"'";
606if ($dateend_dtend > 0) {
607 $sql .=
" AND a.datep2 <= '".$db->idate($dateend_dtend).
"'";
611if ($search_categ_cus != -1) {
612 if ($search_categ_cus == -2) {
613 $sql .=
" AND NOT EXISTS (SELECT ca.fk_actioncomm FROM ".MAIN_DB_PREFIX.
"categorie_actioncomm as ca WHERE ca.fk_actioncomm = a.id)";
614 } elseif ($search_categ_cus > 0) {
615 $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).
"))";
620include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
623$parameters = array();
624$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
625$sql .= $hookmanager->resPrint;
630if (($filtert !=
'-1' && $filtert !=
'-2') || $usergroup > 0) {
631 if ($filtert !=
'' && $filtert !=
'-1' && $filtert !=
'-2' && $filtert !=
'-3') {
632 $where1 =
"a.fk_user_action = ".((int) $filtert);
633 $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).
"))";
634 $sql1 = $sql .
" AND " . $where1;
635 $sql2 = $sql .
" AND " . $where2;
636 $sql .=
" AND ((" . $where1 .
") OR (" . $where2.
"))";
637 } elseif ($filtert ==
'-3') {
639 $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))).
"))";
640 } elseif ($usergroup > 0) {
642 $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).
"))";
648$nbtotalofrecords =
'';
651 if (empty($sql1) && empty($sql2)) {
652 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
653 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
657 $resql = $db->query($sqlforcount);
659 $objforcount = $db->fetch_object($resql);
660 $nbtotalofrecords = (int) $objforcount->nbtotalofrecords;
667 $sqlforcount1 = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql1);
668 $sqlforcount2 = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql2);
670 $resql1 = $db->query($sqlforcount1);
671 $resql2 = $db->query($sqlforcount2);
672 if ($resql1 && $resql2) {
673 $objforcount1 = $db->fetch_object($resql1);
674 $objforcount2 = $db->fetch_object($resql2);
675 $nbtotalofrecords = (int) $objforcount1->nbtotalofrecords + (
int) $objforcount2->nbtotalofrecords;
684 if (($page * $limit) > (
int) $nbtotalofrecords) {
691$sql .= $db->order($sortfield, $sortorder);
693 $sql .= $db->plimit($limit + 1, $offset);
696$resql = $db->query($sql);
702$num = $db->num_rows($resql);
704$arrayofselected = is_array($toselect) ? $toselect : array();
707$newtitle =
'<div class="nowrap clear inline-block minheight30">';
708$newtitle .=
'<input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans(
"LocalAgenda").
' ';
709$newtitle .=
'</div>';
712$tabactive =
'cardlist';
716print
'<form method="POST" id="searchFormList" class="listactionsfilter" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
718if ($optioncss !=
'') {
719 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
721print
'<input type="hidden" name="token" value="'.newToken().
'">';
722print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
723print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
724print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
725print
'<input type="hidden" name="type" value="'.$type.
'">';
729 $nav .=
'<input type="hidden" name="search_filter" value="'.$filter.
'">';
732 $nav .=
'<input type="hidden" name="search_showbirthday" value="1">';
740$parameters = array();
741$reshook = $hookmanager->executeHooks(
'addCalendarChoice', $parameters, $object, $action);
742if (empty($reshook)) {
743 $s .= $hookmanager->resPrint;
744} elseif ($reshook > 1) {
745 $s = $hookmanager->resPrint;
752$viewmode =
'<div class="navmode inline-block">';
754$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.
'">';
756$viewmode .=
img_picto($langs->trans(
"List"),
'object_calendarlist',
'class="imgforviewmode pictoactionview block"');
758$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewList").
'</span></a>';
760$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.
'">';
762$viewmode .=
img_picto($langs->trans(
"ViewCal"),
'object_calendarmonth',
'class="pictoactionview block"');
764$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewCal").
'</span></a>';
766$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.
'">';
768$viewmode .=
img_picto($langs->trans(
"ViewWeek"),
'object_calendarweek',
'class="pictoactionview block"');
770$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewWeek").
'</span></a>';
772$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.
'">';
774$viewmode .=
img_picto($langs->trans(
"ViewDay"),
'object_calendarday',
'class="pictoactionview block"');
776$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow">'.$langs->trans(
"ViewDay").
'</span></a>';
778$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.
'">';
780$viewmode .=
img_picto($langs->trans(
"ViewPerUser"),
'object_calendarperuser',
'class="pictoactionview block"');
782$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone inline-block width75 divoverflow" title="'.dolPrintHTML($langs->trans(
"ViewPerUser")).
'">'.$langs->trans(
"ViewPerUser").
'</span></a>';
785$parameters = array();
786$reshook = $hookmanager->executeHooks(
'addCalendarView', $parameters, $object, $action);
787if (empty($reshook)) {
788 $viewmode .= $hookmanager->resPrint;
789} elseif ($reshook > 1) {
790 $viewmode = $hookmanager->resPrint;
793$viewmode .=
'</div>';
795$viewmode .=
'<span class="marginrightonly"></span>';
799$newparam =
'?month='.str_pad((
string) $month, 2,
"0", STR_PAD_LEFT).
'&year='.$tmpforcreatebutton[
'year'];
801$url = DOL_URL_ROOT.
'/comm/action/card.php?action=create';
802$url .=
'&apyear='.$tmpforcreatebutton[
'year'].
'&apmonth='.$tmpforcreatebutton[
'mon'].
'&apday='.$tmpforcreatebutton[
'mday'];
803$url .=
'&aphour='.$tmpforcreatebutton[
'hours'].
'&apmin='.$tmpforcreatebutton[
'minutes'];
804$url .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].$newparam);
806$newcardbutton =
dolGetButtonTitle($langs->trans(
'AddAction'),
'',
'fa fa-plus-circle', $url,
'', (
int) ($user->hasRight(
'agenda',
'myactions',
'create') || $user->hasRight(
'agenda',
'allactions',
'create')));
808$param .=
'&mode='.urlencode($mode);
811print_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);
816include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
820$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
821$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
822if ($massactionbutton) {
823 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
827print
'<div class="liste_titre liste_titre_bydiv centpercent">';
828print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday,
'', $filtert,
'', $pid, $socid, $action, -1, $actioncode, $usergroup,
'', $resourceid, $search_categ_cus, $search_import_key);
833print
'<div class="div-table-responsive">';
834print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
836print
'<tr class="liste_titre_filter">';
839 print
'<td class="liste_titre" align="middle">';
840 $searchpicto = $form->showFilterButtons(
'left');
844if (!empty($arrayfields[
'a.id'][
'checked'])) {
845 print
'<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.
'"></td>';
847if (!empty($arrayfields[
'a.datep'][
'checked'])) {
848 print
'<td class="liste_titre nowraponall center">';
849 print
'<div class="nowrap">';
850 print $form->selectDate($datestart_dtstart,
'datestart_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
852 print
'<div class="nowrap">';
853 print $form->selectDate($datestart_dtend,
'datestart_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
857if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
858 print
'<td class="liste_titre nowraponall center">';
859 print
'<div class="nowrap">';
860 print $form->selectDate($dateend_dtstart,
'dateend_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
862 print
'<div class="nowrap">';
863 print $form->selectDate($dateend_dtend,
'dateend_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
867if (!empty($arrayfields[
'owner'][
'checked'])) {
868 print
'<td class="liste_titre"></td>';
870if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
871 print
'<td class="liste_titre"></td>';
873if (!empty($arrayfields[
'a.label'][
'checked'])) {
874 print
'<td class="liste_titre"><input type="text" class="maxwidth125" name="search_title" value="'.$search_title.
'"></td>';
876if (!empty($arrayfields[
'a.note'][
'checked'])) {
877 print
'<td class="liste_titre"><input type="text" class="maxwidth75" name="search_note" value="'.$search_note.
'"></td>';
879if (!empty($arrayfields[
's.nom'][
'checked'])) {
880 print
'<td class="liste_titre"></td>';
882if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
883 print
'<td class="liste_titre"></td>';
885if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
886 print
'<td class="liste_titre"></td>';
890include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
893$parameters = array(
'arrayfields' => $arrayfields);
894$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
895print $hookmanager->resPrint;
897if (!empty($arrayfields[
'a.datec'][
'checked'])) {
898 print
'<td class="liste_titre"></td>';
900if (!empty($arrayfields[
'a.tms'][
'checked'])) {
901 print
'<td class="liste_titre"></td>';
903if (!empty($arrayfields[
'a.import_key'][
'checked'])) {
904 print
'<td class="liste_titre center"><input type="text" class="maxwidth75" name="search_import_key" value="'.$search_import_key.
'"></td>';
907if (!empty($arrayfields[
'a.percent'][
'checked'])) {
908 print
'<td class="liste_titre center parentonrightofpage">';
909 $formactions->form_select_status_action(
'formaction', $search_status, 1,
'search_status', 1, 2,
'search_status width100 onrightofpage');
914 print
'<td class="liste_titre center">';
915 $searchpicto = $form->showFilterButtons();
926print
'<tr class="liste_titre">';
928 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
931if (!empty($arrayfields[
'a.id'][
'checked'])) {
933 print_liste_field_titre($arrayfields[
'a.id'][
'label'], $_SERVER[
"PHP_SELF"],
"a.id",
"", $param,
"", $sortfield, $sortorder);
936if (!empty($arrayfields[
'a.datep'][
'checked'])) {
937 print_liste_field_titre($arrayfields[
'a.datep'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep,a.id",
"", $param,
'', $sortfield, $sortorder,
'center ');
940if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
941 print_liste_field_titre($arrayfields[
'a.datep2'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep2",
"", $param,
'', $sortfield, $sortorder,
'center ');
944if (!empty($arrayfields[
'owner'][
'checked'])) {
945 print_liste_field_titre($arrayfields[
'owner'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder);
948if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
949 print_liste_field_titre($arrayfields[
'c.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.libelle",
"", $param,
"", $sortfield, $sortorder);
952if (!empty($arrayfields[
'a.label'][
'checked'])) {
953 print_liste_field_titre($arrayfields[
'a.label'][
'label'], $_SERVER[
"PHP_SELF"],
"a.label",
"", $param,
"", $sortfield, $sortorder);
956if (!empty($arrayfields[
'a.note'][
'checked'])) {
957 print_liste_field_titre($arrayfields[
'a.note'][
'label'], $_SERVER[
"PHP_SELF"],
"a.note",
"", $param,
"", $sortfield, $sortorder);
960if (!empty($arrayfields[
's.nom'][
'checked'])) {
961 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
"", $sortfield, $sortorder);
964if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
965 print_liste_field_titre($arrayfields[
'a.fk_contact'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder);
968if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
969 print_liste_field_titre($arrayfields[
'a.fk_element'][
'label'], $_SERVER[
"PHP_SELF"],
"",
"", $param,
"", $sortfield, $sortorder);
973include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
975$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder);
976$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
977print $hookmanager->resPrint;
979if (!empty($arrayfields[
'a.datec'][
'checked'])) {
980 print_liste_field_titre($arrayfields[
'a.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datec,a.id",
"", $param,
'', $sortfield, $sortorder,
'center ');
983if (!empty($arrayfields[
'a.tms'][
'checked'])) {
984 print_liste_field_titre($arrayfields[
'a.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"a.tms,a.id",
"", $param,
'', $sortfield, $sortorder,
'center ');
988if (!empty($arrayfields[
'a.import_key'][
'checked'])) {
989 print_liste_field_titre(
"ImportId", $_SERVER[
"PHP_SELF"],
"a.import_key",
"", $param,
'', $sortfield, $sortorder,
'center ');
993if (!empty($arrayfields[
'a.percent'][
'checked'])) {
994 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"a.percent",
"", $param,
'', $sortfield, $sortorder,
'center ');
998 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'maxwidthsearch center ');
1004$delay_warning =
getDolGlobalInt(
'MAIN_DELAY_ACTIONS_TODO') * 24 * 60 * 60;
1005$today_start_time =
dol_mktime(0, 0, 0, (
int)
date(
'm', $now), (
int)
date(
'd', $now), (
int)
date(
'Y', $now));
1007require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/cactioncomm.class.php';
1009$arraylist = $caction->liste_array(1,
'code',
'', (!
getDolGlobalString(
'AGENDA_USE_EVENT_TYPE') ? 1 : 0),
'', 1);
1010$contactListCache = array();
1011$elementlinkcache = array();
1018$imaxinloop = ($limit ? min($num, $limit) : $num);
1019$cache_user_list = array();
1020while ($i < $imaxinloop) {
1021 $obj = $db->fetch_object($resql);
1027 $object->setVarsFromFetchObj($obj);
1030 if (
getDolGlobalString(
'AGENDA_ALWAYS_HIDE_AUTO') && $obj->type_code ==
'AC_OTH_AUTO') {
1035 $actionstatic->id = $obj->id;
1036 $actionstatic->ref = $obj->id;
1037 $actionstatic->code = $obj->code;
1038 $actionstatic->label = $obj->label;
1039 $actionstatic->location = $obj->location;
1041 $actionstatic->datep = $db->jdate($obj->dp);
1042 $actionstatic->percentage = $obj->percent;
1043 $actionstatic->authorid = $obj->fk_user_author;
1044 $actionstatic->userownerid = $obj->fk_user_action;
1045 $actionstatic->recurid = $obj->recurid;
1046 $actionstatic->recurrule = $obj->recurrule;
1047 $actionstatic->recurdateend = $db->jdate($obj->recurdateend);
1049 $actionstatic->type = $obj->type_type;
1050 $actionstatic->type_code = $obj->type_code;
1051 $actionstatic->type_label = $obj->type_label;
1052 $actionstatic->type_picto = $obj->type_picto;
1053 $actionstatic->type_color = $obj->type_color;
1058 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
1059 $actionstatic->fetchResources();
1063 if ($obj->fk_user_action > 0 && !isset($cache_user_list[$obj->fk_user_action])) {
1064 $userstatic =
new User($db);
1065 $res = $userstatic->fetch($obj->fk_user_action);
1067 $cache_user_list[$obj->fk_user_action] = $userstatic;
1072 $event_owner_style =
'';
1074 if ($obj->fk_user_action > 0 && $cache_user_list[$obj->fk_user_action]->color !=
'') {
1075 $event_owner_style .=
'border-left: #' . $cache_user_list[$obj->fk_user_action]->color .
' 5px solid;';
1079 $event_more_class =
'';
1080 $event_start_date_css =
'';
1081 $event_end_date_css =
'';
1082 $event_start_date_time = $actionstatic->datep;
1083 if ($event_start_date_time > $now) {
1085 $event_more_class =
'event-future';
1086 $event_start_date_css = $event_end_date_css = $event_more_class;
1088 if ($obj->fulldayevent == 1) {
1089 $today_start_date_time = $today_start_time;
1091 $today_start_date_time = $now;
1095 $event_end_date_time = $db->jdate($obj->dp2);
1096 if ($event_end_date_time !=
null && $event_end_date_time < $today_start_date_time) {
1098 $event_more_class =
'event-past';
1099 } elseif ($event_end_date_time ==
null && $event_start_date_time < $today_start_date_time) {
1101 $event_more_class =
'event-past';
1104 $event_more_class =
'event-current';
1106 $event_start_date_css = $event_end_date_css = $event_more_class;
1108 $event_start_date_css = $event_end_date_css = $event_more_class;
1110 print
'<tr class="oddeven row-with-select ' . ($event_more_class !=
'' ?
' '.$event_more_class :
'') .
'">';
1114 print
'<td class="nowrap center">';
1115 if ($massactionbutton || $massaction) {
1117 if (in_array($obj->id, $arrayofselected)) {
1120 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1125 if (!empty($arrayfields[
'a.id'][
'checked'])) {
1126 print
'<td class="nowraponall">';
1127 print $actionstatic->getNomUrl(1, -1);
1132 if (!empty($arrayfields[
'a.datep'][
'checked'])) {
1133 print
'<td class="center nowraponall'.($event_start_date_css ?
' '.$event_start_date_css.
'x' :
'').
'"><span>';
1134 if (empty($obj->fulldayevent)) {
1135 print
'<div class="center inline-block lineheightsmall">';
1136 print
dol_print_date($db->jdate($obj->dp),
'dayreduceformat',
'tzuserrel');
1137 print
'<br><span class="opacitymedium hourspan">';
1138 print
dol_print_date($db->jdate($obj->dp),
'hourreduceformat',
'tzuserrel');
1143 print
'<div class="center inline-block lineheightsmall">';
1144 print
dol_print_date($db->jdate($obj->dp),
'day', ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1145 print
'<br><span class="opacitymedium hourspan">';
1152 if ($actionstatic->hasDelay() && $actionstatic->percentage >= 0 && $actionstatic->percentage < 100) {
1162 if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
1163 print
'<td class="center nowraponall'.($event_end_date_css ?
' '.$event_end_date_css.
'x' :
'').
'"><span>';
1164 if (empty($obj->fulldayevent)) {
1165 print
'<div class="center inline-block lineheightsmall">';
1166 print
dol_print_date($db->jdate($obj->dp2),
'dayreduceformat',
'tzuserrel');
1167 print
'<br><span class="opacitymedium hourspan">';
1168 print
dol_print_date($db->jdate($obj->dp2),
'hourreduceformat',
'tzuserrel');
1173 print
'<div class="center inline-block lineheightsmall">';
1174 print
dol_print_date($db->jdate($obj->dp2),
'day', ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1175 print
'<br><span class="opacitymedium hourspan">';
1176 print
dol_print_date(23*60*60+59*60+59,
'hourreduceformat',
'gmt');
1185 if (!empty($arrayfields[
'owner'][
'checked'])) {
1186 print
'<td class="tdoverflowmax125">';
1187 if ($obj->fk_user_action > 0 && !isset($cache_user_list[$obj->fk_user_action])) {
1188 $userstatic =
new User($db);
1189 $res = $userstatic->fetch($obj->fk_user_action);
1191 $cache_user_list[$obj->fk_user_action] = $userstatic;
1194 if (isset($cache_user_list[$obj->fk_user_action])) {
1195 print $cache_user_list[$obj->fk_user_action]->getNomUrl(-1,
'', 0, 0, 16, 0,
'firstelselast',
'');
1201 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
1202 print
'<td class="tdoverflowmax125 nowraponall">';
1204 print $actionstatic->getTypePicto();
1205 $labeltype = $obj->type_code;
1207 $labeltype =
'AC_OTH';
1209 if (!empty($actionstatic->code) && preg_match(
'/^TICKET_MSG/', $actionstatic->code)) {
1210 $labeltype = $langs->trans(
"Message");
1212 if (!empty($arraylist[$labeltype])) {
1213 $labeltype = $arraylist[$labeltype];
1215 if ($obj->type_code ==
'AC_OTH_AUTO' && ($obj->type_code != $obj->code) && $labeltype && !empty($arraylist[$obj->code])) {
1216 $labeltype .=
' - '.$arraylist[$obj->code];
1224 if (!empty($arrayfields[
'a.label'][
'checked'])) {
1225 print
'<td class="tdoverflowmax300" title="'.dolPrintHTMLForAttribute($actionstatic->label).
'">';
1231 if (!empty($arrayfields[
'a.note'][
'checked'])) {
1233 print
'<td class="minwidth150">';
1234 print
'<div class="small twolinesmax lineheightsmall minwidth150 maxwidth250 classfortooltip" title="'.dolPrintHTMLForAttribute($actionstatic->note_private).
'">';
1242 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1243 print
'<td class="tdoverflowmax150">';
1244 if ($obj->socid > 0) {
1245 $societestatic->id = $obj->socid;
1246 $societestatic->client = (int) $obj->client;
1247 $societestatic->name = (string) $obj->societe;
1248 $societestatic->email = $obj->socemail;
1250 print $societestatic->getNomUrl(1,
'', 28);
1256 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
1257 print
'<td class="tdoverflowmax100">';
1258 if (!empty($actionstatic->socpeopleassigned)) {
1259 $contactList = array();
1260 foreach ($actionstatic->socpeopleassigned as $socpeopleassigned) {
1261 if (!isset($contactListCache[$socpeopleassigned[
'id']])) {
1264 if ($contact->fetch($socpeopleassigned[
'id']) > 0) {
1265 $contactListCache[$socpeopleassigned[
'id']] = $contact->getNomUrl(1,
'', 0);
1266 $contactList[] = $contact->getNomUrl(1,
'', 0);
1270 $contactList[] = $contactListCache[$socpeopleassigned[
'id']];
1273 if (!empty($contactList)) {
1274 print implode(
', ', $contactList);
1276 } elseif ($obj->fk_contact > 0) {
1277 $tmpcontact =
new Contact($db);
1278 $tmpcontact->fetch($obj->fk_contact);
1280 print $contactstatic->getNomUrl(1,
'', 0);
1286 if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
1287 print
'<td class="tdoverflowmax150 nowraponall">';
1288 if (isset($obj->elementtype) && !empty($obj->fk_element)) {
1289 if (isset($elementlinkcache[$obj->elementtype]) && isset($elementlinkcache[$obj->elementtype][$obj->fk_element])) {
1290 $link = $elementlinkcache[$obj->elementtype][$obj->fk_element];
1292 if (!isset($elementlinkcache[$obj->elementtype])) {
1293 $elementlinkcache[$obj->elementtype] = array();
1296 $elementlinkcache[$obj->elementtype][$obj->fk_element] = $link;
1304 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1306 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
1307 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1308 print $hookmanager->resPrint;
1311 if (!empty($arrayfields[
'a.datec'][
'checked'])) {
1313 print
'<td class="center nowrap">'.dol_print_date($db->jdate($obj->datec),
'dayhour',
'tzuserrel').
'</td>';
1316 if (!empty($arrayfields[
'a.tms'][
'checked'])) {
1317 print
'<td class="center nowrap">'.dol_print_date($db->jdate($obj->datem),
'dayhour',
'tzuserrel').
'</td>';
1320 if (!empty($arrayfields[
'a.import_key'][
'checked'])) {
1321 print
'<td class="center nowrap">'.dolPrintHTML($obj->import_key).
'</td>';
1324 if (!empty($arrayfields[
'a.percent'][
'checked'])) {
1325 $datep = $db->jdate($obj->dp);
1326 print
'<td class="center nowrap">'.$actionstatic->LibStatut($obj->percent, 5, 0, $datep).
'</td>';
1330 print
'<td class="nowrap center">';
1331 if ($massactionbutton || $massaction) {
1333 if (in_array($obj->id, $arrayofselected)) {
1336 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1347 print
'<tr><td colspan="'.$totalarray[
'nbfield'].
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1351print
'</table>'.
"\n";
1354print
'</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.
dolGetFirstLineOfText($text, $nboflines=1, $charset='UTF-8')
Return first line of text.
dolPrintHTML($s, $allowiframe=0)
Return a string (that can be on several lines) ready to be output on a HTML page.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
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.
if(getDolGlobalString( 'TAKEPOS_SHOW_CUSTOMER')) print $langs trans('Date')." left 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 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.