dolibarr  7.0.0-beta
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@capnetworks.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  $this->family = "technic";
48  // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
49  $this->name = preg_replace('/^mod/i','',get_class($this));
50  $this->description = "Gestion des EMailings";
51  // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
52  $this->version = 'dolibarr';
53  $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
54  $this->special = 0;
55  $this->picto='email';
56 
57  // Data directories to create when module is enabled
58  $this->dirs = array("/mailing/temp");
59 
60  // Dependencies
61  $this->depends = array();
62  $this->requiredby = array();
63  $this->langfiles = array("mails");
64 
65  // Config pages
66  $this->config_page_url = array("mailing.php");
67 
68  // Constants
69  $this->const = array();
70 
71  // Boxes
72  $this->boxes = array();
73 
74  // Permissions
75  $this->rights = array();
76  $this->rights_class = 'mailing';
77  $r=0;
78 
79  $r++;
80  $this->rights[$r][0] = 221; // id de la permission
81  $this->rights[$r][1] = 'Consulter les mailings'; // libelle de la permission
82  $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour)
83  $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
84  $this->rights[$r][4] = 'lire';
85 
86  $r++;
87  $this->rights[$r][0] = 222;
88  $this->rights[$r][1] = 'Creer/modifier les mailings (sujet, destinataires...)';
89  $this->rights[$r][2] = 'w';
90  $this->rights[$r][3] = 0;
91  $this->rights[$r][4] = 'creer';
92 
93  $r++;
94  $this->rights[$r][0] = 223;
95  $this->rights[$r][1] = 'Valider les mailings (permet leur envoi)';
96  $this->rights[$r][2] = 'w';
97  $this->rights[$r][3] = 0;
98  $this->rights[$r][4] = 'valider';
99 
100  $r++;
101  $this->rights[$r][0] = 229;
102  $this->rights[$r][1] = 'Supprimer les mailings';
103  $this->rights[$r][2] = 'd';
104  $this->rights[$r][3] = 0;
105  $this->rights[$r][4] = 'supprimer';
106 
107  $r++;
108  $this->rights[$r][0] = 237;
109  $this->rights[$r][1] = 'View recipients and info';
110  $this->rights[$r][2] = 'r';
111  $this->rights[$r][3] = 0;
112  $this->rights[$r][4] = 'mailing_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
113  $this->rights[$r][5] = 'recipient';
114 
115  $r++;
116  $this->rights[$r][0] = 238;
117  $this->rights[$r][1] = 'Manually send mailings';
118  $this->rights[$r][2] = 'w';
119  $this->rights[$r][3] = 0;
120  $this->rights[$r][4] = 'mailing_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
121  $this->rights[$r][5] = 'send';
122 
123  $r++;
124  $this->rights[$r][0] = 239;
125  $this->rights[$r][1] = 'Delete mailings after validation and/or sent';
126  $this->rights[$r][2] = 'd';
127  $this->rights[$r][3] = 0;
128  $this->rights[$r][4] = 'mailing_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
129  $this->rights[$r][5] = 'delete';
130 
131  // Menus
132  //-------
133  $this->menu = 1; // This module add menu entries. They are coded into menu manager.
134 
135  }
136 
137 
146  function init($options='')
147  {
148  // Permissions
149  $this->remove($options);
150 
151  $sql = array();
152 
153  return $this->_init($sql,$options);
154  }
155 }
Class DolibarrModules.
</td >< tdclass="liste_titre"align="right"></td ></tr >< trclass="liste_titre">< inputtype="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< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="'.$i.'"'.$disabled.'></td >< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"></td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
Definition: replenish.php:554
init($options='')
Function called when module is enabled.
__construct($db)
Constructor.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:104
_init($array_sql, $options='')
Enables a module.
Class to describe and enable module Mailing.