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