dolibarr  17.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-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">';
336  print '<td>'.$userstatic->getNomUrl(1);
337  if ($obj->type == 'email') {
338  if (isValidEmail($obj->email)) {
339  print ' &lt;'.$obj->email.'&gt;';
340  } else {
341  $langs->load("errors");
342  print ' &nbsp; '.img_warning().' '.$langs->trans("ErrorBadEMail", $obj->email);
343  }
344  }
345  print '</td>';
346  print '<td>';
347  $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
348  print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$label;
349  print '</td>';
350  print '<td>';
351  if ($obj->type == 'email') {
352  print $langs->trans("Email");
353  }
354  if ($obj->type == 'sms') {
355  print $langs->trans("SMS");
356  }
357  print '</td>';
358  print '<td class="right"><a href="card.php?id='.$id.'&action=delete&token='.newToken().'&actid='.$obj->rowid.'">'.img_delete().'</a></td>';
359  print '</tr>';
360  $i++;
361  }
362  $db->free($resql);
363  } else {
364  print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
365  }
366  // List of notifications enabled for fixed email
367  /*
368  foreach($conf->global as $key => $val) {
369  if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
370  print '<tr class="oddeven"><td>';
371  $listtmp=explode(',', $val);
372  $first=1;
373  foreach($listtmp as $keyemail => $valemail) {
374  if (! $first) print ', ';
375  $first=0;
376  $valemail=trim($valemail);
377  //print $keyemail.' - '.$valemail.' - '.$reg[1].'<br>';
378  if (isValidEmail($valemail, 1)) {
379  if ($valemail == '__SUPERVISOREMAIL__') print $valemail;
380  else print ' &lt;'.$valemail.'&gt;';
381  } else {
382  print ' '.img_warning().' '.$langs->trans("ErrorBadEMail",$valemail);
383  }
384  }
385  print '</td>';
386  print '<td>';
387  $notifcode=preg_replace('/_THRESHOLD_.*$/','',$reg[1]);
388  $notifcodecond=preg_replace('/^.*_(THRESHOLD_)/','$1',$reg[1]);
389  $label=($langs->trans("Notify_".$notifcode)!="Notify_".$notifcode?$langs->trans("Notify_".$notifcode):$notifcode);
390  print $label;
391  if (preg_match('/^THRESHOLD_HIGHER_(.*)$/',$notifcodecond,$regcond) && ($regcond[1] > 0)) {
392  print ' - '.$langs->trans("IfAmountHigherThan",$regcond[1]);
393  }
394  print '</td>';
395  print '<td>';
396  print $langs->trans("Email");
397  print '</td>';
398  print '<td class="right">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</td>';
399  print '</tr>';
400  }*/
401  /*if ($user->admin) {
402  print '<tr class="oddeven"><td colspan="4">';
403  print '+ <a href="'.DOL_URL_ROOT.'/admin/notification.php">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</a>';
404  print '</td></tr>';
405  }*/
406  }
407 
408  print '</table>';
409 
410  print '</form>';
411 
412 
413  print '<br><br>'."\n";
414 
415 
416  // List
417  $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,";
418  $sql .= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail, c.statut as status,";
419  $sql .= " a.code, a.label";
420  $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
421  $sql .= " ".MAIN_DB_PREFIX."notify as n";
422  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as c ON n.fk_user = c.rowid";
423  $sql .= " WHERE a.rowid = n.fk_action";
424  $sql .= " AND n.fk_user = ".((int) $object->id);
425  $sql .= $db->order($sortfield, $sortorder);
426 
427  // Count total nb of records
428  $nbtotalofrecords = '';
429  if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
430  $result = $db->query($sql);
431  $nbtotalofrecords = $db->num_rows($result);
432  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
433  $page = 0;
434  $offset = 0;
435  }
436  }
437 
438  $sql .= $db->plimit($limit + 1, $offset);
439 
440  $resql = $db->query($sql);
441  if ($resql) {
442  $num = $db->num_rows($resql);
443  } else {
444  dol_print_error($db);
445  }
446 
447  $param = '&id='.$object->id;
448  if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
449  $param .= '&contextpage='.$contextpage;
450  }
451  if ($limit > 0 && $limit != $conf->liste_limit) {
452  $param .= '&limit='.$limit;
453  }
454 
455  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
456  if (isset($optioncss) && $optioncss != '') {
457  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
458  }
459  print '<input type="hidden" name="token" value="'.newToken().'">';
460  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
461  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
462  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
463  print '<input type="hidden" name="page" value="'.$page.'">';
464  print '<input type="hidden" name="id" value="'.$object->id.'">';
465 
466  // List of notifications done
467  print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'email', 0, '', '', $limit);
468 
469  // Line with titles
470  print '<table width="100%" class="noborder">';
471  print '<tr class="liste_titre">';
472  print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '', $sortfield, $sortorder);
473  print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder);
474  print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '', $sortfield, $sortorder);
475  //print_liste_field_titre("Object",$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder);
476  print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "n.daten", '', $param, '', $sortfield, $sortorder, 'right ');
477  print '</tr>';
478 
479  if ($num) {
480  $i = 0;
481 
482  $userstatic = new User($db);
483 
484  while ($i < $num) {
485  $obj = $db->fetch_object($resql);
486 
487  print '<tr class="oddeven"><td>';
488  if ($obj->id > 0) {
489  $userstatic->id = $obj->id;
490  $userstatic->lastname = $obj->lastname;
491  $userstatic->firstname = $obj->firstname;
492  $userstatic->statut = $obj->status;
493  $userstatic->email = $obj->email;
494  print $userstatic->getNomUrl(1);
495  print $obj->email ? ' &lt;'.$obj->email.'&gt;' : $langs->trans("NoMail");
496  } else {
497  print $obj->email;
498  }
499  print '</td>';
500  print '<td>';
501  $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
502  print $label;
503  print '</td>';
504  print '<td>';
505  if ($obj->type == 'email') {
506  print $langs->trans("Email");
507  }
508  if ($obj->type == 'sms') {
509  print $langs->trans("Sms");
510  }
511  print '</td>';
512  // TODO Add link to object here for other types
513  /*print '<td>';
514  if ($obj->object_type == 'order') {
515  $orderstatic->id=$obj->object_id;
516  $orderstatic->ref=...
517  print $orderstatic->getNomUrl(1);
518  }
519  print '</td>';*/
520  // print
521  print'<td class="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
522  print '</tr>';
523  $i++;
524  }
525  $db->free($resql);
526  } else {
527  print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
528  }
529 
530  print '</table>';
531 
532  print '</form>';
533 } else {
534  dol_print_error('', 'RecordNotFound');
535 }
536 
537 // End of page
538 llxFooter();
539 $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:47
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.