dolibarr 25.0.0-alpha
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';
40require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
41require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
42require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
43require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php';
44
45// Load translation files required by page
46$langs->loadLangs(array('companies', 'mails', 'admin', 'other', 'errors'));
47
48$id = GETPOSTINT("id");
49$ref = GETPOST('ref', 'alpha');
50
51if (!isset($id) || empty($id)) {
53}
54
55$contextpage = GETPOST('contextpage');
56$action = GETPOST('action', 'aZ09');
57
58$actionid = GETPOSTINT('actionid');
59
60$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
61$sortfield = GETPOST('sortfield', 'aZ09comma');
62$sortorder = GETPOST('sortorder', 'aZ09comma');
63$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
64if (!$sortorder) {
65 $sortorder = "DESC";
66}
67if (!$sortfield) {
68 $sortfield = "n.daten";
69}
70if (empty($page) || $page == -1) {
71 $page = 0;
72}
73$offset = $limit * $page;
74$pageprev = $page - 1;
75$pagenext = $page + 1;
76
77$now = dol_now();
78
79// Security check
80$object = new User($db);
81if ($id > 0 || !empty($ref)) {
82 $result = $object->fetch($id, $ref, '', 1);
83 $object->loadRights();
84}
85
86$permissiontoadd = (($object->id == $user->id) || ($user->hasRight('user', 'user', 'creer')));
87
88// Security check
89if ($user->socid) {
90 $id = $user->socid;
91}
92$result = restrictedArea($user, 'user', '', '', 'user');
93
94
95/*
96 * Actions
97 */
98
99if (GETPOST('cancel', 'alpha')) {
100 $action = 'list';
101}
102
103$error = 0;
104
105// Add a notification
106if ($action == 'add' && $permissiontoadd) {
107 if ($actionid <= 0) {
108 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Action")), null, 'errors');
109 $error++;
110 $action = 'create';
111 }
112
113 if (!$error) {
114 $db->begin();
115
116 $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
117 $sql .= " WHERE fk_user = ".((int) $id)." AND fk_action = ".((int) $actionid);
118 if ($db->query($sql)) {
119 $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec, fk_user, fk_action)";
120 $sql .= " VALUES ('".$db->idate($now)."', ".((int) $id).", ".((int) $actionid).")";
121
122 if (!$db->query($sql)) {
123 $error++;
125 }
126 } else {
128 }
129
130 if (!$error) {
131 $db->commit();
132 } else {
133 $db->rollback();
134 $action = 'create';
135 }
136 }
137}
138
139// Remove a notification (edit a user)
140if ($action == 'delete' && $permissiontoadd) {
141 $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid = ".GETPOSTINT("actid");
142 $db->query($sql);
143}
144
145
146
147/*
148 * View
149 */
150
151$form = new Form($db);
152
153$object = new User($db);
154$result = $object->fetch($id, '', '', 1);
155$object->loadRights();
156
157$title = $langs->trans("ThirdParty").' - '.$langs->trans("Notification");
158if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/thirdpartynameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) {
159 $title = $object->name.' - '.$langs->trans("Notification");
160}
161$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
162
163llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-user page-notify_card');
164$type = array('email' => $langs->trans("EMail"), 'sms' => $langs->trans("SMS"));
165
166if ($result > 0) {
167 $langs->load("other");
168
169 $head = user_prepare_head($object);
170
171 print dol_get_fiche_head($head, 'notify', $langs->trans("User"), -1, 'user');
172
173 $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
174
175 $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">';
176 $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard', 'class="valignmiddle marginleftonly paddingrightonly"');
177 $morehtmlref .= '</a>';
178
179 $urltovirtualcard = '/user/virtualcard.php?id='.((int) $object->id);
180 $morehtmlref .= dolButtonToOpenUrlInDialogPopup('publicvirtualcard', $langs->transnoentitiesnoconv("PublicVirtualCardUrl").' - '.$object->getFullName($langs), img_picto($langs->trans("PublicVirtualCardUrl"), 'card', 'class="valignmiddle marginleftonly paddingrightonly"'), $urltovirtualcard, '', 'refid valignmiddle nohover');
181
182 dol_banner_tab($object, 'id', $linkback, $user->hasRight('user', 'user', 'lire') || $user->admin, 'rowid', 'ref', $morehtmlref, '', 0, '', '', 0, '');
183
184 print '<div class="fichecenter">';
185
186 print '<div class="underbanner clearboth"></div>';
187 print '<table class="border centpercent tableforfield">';
188
189 // Login
190 print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
191 if (!empty($object->ldap_sid) && $object->statut == 0) {
192 print '<td class="error">';
193 print $langs->trans("LoginAccountDisableInDolibarr");
194 print '</td>';
195 } else {
196 print '<td>';
197 $addadmin = '';
198 if (property_exists($object, 'admin')) {
199 if (isModEnabled('multicompany') && !empty($object->admin) && empty($object->entity)) {
200 $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "superadmin", 'class="paddingleft valignmiddle"');
201 } elseif (!empty($object->admin)) {
202 $addadmin .= img_picto($langs->trans("AdministratorDesc"), "admin", 'class="paddingleft valignmiddle"');
203 }
204 }
205 print showValueWithClipboardCPButton($object->login).$addadmin;
206 print '</td>';
207 }
208 print '</tr>'."\n";
209
210 print '</table>';
211
212 print '</div>';
213
214 print dol_get_fiche_end();
215
216 print "\n";
217
218 // Help
219 print '<span class="opacitymedium hideonsmartphone">';
220 print '<br>'.$langs->trans("NotificationsDesc");
221 print '<br>'.$langs->trans("NotificationsDescUser").' - '.$langs->trans("YouAreHere");
222 if (isModEnabled('societe')) {
223 print '<br>'.$langs->trans("NotificationsDescContact");
224 }
225 print '<br>'.$langs->trans("NotificationsDescGlobal");
226 print '</span>';
227
228 print '<br><br><br>'."\n";
229
230
231 // Add notification form
232
233 print '<form action="'.$_SERVER["PHP_SELF"].'?id='.urlencode((string) ($id)).'" method="POST">';
234 print '<input type="hidden" name="token" value="'.newToken().'">';
235 print '<input type="hidden" name="page_y" value="">';
236 if ($action == 'create') {
237 print '<input type="hidden" name="action" id="action" value="add">';
238 }
239
240 $param = "&id=".urlencode((string) ($id));
241
242 // Line with titles
243
244 // List of notifications enabled for contacts
245 $sql = "SELECT n.rowid, n.type,";
246 $sql .= " a.code, a.label,";
247 $sql .= " c.rowid as userid, c.entity, c.login, c.lastname, c.firstname, c.email, c.photo, c.gender, c.statut as status";
248 $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
249 $sql .= " ".MAIN_DB_PREFIX."notify_def as n,";
250 $sql .= " ".MAIN_DB_PREFIX."user c";
251 $sql .= " WHERE a.rowid = n.fk_action";
252 $sql .= " AND c.rowid = n.fk_user";
253 $sql .= " AND c.rowid = ".((int) $object->id);
254 $sql .= " AND n.entity IN (".getEntity('notify_def').')';
255
256 $resql = $db->query($sql);
257 $num = 0;
258 if ($resql) {
259 $num = $db->num_rows($resql);
260 } else {
262 }
263
264 $newcardbutton = '';
265 $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', (int) $permissiontoadd);
266
267 $titlelist = $form->textwithpicto($langs->trans("ListOfActiveNotifications"), $langs->trans("ListOfActiveNotificationsHelp", $langs->transnoentitiesnoconv("Target"), $langs->transnoentitiesnoconv("Event")));
268
269 $limitforsubscription = 0; // We show all subscription of user. Pagination will be reserved for the section of notifications sent.
270 // List of active notifications
271 // @phan-suppress-next-line PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamOrder
272 print_barre_liste($titlelist, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, 'email', 0, $newcardbutton, '', $limitforsubscription, 0, 0, 1);
273
274 // Line with titles
275 print '<div class="div-table-responsive-no-min">';
276 print '<table class="noborder centpercent">';
277 print '<tr class="liste_titre">';
278 print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '', $sortfield, $sortorder);
279 print_liste_field_titre("Event", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder);
280 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '', $sortfield, $sortorder);
281 print_liste_field_titre('', '', '');
282 print "</tr>\n";
283
284
285 if ($action == 'create') {
286 // $listofemails=$object->thirdparty_and_contact_email_array();
287 if ($object->email) {
288 $actions = array();
289
290 // Load array of available notifications
291 $notificationtrigger = new InterfaceNotification($db);
292 $listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
293
294 foreach ($listofnotifiedevents as $notifiedevent) {
295 $label = ($langs->trans("Notify_".$notifiedevent['code']) != "Notify_".$notifiedevent['code'] ? $langs->trans("Notify_".$notifiedevent['code']) : $notifiedevent['label']);
296 $actions[$notifiedevent['rowid']] = $label;
297 }
298 print '<tr class="oddeven nohover"><td>';
299 print $object->getNomUrl(1);
300 if (isValidEmail($object->email)) {
301 print ' &lt;'.$object->email.'&gt;';
302 } else {
303 $langs->load("errors");
304 print ' &nbsp; '.img_warning().' '.$langs->trans("ErrorBadEMail", $object->email);
305 }
306 print '</td>';
307 print '<td class="tdoverflowmax200">';
308 print img_picto('', 'object_action', '', 0, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1);
309 print '</td>';
310 print '<td>';
311 print $form->selectarray("typeid", $type);
312 print '</td>';
313 print '<td class="nowraponall">';
314 print '<input type="submit" class="button button-add small" value="'.$langs->trans("Add").'">';
315 print '&nbsp;';
316 print '<input type="submit" class="button button-cancel small" name="cancel" value="'.$langs->trans("Cancel").'">';
317 print '</td>';
318 print '</tr>';
319 } else {
320 print '<tr class="oddeven"><td colspan="4" class="opacitymedium">';
321 print $langs->trans("YouMustAssignUserMailFirst");
322 print '</td></tr>';
323 }
324 } else {
325 if ($num) {
326 $i = 0;
327
328 $userstatic = new User($db);
329
330 while ($i < $num) {
331 $obj = $db->fetch_object($resql);
332
333 $userstatic->id = $obj->userid;
334 $userstatic->lastname = $obj->lastname;
335 $userstatic->firstname = $obj->firstname;
336 $userstatic->email = $obj->email;
337 $userstatic->status = $obj->status;
338 $userstatic->photo = $obj->photo;
339 $userstatic->gender = $obj->gender;
340
341 print '<tr class="oddeven">';
342 print '<td>'.$userstatic->getNomUrl(-1);
343 if ($obj->type == 'email') {
344 if (isValidEmail($obj->email)) {
345 print ' &lt;'.$obj->email.'&gt;';
346 } else {
347 $langs->load("errors");
348 print ' &nbsp; '.img_warning().' <span class="warning">'.$langs->trans("ErrorBadEMail", $obj->email).'</span>';
349 }
350 }
351 print '</td>';
352
353 $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
354 print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($label).'">';
355 print img_picto('', 'object_action', '', 0, 0, 0, '', 'pictofixedwidth').$label;
356 print '</td>';
357
358 print '<td>';
359 print $type[$obj->type];
360 print '</td>';
361 print '<td class="right"><a href="card.php?id='.$id.'&action=delete&token='.newToken().'&actid='.$obj->rowid.'">'.img_delete().'</a></td>';
362 print '</tr>';
363 $i++;
364 }
365 $db->free($resql);
366 } else {
367 print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
368 }
369 // List of notifications enabled for fixed email
370 /*
371 foreach($conf->global as $key => $val) {
372 if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
373 print '<tr class="oddeven"><td>';
374 $listtmp=explode(',', $val);
375 $first=1;
376 foreach($listtmp as $keyemail => $valemail) {
377 if (! $first) print ', ';
378 $first=0;
379 $valemail=trim($valemail);
380 //print $keyemail.' - '.$valemail.' - '.$reg[1].'<br>';
381 if (isValidEmail($valemail, 1)) {
382 if ($valemail == '__SUPERVISOREMAIL__') print $valemail;
383 else print ' &lt;'.$valemail.'&gt;';
384 } else {
385 print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail);
386 }
387 }
388 print '</td>';
389 print '<td>';
390 $notifcode=preg_replace('/_THRESHOLD_.*$/','',$reg[1]);
391 $notifcodecond=preg_replace('/^.*_(THRESHOLD_)/','$1',$reg[1]);
392 $label=($langs->trans("Notify_".$notifcode)!="Notify_".$notifcode?$langs->trans("Notify_".$notifcode):$notifcode);
393 print $label;
394 if (preg_match('/^THRESHOLD_HIGHER_(.*)$/',$notifcodecond,$regcond) && ($regcond[1] > 0)) {
395 print ' - '.$langs->trans("IfAmountHigherThan",$regcond[1]);
396 }
397 print '</td>';
398 print '<td>';
399 print $langs->trans("Email");
400 print '</td>';
401 print '<td class="right">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</td>';
402 print '</tr>';
403 }*/
404 /*if ($user->admin) {
405 print '<tr class="oddeven"><td colspan="4">';
406 print '+ <a href="'.DOL_URL_ROOT.'/admin/notification.php">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</a>';
407 print '</td></tr>';
408 }*/
409 }
410
411 print '</table>';
412 print '</div>';
413
414 print '</form>';
415
416
417 print '<br><br>'."\n";
418
419
420 // List
421 $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,";
422 $sql .= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail, c.photo, c.gender, c.statut as status,";
423 $sql .= " a.code, a.label";
424 $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
425 $sql .= " ".MAIN_DB_PREFIX."notify as n";
426 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as c ON n.fk_user = c.rowid";
427 $sql .= " WHERE a.rowid = n.fk_action";
428 $sql .= " AND n.fk_user = ".((int) $object->id);
429 $sql .= $db->order($sortfield, $sortorder);
430
431 // Count total nb of records
432 $nbtotalofrecords = '';
433 if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
434 $result = $db->query($sql);
435 $nbtotalofrecords = $db->num_rows($result);
436 if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
437 $page = 0;
438 $offset = 0;
439 }
440 }
441
442 $sql .= $db->plimit($limit + 1, $offset);
443
444 $resql = $db->query($sql);
445 if ($resql) {
446 $num = $db->num_rows($resql);
447 } else {
449 }
450
451 $param = '&id='.$object->id;
452 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
453 $param .= '&contextpage='.$contextpage;
454 }
455 if ($limit > 0 && $limit != $conf->liste_limit) {
456 $param .= '&limit='.$limit;
457 }
458
459 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
460 //if (isset($optioncss) && $optioncss != '') {
461 // print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
462 //}
463 print '<input type="hidden" name="token" value="'.newToken().'">';
464 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
465 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
466 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
467 print '<input type="hidden" name="page" value="'.$page.'">';
468 print '<input type="hidden" name="id" value="'.$object->id.'">';
469
470 $titlelist = $form->textwithpicto($langs->trans("ListOfNotificationsDone"), $langs->trans("ListOfNotificationsDoneHelp"));
471
472 // List of notifications done @phan-suppress-next-line PhanPluginSuspiciousParamOrder
473 print_barre_liste($titlelist, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'email', 0, '', '', $limit, '');
474
475 // Line with titles
476 print '<div class="div-table-responsive-no-min">';
477 print '<table class="centpercent noborder">';
478 print '<tr class="liste_titre">';
479 print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '', $sortfield, $sortorder);
480 print_liste_field_titre("Event", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder);
481 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '', $sortfield, $sortorder);
482 //print_liste_field_titre("Object",$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder);
483 print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "n.daten", '', $param, '', $sortfield, $sortorder, 'right ');
484 print '</tr>';
485
486 if ($num) {
487 $i = 0;
488
489 $userstatic = new User($db);
490
491 while ($i < $num) {
492 $obj = $db->fetch_object($resql);
493
494 print '<tr class="oddeven"><td>';
495 if ($obj->id > 0) {
496 $userstatic->id = $obj->id;
497 $userstatic->lastname = $obj->lastname;
498 $userstatic->firstname = $obj->firstname;
499 $userstatic->status = $obj->status;
500 $userstatic->email = $obj->email;
501 $userstatic->photo = $obj->photo;
502 $userstatic->gender = $obj->gender;
503
504 print $userstatic->getNomUrl(-1);
505 print $obj->email ? ' &lt;'.$obj->email.'&gt;' : $langs->trans("NoMail");
506 } else {
507 print $obj->email;
508 }
509 print '</td>';
510
511 $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
512 print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($label).'">';
513 print img_picto('', 'object_action', '', 0, 0, 0, '', 'pictofixedwidth').$label;
514 print '</td>';
515 print '<td>';
516 print $type[$obj->type];
517 print '</td>';
518 // TODO Add link to object here for other types
519 /*print '<td>';
520 if ($obj->object_type == 'order') {
521 $orderstatic->id=$obj->object_id;
522 $orderstatic->ref=...
523 print $orderstatic->getNomUrl(1);
524 }
525 print '</td>';*/
526 // print
527 print'<td class="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
528 print '</tr>';
529 $i++;
530 }
531 $db->free($resql);
532 } else {
533 print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
534 }
535
536 print '</table>';
537 print '</div>';
538
539 print '</form>';
540} else {
541 recordNotFound('', 0);
542}
543
544// End of page
545llxFooter();
546$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.
recordNotFound($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Displays an error page when a record is not found.
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.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
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.
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.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_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.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
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.