dolibarr 19.0.3
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 (getDolGlobalString('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->transnoentitiesnoconv("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->hasRight('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 = '';
270 $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
271
272 $title = $langs->trans("ListOfActiveNotifications");
273
274 // List of active notifications
275 //print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', '');
276 print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, 'email', 0, $newcardbutton, '', $limit, 0, 0, 1);
277
278 // Line with titles
279 print '<table width="100%" class="noborder">';
280 print '<tr class="liste_titre">';
281 print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder);
282 print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder);
283 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder);
284 print_liste_field_titre('', '', '');
285 print '</tr>';
286
287
288 if ($action == 'create') {
289 // $listofemails=$object->thirdparty_and_contact_email_array();
290 if ($object->email) {
291 $actions = array();
292
293 // Load array of available notifications
294 $notificationtrigger = new InterfaceNotification($db);
295 $listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
296
297 foreach ($listofnotifiedevents as $notifiedevent) {
298 $label = ($langs->trans("Notify_".$notifiedevent['code']) != "Notify_".$notifiedevent['code'] ? $langs->trans("Notify_".$notifiedevent['code']) : $notifiedevent['label']);
299 $actions[$notifiedevent['rowid']] = $label;
300 }
301 print '<tr class="oddeven nohover"><td>';
302 print $object->getNomUrl(1);
303 if (isValidEmail($object->email)) {
304 print ' &lt;'.$object->email.'&gt;';
305 } else {
306 $langs->load("errors");
307 print ' &nbsp; '.img_warning().' '.$langs->trans("ErrorBadEMail", $object->email);
308 }
309 print '</td>';
310 print '<td>';
311 print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1);
312 print '</td>';
313 print '<td>';
314 $type = array('email'=>$langs->trans("EMail"));
315 print $form->selectarray("typeid", $type);
316 print '</td>';
317 print '<td class="nowraponall">';
318 print '<input type="submit" class="button button-add" value="'.$langs->trans("Add").'">';
319 print '&nbsp;';
320 print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
321 print '</td>';
322 print '</tr>';
323 } else {
324 print '<tr class="oddeven"><td colspan="4">';
325 print $langs->trans("YouMustAssignUserMailFirst");
326 print '</td></tr>';
327 }
328 } else {
329 if ($num) {
330 $i = 0;
331
332 $userstatic = new User($db);
333
334 while ($i < $num) {
335 $obj = $db->fetch_object($resql);
336
337 $userstatic->id = $obj->userid;
338 $userstatic->lastname = $obj->lastname;
339 $userstatic->firstname = $obj->firstname;
340 $userstatic->email = $obj->email;
341 $userstatic->statut = $obj->status;
342
343 print '<tr class="oddeven">';
344 print '<td>'.$userstatic->getNomUrl(1);
345 if ($obj->type == 'email') {
346 if (isValidEmail($obj->email)) {
347 print ' &lt;'.$obj->email.'&gt;';
348 } else {
349 $langs->load("errors");
350 print ' &nbsp; '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email);
351 }
352 }
353 print '</td>';
354 print '<td>';
355 $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
356 print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$label;
357 print '</td>';
358 print '<td>';
359 if ($obj->type == 'email') {
360 print $langs->trans("Email");
361 }
362 if ($obj->type == 'sms') {
363 print $langs->trans("SMS");
364 }
365 print '</td>';
366 print '<td class="right"><a href="card.php?id='.$id.'&action=delete&token='.newToken().'&actid='.$obj->rowid.'">'.img_delete().'</a></td>';
367 print '</tr>';
368 $i++;
369 }
370 $db->free($resql);
371 } else {
372 print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
373 }
374 // List of notifications enabled for fixed email
375 /*
376 foreach($conf->global as $key => $val) {
377 if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
378 print '<tr class="oddeven"><td>';
379 $listtmp=explode(',', $val);
380 $first=1;
381 foreach($listtmp as $keyemail => $valemail) {
382 if (! $first) print ', ';
383 $first=0;
384 $valemail=trim($valemail);
385 //print $keyemail.' - '.$valemail.' - '.$reg[1].'<br>';
386 if (isValidEmail($valemail, 1)) {
387 if ($valemail == '__SUPERVISOREMAIL__') print $valemail;
388 else print ' &lt;'.$valemail.'&gt;';
389 } else {
390 print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail);
391 }
392 }
393 print '</td>';
394 print '<td>';
395 $notifcode=preg_replace('/_THRESHOLD_.*$/','',$reg[1]);
396 $notifcodecond=preg_replace('/^.*_(THRESHOLD_)/','$1',$reg[1]);
397 $label=($langs->trans("Notify_".$notifcode)!="Notify_".$notifcode?$langs->trans("Notify_".$notifcode):$notifcode);
398 print $label;
399 if (preg_match('/^THRESHOLD_HIGHER_(.*)$/',$notifcodecond,$regcond) && ($regcond[1] > 0)) {
400 print ' - '.$langs->trans("IfAmountHigherThan",$regcond[1]);
401 }
402 print '</td>';
403 print '<td>';
404 print $langs->trans("Email");
405 print '</td>';
406 print '<td class="right">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</td>';
407 print '</tr>';
408 }*/
409 /*if ($user->admin) {
410 print '<tr class="oddeven"><td colspan="4">';
411 print '+ <a href="'.DOL_URL_ROOT.'/admin/notification.php">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</a>';
412 print '</td></tr>';
413 }*/
414 }
415
416 print '</table>';
417
418 print '</form>';
419
420
421 print '<br><br>'."\n";
422
423
424 // List
425 $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,";
426 $sql .= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail, c.statut as status,";
427 $sql .= " a.code, a.label";
428 $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
429 $sql .= " ".MAIN_DB_PREFIX."notify as n";
430 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as c ON n.fk_user = c.rowid";
431 $sql .= " WHERE a.rowid = n.fk_action";
432 $sql .= " AND n.fk_user = ".((int) $object->id);
433 $sql .= $db->order($sortfield, $sortorder);
434
435 // Count total nb of records
436 $nbtotalofrecords = '';
437 if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
438 $result = $db->query($sql);
439 $nbtotalofrecords = $db->num_rows($result);
440 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
441 $page = 0;
442 $offset = 0;
443 }
444 }
445
446 $sql .= $db->plimit($limit + 1, $offset);
447
448 $resql = $db->query($sql);
449 if ($resql) {
450 $num = $db->num_rows($resql);
451 } else {
452 dol_print_error($db);
453 }
454
455 $param = '&id='.$object->id;
456 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
457 $param .= '&contextpage='.$contextpage;
458 }
459 if ($limit > 0 && $limit != $conf->liste_limit) {
460 $param .= '&limit='.$limit;
461 }
462
463 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
464 if (isset($optioncss) && $optioncss != '') {
465 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
466 }
467 print '<input type="hidden" name="token" value="'.newToken().'">';
468 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
469 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
470 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
471 print '<input type="hidden" name="page" value="'.$page.'">';
472 print '<input type="hidden" name="id" value="'.$object->id.'">';
473
474 // List of notifications done
475 print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'email', 0, '', '', $limit);
476
477 // Line with titles
478 print '<table width="100%" class="noborder">';
479 print '<tr class="liste_titre">';
480 print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '', $sortfield, $sortorder);
481 print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder);
482 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '', $sortfield, $sortorder);
483 //print_liste_field_titre("Object",$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder);
484 print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "n.daten", '', $param, '', $sortfield, $sortorder, 'right ');
485 print '</tr>';
486
487 if ($num) {
488 $i = 0;
489
490 $userstatic = new User($db);
491
492 while ($i < $num) {
493 $obj = $db->fetch_object($resql);
494
495 print '<tr class="oddeven"><td>';
496 if ($obj->id > 0) {
497 $userstatic->id = $obj->id;
498 $userstatic->lastname = $obj->lastname;
499 $userstatic->firstname = $obj->firstname;
500 $userstatic->statut = $obj->status;
501 $userstatic->email = $obj->email;
502 print $userstatic->getNomUrl(1);
503 print $obj->email ? ' &lt;'.$obj->email.'&gt;' : $langs->trans("NoMail");
504 } else {
505 print $obj->email;
506 }
507 print '</td>';
508 print '<td>';
509 $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
510 print $label;
511 print '</td>';
512 print '<td>';
513 if ($obj->type == 'email') {
514 print $langs->trans("Email");
515 }
516 if ($obj->type == 'sms') {
517 print $langs->trans("Sms");
518 }
519 print '</td>';
520 // TODO Add link to object here for other types
521 /*print '<td>';
522 if ($obj->object_type == 'order') {
523 $orderstatic->id=$obj->object_id;
524 $orderstatic->ref=...
525 print $orderstatic->getNomUrl(1);
526 }
527 print '</td>';*/
528 // print
529 print'<td class="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
530 print '</tr>';
531 $i++;
532 }
533 $db->free($resql);
534 } else {
535 print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
536 }
537
538 print '</table>';
539
540 print '</form>';
541} else {
542 dol_print_error('', 'RecordNotFound');
543}
544
545// End of page
546llxFooter();
547$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: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.
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 a 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.
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.