dolibarr  7.0.0-beta
advtargetemailing.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
3  * Copyright (C) 2016 Laurent Destailleur <eldy@uers.sourceforge.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
25 if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1');
26 
27 require '../../main.inc.php';
28 
29 require_once DOL_DOCUMENT_ROOT . '/comm/mailing/class/mailing.class.php';
30 require_once DOL_DOCUMENT_ROOT . '/core/lib/emailing.lib.php';
31 require_once DOL_DOCUMENT_ROOT . '/comm/mailing/class/advtargetemailing.class.php';
32 require_once DOL_DOCUMENT_ROOT . '/comm/mailing/class/html.formadvtargetemailing.class.php';
33 require_once DOL_DOCUMENT_ROOT . '/core/modules/mailings/advthirdparties.modules.php';
34 require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
35 require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
36 
37 // Translations
38 $langs->load("mails");
39 $langs->load("companies");
40 if (! empty($conf->categorie->enabled)) {
41  $langs->load("categories");
42 }
43 
44 // Security check
45 if (! $user->rights->mailing->lire || $user->societe_id > 0)
47 
48 // Load variable for pagination
49 $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
50 $sortfield = GETPOST('sortfield','alpha');
51 $sortorder = GETPOST('sortorder','alpha');
52 $page = GETPOST('page','int');
53 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
54 $offset = $limit * $page;
55 $pageprev = $page - 1;
56 $pagenext = $page + 1;
57 if (! $sortorder)
58  $sortorder = "ASC";
59 if (! $sortfield)
60  $sortfield = "email";
61 
62 $id = GETPOST('id', 'int');
63 $rowid = GETPOST('rowid', 'int');
64 $action = GETPOST('action','aZ09');
65 $search_nom = GETPOST("search_nom");
66 $search_prenom = GETPOST("search_prenom");
67 $search_email = GETPOST("search_email");
68 $template_id = GETPOST('template_id', 'int');
69 
70 // Do we click on purge search criteria ?
71 if (GETPOST('button_removefilter_x','alpha')) {
72  $search_nom = '';
73  $search_prenom = '';
74  $search_email = '';
75 }
76 
77 $array_query = array ();
78 
79 $object = new Mailing($db);
80 $advTarget = new AdvanceTargetingMailing($db);
81 if (empty($template_id)) {
82  $advTarget->fk_mailing = $id;
83  $result = $advTarget->fetch_by_mailing();
84 } else {
85  $result = $advTarget->fetch($template_id);
86 }
87 
88 if ($result < 0) {
89  setEventMessage($advTarget->error, 'errors');
90 } else {
91  if (! empty($advTarget->id)) {
92  $array_query = json_decode($advTarget->filtervalue, true);
93  }
94 }
95 
96 
97 /*
98  * Actions
99  */
100 
101 if ($action == 'loadfilter') {
102  if (! empty($template_id)) {
103  $result = $advTarget->fetch($template_id);
104  if ($result < 0) {
105  setEventMessage($advTarget->error, 'errors');
106  } else {
107  if (! empty($advTarget->id)) {
108  $array_query = json_decode($advTarget->filtervalue, true);
109  }
110  }
111  }
112 }
113 
114 if ($action == 'add') {
115 
116  $user_contact_query = false;
117 
118  $array_query = array ();
119 
120  // Get extra fields
121 
122  foreach ( $_POST as $key => $value ) {
123  // print '$key='.$key.' $value='.$value.'<BR>';
124  if (preg_match("/^options_.*(?<!_cnct)$/", $key)) {
125  // Special case for start date come with 3 inputs day, month, year
126  if (preg_match("/st_dt/", $key)) {
127  $dtarr = array ();
128  $dtarr = explode('_', $key);
129  if (! array_key_exists('options_' . $dtarr[1] . '_st_dt', $array_query)) {
130  $array_query['options_' . $dtarr[1] . '_st_dt'] = dol_mktime(0, 0, 0, GETPOST('options_' . $dtarr[1] . '_st_dtmonth', 'int'), GETPOST('options_' . $dtarr[1] . '_st_dtday', 'int'), GETPOST('options_' . $dtarr[1] . '_st_dtyear', 'int'));
131  }
132  } elseif (preg_match("/end_dt/", $key)) {
133  // Special case for end date come with 3 inputs day, month, year
134  $dtarr = array ();
135  $dtarr = explode('_', $key);
136  if (! array_key_exists('options_' . $dtarr[1] . '_end_dt', $array_query)) {
137  $array_query['options_' . $dtarr[1] . '_end_dt'] = dol_mktime(0, 0, 0, GETPOST('options_' . $dtarr[1] . '_end_dtmonth', 'int'), GETPOST('options_' . $dtarr[1] . '_end_dtday', 'int'), GETPOST('options_' . $dtarr[1] . '_end_dtyear', 'int'));
138  }
139  } else {
140  $array_query[$key] = GETPOST($key);
141  }
142  }
143  if (preg_match("/^options_.*_cnct/", $key)) {
144  $user_contact_query = true;
145  // Special case for start date come with 3 inputs day, month, year
146  if (preg_match("/st_dt/", $key)) {
147  $dtarr = array ();
148  $dtarr = explode('_', $key);
149  if (! array_key_exists('options_' . $dtarr[1] . '_st_dt' . '_cnct', $array_query)) {
150  $array_query['options_' . $dtarr[1] . '_st_dt' . '_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_' . $dtarr[1] . '_st_dtmonth' . '_cnct', 'int'), GETPOST('options_' . $dtarr[1] . '_st_dtday' . '_cnct', 'int'), GETPOST('options_' . $dtarr[1] . '_st_dtyear' . '_cnct', 'int'));
151  }
152  } elseif (preg_match("/end_dt/", $key)) {
153  // Special case for end date come with 3 inputs day, month, year
154  $dtarr = array ();
155  $dtarr = explode('_', $key);
156  if (! array_key_exists('options_' . $dtarr[1] . '_end_dt' . '_cnct', $array_query)) {
157  $array_query['options_' . $dtarr[1] . '_end_dt' . '_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_' . $dtarr[1] . '_end_dtmonth' . '_cnct', 'int'), GETPOST('options_' . $dtarr[1] . '_end_dtday' . '_cnct', 'int'), GETPOST('options_' . $dtarr[1] . '_end_dtyear' . '_cnct', 'int'));
158  }
159  } else {
160  $array_query[$key] = GETPOST($key);
161  }
162  }
163 
164  if (preg_match("/^cust_/", $key)) {
165  $array_query[$key] = GETPOST($key);
166  }
167 
168  if (preg_match("/^contact_/", $key)) {
169 
170  $array_query[$key] = GETPOST($key);
171 
172  $specials_date_key = array (
173  'contact_update_st_dt',
174  'contact_update_end_dt',
175  'contact_create_st_dt',
176  'contact_create_end_dt'
177  );
178  foreach ( $specials_date_key as $date_key ) {
179  if ($key == $date_key) {
180  $dt = GETPOST($date_key);
181  if (! empty($dt)) {
182  $array_query[$key] = dol_mktime(0, 0, 0, GETPOST($date_key . 'month', 'int'), GETPOST($date_key . 'day', 'int'), GETPOST($date_key . 'year', 'int'));
183  } else {
184  $array_query[$key] = '';
185  }
186  }
187  }
188 
189  if (! empty($array_query[$key])) {
190  $user_contact_query = true;
191  }
192  }
193 
194  if ($array_query['type_of_target'] == 2 || $array_query['type_of_target'] == 4) {
195  $user_contact_query = true;
196  }
197 
198  if (preg_match("/^type_of_target/", $key)) {
199  $array_query[$key] = GETPOST($key);
200  }
201  }
202 
203  // if ($array_query ['type_of_target'] == 1 || $array_query ['type_of_target'] == 3) {
204  $result = $advTarget->query_thirdparty($array_query);
205  if ($result < 0) {
206  setEventMessage($advTarget->error, 'errors');
207  }
208  /*} else {
209  $advTarget->thirdparty_lines = array ();
210  }*/
211 
212  if ($user_contact_query && ($array_query['type_of_target'] == 1 || $array_query['type_of_target'] == 2 || $array_query['type_of_target'] == 4)) {
213  $result = $advTarget->query_contact($array_query, 1);
214  if ($result < 0) {
215  setEventMessage($advTarget->error, 'errors');
216  }
217  // If use contact but no result use artefact to so not use socid into add_to_target
218  if (count($advTarget->contact_lines) == 0) {
219  $advTarget->contact_lines = array (
220  0
221  );
222  }
223  } else {
224  $advTarget->contact_lines = array ();
225  }
226 
227  if ((count($advTarget->thirdparty_lines) > 0) || (count($advTarget->contact_lines) > 0)) {
228  // Add targets into database
229  $obj = new mailing_advthirdparties($db);
230  $result = $obj->add_to_target_spec($id, $advTarget->thirdparty_lines, $array_query['type_of_target'], $advTarget->contact_lines);
231  } else {
232  $result = 0;
233  }
234 
235  if ($result > 0) {
236  $query_temlate_id = '';
237  if (! empty($template_id)) {
238  $query_temlate_id = '&template_id=' . $template_id;
239  }
240  header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id . $query_temlate_id);
241  exit();
242  }
243  if ($result == 0) {
244  setEventMessage($langs->trans("WarningNoEMailsAdded"), 'warnings');
245  }
246  if ($result < 0) {
247  setEventMessage($obj->error, 'errors');
248  }
249 }
250 
251 if ($action == 'clear') {
252  // Chargement de la classe
253  $classname = "MailingTargets";
254  $obj = new $classname($db);
255  $obj->clear_target($id);
256 
257  header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
258  exit();
259 }
260 
261 if ($action == 'savefilter' || $action == 'createfilter') {
262 
263  $template_name = GETPOST('template_name');
264  $error = 0;
265 
266  if ($action == 'createfilter' && empty($template_name)) {
267  setEventMessage($langs->trans('ErrorFieldRequired', $langs->trans('AdvTgtOrCreateNewFilter')), 'errors');
268  $error ++;
269  }
270 
271  if (empty($error)) {
272 
273  $array_query = array ();
274 
275  // Get extra fields
276  foreach ( $_POST as $key => $value ) {
277  if (preg_match("/^options_.*(?<!_cnct)$/", $key)) {
278  // Special case for start date come with 3 inputs day, month, year
279  if (preg_match("/st_dt/", $key)) {
280  $dtarr = array ();
281  $dtarr = explode('_', $key);
282  if (! array_key_exists('options_' . $dtarr[1] . '_st_dt', $array_query)) {
283  $array_query['options_' . $dtarr[1] . '_st_dt'] = dol_mktime(0, 0, 0, GETPOST('options_' . $dtarr[1] . '_st_dtmonth', 'int'), GETPOST('options_' . $dtarr[1] . '_st_dtday', 'int'), GETPOST('options_' . $dtarr[1] . '_st_dtyear', 'int'));
284  }
285  } elseif (preg_match("/end_dt/", $key)) {
286  // Special case for end date come with 3 inputs day, month, year
287  $dtarr = array ();
288  $dtarr = explode('_', $key);
289  if (! array_key_exists('options_' . $dtarr[1] . '_end_dt', $array_query)) {
290  $array_query['options_' . $dtarr[1] . '_end_dt'] = dol_mktime(0, 0, 0, GETPOST('options_' . $dtarr[1] . '_end_dtmonth', 'int'), GETPOST('options_' . $dtarr[1] . '_end_dtday', 'int'), GETPOST('options_' . $dtarr[1] . '_end_dtyear', 'int'));
291  // print $array_query['options_'.$dtarr[1].'_end_dt'];
292  // 01/02/1013=1361228400
293  }
294  } else {
295  $array_query[$key] = GETPOST($key);
296  }
297  }
298  if (preg_match("/^options_.*_cnct/", $key)) {
299  // Special case for start date come with 3 inputs day, month, year
300  if (preg_match("/st_dt/", $key)) {
301  $dtarr = array ();
302  $dtarr = explode('_', $key);
303  if (! array_key_exists('options_' . $dtarr[1] . '_st_dt' . '_cnct', $array_query)) {
304  $array_query['options_' . $dtarr[1] . '_st_dt' . '_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_' . $dtarr[1] . '_st_dtmonth' . '_cnct', 'int'), GETPOST('options_' . $dtarr[1] . '_st_dtday' . '_cnct', 'int'), GETPOST('options_' . $dtarr[1] . '_st_dtyear' . '_cnct', 'int'));
305  }
306  } elseif (preg_match("/end_dt/", $key)) {
307  // Special case for end date come with 3 inputs day, month, year
308  $dtarr = array ();
309  $dtarr = explode('_', $key);
310  if (! array_key_exists('options_' . $dtarr[1] . '_end_dt' . '_cnct', $array_query)) {
311  $array_query['options_' . $dtarr[1] . '_end_dt' . '_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_' . $dtarr[1] . '_end_dtmonth' . '_cnct', 'int'), GETPOST('options_' . $dtarr[1] . '_end_dtday' . '_cnct', 'int'), GETPOST('options_' . $dtarr[1] . '_end_dtyear' . '_cnct', 'int'));
312  // print $array_query['cnct_options_'.$dtarr[1].'_end_dt'];
313  // 01/02/1013=1361228400
314  }
315  } else {
316  $array_query[$key] = GETPOST($key);
317  }
318  }
319 
320  if (preg_match("/^cust_/", $key)) {
321  $array_query[$key] = GETPOST($key);
322  }
323 
324  if (preg_match("/^contact_/", $key)) {
325 
326  $array_query[$key] = GETPOST($key);
327 
328  $specials_date_key = array (
329  'contact_update_st_dt',
330  'contact_update_end_dt',
331  'contact_create_st_dt',
332  'contact_create_end_dt'
333  );
334  foreach ( $specials_date_key as $date_key ) {
335  if ($key == $date_key) {
336  $dt = GETPOST($date_key);
337  if (! empty($dt)) {
338  $array_query[$key] = dol_mktime(0, 0, 0, GETPOST($date_key . 'month', 'int'), GETPOST($date_key . 'day', 'int'), GETPOST($date_key . 'year', 'int'));
339  } else {
340  $array_query[$key] = '';
341  }
342  }
343  }
344  }
345 
346  if (preg_match("/^type_of_target/", $key)) {
347  $array_query[$key] = GETPOST($key);
348  }
349  }
350  $advTarget->filtervalue = json_encode($array_query);
351 
352  if ($action == 'createfilter') {
353  $advTarget->name = $template_name;
354  $result = $advTarget->create($user);
355  if ($result < 0) {
356  setEventMessage($advTarget->error, 'errors');
357  }
358  } elseif ($action == 'savefilter') {
359  $result = $advTarget->update($user);
360  if ($result < 0) {
361  setEventMessage($advTarget->error, 'errors');
362  }
363  }
364  $template_id = $advTarget->id;
365  }
366 }
367 
368 if ($action == 'deletefilter') {
369  $result = $advTarget->delete($user);
370  if ($result < 0) {
371  setEventMessage($advTarget->error, 'errors');
372  }
373  header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
374  exit();
375 }
376 
377 if ($action == 'delete') {
378  // Ici, rowid indique le destinataire et id le mailing
379  $sql = "DELETE FROM " . MAIN_DB_PREFIX . "mailing_cibles WHERE rowid=" . $rowid;
380  $resql = $db->query($sql);
381  if ($resql) {
382  if (! empty($id)) {
383  $classname = "MailingTargets";
384  $obj = new $classname($db);
385  $obj->update_nb($id);
386 
387  header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
388  exit();
389  } else {
390  header("Location: liste.php");
391  exit();
392  }
393  } else {
394  dol_print_error($db);
395  }
396 }
397 
398 if ($_POST["button_removefilter"]) {
399  $search_nom = '';
400  $search_prenom = '';
401  $search_email = '';
402 }
403 
404 
405 /*
406  * View
407  */
408 
409 
410 llxHeader('', $langs->trans("MailAdvTargetRecipients"));
411 
412 print '<script type="text/javascript" language="javascript">
413  $(document).ready(function() {
414 
415  // Click Function
416  $(":button[name=addcontact]").click(function() {
417  $(":hidden[name=action]").val("add");
418  $("#find_customer").submit();
419  });
420 
421  $(":button[name=loadfilter]").click(function() {
422  $(":hidden[name=action]").val("loadfilter");
423  $("#find_customer").submit();
424  });
425 
426  $(":button[name=deletefilter]").click(function() {
427  $(":hidden[name=action]").val("deletefilter");
428  $("#find_customer").submit();
429  });
430 
431  $(":button[name=savefilter]").click(function() {
432  $(":hidden[name=action]").val("savefilter");
433  $("#find_customer").submit();
434  });
435 
436  $(":button[name=createfilter]").click(function() {
437  $(":hidden[name=action]").val("createfilter");
438  $("#find_customer").submit();
439  });
440  });
441 </script>';
442 
443 $form = new Form($db);
444 $formadvtargetemaling = new FormAdvTargetEmailing($db);
445 $formcompany = new FormCompany($db);
446 $formother = new FormOther($db);
447 
448 if ($object->fetch($id) >= 0) {
449 
450  $head = emailing_prepare_head($object);
451 
452  dol_fiche_head($head, 'advtargets', $langs->trans("Mailing"), 0, 'email');
453 
454  print '<table class="border" width="100%">';
455 
456  $linkback = '<a href="' . DOL_URL_ROOT . '/comm/mailing/liste.php">' . $langs->trans("BackToList") . '</a>';
457 
458  print '<tr><td width="25%">' . $langs->trans("Ref") . '</td>';
459  print '<td colspan="3">';
460  print $form->showrefnav($object, 'id', $linkback);
461  print '</td></tr>';
462 
463  print '<tr><td width="25%">' . $langs->trans("MailTitle") . '</td><td colspan="3">' . $object->titre . '</td></tr>';
464 
465  print '<tr><td width="25%">' . $langs->trans("MailFrom") . '</td><td colspan="3">' . dol_print_email($object->email_from, 0, 0, 0, 0, 1) . '</td></tr>';
466 
467  // Errors to
468  print '<tr><td width="25%">' . $langs->trans("MailErrorsTo") . '</td><td colspan="3">' . dol_print_email($object->email_errorsto, 0, 0, 0, 0, 1);
469  print '</td></tr>';
470 
471  // Status
472  print '<tr><td width="25%">' . $langs->trans("Status") . '</td><td colspan="3">' . $object->getLibStatut(4) . '</td></tr>';
473 
474  // Nb of distinct emails
475  print '<tr><td width="25%">';
476  print $langs->trans("TotalNbOfDistinctRecipients");
477  print '</td><td colspan="3">';
478  $nbemail = ($object->nbemail ? $object->nbemail : '0');
479  if (! empty($conf->global->MAILING_LIMIT_SENDBYWEB) && $conf->global->MAILING_LIMIT_SENDBYWEB < $nbemail) {
480  $text = $langs->trans('LimitSendingEmailing', $conf->global->MAILING_LIMIT_SENDBYWEB);
481  print $form->textwithpicto($nbemail, $text, 1, 'warning');
482  } else {
483  print $nbemail;
484  }
485  print '</td></tr>';
486 
487  print '</table>';
488 
489  print "</div>";
490 
491  // Show email selectors
492  if ($object->statut == 0 && $user->rights->mailing->creer) {
493  print_fiche_titre($langs->trans("AdvTgtTitle"));
494 
495  print '<div class="tabBar">' . "\n";
496  print '<form name="find_customer" id="find_customer" action="' . $_SERVER['PHP_SELF'] . '?id=' . $id . '" method="POST">' . "\n";
497  print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">' . "\n";
498  print '<input type="hidden" name="action" value="">' . "\n";
499  print '<table class="border" width="100%">' . "\n";
500 
501  print '<tr>' . "\n";
502  print '<td colspan="3" align="right">' . "\n";
503 
504  print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n";
505 
506  print '</td>' . "\n";
507  print '</tr>' . "\n";
508 
509  print '<tr><td>' . $langs->trans('AdvTgtNameTemplate') . '</td><td>';
510  if (! empty($template_id)) {
511  $default_template = $template_id;
512  } else {
513  $default_template = $advTarget->id;
514  }
515  print $formadvtargetemaling->selectAdvtargetemailingTemplate('template_id', $default_template);
516  print '<input type="button" name="loadfilter" id="loadfilter" value="' . $langs->trans('AdvTgtLoadFilter') . '" class="butAction"/>';
517  print '<input type="button" name="deletefilter" id="deletefilter" value="' . $langs->trans('AdvTgtDeleteFilter') . '" class="butAction"/>';
518  print '<input type="button" name="savefilter" id="savefilter" value="' . $langs->trans('AdvTgtSaveFilter') . '" class="butAction"/>';
519  print $langs->trans('AdvTgtOrCreateNewFilter');
520  print '<input type="text" name="template_name" id="template_name" value=""/>';
521  print '<input type="button" name="createfilter" id="createfilter" value="' . $langs->trans('AdvTgtCreateFilter') . '" class="butAction"/>';
522  print '</td><td>' . "\n";
523  print '</td></tr>' . "\n";
524 
525  print '<tr><td>' . $langs->trans('AdvTgtTypeOfIncude') . '</td><td>';
526  print $form->selectarray('type_of_target', $advTarget->select_target_type, $array_query['type_of_target']);
527  print '</td><td>' . "\n";
528  print $form->textwithpicto('', $langs->trans("AdvTgtTypeOfIncudeHelp"), 1, 'help');
529  print '</td></tr>' . "\n";
530 
531  // Customer name
532  print '<tr><td>' . $langs->trans('ThirdPartyName');
533  if (! empty($array_query['cust_name'])) {
534  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
535  }
536  print '</td><td><input type="text" name="cust_name" value="' . $array_query['cust_name'] . '"/></td><td>' . "\n";
537  print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
538  print '</td></tr>' . "\n";
539 
540  // Code Client
541  print '<tr><td>' . $langs->trans('CustomerCode');
542  if (! empty($array_query['cust_code'])) {
543  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
544  }
545  print '</td><td><input type="text" name="cust_code" value="' . $array_query['cust_code'] . '"/></td><td>' . "\n";
546  print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
547  print '</td></tr>' . "\n";
548 
549  // Address Client
550  print '<tr><td>' . $langs->trans('Address');
551  if (! empty($array_query['cust_adress'])) {
552  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
553  }
554  print '</td><td><input type="text" name="cust_adress" value="' . $array_query['cust_adress'] . '"/></td><td>' . "\n";
555  print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
556  print '</td></tr>' . "\n";
557 
558  // Zip Client
559  print '<tr><td>' . $langs->trans('Zip');
560  if (! empty($array_query['cust_zip'])) {
561  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
562  }
563  print '</td><td><input type="text" name="cust_zip" value="' . $array_query['cust_zip'] . '"/></td><td>' . "\n";
564  print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
565  print '</td></tr>' . "\n";
566 
567  // City Client
568  print '<tr><td>' . $langs->trans('Town');
569  if (! empty($array_query['cust_city'])) {
570  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
571  }
572  print '</td><td><input type="text" name="cust_city" value="' . $array_query['cust_city'] . '"/></td><td>' . "\n";
573  print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
574  print '</td></tr>' . "\n";
575 
576  // Customer Country
577  print '<tr><td>' . $langs->trans("Country");
578  if (count($array_query['cust_country']) > 0) {
579  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
580  }
581  print '</td><td>' . "\n";
582  print $formadvtargetemaling->multiselectCountry('cust_country', $array_query['cust_country']);
583  print '</td><td>' . "\n";
584  print '</td></tr>' . "\n";
585 
586  // State Customer
587  print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('ThirdParty');
588  if (count($array_query['cust_status']) > 0) {
589  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
590  }
591  print '</td><td>';
592  print $formadvtargetemaling->advMultiselectarray('cust_status', array (
593  '0' => $langs->trans('ActivityCeased'),
594  '1' => $langs->trans('InActivity')
595  ), $array_query['cust_status']);
596  print '</td><td>' . "\n";
597  print '</td></tr>' . "\n";
598 
599  // Mother Company
600  print '<tr><td>' . $langs->trans("Maison mère");
601  if (! empty($array_query['cust_mothercompany'])) {
602  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
603  }
604  print '</td><td>' . "\n";
605  print '<input type="text" name="cust_mothercompany" value="' . $array_query['cust_mothercompany'] . '"/>';
606  print '</td><td>' . "\n";
607  print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
608  print '</td></tr>' . "\n";
609 
610  // Prospect/Customer
611  $selected = $array_query['cust_typecust'];
612  print '<tr><td>' . $langs->trans('ProspectCustomer') . ' ' . $langs->trans('ThirdParty');
613  if (count($array_query['cust_typecust']) > 0) {
614  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
615  }
616  print '</td><td>';
617  $options_array = array (
618  2 => $langs->trans('Prospect'),
619  3 => $langs->trans('ProspectCustomer'),
620  1 => $langs->trans('Customer'),
621  0 => $langs->trans('NorProspectNorCustomer')
622  );
623  print $formadvtargetemaling->advMultiselectarray('cust_typecust', $options_array, $array_query['cust_typecust']);
624  print '</td><td>' . "\n";
625  print '</td></tr>' . "\n";
626 
627  // Prospection status
628  print '<tr><td>' . $langs->trans('ProspectLevel');
629  if (count($array_query['cust_prospect_status']) > 0) {
630  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
631  }
632  print '</td><td>';
633  print $formadvtargetemaling->multiselectProspectionStatus($array_query['cust_prospect_status'], 'cust_prospect_status', 1);
634  print '</td><td>' . "\n";
635  print '</td></tr>' . "\n";
636 
637  // Prospection comm status
638  print '<tr><td>' . $langs->trans('StatusProsp');
639  if (count($array_query['cust_comm_status']) > 0) {
640  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
641  }
642  print '</td><td>';
643  print $formadvtargetemaling->advMultiselectarray('cust_comm_status', $advTarget->type_statuscommprospect, $array_query['cust_comm_status']);
644  print '</td><td>' . "\n";
645  print '</td></tr>' . "\n";
646 
647  // Customer Type
648  print '<tr><td>' . $langs->trans("ThirdPartyType");
649  if (count($array_query['cust_typeent']) > 0) {
650  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
651  }
652  print '</td><td>' . "\n";
653  print $formadvtargetemaling->advMultiselectarray('cust_typeent', $formcompany->typent_array(0, " AND id <> 0"), $array_query['cust_typeent']);
654  print '</td><td>' . "\n";
655  print '</td></tr>' . "\n";
656 
657  // Staff number
658  print '<td>' . $langs->trans("Staff");
659  if (count($array_query['cust_effectif_id']) > 0) {
660  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
661  }
662  print '</td><td>';
663  print $formadvtargetemaling->advMultiselectarray("cust_effectif_id", $formcompany->effectif_array(0, " AND id <> 0"), $array_query['cust_effectif_id']);
664  print '</td><td>' . "\n";
665  print '</td></tr>' . "\n";
666 
667  // Sales manager
668  print '<tr><td>' . $langs->trans("SalesRepresentatives");
669  if (count($array_query['cust_saleman']) > 0) {
670  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
671  }
672  print '</td><td>' . "\n";
673  print $formadvtargetemaling->multiselectselectSalesRepresentatives('cust_saleman', $array_query['cust_saleman'], $user);
674  print '</td><td>' . "\n";
675  print '</td></tr>' . "\n";
676 
677  // Customer Default Langauge
678  if (! empty($conf->global->MAIN_MULTILANGS)) {
679 
680  print '<tr><td>' . $langs->trans("DefaultLang");
681  if (count($array_query['cust_language']) > 0) {
682  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
683  }
684  print '</td><td>' . "\n";
685  print $formadvtargetemaling->multiselectselectLanguage('cust_language', $array_query['cust_language']);
686  print '</td><td>' . "\n";
687  print '</td></tr>' . "\n";
688  }
689 
690  if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
691  // Customer Categories
692  print '<tr><td>' . $langs->trans("CustomersCategoryShort");
693  if (count($array_query['cust_categ']) > 0) {
694  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
695  }
696  print '</td><td>' . "\n";
697  print $formadvtargetemaling->multiselectCustomerCategories('cust_categ', $array_query['cust_categ']);
698  print '</td><td>' . "\n";
699  print '</td></tr>' . "\n";
700  }
701 
702  // Standard Extrafield feature
703  if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
704  // fetch optionals attributes and labels
705  dol_include_once('/core/class/extrafields.class.php');
706  $extrafields = new ExtraFields($db);
707  $extralabels = $extrafields->fetch_name_optionals_label('societe');
708  foreach ( $extralabels as $key => $val ) {
709  if ($key != 'ts_nameextra' && $key != 'ts_payeur') {
710  print '<tr><td>' . $extrafields->attribute_label[$key];
711  if (! empty($array_query['options_' . $key]) || (is_array($array_query['options_' . $key]) && count($array_query['options_' . $key]) > 0)) {
712  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
713  }
714  print '</td><td>';
715  if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) {
716  print '<input type="text" name="options_' . $key . '"/></td><td>' . "\n";
717  print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
718  } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) {
719  print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options' . $key . '_min"/>';
720  print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options' . $key . '_max"/>';
721  print '</td><td>' . "\n";
722  print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help');
723  } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) {
724 
725  print '<table class="nobordernopadding"><tr>';
726  print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>';
727  print $form->select_date('', 'options_' . $key . '_st_dt');
728  print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>';
729  print $form->select_date('', 'options_' . $key . '_end_dt');
730  print '</td></tr></table>';
731 
732  print '</td><td>' . "\n";
733  print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help');
734  } elseif (($extrafields->attribute_type[$key] == 'boolean')) {
735  print $form->selectarray('options_' . $key, array (
736  '' => '',
737  '1' => $langs->trans('Yes'),
738  '0' => $langs->trans('No')
739  ), $array_query['options_' . $key]);
740  print '</td><td>' . "\n";
741  } elseif (($extrafields->attribute_type[$key] == 'select')) {
742  print $formadvtargetemaling->advMultiselectarray('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]);
743  print '</td><td>' . "\n";
744  } elseif (($extrafields->attribute_type[$key] == 'sellist')) {
745  print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key, $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key]);
746  print '</td><td>' . "\n";
747  } else {
748 
749  print '<table class="nobordernopadding"><tr>';
750  print '<td></td><td>';
751  if (is_array($array_query['options_' . $key])) {
752  print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key]));
753  } else {
754  print $extrafields->showInputField($key, $array_query['options_' . $key]);
755  }
756  print '</td></tr></table>';
757 
758  print '</td><td>' . "\n";
759  }
760  print '</td></tr>' . "\n";
761  }
762  }
763  } else {
764  $std_soc = new Societe($db);
765  $action_search = 'query';
766 
767  // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
768  include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
769  $hookmanager = new HookManager($db);
770  $hookmanager->initHooks(array ('thirdpartycard'));
771 
772  $parameters=array();
773  if (! empty($advTarget->id)) {
774  $parameters = array('array_query' => $advTarget->filtervalue);
775  }
776  // Other attributes
777  $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $std_soc, $action_search);
778  print $hookmanager->resPrint;
779  }
780 
781  // State Contact
782  print '<tr><td>' . $langs->trans('Status') . ' ' . $langs->trans('Contact');
783  if (count($array_query['contact_status']) > 0) {
784  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
785  }
786  print '</td><td>';
787  print $formadvtargetemaling->advMultiselectarray('contact_status', array (
788  '0' => $langs->trans('ActivityCeased'),
789  '1' => $langs->trans('InActivity')
790  ), $array_query['contact_status']);
791  print '</td><td>' . "\n";
792  print $form->textwithpicto('', $langs->trans("AdvTgtContactHelp"), 1, 'help');
793  print '</td></tr>' . "\n";
794 
795  // Civility
796  print '<tr><td width="15%">' . $langs->trans("UserTitle");
797  if (count($array_query['contact_civility']) > 0) {
798  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
799  }
800  print '</td><td>';
801  print $formadvtargetemaling->multiselectCivility('contact_civility', $array_query['contact_civility']);
802  print '</td></tr>';
803 
804  // contact name
805  print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Lastname');
806  if (! empty($array_query['contact_lastname'])) {
807  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
808  }
809  print '</td><td><input type="text" name="contact_lastname" value="' . $array_query['contact_lastname'] . '"/></td><td>' . "\n";
810  print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
811  print '</td></tr>' . "\n";
812  print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans('Firstname');
813  if (! empty($array_query['contact_firstname'])) {
814  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
815  }
816  print '</td><td><input type="text" name="contact_firstname" value="' . $array_query['contact_firstname'] . '"/></td><td>' . "\n";
817  print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
818  print '</td></tr>' . "\n";
819 
820  // Contact Country
821  print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("Country");
822  if (count($array_query['contact_country']) > 0) {
823  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
824  }
825  print '</td><td>' . "\n";
826  print $formadvtargetemaling->multiselectCountry('contact_country', $array_query['contact_country']);
827  print '</td><td>' . "\n";
828  print '</td></tr>' . "\n";
829 
830  // Never send mass mailing
831  print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("No_Email");
832  if (! empty($array_query['contact_no_email'])) {
833  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
834  }
835  print '</td><td>' . "\n";
836  print $form->selectarray('contact_no_email', array (
837  '' => '',
838  '1' => $langs->trans('Yes'),
839  '0' => $langs->trans('No')
840  ), $array_query['contact_no_email']);
841  print '</td><td>' . "\n";
842  print '</td></tr>' . "\n";
843 
844  // Contact Date Create
845  print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateCreation");
846  if (! empty($array_query['contact_create_st_dt'])) {
847  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
848  }
849  print '</td><td>' . "\n";
850  print '<table class="nobordernopadding"><tr>';
851  print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>';
852  print $form->select_date($array_query['contact_create_st_dt'], 'contact_create_st_dt', 0, 0, 1, 'find_customer', 1, 1);
853  print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>';
854  print $form->select_date($array_query['contact_create_end_dt'], 'contact_create_end_dt', 0, 0, 1, 'find_customer', 1, 1);
855  print '</td></tr></table>';
856  print '</td><td>' . "\n";
857  print '</td></tr>' . "\n";
858 
859  // Contact update Create
860  print '<tr><td>' . $langs->trans('Contact') . ' ' . $langs->trans("DateLastModification");
861  if (! empty($array_query['contact_update_st_dt'])) {
862  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
863  }
864  print '</td><td>' . "\n";
865  print '<table class="nobordernopadding"><tr>';
866  print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>';
867  print $form->select_date($array_query['contact_update_st_dt'], 'contact_update_st_dt', 0, 0, 1, 'find_customer', 1, 1);
868  print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>';
869  print $form->select_date($array_query['contact_update_end_dt'], 'contact_update_end_dt', 0, 0, 1, 'find_customer', 1, 1);
870  print '</td></tr></table>';
871  print '</td><td>' . "\n";
872  print '</td></tr>' . "\n";
873 
874  if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
875  // Customer Categories
876  print '<tr><td>' . $langs->trans("ContactCategoriesShort");
877  if (count($array_query['contact_categ']) > 0) {
878  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
879  }
880  print '</td><td>' . "\n";
881  print $formadvtargetemaling->multiselectContactCategories('contact_categ', $array_query['contact_categ']);
882  print '</td><td>' . "\n";
883  print '</td></tr>' . "\n";
884  }
885 
886  // Standard Extrafield feature
887  if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) {
888  // fetch optionals attributes and labels
889  dol_include_once('/core/class/extrafields.class.php');
890  $extrafields = new ExtraFields($db);
891  $extralabels = $extrafields->fetch_name_optionals_label('socpeople');
892  foreach($extrafields->attribute_type as $key=>&$value) {
893  if($value == 'radio')$value = 'select';
894  }
895 
896 
897  foreach ( $extralabels as $key => $val ) {
898 
899  print '<tr><td>' . $extrafields->attribute_label[$key];
900  if ($array_query['options_' . $key . '_cnct'] != '' || (is_array($array_query['options_' . $key . '_cnct']) && count($array_query['options_' . $key . '_cnct']) > 0)) {
901  print img_picto($langs->trans('AdvTgtUse'), 'ok.png@advtargetemailing');
902  }
903  print '</td><td>';
904  if (($extrafields->attribute_type[$key] == 'varchar') || ($extrafields->attribute_type[$key] == 'text')) {
905  print '<input type="text" name="options_' . $key . '_cnct"/></td><td>' . "\n";
906  print $form->textwithpicto('', $langs->trans("AdvTgtSearchTextHelp"), 1, 'help');
907  } elseif (($extrafields->attribute_type[$key] == 'int') || ($extrafields->attribute_type[$key] == 'double')) {
908  print $langs->trans("AdvTgtMinVal") . '<input type="text" name="options_' . $key . '_min_cnct"/>';
909  print $langs->trans("AdvTgtMaxVal") . '<input type="text" name="options_' . $key . '_max_cnct"/>';
910  print '</td><td>' . "\n";
911  print $form->textwithpicto('', $langs->trans("AdvTgtSearchIntHelp"), 1, 'help');
912  } elseif (($extrafields->attribute_type[$key] == 'date') || ($extrafields->attribute_type[$key] == 'datetime')) {
913 
914  print '<table class="nobordernopadding"><tr>';
915  print '<td>' . $langs->trans("AdvTgtStartDt") . '</td><td>';
916  print $form->select_date('', 'options_' . $key . '_st_dt' . '_cnct');
917  print '</td><td>' . $langs->trans("AdvTgtEndDt") . '</td><td>';
918  print $form->select_date('', 'options_' . $key . '_end_dt' . '_cnct');
919  print '</td></tr></table>';
920 
921  print '</td><td>' . "\n";
922  print $form->textwithpicto('', $langs->trans("AdvTgtSearchDtHelp"), 1, 'help');
923  } elseif (($extrafields->attribute_type[$key] == 'boolean')) {
924  print $form->selectarray('options_' . $key . '_cnct', array (
925  '' => '',
926  '1' => $langs->trans('Yes'),
927  '0' => $langs->trans('No')
928  ), $array_query['options_' . $key . '_cnct']);
929  print '</td><td>' . "\n";
930  } elseif (($extrafields->attribute_type[$key] == 'select')) {
931  print $formadvtargetemaling->advMultiselectarray('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']);
932  print '</td><td>' . "\n";
933  } elseif (($extrafields->attribute_type[$key] == 'sellist')) {
934  print $formadvtargetemaling->advMultiselectarraySelllist('options_' . $key . '_cnct', $extrafields->attribute_param[$key]['options'], $array_query['options_' . $key . '_cnct']);
935  print '</td><td>' . "\n";
936  } else {
937 
938  print '<table class="nobordernopadding"><tr>';
939  print '<td></td><td>';
940  if (is_array($array_query['options_' . $key . '_cnct'])) {
941  print $extrafields->showInputField($key, implode(',', $array_query['options_' . $key . '_cnct']), '', '_cnct');
942  } else {
943  print $extrafields->showInputField($key, $array_query['options_' . $key . '_cnct'], '', '_cnct');
944  }
945  print '</td></tr></table>';
946 
947  print '</td><td>' . "\n";
948  }
949  print '</td></tr>' . "\n";
950  }
951  }
952 
953  print '<tr>' . "\n";
954  print '<td colspan="3" align="right">' . "\n";
955 
956  print '<input type="button" name="addcontact" id="addcontact" value="' . $langs->trans('AdvTgtAddContact') . '" class="butAction"/>' . "\n";
957 
958  print '</td>' . "\n";
959  print '</tr>' . "\n";
960  print '</table>' . "\n";
961  print '</form>' . "\n";
962  print '</div>' . "\n";
963 
964  print '<form action="' . $_SERVER['PHP_SELF'] . '?action=clear&id=' . $object->id . '" method="POST">';
965  print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
966  print_titre($langs->trans("ToClearAllRecipientsClickHere"));
967  print '<table class="noborder" width="100%">';
968  print '<tr class="liste_titre">';
969  print '<td class="liste_titre" align="right"><input type="submit" class="button" value="' . $langs->trans("TargetsReset") . '"></td>';
970  print '</tr>';
971  print '</table>';
972  print '</form>';
973  print '<br>';
974  }
975 }
976 
977 llxFooter();
978 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:58
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it's its name (generic function)
Class to manage a list of personalised recipients for mailing feature.
Class to manage building of HTML components.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm=false, $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='')
Show tab header of a card.
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
if(empty($reshook)) $form
View.
Definition: perms.php:103
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to build HTML component for third parties management Only common components are here...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Class to manage standard extra fields.
Class to manage hooks.
Class to manage generation of HTML components Only common components must be here.
Class to manage third parties objects (customers, suppliers, prospects...)
emailing_prepare_head(Mailing $object)
Prepare array with list of tabs.
Classe permettant la generation de composants html autre Only common components are here...
llxHeader()
Empty header.
Definition: wrapper.php:46
Class to manage emailings module.
print_fiche_titre($title, $mesg='', $picto='title_generic.png', $pictoisfullpath=0, $id='')
Show a title with picto.
print
Draft customers invoices.
Definition: index.php:91
setEventMessage($mesgs, $style='mesgs')
Set event message in dol_events session object.
Class to manage advanced emailing target selector.
dol_print_email($email, $cid=0, $socid=0, $addlink=0, $max=64, $showinvalid=1, $withpicto=0)
Show EMail link.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if(!empty($conf->fournisseur->enabled)&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->societe->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if(!empty($conf->fournisseur->enabled)&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1013
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Return a prefix to use for this Dolibarr instance, for session/cookie names or email id...
print_titre($title)
Show a title.