dolibarr  x.y.z
card.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2014 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) 2016 Abbes Bahfir <contact@dolibarrpar.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
28 // Load Dolibarr environment
29 require '../../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
32 require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php';
34 
35 // Load translation files required by page
36 $langs->loadLangs(array('companies', 'mails', 'admin', 'other', 'errors'));
37 
38 $id = GETPOST("id", 'int');
39 $ref = GETPOST('ref', 'alpha');
40 
41 $action = GETPOST('action', 'aZ09');
42 $actionid = GETPOST('actionid', 'int');
43 
44 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
45 $sortfield = GETPOST('sortfield', 'aZ09comma');
46 $sortorder = GETPOST('sortorder', 'aZ09comma');
47 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
48 if (!$sortorder) {
49  $sortorder = "DESC";
50 }
51 if (!$sortfield) {
52  $sortfield = "n.daten";
53 }
54 if (empty($page) || $page == -1) {
55  $page = 0;
56 }
57 $offset = $limit * $page;
58 $pageprev = $page - 1;
59 $pagenext = $page + 1;
60 
61 $now = dol_now();
62 
63 // Security check
64 $object = new User($db);
65 if ($id > 0 || !empty($ref)) {
66  $result = $object->fetch($id, $ref, '', 1);
67  $object->getrights();
68 }
69 
70 $permissiontoadd = (($object->id == $user->id) || (!empty($user->rights->user->user->lire)));
71 
72 // Security check
73 if ($user->socid) {
74  $id = $user->socid;
75 }
76 $result = restrictedArea($user, 'user', '', '', 'user');
77 
78 
79 /*
80  * Actions
81  */
82 
83 if (GETPOST('cancel', 'alpha')) {
84  $action = 'list';
85 }
86 
87 // Add a notification
88 if ($action == 'add') {
89  $error = 0;
90 
91  if ($actionid <= 0) {
92  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Action")), null, 'errors');
93  $error++;
94  $action = 'create';
95  }
96 
97  if (!$error) {
98  $db->begin();
99 
100  $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
101  $sql .= " WHERE fk_user=".((int) $id)." AND fk_action=".((int) $actionid);
102  if ($db->query($sql)) {
103  $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec, fk_user, fk_action)";
104  $sql .= " VALUES ('".$db->idate($now)."', ".((int) $id).", ".((int) $actionid).")";
105 
106  if (!$db->query($sql)) {
107  $error++;
108  dol_print_error($db);
109  }
110  } else {
111  dol_print_error($db);
112  }
113 
114  if (!$error) {
115  $db->commit();
116  } else {
117  $db->rollback();
118  $action = 'create';
119  }
120  }
121 }
122 
123 // Remove a notification
124 if ($action == 'delete') {
125  $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".GETPOST("actid", "int");
126  $db->query($sql);
127 }
128 
129 
130 
131 /*
132  * View
133  */
134 
135 $form = new Form($db);
136 
137 $object = new User($db);
138 $result = $object->fetch($id, '', '', 1);
139 $object->getrights();
140 
141 $title = $langs->trans("ThirdParty").' - '.$langs->trans("Notification");
142 if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) {
143  $title = $object->name.' - '.$langs->trans("Notification");
144 }
145 $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
146 llxHeader('', $title, $help_url);
147 
148 
149 if ($result > 0) {
150  $langs->load("other");
151 
152  $head = user_prepare_head($object);
153 
154  print dol_get_fiche_head($head, 'notify', $langs->trans("User"), -1, 'user');
155 
156  $linkback = '<a href="'.DOL_URL_ROOT.'/user/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
157 
158  $morehtmlref = '<a href="'.DOL_URL_ROOT.'/user/vcard.php?id='.$object->id.'" class="refid">';
159  $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
160  $morehtmlref .= '</a>';
161 
162  dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin, 'rowid', 'ref', $morehtmlref, '', 0, '', '', 0, '');
163 
164  print '<div class="fichecenter">';
165 
166  print '<div class="underbanner clearboth"></div>';
167  print '<table class="border centpercent tableforfield">';
168 
169  // Login
170  print '<tr><td class="titlefield">'.$langs->trans("Login").'</td>';
171  if (!empty($object->ldap_sid) && $object->statut == 0) {
172  print '<td class="error">';
173  print $langs->trans("LoginAccountDisableInDolibarr");
174  print '</td>';
175  } else {
176  print '<td>';
177  $addadmin = '';
178  if (property_exists($object, 'admin')) {
179  if (isModEnabled('multicompany') && !empty($object->admin) && empty($object->entity)) {
180  $addadmin .= img_picto($langs->trans("SuperAdministratorDesc"), "redstar", 'class="paddingleft"');
181  } elseif (!empty($object->admin)) {
182  $addadmin .= img_picto($langs->trans("AdministratorDesc"), "star", 'class="paddingleft"');
183  }
184  }
185  print showValueWithClipboardCPButton($object->login).$addadmin;
186  print '</td>';
187  }
188  print '</tr>'."\n";
189 
190  /*print '<tr><td class="titlefield">'.$langs->trans("NbOfActiveNotifications").'</td>'; // Notification for this thirdparty
191  print '<td colspan="3">';
192  $nbofrecipientemails=0;
193  $notify=new Notify($db);
194  $tmparray = $notify->getNotificationsArray('', 0, null, $object->id, array('user'));
195  foreach($tmparray as $tmpkey => $tmpval)
196  {
197  $nbofrecipientemails++;
198  }
199  print $nbofrecipientemails;
200  print '</td></tr>';*/
201 
202  print '</table>';
203 
204  print '</div>';
205 
206  print dol_get_fiche_end();
207 
208  print "\n";
209 
210  // Help
211  print '<span class="opacitymedium">';
212  print '<br>'.$langs->trans("NotificationsDesc");
213  print '<br>'.$langs->trans("NotificationsDescUser");
214  print '<br>'.$langs->trans("NotificationsDescContact");
215  print '<br>'.$langs->trans("NotificationsDescGlobal");
216  print '</span>';
217 
218  print '<br><br><br>'."\n";
219 
220 
221  // Add notification form
222  // print load_fiche_titre($langs->trans("AddNewNotification"), '', '');
223 
224  print '<form action="'.$_SERVER["PHP_SELF"].'?id='.urlencode($id).'" method="POST">';
225  print '<input type="hidden" name="token" value="'.newToken().'">';
226  print '<input type="hidden" name="action" value="add">';
227 
228  $param = "&id=".urlencode($id);
229 
230  // Line with titles
231  /* print '<table width="100%" class="noborder">';
232  print '<tr class="liste_titre">';
233  print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder);
234  print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder);
235  print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder);
236  print_liste_field_titre('');
237  print "</tr>\n";
238 
239  print '</table>';
240 
241  print '<br>';
242  */
243  // List of notifications enabled for contacts
244  $sql = "SELECT n.rowid, n.type,";
245  $sql .= " a.code, a.label,";
246  $sql .= " c.rowid as userid, c.entity, c.login, c.lastname, c.firstname, c.email, c.statut as status";
247  $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
248  $sql .= " ".MAIN_DB_PREFIX."notify_def as n,";
249  $sql .= " ".MAIN_DB_PREFIX."user c";
250  $sql .= " WHERE a.rowid = n.fk_action";
251  $sql .= " AND c.rowid = n.fk_user";
252  $sql .= " AND c.rowid = ".((int) $object->id);
253  $sql .= " AND c.entity IN (".getEntity('user').')';
254 
255  $resql = $db->query($sql);
256  if ($resql) {
257  $num = $db->num_rows($resql);
258  } else {
259  dol_print_error($db);
260  }
261 
262  $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
263 
264  $title = $langs->trans("ListOfActiveNotifications");
265 
266  // List of active notifications
267  //print load_fiche_titre($langs->trans("ListOfActiveNotifications").' ('.$num.')', '', '');
268  print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $num, 'email', 0, $newcardbutton, '', $limit, 0, 0, 1);
269 
270  // Line with titles
271  print '<table width="100%" class="noborder">';
272  print '<tr class="liste_titre">';
273  print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder);
274  print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder);
275  print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder);
276  print_liste_field_titre('', '', '');
277  print '</tr>';
278 
279 
280  if ($action == 'create') {
281  // $listofemails=$object->thirdparty_and_contact_email_array();
282  if ($object->email) {
283  $actions = array();
284 
285  // Load array of available notifications
286  $notificationtrigger = new InterfaceNotification($db);
287  $listofnotifiedevents = $notificationtrigger->getListOfManagedEvents();
288 
289  foreach ($listofnotifiedevents as $notifiedevent) {
290  $label = ($langs->trans("Notify_".$notifiedevent['code']) != "Notify_".$notifiedevent['code'] ? $langs->trans("Notify_".$notifiedevent['code']) : $notifiedevent['label']);
291  $actions[$notifiedevent['rowid']] = $label;
292  }
293  print '<tr class="oddeven nohover"><td>';
294  print $object->getNomUrl(1);
295  if (isValidEmail($object->email)) {
296  print ' &lt;'.$object->email.'&gt;';
297  } else {
298  $langs->load("errors");
299  print ' &nbsp; '.img_warning().' '.$langs->trans("ErrorBadEMail", $object->email);
300  }
301  print '</td>';
302  print '<td>';
303  print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1);
304  print '</td>';
305  print '<td>';
306  $type = array('email'=>$langs->trans("EMail"));
307  print $form->selectarray("typeid", $type);
308  print '</td>';
309  print '<td class="nowraponall">';
310  print '<input type="submit" class="button button-add" value="'.$langs->trans("Add").'">';
311  print '&nbsp;';
312  print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
313  print '</td>';
314  print '</tr>';
315  } else {
316  print '<tr class="oddeven"><td colspan="4">';
317  print $langs->trans("YouMustAssignUserMailFirst");
318  print '</td></tr>';
319  }
320  } else {
321  if ($num) {
322  $i = 0;
323 
324  $userstatic = new user($db);
325 
326  while ($i < $num) {
327  $obj = $db->fetch_object($resql);
328 
329  $userstatic->id = $obj->userid;
330  $userstatic->lastname = $obj->lastname;
331  $userstatic->firstname = $obj->firstname;
332  $userstatic->email = $obj->email;
333  $userstatic->statut = $obj->status;
334 
335  print '<tr class="oddeven"><td>'.$userstatic->getNomUrl(1);
336  if ($obj->type == 'email') {
337  if (isValidEmail($obj->email)) {
338  print ' &lt;'.$obj->email.'&gt;';
339  } else {
340  $langs->load("errors");
341  print ' &nbsp; '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email);
342  }
343  }
344  print '</td>';
345  print '<td>';
346  $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
347  print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$label;
348  print '</td>';
349  print '<td>';
350  if ($obj->type == 'email') {
351  print $langs->trans("Email");
352  }
353  if ($obj->type == 'sms') {
354  print $langs->trans("SMS");
355  }
356  print '</td>';
357  print '<td class="right"><a href="card.php?id='.$id.'&action=delete&token='.newToken().'&actid='.$obj->rowid.'">'.img_delete().'</a></td>';
358  print '</tr>';
359  $i++;
360  }
361  $db->free($resql);
362  }
363 
364  // List of notifications enabled for fixed email
365  /*
366  foreach($conf->global as $key => $val) {
367  if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
368  print '<tr class="oddeven"><td>';
369  $listtmp=explode(',', $val);
370  $first=1;
371  foreach($listtmp as $keyemail => $valemail) {
372  if (! $first) print ', ';
373  $first=0;
374  $valemail=trim($valemail);
375  //print $keyemail.' - '.$valemail.' - '.$reg[1].'<br>';
376  if (isValidEmail($valemail, 1)) {
377  if ($valemail == '__SUPERVISOREMAIL__') print $valemail;
378  else print ' &lt;'.$valemail.'&gt;';
379  } else {
380  print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail);
381  }
382  }
383  print '</td>';
384  print '<td>';
385  $notifcode=preg_replace('/_THRESHOLD_.*$/','',$reg[1]);
386  $notifcodecond=preg_replace('/^.*_(THRESHOLD_)/','$1',$reg[1]);
387  $label=($langs->trans("Notify_".$notifcode)!="Notify_".$notifcode?$langs->trans("Notify_".$notifcode):$notifcode);
388  print $label;
389  if (preg_match('/^THRESHOLD_HIGHER_(.*)$/',$notifcodecond,$regcond) && ($regcond[1] > 0)) {
390  print ' - '.$langs->trans("IfAmountHigherThan",$regcond[1]);
391  }
392  print '</td>';
393  print '<td>';
394  print $langs->trans("Email");
395  print '</td>';
396  print '<td class="right">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</td>';
397  print '</tr>';
398  }*/
399  /*if ($user->admin) {
400  print '<tr class="oddeven"><td colspan="4">';
401  print '+ <a href="'.DOL_URL_ROOT.'/admin/notification.php">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</a>';
402  print '</td></tr>';
403  }*/
404  }
405 
406  print '</table>';
407 
408  print '</form>';
409 
410 
411  print '<br><br>'."\n";
412 
413 
414  // List
415  $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,";
416  $sql .= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail, c.statut as status,";
417  $sql .= " a.code, a.label";
418  $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
419  $sql .= " ".MAIN_DB_PREFIX."notify as n";
420  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as c ON n.fk_user = c.rowid";
421  $sql .= " WHERE a.rowid = n.fk_action";
422  $sql .= " AND n.fk_user = ".((int) $object->id);
423  $sql .= $db->order($sortfield, $sortorder);
424 
425  // Count total nb of records
426  $nbtotalofrecords = '';
427  if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
428  $result = $db->query($sql);
429  $nbtotalofrecords = $db->num_rows($result);
430  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
431  $page = 0;
432  $offset = 0;
433  }
434  }
435 
436  $sql .= $db->plimit($limit + 1, $offset);
437 
438  $resql = $db->query($sql);
439  if ($resql) {
440  $num = $db->num_rows($resql);
441  } else {
442  dol_print_error($db);
443  }
444 
445  $param = '&id='.$object->id;
446  if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
447  $param .= '&contextpage='.$contextpage;
448  }
449  if ($limit > 0 && $limit != $conf->liste_limit) {
450  $param .= '&limit='.$limit;
451  }
452 
453  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
454  if (isset($optioncss) && $optioncss != '') {
455  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
456  }
457  print '<input type="hidden" name="token" value="'.newToken().'">';
458  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
459  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
460  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
461  print '<input type="hidden" name="page" value="'.$page.'">';
462  print '<input type="hidden" name="id" value="'.$object->id.'">';
463 
464  // List of notifications done
465  print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'email', 0, '', '', $limit);
466 
467  // Line with titles
468  print '<table width="100%" class="noborder">';
469  print '<tr class="liste_titre">';
470  print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '', $sortfield, $sortorder);
471  print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder);
472  print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '', $sortfield, $sortorder);
473  //print_liste_field_titre("Object",$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder);
474  print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "n.daten", '', $param, '', $sortfield, $sortorder, 'right ');
475  print '</tr>';
476 
477  if ($num) {
478  $i = 0;
479 
480  $userstatic = new User($db);
481 
482  while ($i < $num) {
483  $obj = $db->fetch_object($resql);
484 
485  print '<tr class="oddeven"><td>';
486  if ($obj->id > 0) {
487  $userstatic->id = $obj->id;
488  $userstatic->lastname = $obj->lastname;
489  $userstatic->firstname = $obj->firstname;
490  $userstatic->statut = $obj->status;
491  $userstatic->email = $obj->email;
492  print $userstatic->getNomUrl(1);
493  print $obj->email ? ' &lt;'.$obj->email.'&gt;' : $langs->trans("NoMail");
494  } else {
495  print $obj->email;
496  }
497  print '</td>';
498  print '<td>';
499  $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
500  print $label;
501  print '</td>';
502  print '<td>';
503  if ($obj->type == 'email') {
504  print $langs->trans("Email");
505  }
506  if ($obj->type == 'sms') {
507  print $langs->trans("Sms");
508  }
509  print '</td>';
510  // TODO Add link to object here for other types
511  /*print '<td>';
512  if ($obj->object_type == 'order') {
513  $orderstatic->id=$obj->object_id;
514  $orderstatic->ref=...
515  print $orderstatic->getNomUrl(1);
516  }
517  print '</td>';*/
518  // print
519  print'<td class="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
520  print '</tr>';
521  $i++;
522  }
523  $db->free($resql);
524  } else {
525  print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
526  }
527 
528  print '</table>';
529 
530  print '</form>';
531 } else {
532  dol_print_error('', 'RecordNotFound');
533 }
534 
535 // End of page
536 llxFooter();
537 $db->close();
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
Definition: agenda.php:118
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:56
llxFooter()
Empty footer.
Definition: wrapper.php:70
Class to manage generation of HTML components Only common components must be here.
Class of triggers for notification module.
Class to manage Dolibarr users.
Definition: user.class.php:45
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:745
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
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.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
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.
isModEnabled($module)
Is Dolibarr module enabled.
$nbtotalofrecords
Count total nb of records.
Definition: list.php:329
$conf db user
Definition: repair.php:123
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.
user_prepare_head(User $object)
Prepare array with list of tabs.