dolibarr 20.0.0
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 Frédéric France <frederic.france@free.fr>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
29// Load Dolibarr environment
30require '../../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
32require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
33require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
34require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php';
35
36// Load translation files required by page
37$langs->loadLangs(array('companies', 'mails', 'admin', 'other', 'errors'));
38
39$id = GETPOSTINT("id");
40$ref = GETPOST('ref', 'alpha');
41
42if (!isset($id) || empty($id)) {
44}
45
46$action = GETPOST('action', 'aZ09');
47$actionid = GETPOSTINT('actionid');
48
49$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
50$sortfield = GETPOST('sortfield', 'aZ09comma');
51$sortorder = GETPOST('sortorder', 'aZ09comma');
52$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
53if (!$sortorder) {
54 $sortorder = "DESC";
55}
56if (!$sortfield) {
57 $sortfield = "n.daten";
58}
59if (empty($page) || $page == -1) {
60 $page = 0;
61}
62$offset = $limit * $page;
63$pageprev = $page - 1;
64$pagenext = $page + 1;
65
66$now = dol_now();
67
68// Security check
69$object = new User($db);
70if ($id > 0 || !empty($ref)) {
71 $result = $object->fetch($id, $ref, '', 1);
72 $object->getrights();
73}
74
75$permissiontoadd = (($object->id == $user->id) || ($user->hasRight('user', 'user', 'lire')));
76
77// Security check
78if ($user->socid) {
79 $id = $user->socid;
80}
81$result = restrictedArea($user, 'user', '', '', 'user');
82
83
84/*
85 * Actions
86 */
87
88if (GETPOST('cancel', 'alpha')) {
89 $action = 'list';
90}
91
92// Add a notification
93if ($action == 'add') {
94 $error = 0;
95
96 if ($actionid <= 0) {
97 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Action")), null, 'errors');
98 $error++;
99 $action = 'create';
100 }
101
102 if (!$error) {
103 $db->begin();
104
105 $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
106 $sql .= " WHERE fk_user=".((int) $id)." AND fk_action=".((int) $actionid);
107 if ($db->query($sql)) {
108 $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec, fk_user, fk_action)";
109 $sql .= " VALUES ('".$db->idate($now)."', ".((int) $id).", ".((int) $actionid).")";
110
111 if (!$db->query($sql)) {
112 $error++;
113 dol_print_error($db);
114 }
115 } else {
116 dol_print_error($db);
117 }
118
119 if (!$error) {
120 $db->commit();
121 } else {
122 $db->rollback();
123 $action = 'create';
124 }
125 }
126}
127
128// Remove a notification
129if ($action == 'delete') {
130 $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".GETPOSTINT("actid");
131 $db->query($sql);
132}
133
134
135
136/*
137 * View
138 */
139
140$form = new Form($db);
141
142$object = new User($db);
143$result = $object->fetch($id, '', '', 1);
144$object->getrights();
145
146$title = $langs->trans("ThirdParty").' - '.$langs->trans("Notification");
147if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/thirdpartynameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) {
148 $title = $object->name.' - '.$langs->trans("Notification");
149}
150$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
151llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-user page-notify_card');
152
153
154if ($result > 0) {
155 $langs->load("other");
156
157 $head = user_prepare_head($object);
158
159 print dol_get_fiche_head($head, 'notify', $langs->trans("User"), -1, 'user');
160
161 $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
162
163 $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'&output=file&file='.urlencode(dol_sanitizeFileName($object->getFullName($langs).'.vcf')).'" class="refid" rel="noopener">';
164 $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
165 $morehtmlref .= '</a>';
166
167 $urltovirtualcard = '/user/virtualcard.php?id='.((int) $object->id);
168 $morehtmlref .= dolButtonToOpenUrlInDialogPopup('publicvirtualcard', $langs->transnoentitiesnoconv("PublicVirtualCardUrl").' - '.$object->getFullName($langs), img_picto($langs->trans("PublicVirtualCardUrl"), 'card', 'class="valignmiddle marginleftonly paddingrightonly"'), $urltovirtualcard, '', 'nohover');
169
170 dol_banner_tab($object, 'id', $linkback, $user->hasRight('user', 'user', 'lire') || $user->admin, 'rowid', 'ref', $morehtmlref, '', 0, '', '', 0, '');
171
172 print '<div class="fichecenter">';
173
174 print '<div class="underbanner clearboth"></div>';
175 print '<table class="border centpercent tableforfield">';
176
177 // Login
178 print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
179 if (!empty($object->ldap_sid) && $object->statut == 0) {
180 print '<td class="error">';
181 print $langs->trans("LoginAccountDisableInDolibarr");
182 print '</td>';
183 } else {
184 print '<td>';
185 $addadmin = '';
186 if (property_exists($object, 'admin')) {
187 if (isModEnabled('multicompany') && !empty($object->admin) && empty($object->entity)) {
188 $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"');
189 } elseif (!empty($object->admin)) {
190 $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"');
191 }
192 }
193 print showValueWithClipboardCPButton($object->login).$addadmin;
194 print '</td>';
195 }
196 print '</tr>'."\n";
197
198 /*print '<tr><td class="titlefield">'.$langs->trans("NbOfActiveNotifications").'</td>'; // Notification for this thirdparty
199 print '<td colspan="3">';
200 $nbofrecipientemails=0;
201 $notify=new Notify($db);
202 $tmparray = $notify->getNotificationsArray('', 0, null, $object->id, array('user'));
203 foreach($tmparray as $tmpkey => $tmpval)
204 {
205 $nbofrecipientemails++;
206 }
207 print $nbofrecipientemails;
208 print '</td></tr>';*/
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">';
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 // print load_fiche_titre($langs->trans("AddNewNotification"), '', '');
233
234 print '<form action="'.$_SERVER["PHP_SELF"].'?id='.urlencode((string) ($id)).'" method="POST">';
235 print '<input type="hidden" name="token" value="'.newToken().'">';
236 print '<input type="hidden" name="action" value="add">';
237
238 $param = "&id=".urlencode((string) ($id));
239
240 // Line with titles
241 /* print '<table width="100%" class="noborder">';
242 print '<tr class="liste_titre">';
243 print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder);
244 print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder);
245 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder);
246 print_liste_field_titre('');
247 print "</tr>\n";
248
249 print '</table>';
250
251 print '<br>';
252 */
253 // List of notifications enabled for contacts
254 $sql = "SELECT n.rowid, n.type,";
255 $sql .= " a.code, a.label,";
256 $sql .= " c.rowid as userid, c.entity, c.login, c.lastname, c.firstname, c.email, c.statut as status";
257 $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
258 $sql .= " ".MAIN_DB_PREFIX."notify_def as n,";
259 $sql .= " ".MAIN_DB_PREFIX."user c";
260 $sql .= " WHERE a.rowid = n.fk_action";
261 $sql .= " AND c.rowid = n.fk_user";
262 $sql .= " AND c.rowid = ".((int) $object->id);
263 $sql .= " AND c.entity IN (".getEntity('user').')';
264
265 $resql = $db->query($sql);
266 if ($resql) {
267 $num = $db->num_rows($resql);
268 } else {
269 dol_print_error($db);
270 }
271
272 $newcardbutton = '';
273 $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
274
275 $titlelist = $langs->trans("ListOfActiveNotifications");
276
277 // List of active notifications
278 // @phan-suppress-next-line PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamOrder
279 print_barre_liste($titlelist, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, 'email', 0, $newcardbutton, '', $limit, 0, 0, 1);
280
281 // Line with titles
282 print '<table width="100%" class="noborder">';
283 print '<tr class="liste_titre">';
284 print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder);
285 print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder);
286 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder);
287 print_liste_field_titre('', '', '');
288 print '</tr>';
289
290
291 if ($action == 'create') {
292 // $listofemails=$object->thirdparty_and_contact_email_array();
293 if ($object->email) {
294 $actions = array();
295
296 // Load array of available notifications
297 $notificationtrigger = new InterfaceNotification($db);
298 $listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
299
300 foreach ($listofnotifiedevents as $notifiedevent) {
301 $label = ($langs->trans("Notify_".$notifiedevent['code']) != "Notify_".$notifiedevent['code'] ? $langs->trans("Notify_".$notifiedevent['code']) : $notifiedevent['label']);
302 $actions[$notifiedevent['rowid']] = $label;
303 }
304 print '<tr class="oddeven nohover"><td>';
305 print $object->getNomUrl(1);
306 if (isValidEmail($object->email)) {
307 print ' &lt;'.$object->email.'&gt;';
308 } else {
309 $langs->load("errors");
310 print ' &nbsp; '.img_warning().' '.$langs->trans("ErrorBadEMail", $object->email);
311 }
312 print '</td>';
313 print '<td>';
314 print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1);
315 print '</td>';
316 print '<td>';
317 $type = array('email' => $langs->trans("EMail"));
318 print $form->selectarray("typeid", $type);
319 print '</td>';
320 print '<td class="nowraponall">';
321 print '<input type="submit" class="button button-add" value="'.$langs->trans("Add").'">';
322 print '&nbsp;';
323 print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
324 print '</td>';
325 print '</tr>';
326 } else {
327 print '<tr class="oddeven"><td colspan="4">';
328 print $langs->trans("YouMustAssignUserMailFirst");
329 print '</td></tr>';
330 }
331 } else {
332 if ($num) {
333 $i = 0;
334
335 $userstatic = new User($db);
336
337 while ($i < $num) {
338 $obj = $db->fetch_object($resql);
339
340 $userstatic->id = $obj->userid;
341 $userstatic->lastname = $obj->lastname;
342 $userstatic->firstname = $obj->firstname;
343 $userstatic->email = $obj->email;
344 $userstatic->status = $obj->status;
345
346 print '<tr class="oddeven">';
347 print '<td>'.$userstatic->getNomUrl(1);
348 if ($obj->type == 'email') {
349 if (isValidEmail($obj->email)) {
350 print ' &lt;'.$obj->email.'&gt;';
351 } else {
352 $langs->load("errors");
353 print ' &nbsp; '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email);
354 }
355 }
356 print '</td>';
357 print '<td>';
358 $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
359 print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$label;
360 print '</td>';
361 print '<td>';
362 if ($obj->type == 'email') {
363 print $langs->trans("Email");
364 }
365 if ($obj->type == 'sms') {
366 print $langs->trans("SMS");
367 }
368 print '</td>';
369 print '<td class="right"><a href="card.php?id='.$id.'&action=delete&token='.newToken().'&actid='.$obj->rowid.'">'.img_delete().'</a></td>';
370 print '</tr>';
371 $i++;
372 }
373 $db->free($resql);
374 } else {
375 print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
376 }
377 // List of notifications enabled for fixed email
378 /*
379 foreach($conf->global as $key => $val) {
380 if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
381 print '<tr class="oddeven"><td>';
382 $listtmp=explode(',', $val);
383 $first=1;
384 foreach($listtmp as $keyemail => $valemail) {
385 if (! $first) print ', ';
386 $first=0;
387 $valemail=trim($valemail);
388 //print $keyemail.' - '.$valemail.' - '.$reg[1].'<br>';
389 if (isValidEmail($valemail, 1)) {
390 if ($valemail == '__SUPERVISOREMAIL__') print $valemail;
391 else print ' &lt;'.$valemail.'&gt;';
392 } else {
393 print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail);
394 }
395 }
396 print '</td>';
397 print '<td>';
398 $notifcode=preg_replace('/_THRESHOLD_.*$/','',$reg[1]);
399 $notifcodecond=preg_replace('/^.*_(THRESHOLD_)/','$1',$reg[1]);
400 $label=($langs->trans("Notify_".$notifcode)!="Notify_".$notifcode?$langs->trans("Notify_".$notifcode):$notifcode);
401 print $label;
402 if (preg_match('/^THRESHOLD_HIGHER_(.*)$/',$notifcodecond,$regcond) && ($regcond[1] > 0)) {
403 print ' - '.$langs->trans("IfAmountHigherThan",$regcond[1]);
404 }
405 print '</td>';
406 print '<td>';
407 print $langs->trans("Email");
408 print '</td>';
409 print '<td class="right">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</td>';
410 print '</tr>';
411 }*/
412 /*if ($user->admin) {
413 print '<tr class="oddeven"><td colspan="4">';
414 print '+ <a href="'.DOL_URL_ROOT.'/admin/notification.php">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</a>';
415 print '</td></tr>';
416 }*/
417 }
418
419 print '</table>';
420
421 print '</form>';
422
423
424 print '<br><br>'."\n";
425
426
427 // List
428 $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,";
429 $sql .= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail, c.statut as status,";
430 $sql .= " a.code, a.label";
431 $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
432 $sql .= " ".MAIN_DB_PREFIX."notify as n";
433 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as c ON n.fk_user = c.rowid";
434 $sql .= " WHERE a.rowid = n.fk_action";
435 $sql .= " AND n.fk_user = ".((int) $object->id);
436 $sql .= $db->order($sortfield, $sortorder);
437
438 // Count total nb of records
439 $nbtotalofrecords = '';
440 if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
441 $result = $db->query($sql);
442 $nbtotalofrecords = $db->num_rows($result);
443 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
444 $page = 0;
445 $offset = 0;
446 }
447 }
448
449 $sql .= $db->plimit($limit + 1, $offset);
450
451 $resql = $db->query($sql);
452 if ($resql) {
453 $num = $db->num_rows($resql);
454 } else {
455 dol_print_error($db);
456 }
457
458 $param = '&id='.$object->id;
459 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
460 $param .= '&contextpage='.$contextpage;
461 }
462 if ($limit > 0 && $limit != $conf->liste_limit) {
463 $param .= '&limit='.$limit;
464 }
465
466 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
467 if (isset($optioncss) && $optioncss != '') {
468 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
469 }
470 print '<input type="hidden" name="token" value="'.newToken().'">';
471 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
472 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
473 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
474 print '<input type="hidden" name="page" value="'.$page.'">';
475 print '<input type="hidden" name="id" value="'.$object->id.'">';
476
477 // List of notifications done @phan-suppress-next-line PhanPluginSuspiciousParamOrder
478 print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'email', 0, '', '', $limit);
479
480 // Line with titles
481 print '<table width="100%" class="noborder">';
482 print '<tr class="liste_titre">';
483 print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '', $sortfield, $sortorder);
484 print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder);
485 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '', $sortfield, $sortorder);
486 //print_liste_field_titre("Object",$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder);
487 print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "n.daten", '', $param, '', $sortfield, $sortorder, 'right ');
488 print '</tr>';
489
490 if ($num) {
491 $i = 0;
492
493 $userstatic = new User($db);
494
495 while ($i < $num) {
496 $obj = $db->fetch_object($resql);
497
498 print '<tr class="oddeven"><td>';
499 if ($obj->id > 0) {
500 $userstatic->id = $obj->id;
501 $userstatic->lastname = $obj->lastname;
502 $userstatic->firstname = $obj->firstname;
503 $userstatic->status = $obj->status;
504 $userstatic->email = $obj->email;
505 print $userstatic->getNomUrl(1);
506 print $obj->email ? ' &lt;'.$obj->email.'&gt;' : $langs->trans("NoMail");
507 } else {
508 print $obj->email;
509 }
510 print '</td>';
511 print '<td>';
512 $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
513 print $label;
514 print '</td>';
515 print '<td>';
516 if ($obj->type == 'email') {
517 print $langs->trans("Email");
518 }
519 if ($obj->type == 'sms') {
520 print $langs->trans("Sms");
521 }
522 print '</td>';
523 // TODO Add link to object here for other types
524 /*print '<td>';
525 if ($obj->object_type == 'order') {
526 $orderstatic->id=$obj->object_id;
527 $orderstatic->ref=...
528 print $orderstatic->getNomUrl(1);
529 }
530 print '</td>';*/
531 // print
532 print'<td class="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
533 print '</tr>';
534 $i++;
535 }
536 $db->free($resql);
537 } else {
538 print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
539 }
540
541 print '</table>';
542
543 print '</form>';
544} else {
545 dol_print_error(null, 'RecordNotFound');
546}
547
548// End of page
549llxFooter();
550$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage generation of HTML components Only common components must be here.
Class of triggers for notification module.
Class to manage Dolibarr users.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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)
Show tabs of a record.
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.
dolButtonToOpenUrlInDialogPopup($name, $label, $buttonstring, $url, $disabled='', $morecss='classlink button bordertransp', $jsonopen='', $backtopagejsfields='', $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_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $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, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
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.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
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 dolibarr global constant string value.
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.