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-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  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  */
20 
27 // Load Dolibarr environment
28 require '../../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
31 require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php';
33 
34 $langs->loadLangs(array("companies", "mails", "admin", "other", "errors"));
35 
36 $socid = GETPOST("socid", 'int');
37 $action = GETPOST('action', 'aZ09');
38 $contactid = GETPOST('contactid', 'alpha'); // May be an int or 'thirdparty'
39 $actionid = GETPOST('actionid', 'int');
40 $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
41 
42 // Security check
43 if ($user->socid) {
44  $socid = $user->socid;
45 }
46 $result = restrictedArea($user, 'societe', '', '');
47 
48 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
49 $sortfield = GETPOST('sortfield', 'aZ09comma');
50 $sortorder = GETPOST('sortorder', 'aZ09comma');
51 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
52 if (!$sortorder) {
53  $sortorder = "DESC";
54 }
55 if (!$sortfield) {
56  $sortfield = "n.daten";
57 }
58 if (empty($page) || $page == -1) {
59  $page = 0;
60 }
61 $offset = $limit * $page;
62 $pageprev = $page - 1;
63 $pagenext = $page + 1;
64 
65 $now = dol_now();
66 
67 $object = new Societe($db);
68 
69 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
70 $hookmanager->initHooks(array('thirdpartynotification', 'globalcard'));
71 
72 
73 
74 /*
75  * Actions
76  */
77 
78 $parameters = array('id'=>$socid);
79 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
80 if ($reshook < 0) {
81  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
82 }
83 
84 if (empty($reshook)) {
85  $error = 0;
86 
87  // Add a notification
88  if ($action == 'add') {
89  if (empty($contactid)) {
90  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Contact")), null, 'errors');
91  $error++;
92  }
93  if ($actionid <= 0) {
94  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Action")), null, 'errors');
95  $error++;
96  }
97 
98  if (!$error) {
99  $db->begin();
100 
101  $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def";
102  $sql .= " WHERE fk_soc=".((int) $socid)." AND fk_contact=".((int) $contactid)." AND fk_action=".((int) $actionid);
103  if ($db->query($sql)) {
104  $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_soc, fk_contact, fk_action)";
105  $sql .= " VALUES ('".$db->idate($now)."',".((int) $socid).",".((int) $contactid).",".((int) $actionid).")";
106 
107  if (!$db->query($sql)) {
108  $error++;
109  dol_print_error($db);
110  }
111  } else {
112  dol_print_error($db);
113  }
114 
115  if (!$error) {
116  $db->commit();
117  } else {
118  $db->rollback();
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 /*
133  * View
134  */
135 
136 $form = new Form($db);
137 
138 $object = new Societe($db);
139 $result = $object->fetch($socid);
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 
147 llxHeader('', $title, $help_url);
148 
149 
150 if ($result > 0) {
151  $langs->load("other");
152 
153  $head = societe_prepare_head($object);
154 
155  print dol_get_fiche_head($head, 'notify', $langs->trans("ThirdParty"), -1, 'company');
156 
157  $linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
158 
159  dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom');
160 
161  print '<div class="fichecenter">';
162 
163  print '<div class="underbanner clearboth"></div>';
164  print '<table class="border centpercent tableforfield">';
165 
166  // Type Prospect/Customer/Supplier
167  print '<tr><td class="titlefield">'.$langs->trans('NatureOfThirdParty').'</td><td>';
168  print $object->getTypeUrl(1);
169  print '</td></tr>';
170 
171  // Prefix
172  if (!empty($conf->global->SOCIETE_USEPREFIX)) { // Old not used prefix field
173  print '<tr><td class="titlefield">'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
174  }
175 
176  if ($object->client) {
177  print '<tr><td class="titlefield">';
178  print $langs->trans('CustomerCode').'</td><td colspan="3">';
179  print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client));
180  $tmpcheck = $object->check_codeclient();
181  if ($tmpcheck != 0 && $tmpcheck != -5) {
182  print ' <span class="error">('.$langs->trans("WrongCustomerCode").')</span>';
183  }
184  print '</td></tr>';
185  }
186 
187  if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $object->fournisseur && !empty($user->rights->fournisseur->lire)) {
188  print '<tr><td class="titlefield">';
189  print $langs->trans('SupplierCode').'</td><td colspan="3">';
190  print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur));
191  $tmpcheck = $object->check_codefournisseur();
192  if ($tmpcheck != 0 && $tmpcheck != -5) {
193  print ' <span class="error">('.$langs->trans("WrongSupplierCode").')</span>';
194  }
195  print '</td></tr>';
196  }
197 
198  /*print '<tr><td class="titlefield">'.$langs->trans("NbOfActiveNotifications").'</td>'; // Notification for this thirdparty
199  print '<td colspan="3">';
200  $nbofrecipientemails=0;
201  $notify=new Notify($db);
202  $tmparray = $notify->getNotificationsArray('', $object->id, null, 0, array('thirdparty'));
203  foreach($tmparray as $tmpkey => $tmpval)
204  {
205  if (!empty($tmpkey)) $nbofrecipientemails++;
206  }
207  print $nbofrecipientemails;
208  print '</td></tr>';*/
209 
210  print '</table>';
211 
212  print '</div>';
213 
214  print dol_get_fiche_end();
215 
216  print "\n";
217 
218  // Help
219  print '<div class="opacitymedium hideonsmartphone">';
220  print $langs->trans("NotificationsDesc");
221  print '<br>'.$langs->trans("NotificationsDescUser");
222  print '<br>'.$langs->trans("NotificationsDescContact");
223  print '<br>'.$langs->trans("NotificationsDescGlobal");
224  print '<br>';
225  print '</div>';
226 
227  print '<br>'."\n";
228 
229 
230  // List of notifications enabled for contacts
231  $sql = "SELECT n.rowid, n.type,";
232  $sql .= " a.code, a.label,";
233  $sql .= " c.rowid as contactid, c.lastname, c.firstname, c.email";
234  $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
235  $sql .= " ".MAIN_DB_PREFIX."notify_def as n,";
236  $sql .= " ".MAIN_DB_PREFIX."socpeople c";
237  $sql .= " WHERE a.rowid = n.fk_action";
238  $sql .= " AND c.rowid = n.fk_contact";
239  $sql .= " AND c.fk_soc = ".((int) $object->id);
240 
241  $resql = $db->query($sql);
242  if ($resql) {
243  $num = $db->num_rows($resql);
244  } else {
245  dol_print_error($db);
246  }
247 
248 
249  // Add notification form
250  print load_fiche_titre($langs->trans("ListOfActiveNotifications").' <span class="opacitymedium colorblack paddingleft">('.$num.')</span>', '', '');
251 
252  print '<form action="'.$_SERVER["PHP_SELF"].'?socid='.$socid.'" method="post">';
253  print '<input type="hidden" name="token" value="'.newToken().'">';
254  print '<input type="hidden" name="action" value="add">';
255 
256  $param = "&socid=".$socid;
257 
258  // Line with titles
259  print '<div class="div-table-responsive-no-min">';
260  print '<table class="centpercent noborder">';
261  print '<tr class="liste_titre">';
262  print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, 'width="45%"', $sortfield, $sortorder);
263  print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, 'width="35%"', $sortfield, $sortorder);
264  print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, 'width="10%"', $sortfield, $sortorder);
266  print "</tr>\n";
267 
268  // Line to add a new subscription
269  $listofemails = $object->thirdparty_and_contact_email_array();
270  if (count($listofemails) > 0) {
271  $actions = array();
272 
273  // Load array of available notifications
274  $notificationtrigger = new InterfaceNotification($db);
275  $listofmanagedeventfornotification = $notificationtrigger->getListOfManagedEvents();
276 
277  foreach ($listofmanagedeventfornotification as $managedeventfornotification) {
278  $label = ($langs->trans("Notify_".$managedeventfornotification['code']) != "Notify_".$managedeventfornotification['code'] ? $langs->trans("Notify_".$managedeventfornotification['code']) : $managedeventfornotification['label']);
279  $actions[$managedeventfornotification['rowid']] = $label;
280  }
281  print '<tr class="oddeven nohover">';
282  print '<td class="nowraponall">';
283  print img_picto('', 'contact', '', false, 0, 0, '', 'paddingright').$form->selectarray("contactid", $listofemails, '', 1, 0, 0, '', 0, 0, 0, '', 'minwidth100imp maxwidthonsmartphone');
284  print '</td>';
285  print '<td class="nowraponall">';
286  print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$form->selectarray("actionid", $actions, '', 1, 0, 0, '', 0, 0, 0, '', 'minwidth100imp maxwidthonsmartphone');
287  print '</td>';
288  print '<td>';
289  $type = array('email'=>$langs->trans("EMail"));
290  print $form->selectarray("typeid", $type, '', 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
291  print '</td>';
292  print '<td class="right"><input type="submit" class="button button-add" value="'.$langs->trans("Add").'"></td>';
293  print '</tr>';
294  } else {
295  print '<tr class="oddeven"><td colspan="4" class="opacitymedium">';
296  print $langs->trans("YouMustCreateContactFirst");
297  print '</td></tr>';
298  }
299 
300 
301  if ($num) {
302  $i = 0;
303 
304  $contactstatic = new Contact($db);
305 
306  while ($i < $num) {
307  $obj = $db->fetch_object($resql);
308 
309  $contactstatic->id = $obj->contactid;
310  $contactstatic->lastname = $obj->lastname;
311  $contactstatic->firstname = $obj->firstname;
312 
313  print '<tr class="oddeven">';
314  print '<td>'.$contactstatic->getNomUrl(1);
315  if ($obj->type == 'email') {
316  if (isValidEmail($obj->email)) {
317  print ' &lt;'.$obj->email.'&gt;';
318  } else {
319  $langs->load("errors");
320  print ' '.img_warning().' <span class="warning">'.$langs->trans("ErrorBadEMail", $obj->email).'</span>';
321  }
322  }
323  print '</td>';
324  print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($label).'">';
325  $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
326  print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').$label;
327  print '</td>';
328  print '<td>';
329  if ($obj->type == 'email') {
330  print $langs->trans("Email");
331  }
332  if ($obj->type == 'sms') {
333  print $langs->trans("SMS");
334  }
335  print '</td>';
336  print '<td class="right"><a href="card.php?socid='.$socid.'&action=delete&token='.newToken().'&actid='.$obj->rowid.'">'.img_delete().'</a></td>';
337  print '</tr>';
338  $i++;
339  }
340  $db->free($resql);
341  }
342 
343  // List of notifications enabled for fixed email
344  /*
345  foreach($conf->global as $key => $val)
346  {
347  if (! preg_match('/^NOTIFICATION_FIXEDEMAIL_(.*)/', $key, $reg)) continue;
348  print '<tr class="oddeven"><td>';
349  $listtmp=explode(',',$val);
350  $first=1;
351  foreach($listtmp as $keyemail => $valemail)
352  {
353  if (! $first) print ', ';
354  $first=0;
355  $valemail=trim($valemail);
356  //print $keyemail.' - '.$valemail.' - '.$reg[1].'<br>';
357  if (isValidEmail($valemail, 1))
358  {
359  if ($valemail == '__SUPERVISOREMAIL__') print $valemail;
360  else print ' &lt;'.$valemail.'&gt;';
361  }
362  else
363  {
364  $langs->load("errors");
365  print ' '.img_warning().' <span class="warning">'.$langs->trans("ErrorBadEMail",$valemail).'</span>;
366  }
367  }
368  print '</td>';
369  print '<td>';
370  $notifcode=preg_replace('/_THRESHOLD_.*$/','',$reg[1]);
371  $notifcodecond=preg_replace('/^.*_(THRESHOLD_)/','$1',$reg[1]);
372  $label=($langs->trans("Notify_".$notifcode)!="Notify_".$notifcode?$langs->trans("Notify_".$notifcode):$notifcode);
373  print $label;
374  if (preg_match('/^THRESHOLD_HIGHER_(.*)$/',$notifcodecond,$regcond) && ($regcond[1] > 0))
375  {
376  print ' - '.$langs->trans("IfAmountHigherThan",$regcond[1]);
377  }
378  print '</td>';
379  print '<td>';
380  print $langs->trans("Email");
381  print '</td>';
382  print '<td class="right">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</td>';
383  print '</tr>';
384  }*/
385 
386  /*if ($user->admin)
387  {
388  print '<tr class="oddeven"><td colspan="4">';
389  print '+ <a href="'.DOL_URL_ROOT.'/admin/notification.php">'.$langs->trans("SeeModuleSetup", $langs->transnoentitiesnoconv("Module600Name")).'</a>';
390  print '</td></tr>';
391  }*/
392 
393  print '</table>';
394  print '</div>';
395  print '</form>';
396 
397  print '<br><br>'."\n";
398 
399 
400  // List
401  $sql = "SELECT n.rowid, n.daten, n.email, n.objet_type as object_type, n.objet_id as object_id, n.type,";
402  $sql .= " c.rowid as id, c.lastname, c.firstname, c.email as contactemail,";
403  $sql .= " a.code, a.label";
404  $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger as a,";
405  $sql .= " ".MAIN_DB_PREFIX."notify as n ";
406  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as c ON n.fk_contact = c.rowid";
407  $sql .= " WHERE a.rowid = n.fk_action";
408  $sql .= " AND n.fk_soc = ".((int) $object->id);
409  $sql .= $db->order($sortfield, $sortorder);
410 
411  // Count total nb of records
412  $nbtotalofrecords = '';
413  if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
414  $result = $db->query($sql);
415  $nbtotalofrecords = $db->num_rows($result);
416  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
417  $page = 0;
418  $offset = 0;
419  }
420  }
421 
422  $sql .= $db->plimit($limit + 1, $offset);
423 
424  $resql = $db->query($sql);
425  if ($resql) {
426  $num = $db->num_rows($resql);
427  } else {
428  dol_print_error($db);
429  }
430 
431  $param = '&socid='.$object->id;
432  if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
433  $param .= '&contextpage='.$contextpage;
434  }
435  if ($limit > 0 && $limit != $conf->liste_limit) {
436  $param .= '&limit='.$limit;
437  }
438 
439  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
440  if ($optioncss != '') {
441  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
442  }
443  print '<input type="hidden" name="token" value="'.newToken().'">';
444  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
445  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
446  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
447  print '<input type="hidden" name="page" value="'.$page.'">';
448  print '<input type="hidden" name="socid" value="'.$object->id.'">';
449 
450  // List of active notifications
451  print_barre_liste($langs->trans("ListOfNotificationsDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit);
452 
453  // Line with titles
454  print '<div class="div-table-responsive-no-min">';
455  print '<table class="centpercent noborder">';
456  print '<tr class="liste_titre">';
457  print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "c.lastname,c.firstname", '', $param, '', $sortfield, $sortorder);
458  print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder);
459  print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "n.type", '', $param, '', $sortfield, $sortorder);
460  //print_liste_field_titre("Object",$_SERVER["PHP_SELF"],"",'',$param,'"',$sortfield,$sortorder);
461  print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "n.daten", '', $param, '', $sortfield, $sortorder, 'right ');
462  print '</tr>';
463 
464  if ($num > 0) {
465  $i = 0;
466 
467  $contactstatic = new Contact($db);
468 
469  while ($i < $num) {
470  $obj = $db->fetch_object($resql);
471 
472  print '<tr class="oddeven"><td>';
473  if ($obj->id > 0) {
474  $contactstatic->id = $obj->id;
475  $contactstatic->lastname = $obj->lastname;
476  $contactstatic->firstname = $obj->firstname;
477  print $contactstatic->getNomUrl(1);
478  print $obj->email ? ' &lt;'.$obj->email.'&gt;' : $langs->trans("NoMail");
479  } else {
480  print $obj->email;
481  }
482  print '</td>';
483  print '<td>';
484  $label = ($langs->trans("Notify_".$obj->code) != "Notify_".$obj->code ? $langs->trans("Notify_".$obj->code) : $obj->label);
485  print $label;
486  print '</td>';
487  print '<td>';
488  if ($obj->type == 'email') {
489  print $langs->trans("Email");
490  }
491  if ($obj->type == 'sms') {
492  print $langs->trans("Sms");
493  }
494  print '</td>';
495  // TODO Add link to object here for other types
496  /*print '<td>';
497  if ($obj->object_type == 'order')
498  {
499  $orderstatic->id=$obj->object_id;
500  $orderstatic->ref=...
501  print $orderstatic->getNomUrl(1);
502  }
503  print '</td>';*/
504  // print
505  print'<td class="right">'.dol_print_date($db->jdate($obj->daten), 'dayhour').'</td>';
506  print '</tr>';
507  $i++;
508  }
509  $db->free($resql);
510  } else {
511  print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
512  }
513 
514  print '</table>';
515  print '</div>';
516 
517  print '</form>';
518 } else {
519  dol_print_error('', 'RecordNotFound');
520 }
521 
522 // End of page
523 llxFooter();
524 $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 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.
Definition: company.lib.php:42
$parameters
Actions.
Definition: card.php:79
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.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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
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.