dolibarr  17.0.4
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 
30 function emailing_prepare_head(Mailing $object)
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 (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->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 (!empty($conf->global->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  complete_head_from_modules($conf, $langs, $object, $head, $h, 'emailing');
65 
66  complete_head_from_modules($conf, $langs, $object, $head, $h, 'emailing', 'remove');
67 
68  return $head;
69 }
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).