31 require
'../../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.
'/contact/class/contact.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/actioncomm.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/agenda.lib.php';
36 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formactions.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
40 $langs->loadLangs(array(
"users",
"companies",
"agenda",
"commercial",
"other",
"orders",
"bills"));
42 $action =
GETPOST(
'action',
'aZ09');
43 $massaction =
GETPOST(
'massaction',
'alpha');
44 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'actioncommlist';
45 $optioncss =
GETPOST(
'optioncss',
'alpha');
46 $toselect =
GETPOST(
'toselect',
'array');
47 $confirm =
GETPOST(
'confirm',
'alpha');
49 $disabledefaultvalues =
GETPOST(
'disabledefaultvalues',
'int');
51 $mode =
GETPOST(
'mode',
'aZ09');
52 if (empty($mode) && preg_match(
'/show_/', $action)) {
55 $resourceid =
GETPOST(
"search_resourceid",
"int") ?
GETPOST(
"search_resourceid",
"int") :
GETPOST(
"resourceid",
"int");
56 $pid =
GETPOST(
"search_projectid",
'int', 3) ?
GETPOST(
"search_projectid",
'int', 3) :
GETPOST(
"projectid",
'int', 3);
57 $search_status = (
GETPOST(
"search_status",
'aZ09') !=
'') ?
GETPOST(
"search_status",
'aZ09') :
GETPOST(
"status",
'aZ09');
58 $type =
GETPOST(
'search_type',
'alphanohtml') ?
GETPOST(
'search_type',
'alphanohtml') :
GETPOST(
'type',
'alphanohtml');
60 $month =
GETPOST(
"month",
'int');
64 if (
GETPOST(
'search_actioncode',
'array')) {
65 $actioncode =
GETPOST(
'search_actioncode',
'array', 3);
66 if (!count($actioncode)) {
70 $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));
73 $search_id =
GETPOST(
'search_id',
'alpha');
74 $search_title =
GETPOST(
'search_title',
'alpha');
75 $search_note =
GETPOST(
'search_note',
'alpha');
78 $datestart_dtstart =
dol_mktime(0, 0, 0,
GETPOST(
'datestart_dtstartmonth',
'int'),
GETPOST(
'datestart_dtstartday',
'int'),
GETPOST(
'datestart_dtstartyear',
'int'),
'tzuserrel');
79 $datestart_dtend =
dol_mktime(23, 59, 59,
GETPOST(
'datestart_dtendmonth',
'int'),
GETPOST(
'datestart_dtendday',
'int'),
GETPOST(
'datestart_dtendyear',
'int'),
'tzuserrel');
80 $dateend_dtstart =
dol_mktime(0, 0, 0,
GETPOST(
'dateend_dtstartmonth',
'int'),
GETPOST(
'dateend_dtstartday',
'int'),
GETPOST(
'dateend_dtstartyear',
'int'),
'tzuserrel');
81 $dateend_dtend =
dol_mktime(23, 59, 59,
GETPOST(
'dateend_dtendmonth',
'int'),
GETPOST(
'dateend_dtendday',
'int'),
GETPOST(
'dateend_dtendyear',
'int'),
'tzuserrel');
82 if ($search_status ==
'' && !
GETPOSTISSET(
'search_status')) {
83 $search_status = ((empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) || $disabledefaultvalues) ?
'' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
86 $mode = (empty($conf->global->AGENDA_DEFAULT_VIEW) ?
'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
89 $filter =
GETPOST(
"search_filter",
'alpha', 3) ?
GETPOST(
"search_filter",
'alpha', 3) :
GETPOST(
"filter",
'alpha', 3);
90 $filtert =
GETPOST(
"search_filtert",
"int", 3) ?
GETPOST(
"search_filtert",
"int", 3) :
GETPOST(
"filtert",
"int", 3);
91 $usergroup =
GETPOST(
"search_usergroup",
"int", 3) ?
GETPOST(
"search_usergroup",
"int", 3) :
GETPOST(
"usergroup",
"int", 3);
92 $showbirthday = empty($conf->use_javascript_ajax) ? (
GETPOST(
"search_showbirthday",
"int") ?
GETPOST(
"search_showbirthday",
"int") :
GETPOST(
"showbirthday",
"int")) : 1;
96 $hookmanager->initHooks(array(
'agendalist'));
101 $extrafields->fetch_name_optionals_label($object->table_element);
103 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
105 if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS)) {
106 $filtert = $user->id;
109 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
110 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
111 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
113 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
117 $offset = $limit * $page;
119 $sortorder =
"DESC,DESC";
120 if ($search_status ==
'todo') {
121 $sortorder =
"DESC,DESC";
125 $sortfield =
"a.datep,a.id";
126 if ($search_status ==
'todo') {
127 $sortfield =
"a.datep,a.id";
134 $socid = $user->socid;
141 if (empty($user->rights->agenda->myactions->read)) {
144 if (empty($user->rights->agenda->allactions->read)) {
147 if (empty($user->rights->agenda->allactions->read) || $filter ==
'mine') {
148 $filtert = $user->id;
151 $arrayfields = array(
152 'a.id'=>array(
'label'=>
"Ref",
'checked'=>1),
153 'owner'=>array(
'label'=>
"Owner",
'checked'=>1),
154 'c.libelle'=>array(
'label'=>
"Type",
'checked'=>1),
155 'a.label'=>array(
'label'=>
"Title",
'checked'=>1),
156 'a.note'=>array(
'label'=>
'Description',
'checked'=>0),
157 'a.datep'=>array(
'label'=>
"DateStart",
'checked'=>1),
158 'a.datep2'=>array(
'label'=>
"DateEnd",
'checked'=>1),
159 's.nom'=>array(
'label'=>
"ThirdParty",
'checked'=>1),
160 'a.fk_contact'=>array(
'label'=>
"Contact",
'checked'=>0),
161 'a.fk_element'=>array(
'label'=>
"LinkedObject",
'checked'=>1,
'enabled'=>(!empty($conf->global->AGENDA_SHOW_LINKED_OBJECT))),
162 'a.datec'=>array(
'label'=>
'DateCreation',
'checked'=>0,
'position'=>510),
163 'a.tms'=>array(
'label'=>
'DateModification',
'checked'=>0,
'position'=>520),
164 'a.percent'=>array(
'label'=>
"Status",
'checked'=>1,
'position'=>1000)
167 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
173 if ($user->socid && $socid) {
182 if (
GETPOST(
'cancel',
'alpha')) {
189 if (is_array($_POST)) {
190 foreach ($_POST as $key => $val) {
191 $param .=
'&'.$key.
'='.urlencode($val);
195 header(
"Location: ".DOL_URL_ROOT.
'/comm/action/index.php?'.$param);
199 $parameters = array(
'id'=>$socid);
200 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
206 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
208 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
213 $datestart_dtstart =
'';
214 $datestart_dtend =
'';
215 $dateend_dtstart =
'';
226 $search_array_options = array();
229 if (empty($reshook) && !empty($massaction)) {
232 switch ($massaction) {
233 case 'set_all_events_to_todo':
237 case 'set_all_events_to_in_progress':
241 case 'set_all_events_to_finished':
246 if (isset($percent)) {
247 foreach ($toselect as $toselectid) {
248 $result = $object->updatePercent($toselectid, $percent);
258 if (empty($reshook)) {
259 $objectclass =
'ActionComm';
260 $objectlabel =
'Events';
263 $permissiontodelete = $user->rights->agenda->allactions->delete;
264 $permissiontoadd = $user->rights->agenda->myactions->create;
265 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
273 $userstatic =
new User($db);
277 $societestatic =
new Societe($db);
278 $contactstatic =
new Contact($db);
281 $nav .=
$form->selectDate($dateselect,
'dateselect', 0, 0, 1,
'', 1, 0);
282 $nav .=
' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans(
"Refresh").
'">';
286 $help_url =
'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
287 $title = $langs->trans(
"Agenda");
291 $listofextcals = array();
294 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
295 $param .=
'&contextpage='.urlencode($contextpage);
297 if ($limit > 0 && $limit != $conf->liste_limit) {
298 $param .=
'&limit='.urlencode($limit);
300 if ($actioncode !=
'') {
301 if (is_array($actioncode)) {
302 foreach ($actioncode as $str_action) {
303 $param .=
"&search_actioncode[]=".urlencode($str_action);
306 $param .=
"&search_actioncode=".urlencode($actioncode);
309 if ($resourceid > 0) {
310 $param .=
"&search_resourceid=".urlencode($resourceid);
312 if ($search_status !=
'') {
313 $param .=
"&search_status=".urlencode($search_status);
316 $param .=
"&search_filter=".urlencode($filter);
319 $param .=
"&search_filtert=".urlencode($filtert);
321 if ($usergroup > 0) {
322 $param .=
"&search_usergroup=".urlencode($usergroup);
325 $param .=
"&search_socid=".urlencode($socid);
328 $param .=
"&search_showbirthday=1";
331 $param .=
"&search_projectid=".urlencode($pid);
334 $param .=
"&search_type=".urlencode($type);
336 if ($search_id !=
'') {
337 $param .=
'&search_title='.urlencode($search_id);
339 if ($search_title !=
'') {
340 $param .=
'&search_title='.urlencode($search_title);
342 if ($search_note !=
'') {
343 $param .=
'&search_note='.urlencode($search_note);
345 if (
GETPOST(
'datestartday_dtstart',
'int')) {
346 $param .=
'&datestartday_dtstart='.GETPOST(
'datestartday_dtstart',
'int');
348 if (
GETPOST(
'datestartmonth_dtstart',
'int')) {
349 $param .=
'&datestartmonth_dtstart='.GETPOST(
'datestartmonth_dtstart',
'int');
351 if (
GETPOST(
'datestartyear_dtstart',
'int')) {
352 $param .=
'&datestartyear_dtstart='.GETPOST(
'datestartyear_dtstart',
'int');
354 if (
GETPOST(
'datestartday_dtend',
'int')) {
355 $param .=
'&datestartday_dtend='.GETPOST(
'datestartday_dtend',
'int');
357 if (
GETPOST(
'datestartmonth_dtend',
'int')) {
358 $param .=
'&datestartmonth_dtend='.GETPOST(
'datestartmonth_dtend',
'int');
360 if (
GETPOST(
'datestartyear_dtend',
'int')) {
361 $param .=
'&datestartyear_dtend='.GETPOST(
'datestartyear_dtend',
'int');
363 if (
GETPOST(
'dateendday_dtstart',
'int')) {
364 $param .=
'&dateendday_dtstart='.GETPOST(
'dateendday_dtstart',
'int');
366 if (
GETPOST(
'dateendmonth_dtstart',
'int')) {
367 $param .=
'&dateendmonth_dtstart='.GETPOST(
'dateendmonth_dtstart',
'int');
369 if (
GETPOST(
'dateendyear_dtstart',
'int')) {
370 $param .=
'&dateendyear_dtstart='.GETPOST(
'dateendyear_dtstart',
'int');
372 if (
GETPOST(
'dateendday_dtend',
'int')) {
373 $param .=
'&dateendday_dtend='.GETPOST(
'dateendday_dtend',
'int');
375 if (
GETPOST(
'dateendmonth_dtend',
'int')) {
376 $param .=
'&dateendmonth_dtend='.GETPOST(
'dateendmonth_dtend',
'int');
378 if (
GETPOST(
'dateendyear_dtend',
'int')) {
379 $param .=
'&dateendyear_dtend='.GETPOST(
'dateendyear_dtend',
'int');
381 if ($optioncss !=
'') {
382 $param .=
'&optioncss='.urlencode($optioncss);
385 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
387 $paramnoactionodate = $param;
390 $arrayofmassactions = array(
391 'set_all_events_to_todo' => $langs->trans(
"SetAllEventsToTodo"),
392 'set_all_events_to_in_progress' => $langs->trans(
"SetAllEventsToInProgress"),
393 'set_all_events_to_finished' => $langs->trans(
"SetAllEventsToFinished"),
395 if ($user->rights->agenda->allactions->delete) {
396 $arrayofmassactions[
'predelete'] =
img_picto(
'',
'delete',
'class="pictofixedwidth"').$langs->trans(
"Delete");
398 if (
isModEnabled(
'category') && $user->rights->agenda->myactions->create) {
399 $arrayofmassactions[
'preaffecttag'] =
img_picto(
'',
'category',
'class="pictofixedwidth"').$langs->trans(
"AffectTag");
401 if (
GETPOST(
'nomassaction',
'int') || in_array($massaction, array(
'presend',
'predelete',
'preaffecttag'))) {
402 $arrayofmassactions = array();
404 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
407 if ($usergroup > 0) {
410 $sql .=
" s.nom as societe, s.rowid as socid, s.client, s.email as socemail,";
411 $sql .=
" a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulldayevent, a.location,";
412 $sql .=
' a.fk_user_author,a.fk_user_action,';
413 $sql .=
" a.fk_contact, a.note, a.percent as percent,";
414 $sql .=
" a.fk_element, a.elementtype, a.datec, a.tms as datem,";
415 $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,";
416 $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";
419 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
420 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
421 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
426 $parameters = array();
427 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
428 $sql .= $hookmanager->resPrint;
432 $sql .=
" FROM ".MAIN_DB_PREFIX.
"actioncomm as a";
433 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"actioncomm_extrafields as ef ON (a.id = ef.fk_object)";
434 if (empty($user->rights->societe->client->voir) && !$socid) {
435 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
437 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON a.fk_soc = s.rowid";
438 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"socpeople as sp ON a.fk_contact = sp.rowid";
439 $sql .=
" ,".MAIN_DB_PREFIX.
"c_actioncomm as c";
441 if ($resourceid > 0) {
442 $sql .=
", ".MAIN_DB_PREFIX.
"element_resources as r";
445 if ($filtert > 0 || $usergroup > 0) {
446 $sql .=
", ".MAIN_DB_PREFIX.
"actioncomm_resources as ar";
448 if ($usergroup > 0) {
449 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
451 $sql .=
" WHERE c.id = a.fk_action";
452 $sql .=
' AND a.entity IN ('.getEntity(
'agenda').
')';
454 if (!empty($actioncode)) {
455 if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
456 if ($actioncode ==
'AC_NON_AUTO') {
457 $sql .=
" AND c.type != 'systemauto'";
458 } elseif ($actioncode ==
'AC_ALL_AUTO') {
459 $sql .=
" AND c.type = 'systemauto'";
461 if ($actioncode ==
'AC_OTH') {
462 $sql .=
" AND c.type != 'systemauto'";
464 if ($actioncode ==
'AC_OTH_AUTO') {
465 $sql .=
" AND c.type = 'systemauto'";
469 if ($actioncode ==
'AC_NON_AUTO') {
470 $sql .=
" AND c.type != 'systemauto'";
471 } elseif ($actioncode ==
'AC_ALL_AUTO') {
472 $sql .=
" AND c.type = 'systemauto'";
474 if (is_array($actioncode)) {
475 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", $actioncode).
"'", 1).
")";
477 $sql .=
" AND c.code IN (".$db->sanitize(
"'".implode(
"','", explode(
',', $actioncode)).
"'", 1).
")";
482 if ($resourceid > 0) {
483 $sql .=
" AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".((int) $resourceid);
486 $sql .=
" AND a.fk_project=".((int) $pid);
488 if (empty($user->rights->societe->client->voir) && !$socid) {
489 $sql .=
" AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).
")";
492 $sql .=
" AND s.rowid = ".((int) $socid);
495 if ($filtert > 0 || $usergroup > 0) {
496 $sql .=
" AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
499 $sql .=
" AND c.id = ".((int) $type);
501 if ($search_status ==
'0') {
502 $sql .=
" AND a.percent = 0";
504 if ($search_status ==
'na') {
505 $sql .=
" AND a.percent = -1";
507 if ($search_status ==
'50') {
508 $sql .=
" AND (a.percent > 0 AND a.percent < 100)";
510 if ($search_status ==
'100') {
511 $sql .=
" AND a.percent = 100";
513 if ($search_status ==
'done') {
514 $sql .=
" AND (a.percent = 100)";
516 if ($search_status ==
'todo') {
517 $sql .=
" AND (a.percent >= 0 AND a.percent < 100)";
529 if ($filtert > 0 || $usergroup > 0) {
532 $sql .=
"(ar.fk_element = ".((int) $filtert).
" OR (ar.fk_element IS NULL AND a.fk_user_action = ".((int) $filtert).
"))";
534 if ($usergroup > 0) {
535 $sql .= ($filtert > 0 ?
" OR " :
"").
" ugu.fk_usergroup = ".((
int) $usergroup);
541 if ($dateselect > 0) {
542 $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).
"'))";
544 if ($datestart_dtstart > 0) {
545 $sql .=
" AND a.datep >= '".$db->idate($datestart_dtstart).
"'";
547 if ($datestart_dtend > 0) {
548 $sql .=
" AND a.datep <= '".$db->idate($datestart_dtend).
"'";
550 if ($dateend_dtstart > 0) {
551 $sql .=
" AND a.datep2 >= '".$db->idate($dateend_dtstart).
"'";
553 if ($dateend_dtend > 0) {
554 $sql .=
" AND a.datep2 <= '".$db->idate($dateend_dtend).
"'";
558 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
561 $parameters = array();
562 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
563 $sql .= $hookmanager->resPrint;
567 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
569 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
570 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
571 $resql = $db->query($sqlforcount);
573 $objforcount = $db->fetch_object(
$resql);
587 $sql .= $db->order($sortfield, $sortorder);
589 $sql .= $db->plimit($limit + 1, $offset);
592 $resql = $db->query($sql);
598 $num = $db->num_rows(
$resql);
600 $arrayofselected = is_array($toselect) ? $toselect : array();
603 $newtitle =
'<div class="nowrap clear inline-block minheight30 margintoponly">';
604 $newtitle .=
'<input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans(
"LocalAgenda").
' ';
605 $newtitle .=
'</div>';
608 $tabactive =
'cardlist';
612 print
'<form method="POST" id="searchFormList" class="listactionsfilter" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
614 if ($optioncss !=
'') {
615 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
617 print
'<input type="hidden" name="token" value="'.newToken().
'">';
618 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
619 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
620 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
621 print
'<input type="hidden" name="type" value="'.$type.
'">';
625 $nav .=
'<input type="hidden" name="search_filter" value="'.$filter.
'">';
628 $nav .=
'<input type="hidden" name="search_showbirthday" value="1">';
640 $parameters = array();
641 $reshook = $hookmanager->executeHooks(
'addCalendarChoice', $parameters, $object, $action);
642 if (empty($reshook)) {
643 $s .= $hookmanager->resPrint;
644 } elseif ($reshook > 1) {
645 $s = $hookmanager->resPrint;
647 $viewyear = is_object($object) ?
dol_print_date($object->datep,
'%Y') :
'';
648 $viewmonth = is_object($object) ?
dol_print_date($object->datep,
'%m') :
'';
649 $viewday = is_object($object) ?
dol_print_date($object->datep,
'%d') :
'';
651 $viewmode .=
'<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.
'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1'.$paramnoactionodate.
'">';
653 $viewmode .=
img_picto($langs->trans(
"List"),
'object_calendarlist',
'class="imgforviewmode pictoactionview block"');
655 $viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewList").
'</span></a>';
657 $viewmode .=
'<a class="btnTitle reposition" href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_month&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
659 $viewmode .=
img_picto($langs->trans(
"ViewCal"),
'object_calendarmonth',
'class="pictoactionview block"');
661 $viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewCal").
'</span></a>';
663 $viewmode .=
'<a class="btnTitle reposition" href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_week&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
665 $viewmode .=
img_picto($langs->trans(
"ViewWeek"),
'object_calendarweek',
'class="pictoactionview block"');
667 $viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewWeek").
'</span></a>';
669 $viewmode .=
'<a class="btnTitle reposition" href="'.DOL_URL_ROOT.
'/comm/action/index.php?mode=show_day&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
671 $viewmode .=
img_picto($langs->trans(
"ViewDay"),
'object_calendarday',
'class="pictoactionview block"');
673 $viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewDay").
'</span></a>';
675 $viewmode .=
'<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.
'/comm/action/peruser.php?mode=show_peruser&year='.$viewyear.
'&month='.$viewmonth.
'&day='.$viewday.$paramnoactionodate.
'">';
677 $viewmode .=
img_picto($langs->trans(
"ViewPerUser"),
'object_calendarperuser',
'class="pictoactionview block"');
679 $viewmode .=
'<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans(
"ViewPerUser").
'</span></a>';
681 $viewmode .=
'<span class="marginrightonly"></span>';
684 $parameters = array();
685 $reshook = $hookmanager->executeHooks(
'addCalendarView', $parameters, $object, $action);
686 if (empty($reshook)) {
687 $viewmode .= $hookmanager->resPrint;
688 } elseif ($reshook > 1) {
689 $viewmode = $hookmanager->resPrint;
694 $newparam =
'&month='.str_pad($month, 2,
"0", STR_PAD_LEFT).
'&year='.$tmpforcreatebutton[
'year'];
699 $url = DOL_URL_ROOT.
'/comm/action/card.php?action=create';
700 $url .=
'&datep='.sprintf(
"%04d%02d%02d", $tmpforcreatebutton[
'year'], $tmpforcreatebutton[
'mon'], $tmpforcreatebutton[
'mday']).$hourminsec;
701 $url .=
'&backtopage='.urlencode($_SERVER[
"PHP_SELF"].($newparam ?
'?'.$newparam :
''));
703 $newcardbutton =
dolGetButtonTitle($langs->trans(
'AddAction'),
'',
'fa fa-plus-circle', $url,
'', $user->rights->agenda->myactions->create || $user->hasRight(
'agenda',
'allactions',
'create'));
705 $param .=
'&mode='.$mode;
707 print_barre_liste($langs->trans(
"Agenda"), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1 *
$nbtotalofrecords,
'object_action', 0, $nav.$newcardbutton,
'', $limit, 0, 0, 1, $viewmode);
712 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
716 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
717 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
718 if ($massactionbutton) {
719 $selectedfields .=
$form->showCheckAddButtons(
'checkforselect', 1);
723 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
724 print_actions_filter(
$form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup,
'', $resourceid);
727 print
'<div class="div-table-responsive">';
728 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
730 print
'<tr class="liste_titre_filter">';
733 print
'<td class="liste_titre" align="middle">';
734 $searchpicto =
$form->showFilterButtons(
'left');
738 if (!empty($arrayfields[
'a.id'][
'checked'])) {
739 print
'<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.
'"></td>';
741 if (!empty($arrayfields[
'owner'][
'checked'])) {
742 print
'<td class="liste_titre"></td>';
744 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
745 print
'<td class="liste_titre"></td>';
747 if (!empty($arrayfields[
'a.label'][
'checked'])) {
748 print
'<td class="liste_titre"><input type="text" class="maxwidth75" name="search_title" value="'.$search_title.
'"></td>';
750 if (!empty($arrayfields[
'a.note'][
'checked'])) {
751 print
'<td class="liste_titre"><input type="text" class="maxwidth75" name="search_note" value="'.$search_note.
'"></td>';
753 if (!empty($arrayfields[
'a.datep'][
'checked'])) {
754 print
'<td class="liste_titre nowraponall" align="center">';
755 print
'<div class="nowrap">';
756 print
$form->selectDate($datestart_dtstart,
'datestart_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
758 print
'<div class="nowrap">';
759 print
$form->selectDate($datestart_dtend,
'datestart_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
763 if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
764 print
'<td class="liste_titre nowraponall" align="center">';
765 print
'<div class="nowrap">';
766 print
$form->selectDate($dateend_dtstart,
'dateend_dtstart', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'),
'tzuserrel');
768 print
'<div class="nowrap">';
769 print
$form->selectDate($dateend_dtend,
'dateend_dtend', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'To'),
'tzuserrel');
773 if (!empty($arrayfields[
's.nom'][
'checked'])) {
774 print
'<td class="liste_titre"></td>';
776 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
777 print
'<td class="liste_titre"></td>';
779 if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
780 print
'<td class="liste_titre"></td>';
784 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
787 $parameters = array(
'arrayfields'=>$arrayfields);
788 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
789 print $hookmanager->resPrint;
791 if (!empty($arrayfields[
'a.datec'][
'checked'])) {
792 print
'<td class="liste_titre"></td>';
794 if (!empty($arrayfields[
'a.tms'][
'checked'])) {
795 print
'<td class="liste_titre"></td>';
797 if (!empty($arrayfields[
'a.percent'][
'checked'])) {
798 print
'<td class="liste_titre center">';
799 $formactions->form_select_status_action(
'formaction', $search_status, 1,
'search_status', 1, 2,
'minwidth100imp maxwidth125');
805 print
'<td class="liste_titre" align="middle">';
806 $searchpicto =
$form->showFilterButtons();
812 $totalarray = array();
813 $totalarray[
'nbfield'] = 0;
817 print
'<tr class="liste_titre">';
819 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
821 if (!empty($arrayfields[
'a.id'][
'checked'])) {
822 print_liste_field_titre($arrayfields[
'a.id'][
'label'], $_SERVER[
"PHP_SELF"],
"a.id", $param,
"",
"", $sortfield, $sortorder);
823 $totalarray[
'nbfield']++;
825 if (!empty($arrayfields[
'owner'][
'checked'])) {
826 print_liste_field_titre($arrayfields[
'owner'][
'label'], $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
827 $totalarray[
'nbfield']++;
829 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
830 print_liste_field_titre($arrayfields[
'c.libelle'][
'label'], $_SERVER[
"PHP_SELF"],
"c.libelle", $param,
"",
"", $sortfield, $sortorder);
831 $totalarray[
'nbfield']++;
833 if (!empty($arrayfields[
'a.label'][
'checked'])) {
834 print_liste_field_titre($arrayfields[
'a.label'][
'label'], $_SERVER[
"PHP_SELF"],
"a.label", $param,
"",
"", $sortfield, $sortorder);
835 $totalarray[
'nbfield']++;
837 if (!empty($arrayfields[
'a.note'][
'checked'])) {
838 print_liste_field_titre($arrayfields[
'a.note'][
'label'], $_SERVER[
"PHP_SELF"],
"a.note", $param,
"",
"", $sortfield, $sortorder);
839 $totalarray[
'nbfield']++;
842 if (!empty($arrayfields[
'a.datep'][
'checked'])) {
843 print_liste_field_titre($arrayfields[
'a.datep'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep,a.id", $param,
'',
'align="center"', $sortfield, $sortorder);
844 $totalarray[
'nbfield']++;
846 if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
847 print_liste_field_titre($arrayfields[
'a.datep2'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datep2", $param,
'',
'align="center"', $sortfield, $sortorder);
848 $totalarray[
'nbfield']++;
850 if (!empty($arrayfields[
's.nom'][
'checked'])) {
851 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom", $param,
"",
"", $sortfield, $sortorder);
852 $totalarray[
'nbfield']++;
854 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
855 print_liste_field_titre($arrayfields[
'a.fk_contact'][
'label'], $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
856 $totalarray[
'nbfield']++;
858 if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
859 print_liste_field_titre($arrayfields[
'a.fk_element'][
'label'], $_SERVER[
"PHP_SELF"],
"", $param,
"",
"", $sortfield, $sortorder);
860 $totalarray[
'nbfield']++;
863 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
865 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
866 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
867 print $hookmanager->resPrint;
869 if (!empty($arrayfields[
'a.datec'][
'checked'])) {
870 print_liste_field_titre($arrayfields[
'a.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"a.datec,a.id", $param,
"",
'align="center"', $sortfield, $sortorder);
871 $totalarray[
'nbfield']++;
873 if (!empty($arrayfields[
'a.tms'][
'checked'])) {
874 print_liste_field_titre($arrayfields[
'a.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"a.tms,a.id", $param,
"",
'align="center"', $sortfield, $sortorder);
875 $totalarray[
'nbfield']++;
878 if (!empty($arrayfields[
'a.percent'][
'checked'])) {
879 print_liste_field_titre(
"Status", $_SERVER[
"PHP_SELF"],
"a.percent", $param,
"",
'align="center"', $sortfield, $sortorder);
880 $totalarray[
'nbfield']++;
883 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'align="center"', $sortfield, $sortorder,
'maxwidthsearch ');
885 $totalarray[
'nbfield']++;
889 $delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60;
891 require_once DOL_DOCUMENT_ROOT.
'/comm/action/class/cactioncomm.class.php';
893 $arraylist = $caction->liste_array(1,
'code',
'', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0),
'', 1);
894 $contactListCache = array();
901 $imaxinloop = ($limit ? min($num, $limit) : $num);
902 while ($i < $imaxinloop) {
903 $obj = $db->fetch_object(
$resql);
909 $object->setVarsFromFetchObj($obj);
912 if (!empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->type_code ==
'AC_OTH_AUTO') {
917 $actionstatic->id = $obj->id;
918 $actionstatic->ref = $obj->id;
919 $actionstatic->code = $obj->code;
920 $actionstatic->type_code = $obj->type_code;
921 $actionstatic->type_label = $obj->type_label;
922 $actionstatic->type_picto = $obj->type_picto;
923 $actionstatic->type_color = $obj->type_color;
924 $actionstatic->label = $obj->label;
925 $actionstatic->location = $obj->location;
927 $actionstatic->datep = $db->jdate($obj->dp);
928 $actionstatic->percentage = $obj->percent;
932 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
933 $actionstatic->fetchResources();
936 print
'<tr class="oddeven">';
939 print
'<td class="nowrap center">';
940 if ($massactionbutton || $massaction) {
942 if (in_array($obj->id, $arrayofselected)) {
945 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
950 if (!empty($arrayfields[
'a.id'][
'checked'])) {
951 print
'<td class="nowraponall">';
952 print $actionstatic->getNomUrl(1, -1);
957 if (!empty($arrayfields[
'owner'][
'checked'])) {
958 print
'<td class="tdoverflowmax150">';
959 if ($obj->fk_user_action > 0) {
960 $userstatic->fetch($obj->fk_user_action);
961 print $userstatic->getNomUrl(-1);
969 if (!empty($arrayfields[
'c.libelle'][
'checked'])) {
970 print
'<td class="nowraponall">';
971 print $actionstatic->getTypePicto();
972 $labeltype = $obj->type_code;
973 if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($arraylist[$labeltype])) {
974 $labeltype =
'AC_OTH';
976 if (preg_match(
'/^TICKET_MSG/', $actionstatic->code)) {
977 $labeltype = $langs->trans(
"Message");
979 if (!empty($arraylist[$labeltype])) {
980 $labeltype = $arraylist[$labeltype];
982 if ($obj->type_code ==
'AC_OTH_AUTO' && ($obj->type_code != $obj->code) && $labeltype && !empty($arraylist[$obj->code])) {
983 $labeltype .=
' - '.$arraylist[$obj->code];
991 if (!empty($arrayfields[
'a.label'][
'checked'])) {
992 print
'<td class="tdoverflowmax200" title="'.dol_escape_htmltag($actionstatic->label).
'">';
993 print $actionstatic->label;
998 if (!empty($arrayfields[
'a.note'][
'checked'])) {
999 print
'<td class="tdoverflowonsmartphone">';
1001 print
$form->textwithtooltip(
dol_trunc($text, 48), $actionstatic->note_private);
1005 $formatToUse = $obj->fulldayevent ?
'day' :
'dayhour';
1008 if (!empty($arrayfields[
'a.datep'][
'checked'])) {
1009 print
'<td class="center nowraponall">';
1010 if (empty($obj->fulldayevent)) {
1011 print
dol_print_date($db->jdate($obj->dp), $formatToUse,
'tzuserrel');
1014 print
dol_print_date($db->jdate($obj->dp), $formatToUse, ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1017 if ($actionstatic->hasDelay() && $actionstatic->percentage >= 0 && $actionstatic->percentage < 100 ) {
1027 if (!empty($arrayfields[
'a.datep2'][
'checked'])) {
1028 print
'<td class="center nowraponall">';
1029 if (empty($obj->fulldayevent)) {
1030 print
dol_print_date($db->jdate($obj->dp2), $formatToUse,
'tzuserrel');
1033 print
dol_print_date($db->jdate($obj->dp2), $formatToUse, ($tzforfullday ? $tzforfullday :
'tzuserrel'));
1039 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1040 print
'<td class="tdoverflowmax150">';
1041 if ($obj->socid > 0) {
1042 $societestatic->id = $obj->socid;
1043 $societestatic->client = $obj->client;
1044 $societestatic->name = $obj->societe;
1045 $societestatic->email = $obj->socemail;
1047 print $societestatic->getNomUrl(1,
'', 28);
1055 if (!empty($arrayfields[
'a.fk_contact'][
'checked'])) {
1056 print
'<td class="tdoverflowmax100">';
1058 if (!empty($actionstatic->socpeopleassigned)) {
1059 $contactList = array();
1060 foreach ($actionstatic->socpeopleassigned as $socpeopleassigned) {
1061 if (!isset($contactListCache[$socpeopleassigned[
'id']])) {
1064 if ($contact->fetch($socpeopleassigned[
'id']) > 0) {
1065 $contactListCache[$socpeopleassigned[
'id']] = $contact->getNomUrl(1,
'', 0);
1066 $contactList[] = $contact->getNomUrl(1,
'', 0);
1070 $contactList[] = $contactListCache[$socpeopleassigned[
'id']];
1073 if (!empty($contactList)) {
1074 print implode(
', ', $contactList);
1076 } elseif ($obj->fk_contact > 0) {
1077 $contactstatic->id = $obj->fk_contact;
1078 $contactstatic->email = $obj->email;
1079 $contactstatic->lastname = $obj->lastname;
1080 $contactstatic->firstname = $obj->firstname;
1081 $contactstatic->phone_pro = $obj->phone_pro;
1082 $contactstatic->phone_mobile = $obj->phone_mobile;
1083 $contactstatic->phone_perso = $obj->phone_perso;
1084 $contactstatic->country_id = $obj->country_id;
1085 print $contactstatic->getNomUrl(1,
'', 0);
1093 if (!empty($arrayfields[
'a.fk_element'][
'checked'])) {
1094 print
'<td class="tdoverflowmax150">';
1096 if ($obj->fk_element > 0 && !empty($obj->elementtype)) {
1097 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
1106 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1108 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1109 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1110 print $hookmanager->resPrint;
1113 if (!empty($arrayfields[
'a.datec'][
'checked'])) {
1115 print
'<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datec),
'dayhour',
'tzuserrel').
'</td>';
1118 if (!empty($arrayfields[
'a.tms'][
'checked'])) {
1119 print
'<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datem),
'dayhour',
'tzuserrel').
'</td>';
1121 if (!empty($arrayfields[
'a.percent'][
'checked'])) {
1123 $datep = $db->jdate($obj->dp);
1124 print
'<td align="center" class="nowrap">'.$actionstatic->LibStatut($obj->percent, 5, 0, $datep).
'</td>';
1128 print
'<td class="nowrap center">';
1129 if ($massactionbutton || $massaction) {
1131 if (in_array($obj->id, $arrayofselected)) {
1134 print
'<input id="cb'.$obj->id.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1145 print
'<tr><td colspan="'.$totalarray[
'nbfield'].
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1149 print
'</table>'.
"\n";
1150 print
'</div>'.
"\n";
1152 print
'</form>'.
"\n";
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
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.
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
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.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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.
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.
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.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
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...
isModEnabled($module)
Is Dolibarr module enabled.
dol_getdate($timestamp, $fast=false, $forcetimezone='')
Return an array with locale date info.
$nbtotalofrecords
Count total nb of records.
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.