dolibarr 24.0.0-beta
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 * Copyright (C) 2024-2025 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';
38require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
39require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
40require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
41require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php';
42
43$langs->loadLangs(array("companies", "mails", "admin", "other", "errors"));
44
45$socid = GETPOSTINT("socid");
46$action = GETPOST('action', 'aZ09');
47$contactid = GETPOST('contactid', 'alpha'); // May be an int or 'thirdparty'
48$actionid = GETPOSTINT('actionid');
49$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
50
51// Security check
52if ($user->socid) {
53 $socid = $user->socid;
54}
55
56// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
57$hookmanager->initHooks(array('thirdpartynotification', 'globalcard'));
58
59$result = restrictedArea($user, 'societe', '', '');
60
61$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
62$sortfield = GETPOST('sortfield', 'aZ09comma');
63$sortorder = GETPOST('sortorder', 'aZ09comma');
64$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
65if (!$sortorder) {
66 $sortorder = "DESC";
67}
68if (!$sortfield) {
69 $sortfield = "n.daten";
70}
71if (empty($page) || $page == -1) {
72 $page = 0;
73}
74$offset = $limit * $page;
75$pageprev = $page - 1;
76$pagenext = $page + 1;
77
78$now = dol_now();
79
80// Security check
81$object = new Societe($db);
82
83$permissiontoadd = $user->hasRight('societe', 'write');
84
85
86/*
87 * Actions
88 */
89
90if (GETPOST('cancel', 'alpha')) {
91 $action = 'list';
92}
93
94$parameters = array('id' => $socid);
95$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
96if ($reshook < 0) {
97 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
98}
99
100if (empty($reshook)) {
101 $error = 0;
102
103 // Add a notification
104 if ($action == 'add' && $permissiontoadd) {
105 if (empty($contactid)) {
106 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Contact")), null, 'errors');
107 $error++;
108 }
109 if ($actionid <= 0) {
110 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Action")), null, 'errors');
111 $error++;
112 $action = 'create';
113 }
114
115 if (!$error) {
116 $db->begin();
117
118 $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
119 $sql .= " WHERE fk_soc=".((int) $socid)." AND fk_contact=".((int) $contactid)." AND fk_action = ".((int) $actionid);
120 if ($db->query($sql)) {
121 $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_soc, fk_contact, fk_action)";
122 $sql .= " VALUES ('".$db->idate($now)."', ".((int) $socid).",".((int) $contactid).",".((int) $actionid).")";
123
124 if (!$db->query($sql)) {
125 $error++;
127 }
128 } else {
130 }
131
132 if (!$error) {
133 $db->commit();
134 } else {
135 $db->rollback();
136 $action = 'create';
137 }
138 }
139 }
140
141 // Remove a notification
142 if ($action == 'delete' && $permissiontoadd) {
143 $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid = ".GETPOSTINT('actid');
144 $db->query($sql);
145 }
146}
147
148
149
150/*
151 * View
152 */
153
154$form = new Form($db);
155
156$object = new Societe($db);
157$result = $object->fetch($socid);
158
159$title = $langs->trans("ThirdParty").' - '.$langs->trans("Notification");
160if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/thirdpartynameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) {
161 $title = $object->name.' - '.$langs->trans("Notification");
162}
163$help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
164
165llxHeader('', $title, $help_url);
166
167
168if ($result > 0) {
169 $langs->load("other");
170
171 $head = societe_prepare_head($object);
172
173 print dol_get_fiche_head($head, 'notify', $langs->trans("ThirdParty"), -1, 'company');
174
175 $linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
176
177 dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom');
178
179 print '<div class="fichecenter">';
180
181 print '<div class="underbanner clearboth"></div>';
182 print '<table class="border centpercent tableforfield">';
183
184 // Type Prospect/Customer/Supplier
185 print '<tr><td class="titlefield">'.$langs->trans('NatureOfThirdParty').'</td><td>';
186 print $object->getTypeUrl(1);
187 print '</td></tr>';
188
189 if ($object->client) {
190 print '<tr><td class="titlefield">';
191 print $langs->trans('CustomerCode').'</td><td colspan="3">';
192 print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client));
193 $tmpcheck = $object->check_codeclient();
194 if ($tmpcheck != 0 && $tmpcheck != -5) {
195 print ' <span class="error">('.$langs->trans("WrongCustomerCode").')</span>';
196 }
197 print '</td></tr>';
198 }
199
200 if ((isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $object->fournisseur && $user->hasRight('fournisseur', 'lire')) {
201 print '<tr><td class="titlefield">';
202 print $langs->trans('SupplierCode').'</td><td colspan="3">';
203 print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur));
204 $tmpcheck = $object->check_codefournisseur();
205 if ($tmpcheck != 0 && $tmpcheck != -5) {
206 print ' <span class="error">('.$langs->trans("WrongSupplierCode").')</span>';
207 }
208 print '</td>';
209 }
210 print '</tr>'."\n";
211
212 /*print '<tr><td class="titlefield">'.$langs->trans("NbOfActiveNotifications").'</td>'; // Notification for this thirdparty
213 print '<td colspan="3">';
214 $nbofrecipientemails=0;
215 $notify=new Notify($db);
216 $tmparray = $notify->getNotificationsArray('', $object->id, null, 0, array('thirdparty'));
217 foreach($tmparray as $tmpkey => $tmpval)
218 {
219 if (!empty($tmpkey)) $nbofrecipientemails++;
220 }
221 print $nbofrecipientemails;
222 print '</td></tr>';*/
223
224 print '</table>';
225
226 print '</div>';
227
228 print dol_get_fiche_end();
229
230 print "\n";
231
232 // Help
233 print '<div class="info hideonsmartphone">';
234 print $langs->trans("NotificationsDesc");
235 print '<br>'.$langs->trans("NotificationsDescUser");
236 print '<br>'.$langs->trans("NotificationsDescContact").' - '.$langs->trans("YouAreHere");
237 print '<br>'.$langs->trans("NotificationsDescGlobal");
238 print '</div>';
239
240 print '<br>'."\n";
241
242
243 // Add notification form
244
245 print '<form action="'.$_SERVER["PHP_SELF"].'?socid='.urlencode((string) $socid).'" method="POST">';
246 print '<input type="hidden" name="token" value="'.newToken().'">';
247 print '<input type="hidden" name="page_y" value="">';
248 if ($action == 'create') {
249 print '<input type="hidden" name="action" id="action" value="add">';
250 }
251
252 $nbtotalofrecords = '';
253
254 // List of notifications enabled for contacts of the thirdparty
255 $sql = "SELECT n.rowid, n.type,";
256 $sql .= " a.code, a.label,";
257 $sql .= " c.rowid as contactid, c.lastname, c.firstname, c.email";
258 $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
259 $sql .= " ".MAIN_DB_PREFIX."notify_def as n,";
260 $sql .= " ".MAIN_DB_PREFIX."socpeople as c";
261 $sql .= " WHERE a.rowid = n.fk_action";
262 $sql .= " AND c.rowid = n.fk_contact";
263 $sql .= " AND c.fk_soc = ".((int) $object->id);
264
265 $resql = $db->query($sql);
266 if ($resql) {
267 $nbtotalofrecords = $db->num_rows($resql);
268 } else {
270 }
271
272 $param = "&socid=".((int) $socid);
273
274 $listofemails = $object->thirdparty_and_contact_email_array();
275
276 $helptext = '';
277 $buttonstatus = $permissiontoadd ? 1 : 0;
278 if (empty($listofemails)) {
279 $buttonstatus = 2;
280 $helptext = $langs->trans("YouMustCreateContactFirst");
281 }
282
283 $newcardbutton = '';
284 $newcardbutton .= dolGetButtonTitle($langs->trans('New'), $helptext, 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $buttonstatus);
285
286 $titlelist = $form->textwithpicto($langs->trans("ListOfActiveNotifications"), $langs->trans("ListOfActiveNotificationsHelp", $langs->transnoentitiesnoconv("Target"), $langs->transnoentitiesnoconv("Event")));
287
288 $num = $nbtotalofrecords;
289
290 $limitforsubscription = 0; // We show all subscription of user. Pagination will be reserved for the section of notifications sent.
291 // List of active notifications
292 // @phan-suppress-next-line PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamOrder
293 print_barre_liste($titlelist, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, (empty($nbtotalofrecords) ? -1 : $nbtotalofrecords), 'email', 0, $newcardbutton, '', $limitforsubscription, 0, 0, 1);
294
295 // Line with titles
296 print '<div class="div-table-responsive-no-min">';
297 print '<table class="noborder centpercent">';
298 print '<tr class="liste_titre">';
299 print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder);
300 print_liste_field_titre("Event", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder);
301 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder);
303 print "</tr>\n";
304
305 // Line to add a new subscription
306 if ($action == 'create') {
307 if (count($listofemails) > 0) {
308 $actions = array();
309
310 // Load array of available notifications
311 $notificationtrigger = new InterfaceNotification($db);
312 $listofmanagedeventfornotification = $notificationtrigger->getListOfManagedEvents();
313
314 foreach ($listofmanagedeventfornotification as $managedeventfornotification) {
315 $label = ($langs->trans("Notify_".$managedeventfornotification['code']) != "Notify_".$managedeventfornotification['code'] ? $langs->trans("Notify_".$managedeventfornotification['code']) : $managedeventfornotification['label']);
316 $actions[$managedeventfornotification['rowid']] = $label;
317 }
318
319 $newlistofemails = array();
320 foreach ($listofemails as $tmpkey => $tmpval) {
321 $labelhtml = str_replace(array('<', '>'), array(' - <span class="opacitymedium">', '</span>'), $tmpval);
322 $newlistofemails[$tmpkey] = array('label' => dol_string_nohtmltag($tmpval), 'id' => $tmpkey, 'data-html' => $labelhtml);
323 }
324
325 print '<tr class="oddeven nohover">';
326 print '<td class="nowraponall">';
327 print img_picto('', 'contact', '', 0, 0, 0, '', 'paddingright');
328 print $form->selectarray("contactid", $newlistofemails, '', 1, 0, 0, '', 0, 0, 0, '', 'minwidth100imp maxwidthonsmartphone');
329 print '</td>';
330 print '<td class="tdoverflowmax200">';
331 print img_picto('', 'object_action', '', 0, 0, 0, '', 'paddingright');
332 print $form->selectarray("actionid", $actions, '', 1, 0, 0, '', 0, 0, 0, '', 'minwidth100imp maxwidthonsmartphone');
333 print '</td>';
334 print '<td>';
335 $type = array('email' => $langs->trans("EMail"));
336 print $form->selectarray("typeid", $type, '', 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
337 print '</td>';
338 print '<td class="right nowraponall">';
339 print '<input type="submit" class="button button-add small" value="'.$langs->trans("Add").'">';
340 print '&nbsp;';
341 print '<input type="submit" class="button button-cancel small" name="cancel" value="'.$langs->trans("Cancel").'">';
342 print '</td>';
343 print '</tr>';
344 } else {
345 print '<tr class="oddeven"><td colspan="4" class="opacitymedium">';
346 print $langs->trans("YouMustCreateContactFirst");
347 print '</td></tr>';
348 }
349 } else {
350 if ($num) {
351 $i = 0;
352
353 $contactstatic = new Contact($db);
354
355 while ($i < $num) {
356 $obj = $db->fetch_object($resql);
357
358 $contactstatic->id = $obj->contactid;
359 $contactstatic->lastname = $obj->lastname;
360 $contactstatic->firstname = $obj->firstname;
361
362 print '<tr class="oddeven">';
363 print '<td>'.$contactstatic->getNomUrl(1);
364 if ($obj->type == 'email') {
365 if (isValidEmail($obj->email)) {
366 print ' &lt;'.$obj->email.'&gt;';
367 } else {
368 $langs->load("errors");
369 print ' &nbsp; '.img_warning().' <span class="warning">'.$langs->trans("ErrorBadEMail", $obj->email).'</span>';
370 }
371 }
372 print '</td>';
373
374 $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
375 print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($label).'">';
376 print img_picto('', 'object_action', '', 0, 0, 0, '', 'pictofixedwidth').$label;
377 print '</td>';
378 print '<td>';
379 if ($obj->type == 'email') {
380 print $langs->trans("Email");
381 }
382 if ($obj->type == 'sms') {
383 print $langs->trans("SMS");
384 }
385 print '</td>';
386 print '<td class="right"><a href="card.php?socid='.$socid.'&action=delete&token='.newToken().'&actid='.$obj->rowid.'">'.img_delete().'</a></td>';
387 print '</tr>';
388 $i++;
389 }
390 $db->free($resql);
391 } else {
392 print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
393 }
394 }
395
396
397
398 print '</table>';
399 print '</div>';
400 print '</form>';
401
402 print '<br><br>'."\n";
403
404
405 // List
406 $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,";
407 $sql .= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail,";
408 $sql .= " a.code, a.label";
409 $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
410 $sql .= " ".MAIN_DB_PREFIX."notify as n ";
411 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as c ON n.fk_contact = c.rowid";
412 $sql .= " WHERE a.rowid = n.fk_action";
413 $sql .= " AND n.fk_soc = ".((int) $object->id);
414 $sql .= $db->order($sortfield, $sortorder);
415
416 // Count total nb of records
417 $nbtotalofrecords = '';
418 if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
419 $result = $db->query($sql);
420 $nbtotalofrecords = $db->num_rows($result);
421 if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
422 $page = 0;
423 $offset = 0;
424 }
425 }
426
427 $sql .= $db->plimit($limit + 1, $offset);
428
429 $resql = $db->query($sql);
430 if ($resql) {
431 $num = $db->num_rows($resql);
432 } else {
434 }
435
436 $param = '&socid='.$object->id;
437 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
438 $param .= '&contextpage='.$contextpage;
439 }
440 if ($limit > 0 && $limit != $conf->liste_limit) {
441 $param .= '&limit='.$limit;
442 }
443
444 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
445 if ($optioncss != '') {
446 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
447 }
448 print '<input type="hidden" name="token" value="'.newToken().'">';
449 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
450 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
451 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
452 print '<input type="hidden" name="page" value="'.$page.'">';
453 print '<input type="hidden" name="socid" value="'.$object->id.'">';
454
455 $titlelist = $form->textwithpicto($langs->trans("ListOfNotificationsDone"), $langs->trans("ListOfNotificationsDoneHelp"));
456
457 // List of active notifications @phan-suppress-next-line PhanPluginSuspiciousParamOrder
458 print_barre_liste($titlelist, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, empty($nbtotalofrecords) ? -1 : $nbtotalofrecords, 'email', 0, '', '', $limit, '');
459
460 // Line with titles
461 print '<div class="div-table-responsive-no-min">';
462 print '<table class="centpercent noborder">';
463 print '<tr class="liste_titre">';
464 print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '', $sortfield, $sortorder);
465 print_liste_field_titre("Event", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder);
466 print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '', $sortfield, $sortorder);
467 //print_liste_field_titre("Object",$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder);
468 print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "n.daten", '', $param, '', $sortfield, $sortorder, 'right ');
469 print '</tr>';
470
471 if ($num > 0) {
472 $i = 0;
473
474 $contactstatic = new Contact($db);
475
476 while ($i < $num) {
477 $obj = $db->fetch_object($resql);
478
479 print '<tr class="oddeven"><td>';
480 if ($obj->id > 0) {
481 $contactstatic->id = $obj->id;
482 $contactstatic->lastname = $obj->lastname;
483 $contactstatic->firstname = $obj->firstname;
484 print $contactstatic->getNomUrl(1);
485 print $obj->email ? ' &lt;'.$obj->email.'&gt;' : $langs->trans("NoMail");
486 } else {
487 print $obj->email;
488 }
489 print '</td>';
490 print '<td>';
491 $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
492 print $label;
493 print '</td>';
494 print '<td>';
495 if ($obj->type == 'email') {
496 print $langs->trans("Email");
497 }
498 if ($obj->type == 'sms') {
499 print $langs->trans("Sms");
500 }
501 print '</td>';
502 // TODO Add link to object here for other types
503 /*print '<td>';
504 if ($obj->object_type == 'order')
505 {
506 $orderstatic->id=$obj->object_id;
507 $orderstatic->ref=...
508 print $orderstatic->getNomUrl(1);
509 }
510 print '</td>';*/
511 // print
512 print'<td class="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
513 print '</tr>';
514 $i++;
515 }
516 $db->free($resql);
517 } else {
518 print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
519 }
520
521 print '</table>';
522 print '</div>';
523
524 print '</form>';
525} else {
526 recordNotFound('', 0);
527}
528
529// End of page
530llxFooter();
531$db->close();
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
Class to manage 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, $subtabs='')
Return array of tabs to used on pages for third parties cards.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
dol_now($mode='gmt')
Return date for now.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
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, $morecssdiv='')
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
isModEnabled($module)
Is Dolibarr module enabled.
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.