dolibarr  9.0.0
modMailing.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
28 include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
29 
30 
35 {
36 
42  function __construct($db)
43  {
44  $this->db = $db;
45  $this->numero = 22;
46 
47  // Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...'
48  // It is used to group modules by family in module setup page
49  $this->family = "interface";
50  // Module position in the family on 2 digits ('01', '10', '20', ...)
51  $this->module_position = '11';
52 
53  // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
54  $this->name = preg_replace('/^mod/i','',get_class($this));
55  $this->description = "Gestion des EMailings";
56  // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
57  $this->version = 'dolibarr';
58  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
59  $this->picto='email';
60 
61  // Data directories to create when module is enabled
62  $this->dirs = array("/mailing/temp");
63 
64  // Dependencies
65  $this->hidden = false; // A condition to hide module
66  $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
67  $this->requiredby = array(); // List of module ids to disable if this one is disabled
68  $this->conflictwith = array(); // List of module class names as string this module is in conflict with
69  $this->phpmin = array(5,4); // Minimum version of PHP required by module
70  $this->langfiles = array("mails");
71 
72  // Config pages
73  $this->config_page_url = array("mailing.php");
74 
75  // Constants
76  $this->const = array();
77 
78  // Boxes
79  $this->boxes = array();
80 
81  // Permissions
82  $this->rights = array();
83  $this->rights_class = 'mailing';
84  $r=0;
85 
86  $r++;
87  $this->rights[$r][0] = 221; // id de la permission
88  $this->rights[$r][1] = 'Consulter les mailings'; // libelle de la permission
89  $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
90  $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
91  $this->rights[$r][4] = 'lire';
92 
93  $r++;
94  $this->rights[$r][0] = 222;
95  $this->rights[$r][1] = 'Creer/modifier les mailings (sujet, destinataires...)';
96  $this->rights[$r][2] = 'w';
97  $this->rights[$r][3] = 0;
98  $this->rights[$r][4] = 'creer';
99 
100  $r++;
101  $this->rights[$r][0] = 223;
102  $this->rights[$r][1] = 'Valider les mailings (permet leur envoi)';
103  $this->rights[$r][2] = 'w';
104  $this->rights[$r][3] = 0;
105  $this->rights[$r][4] = 'valider';
106 
107  $r++;
108  $this->rights[$r][0] = 229;
109  $this->rights[$r][1] = 'Supprimer les mailings';
110  $this->rights[$r][2] = 'd';
111  $this->rights[$r][3] = 0;
112  $this->rights[$r][4] = 'supprimer';
113 
114  $r++;
115  $this->rights[$r][0] = 237;
116  $this->rights[$r][1] = 'View recipients and info';
117  $this->rights[$r][2] = 'r';
118  $this->rights[$r][3] = 0;
119  $this->rights[$r][4] = 'mailing_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
120  $this->rights[$r][5] = 'recipient';
121 
122  $r++;
123  $this->rights[$r][0] = 238;
124  $this->rights[$r][1] = 'Manually send mailings';
125  $this->rights[$r][2] = 'w';
126  $this->rights[$r][3] = 0;
127  $this->rights[$r][4] = 'mailing_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
128  $this->rights[$r][5] = 'send';
129 
130  $r++;
131  $this->rights[$r][0] = 239;
132  $this->rights[$r][1] = 'Delete mailings after validation and/or sent';
133  $this->rights[$r][2] = 'd';
134  $this->rights[$r][3] = 0;
135  $this->rights[$r][4] = 'mailing_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
136  $this->rights[$r][5] = 'delete';
137 
138  // Menus
139  //-------
140  $this->menu = 1; // This module add menu entries. They are coded into menu manager.
141  }
142 
143 
152  function init($options='')
153  {
154  // Permissions
155  $this->remove($options);
156 
157  $sql = array();
158 
159  return $this->_init($sql,$options);
160  }
161 }
Class DolibarrModules.
</td >< td class="liste_titre" align="right"></td ></tr >< tr class="liste_titre">< input type="checkbox" onClick="toggle(this)"/> Ref p ref Label p label Duration p duration warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow img yes disabled img no img no< tr class="oddeven">< td >< input type="checkbox" class="check" name="' . $i . '"' . $disabled . '></td >< td >< input type="checkbox" class="check" name="choose'.$i.'"></td >< td class="nowrap"></td >< td >< input type="hidden" name="desc' . $i . '" value="' . dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
Definition: replenish.php:573
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:103
init($options='')
Function called when module is enabled.
__construct($db)
Constructor.
_init($array_sql, $options='')
Enables a module.
Class to describe and enable module Mailing.