dolibarr/htdocs/core/modules/modNotification.class.php

98 lines
3.3 KiB
PHP
Raw Normal View History

<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (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/>.
*/
/**
2009-07-29 22:52:08 +00:00
* \defgroup notification Module email notification
* \brief Module pour gerer les notifications (par mail ou autre)
* \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
*/
include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
/**
2015-09-07 13:55:26 +00:00
* Class to describe and enable module Mailing
2008-10-01 19:10:17 +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
*/
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 = "interface";
2008-10-01 19:10:17 +00:00
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
2017-03-13 00:35:04 +00:00
$this->description = "EMail notifications (push) on business Dolibarr events";
2017-08-03 10:04:13 +00:00
$this->descriptionlong = 'Module600Long';
2017-08-22 16:34:58 +00:00
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
2008-10-01 19:10:17 +00:00
$this->picto='email';
// 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
2018-07-09 17:04:50 +00: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
$this->phpmin = array(5,4); // Minimum version of PHP required by module
2008-10-01 19:10:17 +00:00
$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
$this->remove($options);
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
}
}