dolibarr 21.0.0-alpha
emailing.lib.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
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 <https://www.gnu.org/licenses/>.
17 * or see https://www.gnu.org/
18 */
19
32{
33 global $user, $langs, $conf;
34
35 $h = 0;
36 $head = array();
37
38 $head[$h][0] = DOL_URL_ROOT."/comm/mailing/card.php?id=".$object->id;
39 $head[$h][1] = $langs->trans("MailCard");
40 $head[$h][2] = 'card';
41 $h++;
42
43 if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('mailing', 'mailing_advance', 'recipient'))) {
44 $head[$h][0] = DOL_URL_ROOT."/comm/mailing/cibles.php?id=".$object->id;
45 $head[$h][1] = $langs->trans("MailRecipients");
46 if ($object->nbemail > 0) {
47 $head[$h][1] .= '<span class="badge marginleftonlyshort">'.$object->nbemail.'</span>';
48 }
49 $head[$h][2] = 'targets';
50 $h++;
51 }
52
53 if (getDolGlobalString('EMAILING_USE_ADVANCED_SELECTOR')) {
54 $head[$h][0] = DOL_URL_ROOT."/comm/mailing/advtargetemailing.php?id=".$object->id;
55 $head[$h][1] = $langs->trans("MailAdvTargetRecipients");
56 $head[$h][2] = 'advtargets';
57 $h++;
58 }
59
60 $head[$h][0] = DOL_URL_ROOT."/comm/mailing/info.php?id=".$object->id;
61 $head[$h][1] = $langs->trans("Info");
62 $head[$h][2] = 'info';
63 $h++;
64
65 $head[$h][0] = DOL_URL_ROOT."/comm/mailing/note.php?id=".$object->id;
66 $head[$h][1] = $langs->trans("Note");
67 $head[$h][2] = 'note';
68 $h++;
69
70 complete_head_from_modules($conf, $langs, $object, $head, $h, 'emailing');
71
72 complete_head_from_modules($conf, $langs, $object, $head, $h, 'emailing', 'remove');
73
74 return $head;
75}
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 a Dolibarr global constant string value.