2006-08-05 19:08:51 +02:00
|
|
|
<?php
|
|
|
|
|
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2007-10-10 01:15:25 +02:00
|
|
|
* Copyright (C) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
2006-08-05 19:08:51 +02: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 15:36:08 +01:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2006-08-05 19:08:51 +02: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-08-01 01:24:38 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2006-08-05 19:08:51 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2009-07-30 00:52:08 +02:00
|
|
|
* \defgroup notification Module email notification
|
|
|
|
|
* \brief Module pour gerer les notifications (par mail ou autre)
|
2011-10-24 14:11:49 +02:00
|
|
|
* \file htdocs/core/modules/modNotification.class.php
|
2009-07-30 00:03:20 +02:00
|
|
|
* \ingroup notification
|
|
|
|
|
* \brief Fichier de description et activation du module Notification
|
2008-10-01 21:10:17 +02:00
|
|
|
*/
|
2012-08-23 02:04:35 +02:00
|
|
|
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
|
2007-10-10 01:15:25 +02:00
|
|
|
|
2006-08-05 19:08:51 +02:00
|
|
|
/**
|
2012-10-03 00:30:50 +02:00
|
|
|
* Classe de description et activation du module Mailing
|
2008-10-01 21:10:17 +02:00
|
|
|
*/
|
2006-08-05 19:08:51 +02:00
|
|
|
class modNotification extends DolibarrModules
|
|
|
|
|
{
|
|
|
|
|
|
2008-10-01 21:10:17 +02:00
|
|
|
/**
|
2011-09-26 16:22:35 +02:00
|
|
|
* Constructor. Define names, constants, directories, boxes, permissions
|
|
|
|
|
*
|
2012-01-04 21:23:50 +01:00
|
|
|
* @param DoliDB $db Database handler
|
2008-10-01 21:10:17 +02:00
|
|
|
*/
|
2012-07-30 17:17:33 +02:00
|
|
|
function __construct($db)
|
2008-10-01 21:10:17 +02:00
|
|
|
{
|
2012-01-04 21:23:50 +01:00
|
|
|
$this->db = $db;
|
2008-10-01 21:10:17 +02: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 15:09:42 +02:00
|
|
|
$this->name = preg_replace('/^mod/i','',get_class($this));
|
2009-04-28 11:41:30 +02:00
|
|
|
$this->description = "Gestion des notifications (par mail) sur evenement Dolibarr";
|
2008-10-01 21:10:17 +02:00
|
|
|
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
|
2008-10-06 09:39:52 +02:00
|
|
|
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
2008-10-01 21:10:17 +02:00
|
|
|
$this->special = 1;
|
|
|
|
|
$this->picto='email';
|
|
|
|
|
|
2009-05-04 13:40:00 +02:00
|
|
|
// Data directories to create when module is enabled.
|
2008-10-01 21:10:17 +02:00
|
|
|
$this->dirs = array();
|
|
|
|
|
|
2009-04-28 11:41:30 +02:00
|
|
|
// Dependances
|
2008-10-01 21:10:17 +02:00
|
|
|
$this->depends = array();
|
|
|
|
|
$this->requiredby = array();
|
|
|
|
|
$this->langfiles = array("mails");
|
|
|
|
|
|
|
|
|
|
// Config pages
|
|
|
|
|
$this->config_page_url = array("notification.php");
|
|
|
|
|
|
|
|
|
|
// Constantes
|
|
|
|
|
$this->const = array();
|
|
|
|
|
|
|
|
|
|
// Boites
|
|
|
|
|
$this->boxes = array();
|
|
|
|
|
|
|
|
|
|
// Permissions
|
|
|
|
|
$this->rights = array();
|
|
|
|
|
$this->rights_class = 'notification';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2012-01-04 21:23:50 +01: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 21:10:17 +02:00
|
|
|
*/
|
2012-01-04 21:23:50 +01:00
|
|
|
function init($options='')
|
2008-10-01 21:10:17 +02:00
|
|
|
{
|
|
|
|
|
// Permissions
|
2012-03-03 17:37:45 +01:00
|
|
|
$this->remove($options);
|
2009-05-04 13:40:00 +02:00
|
|
|
|
2011-12-05 19:03:36 +01:00
|
|
|
$sql = array();
|
|
|
|
|
|
2012-01-04 21:23:50 +01:00
|
|
|
return $this->_init($sql,$options);
|
2008-10-01 21:10:17 +02:00
|
|
|
}
|
2006-08-05 19:08:51 +02:00
|
|
|
}
|