html.formmailing.class.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /* Copyright (C) 2014 Florian Henry florian.henry@open-concept.pro
  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. */
  17. /**
  18. * \file htdocs/core/class/html.formmailing.class.php
  19. * \ingroup core
  20. * \brief File of predefined functions for HTML forms for mailing module
  21. */
  22. require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php';
  23. /**
  24. * Class to offer components to list and upload files
  25. */
  26. class FormMailing extends Form
  27. {
  28. public $errors=array();
  29. /**
  30. * Output a select with destinaries status
  31. *
  32. * @param string $selectedid The selected id
  33. * @param string $htmlname Name of controm
  34. * @param integer $show_empty Show empty option
  35. * @return string HTML select
  36. */
  37. public function selectDestinariesStatus($selectedid='',$htmlname='dest_status', $show_empty=0) {
  38. global $langs;
  39. $langs->load("mails");
  40. require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php';
  41. $mailing = new Mailing($this->db);
  42. $options = array();
  43. if ($show_empty) {
  44. $options[-2] = ''; // Note -1 is used for error
  45. }
  46. $options = $options + $mailing->statut_dest;
  47. return Form::selectarray($htmlname, $options, $selectedid, 0, 0, 0, '', 1);
  48. }
  49. }