dolibarr  20.0.0-beta
emailing.lib.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <https://www.gnu.org/licenses/>.
16  * or see https://www.gnu.org/
17  */
18 
31 {
32  global $user, $langs, $conf;
33 
34  $h = 0;
35  $head = array();
36 
37  $head[$h][0] = DOL_URL_ROOT."/comm/mailing/card.php?id=".$object->id;
38  $head[$h][1] = $langs->trans("MailCard");
39  $head[$h][2] = 'card';
40  $h++;
41 
42  if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('mailing', 'mailing_advance', 'recipient'))) {
43  $head[$h][0] = DOL_URL_ROOT."/comm/mailing/cibles.php?id=".$object->id;
44  $head[$h][1] = $langs->trans("MailRecipients");
45  if ($object->nbemail > 0) {
46  $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$object->nbemail.'</span>';
47  }
48  $head[$h][2] = 'targets';
49  $h++;
50  }
51 
52  if (getDolGlobalString('EMAILING_USE_ADVANCED_SELECTOR')) {
53  $head[$h][0] = DOL_URL_ROOT."/comm/mailing/advtargetemailing.php?id=".$object->id;
54  $head[$h][1] = $langs->trans("MailAdvTargetRecipients");
55  $head[$h][2] = 'advtargets';
56  $h++;
57  }
58 
59  $head[$h][0] = DOL_URL_ROOT."/comm/mailing/info.php?id=".$object->id;
60  $head[$h][1] = $langs->trans("Info");
61  $head[$h][2] = 'info';
62  $h++;
63 
64  $head[$h][0] = DOL_URL_ROOT."/comm/mailing/note.php?id=".$object->id;
65  $head[$h][1] = $langs->trans("Note");
66  $head[$h][2] = 'note';
67  $h++;
68 
69  complete_head_from_modules($conf, $langs, $object, $head, $h, 'emailing');
70 
71  complete_head_from_modules($conf, $langs, $object, $head, $h, 'emailing', 'remove');
72 
73  return $head;
74 }
if($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition: card.php:58
Class to manage emailings module.
emailing_prepare_head(Mailing $object)
Prepare array with list of tabs.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.