31require
'../../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
38include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
41$langs->loadLangs(array(
"users",
"companies",
"agenda",
"commercial",
"other",
"orders",
"bills"));
44$action =
GETPOST(
'action',
'aZ09');
45$massaction =
GETPOST(
'massaction',
'alpha');
46$confirm =
GETPOST(
'confirm',
'alpha');
47$cancel =
GETPOST(
'cancel',
'alpha');
48$toselect =
GETPOST(
'toselect',
'array');
49$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'actioncommlist';
50$optioncss =
GETPOST(
'optioncss',
'alpha');
53$disabledefaultvalues =
GETPOST(
'disabledefaultvalues',
'int');
56if (empty($mode) && preg_match(
'/show_/', $action)) {
59$resourceid =
GETPOST(
"search_resourceid",
"int") ?
GETPOST(
"search_resourceid",
"int") :
GETPOST(
"resourceid",
"int");
60$pid =
GETPOST(
"search_projectid",
'int', 3) ?
GETPOST(
"search_projectid",
'int', 3) :
GETPOST(
"projectid",
'int', 3);
61$search_status = (
GETPOST(
"search_status",
'aZ09') !=
'') ?
GETPOST(
"search_status",
'aZ09') :
GETPOST(
"status",
'aZ09');
62$type =
GETPOST(
'search_type',
'alphanohtml') ?
GETPOST(
'search_type',
'alphanohtml') :
GETPOST(
'type',
'alphanohtml');
64$month =
GETPOST(
"month",
'int');
68if (
GETPOST(
'search_actioncode',
'array')) {
69 $actioncode =
GETPOST(
'search_actioncode',
'array', 3);
70 if (!count($actioncode)) {
74 $actioncode =
GETPOST(
"search_actioncode",
"alpha", 3) ?
GETPOST(
"search_actioncode",
"alpha", 3) : (
GETPOST(
"search_actioncode") ==
'0' ?
'0' : ((empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE) || $disabledefaultvalues) ?
'' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE));
78$search_id =
GETPOST(
'search_id',
'alpha');
79$search_title =
GETPOST(
'search_title',
'alpha');
80$search_note =
GETPOST(
'search_note',
'alpha');
83$datestart_dtstart =
dol_mktime(0, 0, 0,
GETPOST(
'datestart_dtstartmonth',
'int'),
GETPOST(
'datestart_dtstartday',
'int'),
GETPOST(
'datestart_dtstartyear',
'int'),
'tzuserrel');
84$datestart_dtend =
dol_mktime(23, 59, 59,
GETPOST(
'datestart_dtendmonth',
'int'),
GETPOST(
'datestart_dtendday',
'int'),
GETPOST(
'datestart_dtendyear',
'int'),
'tzuserrel');
85$dateend_dtstart =
dol_mktime(0, 0, 0,
GETPOST(
'dateend_dtstartmonth',
'int'),
GETPOST(
'dateend_dtstartday',
'int'),
GETPOST(
'dateend_dtstartyear',
'int'),
'tzuserrel');
86$dateend_dtend =
dol_mktime(23, 59, 59,
GETPOST(
'dateend_dtendmonth',
'int'),
GETPOST(
'dateend_dtendday',
'int'),
GETPOST(
'dateend_dtendyear',
'int'),
'tzuserrel');
87if ($search_status ==
'' && !GETPOSTISSET(
'search_status')) {
88 $search_status = ((empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) || $disabledefaultvalues) ?
'' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
90if (empty($mode) && !GETPOSTISSET(
'mode')) {
91 $mode = (empty($conf->global->AGENDA_DEFAULT_VIEW) ?
'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
94$filter =
GETPOST(
"search_filter",
'alpha', 3) ?
GETPOST(
"search_filter",
'alpha', 3) :
GETPOST(
"filter",
'alpha', 3);
95$filtert =
GETPOST(
"search_filtert",
"int", 3) ?
GETPOST(
"search_filtert",
"int", 3) :
GETPOST(
"filtert",
"int", 3);
96$usergroup =
GETPOST(
"search_usergroup",
"int", 3) ?
GETPOST(
"search_usergroup",
"int", 3) :
GETPOST(
"usergroup",
"int", 3);
97$showbirthday = empty($conf->use_javascript_ajax) ? (
GETPOST(
"search_showbirthday",
"int") ?
GETPOST(
"search_showbirthday",
"int") :
GETPOST(
"showbirthday",
"int")) : 1;
101$hookmanager->initHooks(array(
'agendalist'));
106$extrafields->fetch_name_optionals_label($object->table_element);
108$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
110if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS)) {
111 $filtert = $user->id;
115$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
116$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
117$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
118$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
119if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
123$offset = $limit * $page;
125 $sortorder =
"DESC,DESC";
126 if ($search_status ==
'todo') {
127 $sortorder =
"DESC,DESC";
131 $sortfield =
"a.datep,a.id";
132 if ($search_status ==
'todo') {
133 $sortfield =
"a.datep,a.id";
140 $socid = $user->socid;
147if (!$user->hasRight(
'agenda',
'myactions',
'read')) {
150if (!$user->hasRight(
'agenda',
'allactions',
'read')) {
153if (!$user->hasRight(
'agenda',
'allactions',
'read') || $filter ==
'mine') {
154 $filtert = $user->id;
158 'a.id'=>array(
'label'=>
"Ref",
'checked'=>1),
159 'owner'=>array(
'label'=>
"Owner",
'checked'=>1),
160 'c.libelle'=>array(
'label'=>
"Type",
'checked'=>1),
161 'a.label'=>array(
'label'=>
"Title",
'checked'=>1),
162 'a.note'=>array(
'label'=>
'Description',
'checked'=>0),
163 'a.datep'=>array(
'label'=>
"DateStart",
'checked'=>1),
164 'a.datep2'=>array(
'label'=>
"DateEnd",
'checked'=>1),
165 's.nom'=>array(
'label'=>
"ThirdParty",
'checked'=>1),
166 'a.fk_contact'=>array(
'label'=>
"Contact",
'checked'=>0),
167 'a.fk_element'=>array(
'label'=>
"LinkedObject",
'checked'=>1,
'enabled'=>(!empty($conf->global->AGENDA_SHOW_LINKED_OBJECT))),
168 'a.datec'=>array(
'label'=>
'DateCreation',
'checked'=>0,
'position'=>510),
169 'a.tms'=>array(
'label'=>
'DateModification',
'checked'=>0,
'position'=>520),
170 'a.percent'=>array(
'label'=>
"Status",
'checked'=>1,
'position'=>1000)
173include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
179if ($user->socid && $socid) {
188if (
GETPOST(
'cancel',
'alpha')) {
195 if (is_array($_POST)) {
196 foreach ($_POST as $key => $val) {
197 $param .=
'&'.$key.
'='.urlencode($val);
201 header(
"Location: ".DOL_URL_ROOT.
'/comm/action/index.php?'.$param);
205$parameters = array(
'id'=>$socid);
206$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
212include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
214if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
219 $datestart_dtstart =
'';
220 $datestart_dtend =
'';
221 $dateend_dtstart =
'';
232 $search_array_options = array();
235if (empty($reshook) && !empty($massaction)) {
238 switch ($massaction) {
239 case 'set_all_events_to_todo':
243 case 'set_all_events_to_in_progress':
247 case 'set_all_events_to_finished':
252 if (isset($percent)) {
253 foreach ($toselect as $toselectid) {
254 $result = $object->updatePercent($toselectid, $percent);
264if (empty($reshook)) {
265 $objectclass =
'ActionComm';
266 $objectlabel =
'Events';
269 $permissiontodelete = $user->rights->agenda->allactions->delete;
270 $permissiontoadd = $user->hasRight(
'agenda',
'myactions',
'create');
271 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
278$form =
new Form($db);
279$userstatic =
new User($db);
283$societestatic =
new Societe($db);
284$contactstatic =
new Contact($db);
287$nav .= $form->selectDate($dateselect,
'dateselect', 0, 0, 1,
'', 1, 0);
288$nav .=
' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans(
"Refresh").
'">';
292$help_url =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda|DE:Modul_Terminplanung';
293$title = $langs->trans(
"Agenda");
297$listofextcals = array();
300if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
301 $param .=
'&contextpage='.urlencode($contextpage);
303if ($limit > 0 && $limit != $conf->liste_limit) {
304 $param .=
'&limit='.((int) $limit);
306if ($actioncode !=
'') {
307 if (is_array($actioncode)) {
308 foreach ($actioncode as $str_action) {
309 $param .=
"&search_actioncode[]=".urlencode($str_action);
312 $param .=
"&search_actioncode=".urlencode($actioncode);
315if ($resourceid > 0) {
316 $param .=
"&search_resourceid=".urlencode($resourceid);
318if ($search_status !=
'') {
319 $param .=
"&search_status=".urlencode($search_status);
322 $param .=
"&search_filter=".urlencode($filter);
325 $param .=
"&search_filtert=".urlencode($filtert);
328 $param .=
"&search_usergroup=".urlencode($usergroup);
331 $param .=
"&search_socid=".urlencode($socid);
334 $param .=
"&search_showbirthday=1";
337 $param .=
"&search_projectid=".urlencode($pid);
340 $param .=
"&search_type=".urlencode($type);
342if ($search_id !=
'') {
343 $param .=
'&search_title='.urlencode($search_id);
345if ($search_title !=
'') {
346 $param .=
'&search_title='.urlencode($search_title);
348if ($search_note !=
'') {
349 $param .=
'&search_note='.urlencode($search_note);
351if (
GETPOST(
'datestart_dtstartday',
'int')) {
352 $param .=
'&datestart_dtstartday='.GETPOST(
'datestart_dtstartday',
'int');
354if (
GETPOST(
'datestart_dtstartmonth',
'int')) {
355 $param .=
'&datestart_dtstartmonth='.GETPOST(
'datestart_dtstartmonth',
'int');
357if (
GETPOST(
'datestart_dtstartyear',
'int')) {
358 $param .=
'&datestart_dtstartyear='.GETPOST(
'datestart_dtstartyear',
'int');
360if (
GETPOST(
'datestart_dtendday',
'int')) {
361 $param .=
'&datestart_dtendday='.GETPOST(
'datestart_dtendday',
'int');
363if (
GETPOST(
'datestart_dtendmonth',
'int')) {
364 $param .=
'&datestart_dtendmonth='.GETPOST(
'datestart_dtendmonth',
'int');
366if (
GETPOST(
'datestart_dtendyear',
'int')) {
367 $param .=
'&datestart_dtendyear='.GETPOST(
'datestart_dtendyear',
'int');
369if (
GETPOST(
'dateend_dtstartday',
'int')) {
370 $param .=
'&dateend_dtstartday='.GETPOST(
'dateend_dtstartday',
'int');
372if (
GETPOST(
'dateend_dtstartmonth',
'int')) {
373 $param .=
'&dateend_dtstartmonth='.GETPOST(
'dateend_dtstartmonth',
'int');
375if (
GETPOST(
'dateend_dtstartyear',
'int')) {
376 $param .=
'&dateend_dtstartyear='.GETPOST(
'dateend_dtstartyear',
'int');
378if (
GETPOST(
'dateend_dtendday',
'int')) {
379 $param .=
'&dateend_dtendday='.GETPOST(
'dateend_dtendday',
'int');
381if (
GETPOST(
'dateend_dtendmonth',
'int')) {
382 $param .=
'&dateend_dtendmonth='.GETPOST(
'dateend_dtendmonth',
'int');
384if (
GETPOST(
'dateend_dtendyear',
'int')) {
385 $param .=
'&dateend_dtendyear='.GETPOST(
'dateend_dtendyear',
'int');
387if ($optioncss !=
'') {
388 $param .=
'&optioncss='.urlencode($optioncss);
391include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
393$paramnoactionodate = $param;
396$arrayofmassactions = array(
397 'set_all_events_to_todo' => $langs->trans(
"SetAllEventsToTodo"),
398 'set_all_events_to_in_progress' => $langs->trans(
"SetAllEventsToInProgress"),
399 'set_all_events_to_finished' => $langs->trans(
"SetAllEventsToFinished"),
401if ($user->rights->agenda->allactions->delete) {
402 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
404if (isModEnabled(
'category') && $user->hasRight(
'agenda',
'myactions',
'create')) {
405 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
407if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
408 $arrayofmassactions = array();
410$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
416$sql .=
" s.nom as societe, s.rowid as socid, s.client, s.email as socemail,";
417$sql .=
" a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,";
418$sql .=
" a.fk_user_author, a.fk_user_action,";
419$sql .=
" a.fk_contact, a.note, a.percent as percent,";
420$sql .=
" a.fk_element, a.elementtype, a.datec, a.tms as datem,";
421$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,";
422$sql .=
" sp.lastname, sp.firstname, sp.email, sp.phone, sp.address, sp.phone as phone_pro, sp.phone_mobile, sp.phone_perso, sp.fk_pays as country_id";
425if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
426 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
427 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
432$parameters = array();
433$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
434$sql .= $hookmanager->resPrint;
438$sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a";
439$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"actioncomm_extrafields as ef ON (a.id = ef.fk_object)";
440if (empty($user->rights->societe->client->voir) && !$socid) {
441 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
443$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
444$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"socpeople as sp ON a.fk_contact = sp.rowid";
445$sql .=
" ,".MAIN_DB_PREFIX.
"c_actioncomm as c";
447if ($resourceid > 0) {
448 $sql .=
", ".MAIN_DB_PREFIX.
"element_resources as r";
451if ($filtert > 0 || $usergroup > 0) {
452 $sql .=
", ".MAIN_DB_PREFIX.
"actioncomm_resources as ar";
455 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
457$sql .=
" WHERE c.id = a.fk_action";
458$sql .=
' AND a.entity IN ('.getEntity(
'agenda').
')';
460if (!empty($actioncode)) {
461 if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
462 if ($actioncode ==
'AC_NON_AUTO') {
463 $sql .=
" AND c.type != 'systemauto'";
464 } elseif ($actioncode ==
'AC_ALL_AUTO') {
465 $sql .=
" AND c.type = 'systemauto'";
467 if ($actioncode ==
'AC_OTH') {
468 $sql .=
" AND c.type != 'systemauto'";
470 if ($actioncode ==
'AC_OTH_AUTO') {
471 $sql .=
" AND c.type = 'systemauto'";
475 if ($actioncode ==
'AC_NON_AUTO') {
476 $sql .=
" AND c.type != 'systemauto'";
477 } elseif ($actioncode ==
'AC_ALL_AUTO') {
478 $sql .=
" AND c.type = 'systemauto'";
480 if (is_array($actioncode)) {
481 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", $actioncode).
"'", 1).
")";
483 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", explode(
',', $actioncode)).
"'", 1).
")";
488if ($resourceid > 0) {
489 $sql .=
" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".((int) $resourceid);
492 $sql .=
" AND a.fk_project=".((int) $pid);
494if (empty($user->rights->societe->client->voir) && !$socid) {
495 $sql .=
" AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).
")";
498 $sql .=
" AND s.rowid = ".((int) $socid);
501if ($filtert > 0 || $usergroup > 0) {
502 $sql .=
" AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
505 $sql .=
" AND c.id = ".((int) $type);
507if ($search_status ==
'0') {
508 $sql .=
" AND a.percent = 0";
510if ($search_status ==
'na') {
511 $sql .=
" AND a.percent = -1";
513if ($search_status ==
'50') {
514 $sql .=
" AND (a.percent > 0 AND a.percent < 100)";
516if ($search_status ==
'100') {
517 $sql .=
" AND a.percent = 100";
519if ($search_status ==
'done') {
520 $sql .=
" AND (a.percent = 100)";
522if ($search_status ==
'todo') {
523 $sql .=
" AND (a.percent >= 0 AND a.percent < 100)";
535if ($filtert > 0 || $usergroup > 0) {
538 $sql .=
"(ar.fk_element = ".((int) $filtert).
" OR (ar.fk_element IS NULL AND a.fk_user_action = ".((int) $filtert).
"))";
540 if ($usergroup > 0) {
541 $sql .= ($filtert > 0 ?
" OR " :
"").
" ugu.fk_usergroup = ".((
int) $usergroup);
547if ($dateselect > 0) {
548 $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).
"'))";
550if ($datestart_dtstart > 0) {
551 $sql .=
" AND a.datep >= '".$db->idate($datestart_dtstart).
"'";
553if ($datestart_dtend > 0) {
554 $sql .=
" AND a.datep <= '".$db->idate($datestart_dtend).
"'";
556if ($dateend_dtstart > 0) {
557 $sql .=
" AND a.datep2 >= '".$db->idate($dateend_dtstart).
"'";
559if ($dateend_dtend > 0) {
560 $sql .=
" AND a.datep2 <= '".$db->idate($dateend_dtend).
"'";
564include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
567$parameters = array();
568$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
569$sql .= $hookmanager->resPrint;
572$nbtotalofrecords =
'';
575 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
576 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
578 $resql = $db->query($sqlforcount);
580 $objforcount = $db->fetch_object($resql);
581 $nbtotalofrecords = $objforcount->nbtotalofrecords;
586 if (($page * $limit) > $nbtotalofrecords) {
594$sql .= $db->order($sortfield, $sortorder);
596 $sql .= $db->plimit($limit + 1, $offset);
599$resql = $db->query($sql);
605$num = $db->num_rows($resql);
607$arrayofselected = is_array($toselect) ? $toselect : array();
610$newtitle =
'<div class="nowrap clear inline-block minheight30">';
611$newtitle .=
'<input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans(
"LocalAgenda").
' ';
612$newtitle .=
'</div>';
615$tabactive =
'cardlist';
619print
'<form method="POST" id="searchFormList" class="listactionsfilter" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
621if ($optioncss !=
'') {
622 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
624print
'<input type="hidden" name="token" value="'.newToken().
'">';
625print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
626print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
627print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
628print
'<input type="hidden" name="type" value="'.$type.
'">';
632 $nav .=
'<input type="hidden" name="search_filter" value="'.$filter.
'">';
635 $nav .=
'<input type="hidden" name="search_showbirthday" value="1">';
647$parameters = array();
648$reshook = $hookmanager->executeHooks(
'addCalendarChoice', $parameters, $object, $action);
649if (empty($reshook)) {
650 $s .= $hookmanager->resPrint;
651} elseif ($reshook > 1) {
652 $s = $hookmanager->resPrint;
654$viewyear = is_object($object) ?
dol_print_date($object->datep,
'%Y') :
'';
655$viewmonth = is_object($object) ?
dol_print_date($object->datep,
'%m') :
'';
656$viewday = is_object($object) ?
dol_print_date($object->datep,
'%d') :
'';
658$viewmode .=
'<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1'.$paramnoactionodate.
'">';
660$viewmode .=
img_picto($langs->trans(
"List"),
'object_calendarlist',
'class="imgforviewmode pictoactionview block"');
662$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewList").
'</span></a>';
664$viewmode .=
'<a class="btnTitle reposition" href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_month&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
666$viewmode .=
img_picto($langs->trans(
"ViewCal"),
'object_calendarmonth',
'class="pictoactionview block"');
668$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewCal").
'</span></a>';
670$viewmode .=
'<a class="btnTitle reposition" href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_week&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
672$viewmode .=
img_picto($langs->trans(
"ViewWeek"),
'object_calendarweek',
'class="pictoactionview block"');
674$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewWeek").
'</span></a>';
676$viewmode .=
'<a class="btnTitle reposition" href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_day&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
678$viewmode .=
img_picto($langs->trans(
"ViewDay"),
'object_calendarday',
'class="pictoactionview block"');
680$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewDay").
'</span></a>';
682$viewmode .=
'<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.
'/comm/action/peruser.php?mode=show_peruser&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
684$viewmode .=
img_picto($langs->trans(
"ViewPerUser"),
'object_calendarperuser',
'class="pictoactionview block"');
686$viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewPerUser").
'</span></a>';
688$viewmode .=
'<span class="marginrightonly"></span>';
691$parameters = array();
692$reshook = $hookmanager->executeHooks(
'addCalendarView', $parameters, $object, $action);
693if (empty($reshook)) {
694 $viewmode .= $hookmanager->resPrint;
695} elseif ($reshook > 1) {
696 $viewmode = $hookmanager->resPrint;
701$newparam =
'&month='.str_pad($month, 2,
"0", STR_PAD_LEFT).
'&year='.$tmpforcreatebutton[
'year'];
706$url = DOL_URL_ROOT.
'/comm/action/card.php?action=create';
707$url .=
'&datep='.sprintf(
"%04d%02d%02d", $tmpforcreatebutton[
'year'], $tmpforcreatebutton[
'mon'], $tmpforcreatebutton[
'mday']).$hourminsec;
708$url .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].($newparam ?
'?'.$newparam :
''));
710$newcardbutton =
dolGetButtonTitle($langs->trans(
'AddAction'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->agenda->myactions->create || $user->hasRight(
'agenda',
'allactions',
'create'));
712$param .=
'&mode='.$mode;
714print_barre_liste($langs->trans(
"Agenda"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, is_numeric($nbtotalofrecords) ? -1 * $nbtotalofrecords: $nbtotalofrecords,
'object_action', 0, $nav.$newcardbutton,
'', $limit, 0, 0, 1, $viewmode);
719include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
723$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
724$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
725if ($massactionbutton) {
726 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
730print
'<div class="liste_titre liste_titre_bydiv centpercent">';
731print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup,
'', $resourceid);
734print
'<div class="div-table-responsive">';
735print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
737print
'<tr class="liste_titre_filter">';
740 print
'<td class="liste_titre" align="middle">';
741 $searchpicto = $form->showFilterButtons(
'left');
745if (!empty($arrayfields[
'a.id'][
'checked'])) {
746 print
'<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.
'"></td>';
748if (!empty($arrayfields[
'owner'][
'checked'])) {
749 print
'<td class="liste_titre"></td>';
751if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
752 print
'<td class="liste_titre"></td>';
754if (!empty($arrayfields[
'a.label'][
'checked'])) {
755 print
'<td class="liste_titre"><input type="text" class="maxwidth75" name="search_title" value="'.$search_title.
'"></td>';
757if (!empty($arrayfields[
'a.note'][
'checked'])) {
758 print
'<td class="liste_titre"><input type="text" class="maxwidth75" name="search_note" value="'.$search_note.
'"></td>';
760if (!empty($arrayfields[
'a.datep'][
'checked'])) {
761 print
'<td class="liste_titre nowraponall" align="center">';
762 print
'<div class="nowrap">';
763 print $form->selectDate($datestart_dtstart,
'datestart_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
765 print
'<div class="nowrap">';
766 print $form->selectDate($datestart_dtend,
'datestart_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
770if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
771 print
'<td class="liste_titre nowraponall" align="center">';
772 print
'<div class="nowrap">';
773 print $form->selectDate($dateend_dtstart,
'dateend_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
775 print
'<div class="nowrap">';
776 print $form->selectDate($dateend_dtend,
'dateend_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
780if (!empty($arrayfields[
's.nom'][
'checked'])) {
781 print
'<td class="liste_titre"></td>';
783if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
784 print
'<td class="liste_titre"></td>';
786if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
787 print
'<td class="liste_titre"></td>';
791include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
794$parameters = array(
'arrayfields'=>$arrayfields);
795$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
796print $hookmanager->resPrint;
798if (!empty($arrayfields[
'a.datec'][
'checked'])) {
799 print
'<td class="liste_titre"></td>';
801if (!empty($arrayfields[
'a.tms'][
'checked'])) {
802 print
'<td class="liste_titre"></td>';
804if (!empty($arrayfields[
'a.percent'][
'checked'])) {
805 print
'<td class="liste_titre right parentonrightofpage">';
806 $formactions->form_select_status_action(
'formaction', $search_status, 1,
'search_status', 1, 2,
'search_status width100 onrightofpage');
811 print
'<td class="liste_titre" align="middle">';
812 $searchpicto = $form->showFilterButtons();
818$totalarray = array();
819$totalarray[
'nbfield'] = 0;
823print
'<tr class="liste_titre">';
825 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
827if (!empty($arrayfields[
'a.id'][
'checked'])) {
828 print_liste_field_titre($arrayfields[
'a.id'][
'label'], $_SERVER[
"PHP_SELF"],
"a.id", $param,
"",
"", $sortfield, $sortorder);
829 $totalarray[
'nbfield']++;
831if (!empty($arrayfields[
'owner'][
'checked'])) {
832 print_liste_field_titre($arrayfields[
'owner'][
'label'], $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
833 $totalarray[
'nbfield']++;
835if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
836 print_liste_field_titre($arrayfields[
'c.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.libelle", $param,
"",
"", $sortfield, $sortorder);
837 $totalarray[
'nbfield']++;
839if (!empty($arrayfields[
'a.label'][
'checked'])) {
840 print_liste_field_titre($arrayfields[
'a.label'][
'label'], $_SERVER[
"PHP_SELF"],
"a.label", $param,
"",
"", $sortfield, $sortorder);
841 $totalarray[
'nbfield']++;
843if (!empty($arrayfields[
'a.note'][
'checked'])) {
844 print_liste_field_titre($arrayfields[
'a.note'][
'label'], $_SERVER[
"PHP_SELF"],
"a.note", $param,
"",
"", $sortfield, $sortorder);
845 $totalarray[
'nbfield']++;
848if (!empty($arrayfields[
'a.datep'][
'checked'])) {
849 print_liste_field_titre($arrayfields[
'a.datep'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep,a.id", $param,
'',
'align="center"', $sortfield, $sortorder);
850 $totalarray[
'nbfield']++;
852if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
853 print_liste_field_titre($arrayfields[
'a.datep2'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep2", $param,
'',
'align="center"', $sortfield, $sortorder);
854 $totalarray[
'nbfield']++;
856if (!empty($arrayfields[
's.nom'][
'checked'])) {
857 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom", $param,
"",
"", $sortfield, $sortorder);
858 $totalarray[
'nbfield']++;
860if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
861 print_liste_field_titre($arrayfields[
'a.fk_contact'][
'label'], $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
862 $totalarray[
'nbfield']++;
864if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
865 print_liste_field_titre($arrayfields[
'a.fk_element'][
'label'], $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
866 $totalarray[
'nbfield']++;
869include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
871$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
872$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
873print $hookmanager->resPrint;
875if (!empty($arrayfields[
'a.datec'][
'checked'])) {
876 print_liste_field_titre($arrayfields[
'a.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datec,a.id", $param,
"",
'align="center"', $sortfield, $sortorder);
877 $totalarray[
'nbfield']++;
879if (!empty($arrayfields[
'a.tms'][
'checked'])) {
880 print_liste_field_titre($arrayfields[
'a.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"a.tms,a.id", $param,
"",
'align="center"', $sortfield, $sortorder);
881 $totalarray[
'nbfield']++;
884if (!empty($arrayfields[
'a.percent'][
'checked'])) {
885 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"a.percent", $param,
"",
'align="center"', $sortfield, $sortorder);
886 $totalarray[
'nbfield']++;
889 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
891$totalarray[
'nbfield']++;
895$delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60;
896$today_start_time =
dol_mktime(0, 0, 0, date(
'm', $now), date(
'd', $now), date(
'Y', $now));
898require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/cactioncomm.class.php';
900$arraylist = $caction->liste_array(1,
'code',
'', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0),
'', 1);
901$contactListCache = array();
908$imaxinloop = ($limit ? min($num, $limit) : $num);
909$cache_user_list = array();
910while ($i < $imaxinloop) {
911 $obj = $db->fetch_object($resql);
917 $object->setVarsFromFetchObj($obj);
920 if (!empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->type_code ==
'AC_OTH_AUTO') {
925 $actionstatic->id = $obj->id;
926 $actionstatic->ref = $obj->id;
927 $actionstatic->code = $obj->code;
928 $actionstatic->type_code = $obj->type_code;
929 $actionstatic->type_label = $obj->type_label;
930 $actionstatic->type_picto = $obj->type_picto;
931 $actionstatic->type_color = $obj->type_color;
932 $actionstatic->label = $obj->label;
933 $actionstatic->location = $obj->location;
935 $actionstatic->datep = $db->jdate($obj->dp);
936 $actionstatic->percentage = $obj->percent;
937 $actionstatic->authorid = $obj->fk_user_author;
938 $actionstatic->userownerid = $obj->fk_user_action;
942 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
943 $actionstatic->fetchResources();
947 if ($obj->fk_user_action > 0 && !isset($cache_user_list[$obj->fk_user_action])) {
948 $userstatic =
new User($db);
949 $res = $userstatic->fetch($obj->fk_user_action);
951 $cache_user_list[$obj->fk_user_action] = $userstatic;
956 $event_owner_style =
'';
958 if ($cache_user_list[$obj->fk_user_action]->color !=
'') {
959 $event_owner_style .=
'border-left: #' . $cache_user_list[$obj->fk_user_action]->color .
' 5px solid;';
963 $event_more_class =
'';
964 $event_start_date_css =
'';
965 $event_end_date_css =
'';
966 $event_start_date_time = $actionstatic->datep;
967 if ($event_start_date_time > $now) {
969 $event_more_class =
'event-future';
970 $event_start_date_css = $event_end_date_css = $event_more_class;
972 if ($obj->fulldayevent == 1) {
973 $today_start_date_time = $today_start_time;
975 $today_start_date_time = $now;
979 $event_end_date_time = $db->jdate($obj->dp2);
980 if ($event_end_date_time !=
null && $event_end_date_time < $today_start_date_time) {
982 $event_more_class =
'event-past';
983 } elseif ($event_end_date_time ==
null && $event_start_date_time < $today_start_date_time) {
985 $event_more_class =
'event-past';
988 $event_more_class =
'event-current';
990 $event_start_date_css = $event_end_date_css = $event_more_class;
992 $event_start_date_css = $event_end_date_css = $event_more_class;
994 print
'<tr class="oddeven' . ($event_more_class !=
'' ?
' '.$event_more_class :
'') .
'">';
997 print
'<td class="nowrap center">';
998 if ($massactionbutton || $massaction) {
1000 if (in_array($obj->id, $arrayofselected)) {
1003 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1008 if (!empty($arrayfields[
'a.id'][
'checked'])) {
1009 print
'<td class="nowraponall">';
1010 print $actionstatic->getNomUrl(1, -1);
1015 if (!empty($arrayfields[
'owner'][
'checked'])) {
1017 print
'<td class="tdoverflowmax150">';
1018 if ($obj->fk_user_action > 0 && !isset($cache_user_list[$obj->fk_user_action])) {
1019 $userstatic =
new User($db);
1020 $res = $userstatic->fetch($obj->fk_user_action);
1022 $cache_user_list[$obj->fk_user_action] = $userstatic;
1025 if (isset($cache_user_list[$obj->fk_user_action])) {
1026 print $cache_user_list[$obj->fk_user_action]->getNomUrl(-1);
1034 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
1035 print
'<td class="nowraponall">';
1036 print $actionstatic->getTypePicto();
1037 $labeltype = $obj->type_code;
1038 if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($arraylist[$labeltype])) {
1039 $labeltype =
'AC_OTH';
1041 if (preg_match(
'/^TICKET_MSG/', $actionstatic->code)) {
1042 $labeltype = $langs->trans(
"Message");
1044 if (!empty($arraylist[$labeltype])) {
1045 $labeltype = $arraylist[$labeltype];
1047 if ($obj->type_code ==
'AC_OTH_AUTO' && ($obj->type_code != $obj->code) && $labeltype && !empty($arraylist[$obj->code])) {
1048 $labeltype .=
' - '.$arraylist[$obj->code];
1056 if (!empty($arrayfields[
'a.label'][
'checked'])) {
1057 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($actionstatic->label).
'">';
1058 print $actionstatic->label;
1063 if (!empty($arrayfields[
'a.note'][
'checked'])) {
1064 print
'<td class="tdoverflowonsmartphone">';
1066 print $form->textwithtooltip(
dol_trunc($text, 48), $actionstatic->note_private);
1070 $formatToUse = $obj->fulldayevent ?
'day' :
'dayhour';
1073 if (!empty($arrayfields[
'a.datep'][
'checked'])) {
1074 print
'<td class="center nowraponall'.($event_start_date_css ?
' '.$event_start_date_css :
'').
'"><span>';
1075 if (empty($obj->fulldayevent)) {
1076 print
dol_print_date($db->jdate($obj->dp), $formatToUse,
'tzuserrel');
1079 print
dol_print_date($db->jdate($obj->dp), $formatToUse, ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1083 if ($actionstatic->hasDelay() && $actionstatic->percentage >= 0 && $actionstatic->percentage < 100 ) {
1093 if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
1094 print
'<td class="center nowraponall'.($event_end_date_css ?
' '.$event_end_date_css :
'').
'"><span>';
1095 if (empty($obj->fulldayevent)) {
1096 print
dol_print_date($db->jdate($obj->dp2), $formatToUse,
'tzuserrel');
1099 print
dol_print_date($db->jdate($obj->dp2), $formatToUse, ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1106 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1107 print
'<td class="tdoverflowmax150">';
1108 if ($obj->socid > 0) {
1109 $societestatic->id = $obj->socid;
1110 $societestatic->client = $obj->client;
1111 $societestatic->name = $obj->societe;
1112 $societestatic->email = $obj->socemail;
1114 print $societestatic->getNomUrl(1,
'', 28);
1122 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
1123 print
'<td class="tdoverflowmax100">';
1125 if (!empty($actionstatic->socpeopleassigned)) {
1126 $contactList = array();
1127 foreach ($actionstatic->socpeopleassigned as $socpeopleassigned) {
1128 if (!isset($contactListCache[$socpeopleassigned[
'id']])) {
1131 if ($contact->fetch($socpeopleassigned[
'id']) > 0) {
1132 $contactListCache[$socpeopleassigned[
'id']] = $contact->getNomUrl(1,
'', 0);
1133 $contactList[] = $contact->getNomUrl(1,
'', 0);
1137 $contactList[] = $contactListCache[$socpeopleassigned[
'id']];
1140 if (!empty($contactList)) {
1141 print implode(
', ', $contactList);
1143 } elseif ($obj->fk_contact > 0) {
1144 $contactstatic->id = $obj->fk_contact;
1145 $contactstatic->email = $obj->email;
1146 $contactstatic->lastname = $obj->lastname;
1147 $contactstatic->firstname = $obj->firstname;
1148 $contactstatic->phone_pro = $obj->phone_pro;
1149 $contactstatic->phone_mobile = $obj->phone_mobile;
1150 $contactstatic->phone_perso = $obj->phone_perso;
1151 $contactstatic->country_id = $obj->country_id;
1152 print $contactstatic->getNomUrl(1,
'', 0);
1160 if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
1161 print
'<td class="tdoverflowmax150">';
1163 if ($obj->fk_element > 0 && !empty($obj->elementtype)) {
1164 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1173 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1175 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1176 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1177 print $hookmanager->resPrint;
1180 if (!empty($arrayfields[
'a.datec'][
'checked'])) {
1182 print
'<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datec),
'dayhour',
'tzuserrel').
'</td>';
1185 if (!empty($arrayfields[
'a.tms'][
'checked'])) {
1186 print
'<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datem),
'dayhour',
'tzuserrel').
'</td>';
1188 if (!empty($arrayfields[
'a.percent'][
'checked'])) {
1190 $datep = $db->jdate($obj->dp);
1191 print
'<td align="center" class="nowrap">'.$actionstatic->LibStatut($obj->percent, 5, 0, $datep).
'</td>';
1195 print
'<td class="nowrap center">';
1196 if ($massactionbutton || $massaction) {
1198 if (in_array($obj->id, $arrayofselected)) {
1201 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1212 print
'<tr><td colspan="'.$totalarray[
'nbfield'].
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1216print
'</table>'.
"\n";
1219print
'</form>'.
"\n";
print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid='', $excludetype='', $resourceid=0)
Show filter form in agenda view.
calendars_prepare_head($param)
Define head array for tabs of agenda setup pages.
if(preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) if(preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) if($action=='set') elseif( $action=='specimen') elseif($action=='setmodel') elseif( $action=='del') elseif($action=='setdoc') $formactions
View.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage agenda events (actions)
const EVENT_FINISHED
Typical value for a event that is in a finished state.
const EVENT_IN_PROGRESS
Typical value for a event that is in a progress state.
const EVENT_TODO
Typical value for a event that is in a todo state.
Class to manage different types of events.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage Dolibarr users.
dolGetElementUrl($objectid, $objecttype, $withpicto=0, $option='')
Return link url to an object.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
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 dolibarr global constant string value.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.