dolibarr 21.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-2017 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) 2024 MDW <mdeweerd@users.noreply.github.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/company.lib.php';
32require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
33require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php';
34
35$langs->loadLangs(array("companies", "mails", "admin", "other", "errors"));
36
37$socid = GETPOSTINT("socid");
38$action = GETPOST('action', 'aZ09');
39$contactid = GETPOST('contactid', 'alpha'); // May be an int or 'thirdparty'
40$actionid = GETPOSTINT('actionid');
41$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
42
43// Security check
44if ($user->socid) {
45 $socid = $user->socid;
46}
47
48// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
49$hookmanager->initHooks(array('thirdpartynotification', 'globalcard'));
50
51$result = restrictedArea($user, 'societe', '', '');
52
53$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
54$sortfield = GETPOST('sortfield', 'aZ09comma');
55$sortorder = GETPOST('sortorder', 'aZ09comma');
56$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
57if (!$sortorder) {
58 $sortorder = "DESC";
59}
60if (!$sortfield) {
61 $sortfield = "n.daten";
62}
63if (empty($page) || $page == -1) {
64 $page = 0;
65}
66$offset = $limit * $page;
67$pageprev = $page - 1;
68$pagenext = $page + 1;
69
70$now = dol_now();
71
72$object = new Societe($db);
73
74/*
75 * Actions
76 */
77
78$parameters = array('id' => $socid);
79$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
80if ($reshook < 0) {
81 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
82}
83
84if (empty($reshook)) {
85 $error = 0;
86
87 if (GETPOST('cancel', 'alpha')) {
88 $action = '';
89 }
90
91 // Add a notification
92 if ($action == 'add') {
93 if (empty($contactid)) {
94 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Contact")), null, 'errors');
95 $error++;
96 }
97 if ($actionid <= 0) {
98 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Action")), null, 'errors');
99 $error++;
100 }
101
102 if (!$error) {
103 $db->begin();
104
105 $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
106 $sql .= " WHERE fk_soc=".((int) $socid)." AND fk_contact=".((int) $contactid)." AND fk_action=".((int) $actionid);
107 if ($db->query($sql)) {
108 $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_soc, fk_contact, fk_action)";
109 $sql .= " VALUES ('".$db->idate($now)."',".((int) $socid).",".((int) $contactid).",".((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 }
124 }
125 }
126
127 // Remove a notification
128 if ($action == 'delete') {
129 $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".GETPOSTINT('actid');
130 $db->query($sql);
131 }
132}
133
134
135
136/*
137 * View
138 */
139
140$form = new Form($db);
141
142$object = new Societe($db);
143$result = $object->fetch($socid);
144
145$title = $langs->trans("ThirdParty").' - '.$langs->trans("Notification");
146if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/thirdpartynameonly/', getDolGlobalString('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';
150
151llxHeader('', $title, $help_url);
152
153
154if ($result > 0) {
155 $langs->load("other");
156
158
159 print dol_get_fiche_head($head, 'notify', $langs->trans("ThirdParty"), -1, 'company');
160
161 $linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
162
163 dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom');
164
165 print '<div class="fichecenter">';
166
167 print '<div class="underbanner clearboth"></div>';
168 print '<table class="border centpercent tableforfield">';
169
170 // Type Prospect/Customer/Supplier
171 print '<tr><td class="titlefield">'.$langs->trans('NatureOfThirdParty').'</td><td>';
172 print $object->getTypeUrl(1);
173 print '</td></tr>';
174
175 // Prefix
176 if (getDolGlobalString('SOCIETE_USEPREFIX')) { // Old not used prefix field
177 print '<tr><td class="titlefield">'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
178 }
179
180 if ($object->client) {
181 print '<tr><td class="titlefield">';
182 print $langs->trans('CustomerCode').'</td><td colspan="3">';
184 $tmpcheck = $object->check_codeclient();
185 if ($tmpcheck != 0 && $tmpcheck != -5) {
186 print ' <span class="error">('.$langs->trans("WrongCustomerCode").')</span>';
187 }
188 print '</td></tr>';
189 }
190
191 if ((isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $object->fournisseur && $user->hasRight('fournisseur', 'lire')) {
192 print '<tr><td class="titlefield">';
193 print $langs->trans('SupplierCode').'</td><td colspan="3">';
195 $tmpcheck = $object->check_codefournisseur();
196 if ($tmpcheck != 0 && $tmpcheck != -5) {
197 print ' <span class="error">('.$langs->trans("WrongSupplierCode").')</span>';
198 }
199 print '</td></tr>';
200 }
201
202 /*print '<tr><td class="titlefield">'.$langs->trans("NbOfActiveNotifications").'</td>'; // Notification for this thirdparty
203 print '<td colspan="3">';
204 $nbofrecipientemails=0;
205 $notify=new Notify($db);
206 $tmparray = $notify->getNotificationsArray('', $object->id, null, 0, array('thirdparty'));
207 foreach($tmparray as $tmpkey => $tmpval)
208 {
209 if (!empty($tmpkey)) $nbofrecipientemails++;
210 }
211 print $nbofrecipientemails;
212 print '</td></tr>';*/
213
214 print '</table>';
215
216 print '</div>';
217
218 print dol_get_fiche_end();
219
220 print "\n";
221
222 // Help
223 print '<div class="opacitymedium hideonsmartphone">';
224 print $langs->trans("NotificationsDesc");
225 print '<br>'.$langs->trans("NotificationsDescUser");
226 print '<br>'.$langs->trans("NotificationsDescContact").' - '.$langs->trans("YouAreHere");
227 print '<br>'.$langs->trans("NotificationsDescGlobal");
228 print '<br>';
229 print '</div>';
230
231 print '<br><br>'."\n";
232
233 $nbtotalofrecords = '';
234
235 // List of notifications enabled for contacts of the thirdparty
236 $sql = "SELECT n.rowid, n.type,";
237 $sql .= " a.code, a.label,";
238 $sql .= " c.rowid as contactid, c.lastname, c.firstname, c.email";
239 $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
240 $sql .= " ".MAIN_DB_PREFIX."notify_def as n,";
241 $sql .= " ".MAIN_DB_PREFIX."socpeople as c";
242 $sql .= " WHERE a.rowid = n.fk_action";
243 $sql .= " AND c.rowid = n.fk_contact";
244 $sql .= " AND c.fk_soc = ".((int) $object->id);
245
246 $resql = $db->query($sql);
247 if ($resql) {
248 $nbtotalofrecords = $db->num_rows($resql);
249 } else {
250 dol_print_error($db);
251 }
252
253 $param = '';
254 $newcardbutton = '';
255 $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $user->hasRight("societe", "creer"));
256
257 $titlelist = $langs->trans("ListOfActiveNotifications");
258
259 // Add notification form
260 //print load_fiche_titre($titlelist.' <span class="opacitymedium colorblack paddingleft">('.$num.')</span>', '', '');
261 $num = $nbtotalofrecords;
262 print_barre_liste($titlelist, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, (empty($nbtotalofrecords) ? -1 : $nbtotalofrecords), 'email', 0, $newcardbutton, '', $limit, 0, 0, 1);
263
264 print '<form action="'.$_SERVER["PHP_SELF"].'?socid='.$socid.'" method="post">';
265 print '<input type="hidden" name="token" value="'.newToken().'">';
266 print '<input type="hidden" name="action" value="add">';
267
268 $param = "&socid=".$socid;
269
270 // Line with titles
271 print '<div class="div-table-responsive-no-min">';
272 print '<table class="centpercent noborder">';
273 print '<tr class="liste_titre">';
274 print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder);
275 print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder);
276 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder);
278 print "</tr>\n";
279
280 // Line to add a new subscription
281 if ($action == 'create') {
282 $listofemails = $object->thirdparty_and_contact_email_array();
283 if (count($listofemails) > 0) {
284 $actions = array();
285
286 // Load array of available notifications
287 $notificationtrigger = new InterfaceNotification($db);
288 $listofmanagedeventfornotification = $notificationtrigger->getListOfManagedEvents();
289
290 foreach ($listofmanagedeventfornotification as $managedeventfornotification) {
291 $label = ($langs->trans("Notify_".$managedeventfornotification['code']) != "Notify_".$managedeventfornotification['code'] ? $langs->trans("Notify_".$managedeventfornotification['code']) : $managedeventfornotification['label']);
292 $actions[$managedeventfornotification['rowid']] = $label;
293 }
294
295 $newlistofemails = array();
296 foreach ($listofemails as $tmpkey => $tmpval) {
297 $labelhtml = str_replace(array('<', '>'), array(' - <span class="opacitymedium">', '</span>'), $tmpval);
298 $newlistofemails[$tmpkey] = array('label' => dol_string_nohtmltag($tmpval), 'id' => $tmpkey, 'data-html' => $labelhtml);
299 }
300
301 print '<tr class="oddeven nohover">';
302 print '<td class="nowraponall">';
303 print img_picto('', 'contact', '', false, 0, 0, '', 'paddingright');
304 print $form->selectarray("contactid", $newlistofemails, '', 1, 0, 0, '', 0, 0, 0, '', 'minwidth100imp maxwidthonsmartphone');
305 print '</td>';
306 print '<td class="nowraponall">';
307 print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright');
308 print $form->selectarray("actionid", $actions, '', 1, 0, 0, '', 0, 0, 0, '', 'minwidth100imp maxwidthonsmartphone');
309 print '</td>';
310 print '<td>';
311 $type = array('email' => $langs->trans("EMail"));
312 print $form->selectarray("typeid", $type, '', 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
313 print '</td>';
314 print '<td class="right nowraponall">';
315 print '<input type="submit" class="button button-add small" value="'.$langs->trans("Add").'">';
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("YouMustCreateContactFirst");
322 print '</td></tr>';
323 }
324 } else {
325 if ($num) {
326 $i = 0;
327
328 $contactstatic = new Contact($db);
329
330 while ($i < $num) {
331 $obj = $db->fetch_object($resql);
332
333 $contactstatic->id = $obj->contactid;
334 $contactstatic->lastname = $obj->lastname;
335 $contactstatic->firstname = $obj->firstname;
336
337 print '<tr class="oddeven">';
338 print '<td>'.$contactstatic->getNomUrl(1);
339 if ($obj->type == 'email') {
340 if (isValidEmail($obj->email)) {
341 print ' &lt;'.$obj->email.'&gt;';
342 } else {
343 $langs->load("errors");
344 print ' '.img_warning().' <span class="warning">'.$langs->trans("ErrorBadEMail", $obj->email).'</span>';
345 }
346 }
347 print '</td>';
348
349 $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
350 print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($label).'">';
351 print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$label;
352 print '</td>';
353 print '<td>';
354 if ($obj->type == 'email') {
355 print $langs->trans("Email");
356 }
357 if ($obj->type == 'sms') {
358 print $langs->trans("SMS");
359 }
360 print '</td>';
361 print '<td class="right"><a href="card.php?socid='.$socid.'&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 }
370
371
372
373 print '</table>';
374 print '</div>';
375 print '</form>';
376
377 print '<br><br>'."\n";
378
379
380 // List
381 $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,";
382 $sql .= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail,";
383 $sql .= " a.code, a.label";
384 $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
385 $sql .= " ".MAIN_DB_PREFIX."notify as n ";
386 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as c ON n.fk_contact = c.rowid";
387 $sql .= " WHERE a.rowid = n.fk_action";
388 $sql .= " AND n.fk_soc = ".((int) $object->id);
389 $sql .= $db->order($sortfield, $sortorder);
390
391 // Count total nb of records
392 $nbtotalofrecords = '';
393 if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
394 $result = $db->query($sql);
395 $nbtotalofrecords = $db->num_rows($result);
396 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
397 $page = 0;
398 $offset = 0;
399 }
400 }
401
402 $sql .= $db->plimit($limit + 1, $offset);
403
404 $resql = $db->query($sql);
405 if ($resql) {
406 $num = $db->num_rows($resql);
407 } else {
408 dol_print_error($db);
409 }
410
411 $param = '&socid='.$object->id;
412 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
413 $param .= '&contextpage='.$contextpage;
414 }
415 if ($limit > 0 && $limit != $conf->liste_limit) {
416 $param .= '&limit='.$limit;
417 }
418
419 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
420 if ($optioncss != '') {
421 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
422 }
423 print '<input type="hidden" name="token" value="'.newToken().'">';
424 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
425 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
426 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
427 print '<input type="hidden" name="page" value="'.$page.'">';
428 print '<input type="hidden" name="socid" value="'.$object->id.'">';
429
430 // List of active notifications @phan-suppress-next-line PhanPluginSuspiciousParamOrder
431 print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, empty($nbtotalofrecords) ? -1 : $nbtotalofrecords, 'email', 0, '', '', $limit);
432
433 // Line with titles
434 print '<div class="div-table-responsive-no-min">';
435 print '<table class="centpercent noborder">';
436 print '<tr class="liste_titre">';
437 print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '', $sortfield, $sortorder);
438 print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder);
439 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '', $sortfield, $sortorder);
440 //print_liste_field_titre("Object",$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder);
441 print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "n.daten", '', $param, '', $sortfield, $sortorder, 'right ');
442 print '</tr>';
443
444 if ($num > 0) {
445 $i = 0;
446
447 $contactstatic = new Contact($db);
448
449 while ($i < $num) {
450 $obj = $db->fetch_object($resql);
451
452 print '<tr class="oddeven"><td>';
453 if ($obj->id > 0) {
454 $contactstatic->id = $obj->id;
455 $contactstatic->lastname = $obj->lastname;
456 $contactstatic->firstname = $obj->firstname;
457 print $contactstatic->getNomUrl(1);
458 print $obj->email ? ' &lt;'.$obj->email.'&gt;' : $langs->trans("NoMail");
459 } else {
460 print $obj->email;
461 }
462 print '</td>';
463 print '<td>';
464 $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
465 print $label;
466 print '</td>';
467 print '<td>';
468 if ($obj->type == 'email') {
469 print $langs->trans("Email");
470 }
471 if ($obj->type == 'sms') {
472 print $langs->trans("Sms");
473 }
474 print '</td>';
475 // TODO Add link to object here for other types
476 /*print '<td>';
477 if ($obj->object_type == 'order')
478 {
479 $orderstatic->id=$obj->object_id;
480 $orderstatic->ref=...
481 print $orderstatic->getNomUrl(1);
482 }
483 print '</td>';*/
484 // print
485 print'<td class="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
486 print '</tr>';
487 $i++;
488 }
489 $db->free($resql);
490 } else {
491 print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
492 }
493
494 print '</table>';
495 print '</div>';
496
497 print '</form>';
498} else {
499 dol_print_error(null, 'RecordNotFound');
500}
501
502// End of page
503llxFooter();
504$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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:70
Class to manage contact/addresses.
Class to manage generation of HTML components Only common components must be here.
Class of triggers for notification module.
Class to manage third parties objects (customers, suppliers, prospects...)
societe_prepare_head(Societe $object)
Return array of tabs to used on pages for third parties cards.
llxFooter()
Footer empty.
Definition document.php:107
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.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
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_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_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
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.