dolibarr  16.0.5
html.formmailing.class.php
Go to the documentation of this file.
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 <https://www.gnu.org/licenses/>.
16 */
17 
23 require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
24 
28 class FormMailing extends Form
29 {
33  public $errors = array();
34 
43  public function selectDestinariesStatus($selectedid = '', $htmlname = 'dest_status', $show_empty = 0)
44  {
45 
46  global $langs;
47  $langs->load("mails");
48 
49  require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php';
50  $mailing = new Mailing($this->db);
51 
52  $options = array();
53 
54  if ($show_empty) {
55  $options[-2] = ''; // Note -1 is used for error
56  }
57 
58  $options = $options + $mailing->statut_dest;
59 
60  return Form::selectarray($htmlname, $options, $selectedid, 0, 0, 0, '', 1);
61  }
62 }
db
$conf db
API class for accounts.
Definition: inc.php:41
FormMailing\selectDestinariesStatus
selectDestinariesStatus($selectedid='', $htmlname='dest_status', $show_empty=0)
Output a select with destinaries status.
Definition: html.formmailing.class.php:43
FormMailing
Class to offer components to list and upload files.
Definition: html.formmailing.class.php:28
Mailing
Class to manage emailings module.
Definition: mailing.class.php:32
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
Form\selectarray
static selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=1, $moreparamonempty='', $disablebademail=0, $nohtmlescape=0)
Return a HTML select string, built from an array of key+value.
Definition: html.form.class.php:7879