info.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.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. */
  18. /**
  19. * \file htdocs/comm/mailing/info.php
  20. * \ingroup mailing
  21. * \brief Page with log information for emailing
  22. */
  23. // Load Dolibarr environment
  24. require '../../main.inc.php';
  25. require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php';
  26. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/lib/emailing.lib.php';
  28. $id = GETPOST('id', 'int');
  29. // Load translation files required by the page
  30. $langs->load("mails");
  31. // Security check
  32. if (!$user->rights->mailing->lire || (empty($conf->global->EXTERNAL_USERS_ARE_AUTHORIZED) && $user->socid > 0)) {
  33. accessforbidden();
  34. }
  35. //$result = restrictedArea($user, 'mailing');
  36. /*
  37. * View
  38. */
  39. llxHeader('', $langs->trans("Mailing"), 'EN:Module_EMailing|FR:Module_Mailing|ES:M&oacute;dulo_Mailing');
  40. $form = new Form($db);
  41. $object = new Mailing($db);
  42. if ($object->fetch($id) >= 0) {
  43. $head = emailing_prepare_head($object);
  44. print dol_get_fiche_head($head, 'info', $langs->trans("Mailing"), -1, 'email');
  45. $linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
  46. $morehtmlright = '';
  47. $nbtry = $nbok = 0;
  48. if ($object->statut == 2 || $object->statut == 3) {
  49. $nbtry = $object->countNbOfTargets('alreadysent');
  50. $nbko = $object->countNbOfTargets('alreadysentko');
  51. $morehtmlright .= ' ('.$nbtry.'/'.$object->nbemail;
  52. if ($nbko) {
  53. $morehtmlright .= ' - '.$nbko.' '.$langs->trans("Error");
  54. }
  55. $morehtmlright .= ') &nbsp; ';
  56. }
  57. dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
  58. print '<div class="underbanner clearboth"></div><br>';
  59. //print '<table width="100%"><tr><td>';
  60. dol_print_object_info($object, 0);
  61. //print '</td></tr></table>';
  62. print dol_get_fiche_end();
  63. }
  64. // End of page
  65. llxFooter();
  66. $db->close();