2006-08-05 17:08:51 +00:00
|
|
|
<?php
|
|
|
|
|
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2007-10-09 23:15:25 +00:00
|
|
|
* Copyright (C) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
2006-08-05 17:08:51 +00:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2013-01-16 14:36:08 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2006-08-05 17:08:51 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2011-07-31 23:24:38 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2006-08-05 17:08:51 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2009-07-29 22:52:08 +00:00
|
|
|
* \defgroup notification Module email notification
|
|
|
|
|
* \brief Module pour gerer les notifications (par mail ou autre)
|
2011-10-24 12:11:49 +00:00
|
|
|
* \file htdocs/core/modules/modNotification.class.php
|
2009-07-29 22:03:20 +00:00
|
|
|
* \ingroup notification
|
|
|
|
|
* \brief Fichier de description et activation du module Notification
|
2008-10-01 19:10:17 +00:00
|
|
|
*/
|
2012-08-23 00:04:35 +00:00
|
|
|
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
2007-10-09 23:15:25 +00:00
|
|
|
|
2006-08-05 17:08:51 +00:00
|
|
|
/**
|
2012-10-02 22:30:50 +00:00
|
|
|
* Classe de description et activation du module Mailing
|
2008-10-01 19:10:17 +00:00
|
|
|
*/
|
2006-08-05 17:08:51 +00:00
|
|
|
class modNotification extends DolibarrModules
|
|
|
|
|
{
|
|
|
|
|
|
2008-10-01 19:10:17 +00:00
|
|
|
/**
|
2011-09-26 14:22:35 +00:00
|
|
|
* Constructor. Define names, constants, directories, boxes, permissions
|
|
|
|
|
*
|
2012-01-04 20:23:50 +00:00
|
|
|
* @param DoliDB $db Database handler
|
2008-10-01 19:10:17 +00:00
|
|
|
*/
|
2012-07-30 15:17:33 +00:00
|
|
|
function __construct($db)
|
2008-10-01 19:10:17 +00:00
|
|
|
{
|
2012-01-04 20:23:50 +00:00
|
|
|
$this->db = $db;
|
2008-10-01 19:10:17 +00:00
|
|
|
$this->numero = 600;
|
|
|
|
|
|
|
|
|
|
$this->family = "technic";
|
|
|
|
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
2009-10-21 13:09:42 +00:00
|
|
|
$this->name = preg_replace('/^mod/i','',get_class($this));
|
2009-04-28 09:41:30 +00:00
|
|
|
$this->description = "Gestion des notifications (par mail) sur evenement Dolibarr";
|
2008-10-01 19:10:17 +00:00
|
|
|
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
|
2008-10-06 07:39:52 +00:00
|
|
|
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
2008-10-01 19:10:17 +00:00
|
|
|
$this->special = 1;
|
|
|
|
|
$this->picto='email';
|
|
|
|
|
|
2009-05-04 11:40:00 +00:00
|
|
|
// Data directories to create when module is enabled.
|
2008-10-01 19:10:17 +00:00
|
|
|
$this->dirs = array();
|
|
|
|
|
|
2015-09-07 13:29:51 +00:00
|
|
|
// Dependencies
|
2008-10-01 19:10:17 +00:00
|
|
|
$this->depends = array();
|
|
|
|
|
$this->requiredby = array();
|
|
|
|
|
$this->langfiles = array("mails");
|
|
|
|
|
|
|
|
|
|
// Config pages
|
|
|
|
|
$this->config_page_url = array("notification.php");
|
|
|
|
|
|
2015-09-07 13:40:55 +00:00
|
|
|
// Constants
|
2008-10-01 19:10:17 +00:00
|
|
|
$this->const = array();
|
|
|
|
|
|
2015-09-07 13:46:57 +00:00
|
|
|
// Boxes
|
2008-10-01 19:10:17 +00:00
|
|
|
$this->boxes = array();
|
|
|
|
|
|
|
|
|
|
// Permissions
|
|
|
|
|
$this->rights = array();
|
|
|
|
|
$this->rights_class = 'notification';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2012-01-04 20:23:50 +00:00
|
|
|
* Function called when module is enabled.
|
|
|
|
|
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
|
|
|
|
|
* It also creates data directories
|
|
|
|
|
*
|
|
|
|
|
* @param string $options Options when enabling module ('', 'noboxes')
|
|
|
|
|
* @return int 1 if OK, 0 if KO
|
2008-10-01 19:10:17 +00:00
|
|
|
*/
|
2012-01-04 20:23:50 +00:00
|
|
|
function init($options='')
|
2008-10-01 19:10:17 +00:00
|
|
|
{
|
|
|
|
|
// Permissions
|
2012-03-03 16:37:45 +00:00
|
|
|
$this->remove($options);
|
2009-05-04 11:40:00 +00:00
|
|
|
|
2011-12-05 18:03:36 +00:00
|
|
|
$sql = array();
|
|
|
|
|
|
2012-01-04 20:23:50 +00:00
|
|
|
return $this->_init($sql,$options);
|
2008-10-01 19:10:17 +00:00
|
|
|
}
|
2006-08-05 17:08:51 +00:00
|
|
|
}
|