dolibarr  7.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 <http://www.gnu.org/licenses/>.
16  * or see http://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  {
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) $head[$h][1].= ' <span class="badge">'.$object->nbemail.'</span>';
47  $head[$h][2] = 'targets';
48  $h++;
49 
50  }
51 
52  if (! empty($conf->global->EMAILING_USE_ADVANCED_SELECTOR))
53  {
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  complete_head_from_modules($conf,$langs,$object,$head,$h,'emailing');
66 
67  complete_head_from_modules($conf,$langs,$object,$head,$h,'emailing','remove');
68 
69  return $head;
70 }
71 
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add')
Complete or removed entries into a head array (used to build tabs).
emailing_prepare_head(Mailing $object)
Prepare array with list of tabs.
Class to manage emailings module.