dolibarr 24.0.0-beta
card.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003 Rodolphe Quiedeville<rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
5 * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
6 * Copyright (C) 2016 Abbes Bahfir <contact@dolibarrpar.com>
7 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
8 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
9 * Copyright (C) 2026 Charlene Benke <charlene@patas-monkey.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23 */
24
31// Load Dolibarr environment
32require '../../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
34require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
35require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
36require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php';
37
46// Load translation files required by page
47$langs->loadLangs(array('companies', 'mails', 'admin', 'other', 'errors'));
48
49$id = GETPOSTINT("id");
50$ref = GETPOST('ref', 'alpha');
51
52if (!isset($id) || empty($id)) {
54}
55
56$action = GETPOST('action', 'aZ09');
57$actionid = GETPOSTINT('actionid');
58
59$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
60$sortfield = GETPOST('sortfield', 'aZ09comma');
61$sortorder = GETPOST('sortorder', 'aZ09comma');
62$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
63if (!$sortorder) {
64 $sortorder = "DESC";
65}
66if (!$sortfield) {
67 $sortfield = "n.daten";
68}
69if (empty($page) || $page == -1) {
70 $page = 0;
71}
72$offset = $limit * $page;
73$pageprev = $page - 1;
74$pagenext = $page + 1;
75
76$now = dol_now();
77
78// Security check
79$object = new User($db);
80if ($id > 0 || !empty($ref)) {
81 $result = $object->fetch($id, $ref, '', 1);
82 $object->loadRights();
83}
84
85$permissiontoadd = (($object->id == $user->id) || ($user->hasRight('user', 'user', 'lire')));
86
87// Security check
88if ($user->socid) {
89 $id = $user->socid;
90}
91$result = restrictedArea($user, 'user', '', '', 'user');
92
93
94/*
95 * Actions
96 */
97
98if (GETPOST('cancel', 'alpha')) {
99 $action = 'list';
100}
101
102$error = 0;
103
104// Add a notification
105if ($action == 'add' && $permissiontoadd) {
106 if ($actionid <= 0) {
107 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Action")), null, 'errors');
108 $error++;
109 $action = 'create';
110 }
111
112 if (!$error) {
113 $db->begin();
114
115 $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
116 $sql .= " WHERE fk_user = ".((int) $id)." AND fk_action = ".((int) $actionid);
117 if ($db->query($sql)) {
118 $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec, fk_user, fk_action)";
119 $sql .= " VALUES ('".$db->idate($now)."', ".((int) $id).", ".((int) $actionid).")";
120
121 if (!$db->query($sql)) {
122 $error++;
124 }
125 } else {
127 }
128
129 if (!$error) {
130 $db->commit();
131 } else {
132 $db->rollback();
133 $action = 'create';
134 }
135 }
136}
137
138// Remove a notification (edit a user)
139if ($action == 'delete' && $permissiontoadd) {
140 $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid = ".GETPOSTINT("actid");
141 $db->query($sql);
142}
143
144
145
146/*
147 * View
148 */
149
150$form = new Form($db);
151
152$object = new User($db);
153$result = $object->fetch($id, '', '', 1);
154$object->loadRights();
155
156$title = $langs->trans("ThirdParty").' - '.$langs->trans("Notification");
157if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/thirdpartynameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) {
158 $title = $object->name.' - '.$langs->trans("Notification");
159}
160$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
161
162llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-user page-notify_card');
163$type = array('email' => $langs->trans("EMail"), 'sms' => $langs->trans("SMS"));
164
165if ($result > 0) {
166 $langs->load("other");
167
168 $head = user_prepare_head($object);
169
170 print dol_get_fiche_head($head, 'notify', $langs->trans("User"), -1, 'user');
171
172 $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
173
174 $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'&output=file&file='.urlencode(dol_sanitizeFileName($object->getFullName($langs).'.vcf')).'" class="refid valignmiddle" rel="noopener">';
175 $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard', 'class="valignmiddle marginleftonly paddingrightonly"');
176 $morehtmlref .= '</a>';
177
178 $urltovirtualcard = '/user/virtualcard.php?id='.((int) $object->id);
179 $morehtmlref .= dolButtonToOpenUrlInDialogPopup('publicvirtualcard', $langs->transnoentitiesnoconv("PublicVirtualCardUrl").' - '.$object->getFullName($langs), img_picto($langs->trans("PublicVirtualCardUrl"), 'card', 'class="valignmiddle marginleftonly paddingrightonly"'), $urltovirtualcard, '', 'refid valignmiddle nohover');
180
181 dol_banner_tab($object, 'id', $linkback, $user->hasRight('user', 'user', 'lire') || $user->admin, 'rowid', 'ref', $morehtmlref, '', 0, '', '', 0, '');
182
183 print '<div class="fichecenter">';
184
185 print '<div class="underbanner clearboth"></div>';
186 print '<table class="border centpercent tableforfield">';
187
188 // Login
189 print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
190 if (!empty($object->ldap_sid) && $object->statut == 0) {
191 print '<td class="error">';
192 print $langs->trans("LoginAccountDisableInDolibarr");
193 print '</td>';
194 } else {
195 print '<td>';
196 $addadmin = '';
197 if (property_exists($object, 'admin')) {
198 if (isModEnabled('multicompany') && !empty($object->admin) && empty($object->entity)) {
199 $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "superadmin", 'class="paddingleft valignmiddle"');
200 } elseif (!empty($object->admin)) {
201 $addadmin .= img_picto($langs->trans("AdministratorDesc"), "admin", 'class="paddingleft valignmiddle"');
202 }
203 }
204 print showValueWithClipboardCPButton($object->login).$addadmin;
205 print '</td>';
206 }
207 print '</tr>'."\n";
208
209 print '</table>';
210
211 print '</div>';
212
213 print dol_get_fiche_end();
214
215 print "\n";
216
217 // Help
218 print '<span class="opacitymedium hideonsmartphone">';
219 print '<br>'.$langs->trans("NotificationsDesc");
220 print '<br>'.$langs->trans("NotificationsDescUser").' - '.$langs->trans("YouAreHere");
221 if (isModEnabled('societe')) {
222 print '<br>'.$langs->trans("NotificationsDescContact");
223 }
224 print '<br>'.$langs->trans("NotificationsDescGlobal");
225 print '</span>';
226
227 print '<br><br><br>'."\n";
228
229
230 // Add notification form
231
232 print '<form action="'.$_SERVER["PHP_SELF"].'?id='.urlencode((string) ($id)).'" method="POST">';
233 print '<input type="hidden" name="token" value="'.newToken().'">';
234 print '<input type="hidden" name="page_y" value="">';
235 if ($action == 'create') {
236 print '<input type="hidden" name="action" id="action" value="add">';
237 }
238
239 $param = "&id=".urlencode((string) ($id));
240
241 // Line with titles
242
243 // List of notifications enabled for contacts
244 $sql = "SELECT n.rowid, n.type,";
245 $sql .= " a.code, a.label,";
246 $sql .= " c.rowid as userid, c.entity, c.login, c.lastname, c.firstname, c.email, c.photo, c.gender, c.statut as status";
247 $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
248 $sql .= " ".MAIN_DB_PREFIX."notify_def as n,";
249 $sql .= " ".MAIN_DB_PREFIX."user c";
250 $sql .= " WHERE a.rowid = n.fk_action";
251 $sql .= " AND c.rowid = n.fk_user";
252 $sql .= " AND c.rowid = ".((int) $object->id);
253 $sql .= " AND n.entity IN (".getEntity('notify_def').')';
254
255 $resql = $db->query($sql);
256 $num = 0;
257 if ($resql) {
258 $num = $db->num_rows($resql);
259 } else {
261 }
262
263 $newcardbutton = '';
264 $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', (int) $permissiontoadd);
265
266 $titlelist = $form->textwithpicto($langs->trans("ListOfActiveNotifications"), $langs->trans("ListOfActiveNotificationsHelp", $langs->transnoentitiesnoconv("Target"), $langs->transnoentitiesnoconv("Event")));
267
268 $limitforsubscription = 0; // We show all subscription of user. Pagination will be reserved for the section of notifications sent.
269 // List of active notifications
270 // @phan-suppress-next-line PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamOrder
271 print_barre_liste($titlelist, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, 'email', 0, $newcardbutton, '', $limitforsubscription, 0, 0, 1);
272
273 // Line with titles
274 print '<div class="div-table-responsive-no-min">';
275 print '<table class="noborder centpercent">';
276 print '<tr class="liste_titre">';
277 print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '', $sortfield, $sortorder);
278 print_liste_field_titre("Event", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder);
279 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '', $sortfield, $sortorder);
280 print_liste_field_titre('', '', '');
281 print "</tr>\n";
282
283
284 if ($action == 'create') {
285 // $listofemails=$object->thirdparty_and_contact_email_array();
286 if ($object->email) {
287 $actions = array();
288
289 // Load array of available notifications
290 $notificationtrigger = new InterfaceNotification($db);
291 $listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
292
293 foreach ($listofnotifiedevents as $notifiedevent) {
294 $label = ($langs->trans("Notify_".$notifiedevent['code']) != "Notify_".$notifiedevent['code'] ? $langs->trans("Notify_".$notifiedevent['code']) : $notifiedevent['label']);
295 $actions[$notifiedevent['rowid']] = $label;
296 }
297 print '<tr class="oddeven nohover"><td>';
298 print $object->getNomUrl(1);
299 if (isValidEmail($object->email)) {
300 print ' &lt;'.$object->email.'&gt;';
301 } else {
302 $langs->load("errors");
303 print ' &nbsp; '.img_warning().' '.$langs->trans("ErrorBadEMail", $object->email);
304 }
305 print '</td>';
306 print '<td class="tdoverflowmax200">';
307 print img_picto('', 'object_action', '', 0, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1);
308 print '</td>';
309 print '<td>';
310 print $form->selectarray("typeid", $type);
311 print '</td>';
312 print '<td class="nowraponall">';
313 print '<input type="submit" class="button button-add small" value="'.$langs->trans("Add").'">';
314 print '&nbsp;';
315 print '<input type="submit" class="button button-cancel small" name="cancel" value="'.$langs->trans("Cancel").'">';
316 print '</td>';
317 print '</tr>';
318 } else {
319 print '<tr class="oddeven"><td colspan="4" class="opacitymedium">';
320 print $langs->trans("YouMustAssignUserMailFirst");
321 print '</td></tr>';
322 }
323 } else {
324 if ($num) {
325 $i = 0;
326
327 $userstatic = new User($db);
328
329 while ($i < $num) {
330 $obj = $db->fetch_object($resql);
331
332 $userstatic->id = $obj->userid;
333 $userstatic->lastname = $obj->lastname;
334 $userstatic->firstname = $obj->firstname;
335 $userstatic->email = $obj->email;
336 $userstatic->status = $obj->status;
337 $userstatic->photo = $obj->photo;
338 $userstatic->gender = $obj->gender;
339
340 print '<tr class="oddeven">';
341 print '<td>'.$userstatic->getNomUrl(-1);
342 if ($obj->type == 'email') {
343 if (isValidEmail($obj->email)) {
344 print ' &lt;'.$obj->email.'&gt;';
345 } else {
346 $langs->load("errors");
347 print ' &nbsp; '.img_warning().' <span class="warning">'.$langs->trans("ErrorBadEMail", $obj->email).'</span>';
348 }
349 }
350 print '</td>';
351
352 $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
353 print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($label).'">';
354 print img_picto('', 'object_action', '', 0, 0, 0, '', 'pictofixedwidth').$label;
355 print '</td>';
356
357 print '<td>';
358 print $type[$obj->type];
359 print '</td>';
360 print '<td class="right"><a href="card.php?id='.$id.'&action=delete&token='.newToken().'&actid='.$obj->rowid.'">'.img_delete().'</a></td>';
361 print '</tr>';
362 $i++;
363 }
364 $db->free($resql);
365 } else {
366 print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
367 }
368 // List of notifications enabled for fixed email
369 /*
370 foreach($conf->global as $key => $val) {
371 if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
372 print '<tr class="oddeven"><td>';
373 $listtmp=explode(',', $val);
374 $first=1;
375 foreach($listtmp as $keyemail => $valemail) {
376 if (! $first) print ', ';
377 $first=0;
378 $valemail=trim($valemail);
379 //print $keyemail.' - '.$valemail.' - '.$reg[1].'<br>';
380 if (isValidEmail($valemail, 1)) {
381 if ($valemail == '__SUPERVISOREMAIL__') print $valemail;
382 else print ' &lt;'.$valemail.'&gt;';
383 } else {
384 print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail);
385 }
386 }
387 print '</td>';
388 print '<td>';
389 $notifcode=preg_replace('/_THRESHOLD_.*$/','',$reg[1]);
390 $notifcodecond=preg_replace('/^.*_(THRESHOLD_)/','$1',$reg[1]);
391 $label=($langs->trans("Notify_".$notifcode)!="Notify_".$notifcode?$langs->trans("Notify_".$notifcode):$notifcode);
392 print $label;
393 if (preg_match('/^THRESHOLD_HIGHER_(.*)$/',$notifcodecond,$regcond) && ($regcond[1] > 0)) {
394 print ' - '.$langs->trans("IfAmountHigherThan",$regcond[1]);
395 }
396 print '</td>';
397 print '<td>';
398 print $langs->trans("Email");
399 print '</td>';
400 print '<td class="right">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</td>';
401 print '</tr>';
402 }*/
403 /*if ($user->admin) {
404 print '<tr class="oddeven"><td colspan="4">';
405 print '+ <a href="'.DOL_URL_ROOT.'/admin/notification.php">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</a>';
406 print '</td></tr>';
407 }*/
408 }
409
410 print '</table>';
411 print '</div>';
412
413 print '</form>';
414
415
416 print '<br><br>'."\n";
417
418
419 // List
420 $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,";
421 $sql .= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail, c.photo, c.gender, c.statut as status,";
422 $sql .= " a.code, a.label";
423 $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
424 $sql .= " ".MAIN_DB_PREFIX."notify as n";
425 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as c ON n.fk_user = c.rowid";
426 $sql .= " WHERE a.rowid = n.fk_action";
427 $sql .= " AND n.fk_user = ".((int) $object->id);
428 $sql .= $db->order($sortfield, $sortorder);
429
430 // Count total nb of records
431 $nbtotalofrecords = '';
432 if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
433 $result = $db->query($sql);
434 $nbtotalofrecords = $db->num_rows($result);
435 if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
436 $page = 0;
437 $offset = 0;
438 }
439 }
440
441 $sql .= $db->plimit($limit + 1, $offset);
442
443 $resql = $db->query($sql);
444 if ($resql) {
445 $num = $db->num_rows($resql);
446 } else {
448 }
449
450 $param = '&id='.$object->id;
451 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
452 $param .= '&contextpage='.$contextpage;
453 }
454 if ($limit > 0 && $limit != $conf->liste_limit) {
455 $param .= '&limit='.$limit;
456 }
457
458 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
459 //if (isset($optioncss) && $optioncss != '') {
460 // print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
461 //}
462 print '<input type="hidden" name="token" value="'.newToken().'">';
463 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
464 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
465 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
466 print '<input type="hidden" name="page" value="'.$page.'">';
467 print '<input type="hidden" name="id" value="'.$object->id.'">';
468
469 $titlelist = $form->textwithpicto($langs->trans("ListOfNotificationsDone"), $langs->trans("ListOfNotificationsDoneHelp"));
470
471 // List of notifications done @phan-suppress-next-line PhanPluginSuspiciousParamOrder
472 print_barre_liste($titlelist, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'email', 0, '', '', $limit, '');
473
474 // Line with titles
475 print '<div class="div-table-responsive-no-min">';
476 print '<table class="centpercent noborder">';
477 print '<tr class="liste_titre">';
478 print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '', $sortfield, $sortorder);
479 print_liste_field_titre("Event", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder);
480 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '', $sortfield, $sortorder);
481 //print_liste_field_titre("Object",$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder);
482 print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "n.daten", '', $param, '', $sortfield, $sortorder, 'right ');
483 print '</tr>';
484
485 if ($num) {
486 $i = 0;
487
488 $userstatic = new User($db);
489
490 while ($i < $num) {
491 $obj = $db->fetch_object($resql);
492
493 print '<tr class="oddeven"><td>';
494 if ($obj->id > 0) {
495 $userstatic->id = $obj->id;
496 $userstatic->lastname = $obj->lastname;
497 $userstatic->firstname = $obj->firstname;
498 $userstatic->status = $obj->status;
499 $userstatic->email = $obj->email;
500 $userstatic->photo = $obj->photo;
501 $userstatic->gender = $obj->gender;
502
503 print $userstatic->getNomUrl(-1);
504 print $obj->email ? ' &lt;'.$obj->email.'&gt;' : $langs->trans("NoMail");
505 } else {
506 print $obj->email;
507 }
508 print '</td>';
509
510 $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
511 print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($label).'">';
512 print img_picto('', 'object_action', '', 0, 0, 0, '', 'pictofixedwidth').$label;
513 print '</td>';
514 print '<td>';
515 print $type[$obj->type];
516 print '</td>';
517 // TODO Add link to object here for other types
518 /*print '<td>';
519 if ($obj->object_type == 'order') {
520 $orderstatic->id=$obj->object_id;
521 $orderstatic->ref=...
522 print $orderstatic->getNomUrl(1);
523 }
524 print '</td>';*/
525 // print
526 print'<td class="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
527 print '</tr>';
528 $i++;
529 }
530 $db->free($resql);
531 } else {
532 print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
533 }
534
535 print '</table>';
536 print '</div>';
537
538 print '</form>';
539} else {
540 recordNotFound('', 0);
541}
542
543// End of page
544llxFooter();
545$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
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.
Definition wrapper.php:73
Class to manage generation of HTML components Only common components must be here.
Class of triggers for notification module.
Class to manage Dolibarr users.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
dol_now($mode='gmt')
Return date for now.
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_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled='', $morecss='classlink button bordertransp', $jsonopen='', $jsonclose='', $accesskey='')
Return HTML code to output a button to open a dialog popup box.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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.
user_prepare_head(User $object)
Prepare array with list of tabs.