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
|
2019-09-23 21:55:30 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2006-08-05 19:08:51 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2023-07-25 23:13:42 +02:00
|
|
|
* \defgroup notification Module notification
|
|
|
|
|
* \brief Module for managing notifications (by e-mail or other means)
|
|
|
|
|
*
|
|
|
|
|
* \file htdocs/core/modules/modNotification.class.php
|
|
|
|
|
* \ingroup notification
|
|
|
|
|
* \brief Description and activation file for the module Notification
|
2008-10-01 21:10:17 +02:00
|
|
|
*/
|
2020-04-10 10:59:32 +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
|
|
|
/**
|
2015-09-07 15:55:26 +02:00
|
|
|
* Class to describe and enable 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
|
|
|
*/
|
2019-02-25 20:35:59 +01:00
|
|
|
public 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;
|
|
|
|
|
|
2018-11-07 16:33:06 +01:00
|
|
|
// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
|
|
|
|
|
// It is used to group modules in module setup page
|
2018-02-25 10:55:02 +01:00
|
|
|
$this->family = "interface";
|
2018-11-07 16:33:06 +01:00
|
|
|
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
2021-04-05 13:52:19 +02:00
|
|
|
$this->module_position = '22';
|
2008-10-01 21:10:17 +02:00
|
|
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
2019-01-27 11:55:16 +01:00
|
|
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
2017-03-13 01:35:04 +01:00
|
|
|
$this->description = "EMail notifications (push) on business Dolibarr events";
|
2020-10-31 14:32:18 +01:00
|
|
|
$this->descriptionlong = 'Module600Long';
|
2017-08-22 18:34:58 +02:00
|
|
|
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
|
2020-10-31 14:32:18 +01:00
|
|
|
$this->version = 'dolibarr';
|
2008-10-06 09:39:52 +02:00
|
|
|
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
2020-04-10 10:59:32 +02:00
|
|
|
$this->picto = 'email';
|
2008-10-01 21:10:17 +02:00
|
|
|
|
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();
|
|
|
|
|
|
2015-09-07 15:29:51 +02:00
|
|
|
// Dependencies
|
2020-04-10 10:59:32 +02:00
|
|
|
$this->hidden = false; // A condition to hide module
|
|
|
|
|
$this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
|
|
|
|
|
$this->requiredby = array(); // List of module ids to disable if this one is disabled
|
|
|
|
|
$this->conflictwith = array(); // List of module class names as string this module is in conflict with
|
2022-09-27 20:48:47 +02:00
|
|
|
$this->phpmin = array(7, 0); // Minimum version of PHP required by module
|
2008-10-01 21:10:17 +02:00
|
|
|
$this->langfiles = array("mails");
|
|
|
|
|
|
|
|
|
|
// Config pages
|
|
|
|
|
$this->config_page_url = array("notification.php");
|
|
|
|
|
|
2015-09-07 15:40:55 +02:00
|
|
|
// Constants
|
2008-10-01 21:10:17 +02:00
|
|
|
$this->const = array();
|
|
|
|
|
|
2015-09-07 15:46:57 +02:00
|
|
|
// Boxes
|
2008-10-01 21:10:17 +02:00
|
|
|
$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
|
|
|
|
|
*
|
2020-10-31 14:32:18 +01:00
|
|
|
* @param string $options Options when enabling module ('', 'noboxes')
|
2012-01-04 21:23:50 +01:00
|
|
|
* @return int 1 if OK, 0 if KO
|
2008-10-01 21:10:17 +02:00
|
|
|
*/
|
2019-02-26 00:34:43 +01:00
|
|
|
public 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();
|
|
|
|
|
|
2019-01-27 11:55:16 +01:00
|
|
|
return $this->_init($sql, $options);
|
2008-10-01 21:10:17 +02:00
|
|
|
}
|
2006-08-05 19:08:51 +02:00
|
|
|
}
|