dolibarr/htdocs/comm/mailing/info.php

87 lines
2.6 KiB
PHP
Raw Normal View History

2009-07-29 20:41:39 +02:00
<?php
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
2018-10-27 14:43:12 +02:00
* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
2009-07-29 20:41:39 +02:00
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
2009-07-29 20:41:39 +02:00
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2009-07-29 20:41:39 +02:00
*/
/**
* \file htdocs/comm/mailing/info.php
* \ingroup mailing
* \brief Page with log information for emailing
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/emailing.lib.php';
2009-07-29 20:41:39 +02:00
$id = GETPOST('id', 'int');
2018-05-26 20:32:23 +02:00
// Load translation files required by the page
2009-07-29 20:41:39 +02:00
$langs->load("mails");
// Security check
2021-03-29 22:43:39 +02:00
if (!$user->rights->mailing->lire || (empty($conf->global->EXTERNAL_USERS_ARE_AUTHORIZED) && $user->socid > 0)) {
2020-11-27 20:33:40 +01:00
accessforbidden();
}
2021-03-29 22:43:39 +02:00
//$result = restrictedArea($user, 'mailing');
2009-07-29 20:41:39 +02:00
/*
* View
*/
llxHeader('', $langs->trans("Mailing"), 'EN:Module_EMailing|FR:Module_Mailing|ES:M&oacute;dulo_Mailing');
2009-07-29 20:41:39 +02:00
$form = new Form($db);
2009-07-29 20:41:39 +02:00
2016-11-11 01:55:53 +01:00
$object = new Mailing($db);
2009-07-29 20:41:39 +02:00
2020-11-27 20:33:40 +01:00
if ($object->fetch($id) >= 0) {
2016-11-11 01:55:53 +01:00
$head = emailing_prepare_head($object);
2009-07-29 20:41:39 +02:00
2020-10-22 22:50:03 +02:00
print dol_get_fiche_head($head, 'info', $langs->trans("Mailing"), -1, 'email');
2009-07-29 20:41:39 +02:00
$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
2016-11-11 01:55:53 +01:00
$morehtmlright = '';
2019-11-02 00:17:08 +01:00
$nbtry = $nbok = 0;
2020-11-27 20:33:40 +01:00
if ($object->statut == 2 || $object->statut == 3) {
2019-11-02 00:17:08 +01:00
$nbtry = $object->countNbOfTargets('alreadysent');
$nbko = $object->countNbOfTargets('alreadysentko');
$morehtmlright .= ' ('.$nbtry.'/'.$object->nbemail;
2020-11-27 20:33:40 +01:00
if ($nbko) {
$morehtmlright .= ' - '.$nbko.' '.$langs->trans("Error");
}
$morehtmlright .= ') &nbsp; ';
2019-11-02 00:17:08 +01:00
}
2016-11-11 01:55:53 +01:00
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
2016-11-11 01:55:53 +01:00
print '<div class="underbanner clearboth"></div><br>';
2016-11-11 01:55:53 +01:00
//print '<table width="100%"><tr><td>';
dol_print_object_info($object, 0);
//print '</td></tr></table>';
2020-10-27 18:19:31 +01:00
print dol_get_fiche_end();
2009-07-29 20:41:39 +02:00
}
2018-07-29 17:17:29 +02:00
// End of page
llxFooter();
$db->close();