info.php 2.6 KB

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