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