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