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