Merge pull request #1753 from marcosgdf/triggers-refactor
Refactored Dolibarr triggers
This commit is contained in:
commit
f46db55f71
@ -23,6 +23,7 @@
|
|||||||
* \brief Fichier de la classe de gestion des triggers
|
* \brief Fichier de la classe de gestion des triggers
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/triggers/DolibarrTriggers.class.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to manage triggers
|
* Class to manage triggers
|
||||||
|
|||||||
149
htdocs/core/triggers/DolibarrTriggers.class.php
Normal file
149
htdocs/core/triggers/DolibarrTriggers.class.php
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class that all the triggers must extend
|
||||||
|
*/
|
||||||
|
abstract class DolibarrTriggers
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Database handler
|
||||||
|
* @var DoliDB
|
||||||
|
*/
|
||||||
|
protected $db;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name of the trigger
|
||||||
|
* @var mixed|string
|
||||||
|
*/
|
||||||
|
public $name = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description of the trigger
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $description = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version of the trigger
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $version = self::VERSION_DEVELOPMENT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Image of the trigger
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $picto = 'technic';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Category of the trigger
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $family = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Error reported by the trigger
|
||||||
|
* @var string
|
||||||
|
* @deprecated Use $this->errors
|
||||||
|
*/
|
||||||
|
public $error = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Errors reported by the trigger
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public $errors = array();
|
||||||
|
|
||||||
|
const VERSION_DEVELOPMENT = 'development';
|
||||||
|
const VERSION_EXPERIMENTAL = 'experimental';
|
||||||
|
const VERSION_DOLIBARR = 'dolibarr';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param DoliDB $db Database handler
|
||||||
|
*/
|
||||||
|
public function __construct(DoliDB $db) {
|
||||||
|
|
||||||
|
$this->db = $db;
|
||||||
|
|
||||||
|
if (!isset($this->name)) {
|
||||||
|
$this->name = preg_replace('/^Interface/i', '', get_class($this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the name of the trigger file
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
return $this->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the description of trigger file
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getDesc()
|
||||||
|
{
|
||||||
|
return $this->description;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the version of the trigger file
|
||||||
|
*
|
||||||
|
* @return string Version of trigger file
|
||||||
|
*/
|
||||||
|
public function getVersion()
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
$langs->load("admin");
|
||||||
|
|
||||||
|
if ($this->version == self::VERSION_DEVELOPMENT) {
|
||||||
|
return $langs->trans("Development");
|
||||||
|
} elseif ($this->version == self::VERSION_EXPERIMENTAL) {
|
||||||
|
return $langs->trans("Experimental");
|
||||||
|
} elseif ($this->version == self::VERSION_DOLIBARR) {
|
||||||
|
return DOL_VERSION;
|
||||||
|
} elseif ($this->version) {
|
||||||
|
return $this->version;
|
||||||
|
} else {
|
||||||
|
return $langs->trans("Unknown");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function called when a Dolibarrr business event is done.
|
||||||
|
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||||
|
*
|
||||||
|
* @param string $action Event action code
|
||||||
|
* @param Object $object Object
|
||||||
|
* @param User $user Object user
|
||||||
|
* @param Translate $langs Object langs
|
||||||
|
* @param conf $conf Object conf
|
||||||
|
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||||
|
*/
|
||||||
|
abstract function run_trigger($action, $object, User $user, Translate $langs, Conf $conf);
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -26,81 +27,25 @@
|
|||||||
/**
|
/**
|
||||||
* Class of triggers for security events
|
* Class of triggers for security events
|
||||||
*/
|
*/
|
||||||
class InterfaceLogevents
|
class InterfaceLogevents extends DolibarrTriggers
|
||||||
{
|
{
|
||||||
var $db;
|
public $picto = 'technic';
|
||||||
var $error;
|
public $family = 'core';
|
||||||
|
public $description = "Triggers of this module allows to add security event records inside Dolibarr.";
|
||||||
|
public $version = self::VERSION_DOLIBARR;
|
||||||
|
|
||||||
var $date;
|
/**
|
||||||
var $duree;
|
* Function called when a Dolibarrr business event is done.
|
||||||
var $texte;
|
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||||
var $desc;
|
*
|
||||||
|
* @param string $action Event action code
|
||||||
/**
|
* @param Object $object Object
|
||||||
* Constructor
|
* @param User $user Object user
|
||||||
*
|
* @param Translate $langs Object langs
|
||||||
* @param DoliDB $db Database handler
|
* @param conf $conf Object conf
|
||||||
*/
|
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||||
function __construct($db)
|
*/
|
||||||
{
|
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||||
$this->db = $db;
|
|
||||||
|
|
||||||
$this->name = preg_replace('/^Interface/i','',get_class($this));
|
|
||||||
$this->family = "core";
|
|
||||||
$this->description = "Triggers of this module allows to add security event records inside Dolibarr.";
|
|
||||||
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
|
|
||||||
$this->picto = 'technic';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return name of trigger file
|
|
||||||
*
|
|
||||||
* @return string Name of trigger file
|
|
||||||
*/
|
|
||||||
function getName()
|
|
||||||
{
|
|
||||||
return $this->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return description of trigger file
|
|
||||||
*
|
|
||||||
* @return string Description of trigger file
|
|
||||||
*/
|
|
||||||
function getDesc()
|
|
||||||
{
|
|
||||||
return $this->description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return version of trigger file
|
|
||||||
*
|
|
||||||
* @return string Version of trigger file
|
|
||||||
*/
|
|
||||||
function getVersion()
|
|
||||||
{
|
|
||||||
global $langs;
|
|
||||||
$langs->load("admin");
|
|
||||||
|
|
||||||
if ($this->version == 'experimental') return $langs->trans("Experimental");
|
|
||||||
elseif ($this->version == 'dolibarr') return DOL_VERSION;
|
|
||||||
elseif ($this->version) return $this->version;
|
|
||||||
else return $langs->trans("Unknown");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function called when a Dolibarrr business event is done.
|
|
||||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
|
||||||
*
|
|
||||||
* @param string $action Event action code
|
|
||||||
* @param Object $object Object
|
|
||||||
* @param User $user Object user
|
|
||||||
* @param Translate $langs Object langs
|
|
||||||
* @param conf $conf Object conf
|
|
||||||
* @param string $entity Value for instance of data (Always 1 except if module MultiCompany is installed)
|
|
||||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
|
||||||
*/
|
|
||||||
function run_trigger($action,$object,$user,$langs,$conf,$entity=1)
|
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->MAIN_LOGEVENTS_DISABLE_ALL)) return 0; // Log events is disabled (hidden features)
|
if (! empty($conf->global->MAIN_LOGEVENTS_DISABLE_ALL)) return 0; // Log events is disabled (hidden features)
|
||||||
|
|
||||||
@ -110,8 +55,7 @@ class InterfaceLogevents
|
|||||||
|
|
||||||
if (empty($conf->entity)) $conf->entity = $entity; // forcing of the entity if it's not defined (ex: in login form)
|
if (empty($conf->entity)) $conf->entity = $entity; // forcing of the entity if it's not defined (ex: in login form)
|
||||||
|
|
||||||
$this->date=dol_now();
|
$date = dol_now();
|
||||||
$this->duree=0;
|
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
if ($action == 'USER_LOGIN')
|
if ($action == 'USER_LOGIN')
|
||||||
@ -119,24 +63,24 @@ class InterfaceLogevents
|
|||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
|
|
||||||
// Initialisation donnees (date,duree,texte,desc)
|
// Initialisation donnees (date,duree,texte,desc)
|
||||||
$this->texte="(UserLogged,".$object->login.")";
|
$text="(UserLogged,".$object->login.")";
|
||||||
$this->desc="(UserLogged,".$object->login.")";
|
$desc="(UserLogged,".$object->login.")";
|
||||||
}
|
}
|
||||||
if ($action == 'USER_LOGIN_FAILED')
|
if ($action == 'USER_LOGIN_FAILED')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
|
|
||||||
// Initialisation donnees (date,duree,texte,desc)
|
// Initialisation donnees (date,duree,texte,desc)
|
||||||
$this->texte=$object->trigger_mesg; // Message direct
|
$text=$object->trigger_mesg; // Message direct
|
||||||
$this->desc=$object->trigger_mesg; // Message direct
|
$desc=$object->trigger_mesg; // Message direct
|
||||||
}
|
}
|
||||||
if ($action == 'USER_LOGOUT')
|
if ($action == 'USER_LOGOUT')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
|
|
||||||
// Initialisation donnees (date,duree,texte,desc)
|
// Initialisation donnees (date,duree,texte,desc)
|
||||||
$this->texte="(UserLogoff,".$object->login.")";
|
$text="(UserLogoff,".$object->login.")";
|
||||||
$this->desc="(UserLogoff,".$object->login.")";
|
$desc="(UserLogoff,".$object->login.")";
|
||||||
}
|
}
|
||||||
if ($action == 'USER_CREATE')
|
if ($action == 'USER_CREATE')
|
||||||
{
|
{
|
||||||
@ -144,8 +88,8 @@ class InterfaceLogevents
|
|||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
|
|
||||||
// Initialisation donnees (date,duree,texte,desc)
|
// Initialisation donnees (date,duree,texte,desc)
|
||||||
$this->texte=$langs->transnoentities("NewUserCreated",$object->login);
|
$text=$langs->transnoentities("NewUserCreated",$object->login);
|
||||||
$this->desc=$langs->transnoentities("NewUserCreated",$object->login);
|
$desc=$langs->transnoentities("NewUserCreated",$object->login);
|
||||||
}
|
}
|
||||||
elseif ($action == 'USER_MODIFY')
|
elseif ($action == 'USER_MODIFY')
|
||||||
{
|
{
|
||||||
@ -153,8 +97,8 @@ class InterfaceLogevents
|
|||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
|
|
||||||
// Initialisation donnees (date,duree,texte,desc)
|
// Initialisation donnees (date,duree,texte,desc)
|
||||||
$this->texte=$langs->transnoentities("EventUserModified",$object->login);
|
$text=$langs->transnoentities("EventUserModified",$object->login);
|
||||||
$this->desc=$langs->transnoentities("EventUserModified",$object->login);
|
$desc=$langs->transnoentities("EventUserModified",$object->login);
|
||||||
}
|
}
|
||||||
elseif ($action == 'USER_NEW_PASSWORD')
|
elseif ($action == 'USER_NEW_PASSWORD')
|
||||||
{
|
{
|
||||||
@ -162,8 +106,8 @@ class InterfaceLogevents
|
|||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
|
|
||||||
// Initialisation donnees (date,duree,texte,desc)
|
// Initialisation donnees (date,duree,texte,desc)
|
||||||
$this->texte=$langs->transnoentities("NewUserPassword",$object->login);
|
$text=$langs->transnoentities("NewUserPassword",$object->login);
|
||||||
$this->desc=$langs->transnoentities("NewUserPassword",$object->login);
|
$desc=$langs->transnoentities("NewUserPassword",$object->login);
|
||||||
}
|
}
|
||||||
elseif ($action == 'USER_ENABLEDISABLE')
|
elseif ($action == 'USER_ENABLEDISABLE')
|
||||||
{
|
{
|
||||||
@ -172,13 +116,13 @@ class InterfaceLogevents
|
|||||||
// Initialisation donnees (date,duree,texte,desc)
|
// Initialisation donnees (date,duree,texte,desc)
|
||||||
if ($object->statut == 0)
|
if ($object->statut == 0)
|
||||||
{
|
{
|
||||||
$this->texte=$langs->transnoentities("UserEnabled",$object->login);
|
$text=$langs->transnoentities("UserEnabled",$object->login);
|
||||||
$this->desc=$langs->transnoentities("UserEnabled",$object->login);
|
$desc=$langs->transnoentities("UserEnabled",$object->login);
|
||||||
}
|
}
|
||||||
if ($object->statut == 1)
|
if ($object->statut == 1)
|
||||||
{
|
{
|
||||||
$this->texte=$langs->transnoentities("UserDisabled",$object->login);
|
$text=$langs->transnoentities("UserDisabled",$object->login);
|
||||||
$this->desc=$langs->transnoentities("UserDisabled",$object->login);
|
$desc=$langs->transnoentities("UserDisabled",$object->login);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($action == 'USER_DELETE')
|
elseif ($action == 'USER_DELETE')
|
||||||
@ -186,8 +130,8 @@ class InterfaceLogevents
|
|||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
// Initialisation donnees (date,duree,texte,desc)
|
// Initialisation donnees (date,duree,texte,desc)
|
||||||
$this->texte=$langs->transnoentities("UserDeleted",$object->login);
|
$text=$langs->transnoentities("UserDeleted",$object->login);
|
||||||
$this->desc=$langs->transnoentities("UserDeleted",$object->login);
|
$desc=$langs->transnoentities("UserDeleted",$object->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Groupes
|
// Groupes
|
||||||
@ -196,24 +140,24 @@ class InterfaceLogevents
|
|||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
// Initialisation donnees (date,duree,texte,desc)
|
// Initialisation donnees (date,duree,texte,desc)
|
||||||
$this->texte=$langs->transnoentities("NewGroupCreated",$object->nom);
|
$text=$langs->transnoentities("NewGroupCreated",$object->nom);
|
||||||
$this->desc=$langs->transnoentities("NewGroupCreated",$object->nom);
|
$desc=$langs->transnoentities("NewGroupCreated",$object->nom);
|
||||||
}
|
}
|
||||||
elseif ($action == 'GROUP_MODIFY')
|
elseif ($action == 'GROUP_MODIFY')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
// Initialisation donnees (date,duree,texte,desc)
|
// Initialisation donnees (date,duree,texte,desc)
|
||||||
$this->texte=$langs->transnoentities("GroupModified",$object->nom);
|
$text=$langs->transnoentities("GroupModified",$object->nom);
|
||||||
$this->desc=$langs->transnoentities("GroupModified",$object->nom);
|
$desc=$langs->transnoentities("GroupModified",$object->nom);
|
||||||
}
|
}
|
||||||
elseif ($action == 'GROUP_DELETE')
|
elseif ($action == 'GROUP_DELETE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
$langs->load("users");
|
$langs->load("users");
|
||||||
// Initialisation donnees (date,duree,texte,desc)
|
// Initialisation donnees (date,duree,texte,desc)
|
||||||
$this->texte=$langs->transnoentities("GroupDeleted",$object->nom);
|
$text=$langs->transnoentities("GroupDeleted",$object->nom);
|
||||||
$this->desc=$langs->transnoentities("GroupDeleted",$object->nom);
|
$desc=$langs->transnoentities("GroupDeleted",$object->nom);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If not found
|
// If not found
|
||||||
@ -226,30 +170,27 @@ class InterfaceLogevents
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Add entry in event table
|
// Add entry in event table
|
||||||
if ($this->date)
|
include_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
|
||||||
|
|
||||||
|
$event=new Events($this->db);
|
||||||
|
$event->type=$action;
|
||||||
|
$event->dateevent=$date;
|
||||||
|
$event->label=$text;
|
||||||
|
$event->description=$desc;
|
||||||
|
$event->user_agent=$_SERVER["HTTP_USER_AGENT"];
|
||||||
|
|
||||||
|
$result=$event->create($user);
|
||||||
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$error ="Failed to insert security event: ".$event->error;
|
||||||
|
$this->error=$error;
|
||||||
|
|
||||||
$event=new Events($this->db);
|
dol_syslog(get_class($this).": ".$this->error, LOG_ERR);
|
||||||
$event->type=$action;
|
return -1;
|
||||||
$event->dateevent=$this->date;
|
|
||||||
$event->label=$this->texte;
|
|
||||||
$event->description=$this->desc;
|
|
||||||
$event->user_agent=$_SERVER["HTTP_USER_AGENT"];
|
|
||||||
|
|
||||||
$result=$event->create($user);
|
|
||||||
if ($result > 0)
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$error ="Failed to insert security event: ".$event->error;
|
|
||||||
$this->error=$error;
|
|
||||||
|
|
||||||
dol_syslog(get_class($this).": ".$this->error, LOG_ERR);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2011-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2011-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -25,76 +26,25 @@
|
|||||||
/**
|
/**
|
||||||
* Class of triggers for paypal module
|
* Class of triggers for paypal module
|
||||||
*/
|
*/
|
||||||
class InterfacePaypalWorkflow
|
class InterfacePaypalWorkflow extends DolibarrTriggers
|
||||||
{
|
{
|
||||||
var $db;
|
public $picto = 'paypal@paypal';
|
||||||
|
public $family = 'paypal';
|
||||||
|
public $description = "Triggers of this module allows to manage paypal workflow";
|
||||||
|
public $version = self::VERSION_DOLIBARR;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Function called when a Dolibarrr business event is done.
|
||||||
*
|
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||||
* @param DoliDB $db Database handler
|
*
|
||||||
*/
|
* @param string $action Event action code
|
||||||
function __construct($db)
|
* @param Object $object Object
|
||||||
{
|
* @param User $user Object user
|
||||||
$this->db = $db;
|
* @param Translate $langs Object langs
|
||||||
|
* @param conf $conf Object conf
|
||||||
$this->name = preg_replace('/^Interface/i','',get_class($this));
|
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||||
$this->family = "paypal";
|
*/
|
||||||
$this->description = "Triggers of this module allows to manage paypal workflow";
|
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||||
$this->version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' or version
|
|
||||||
$this->picto = 'paypal@paypal';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renvoi nom du lot de triggers
|
|
||||||
*
|
|
||||||
* @return string Nom du lot de triggers
|
|
||||||
*/
|
|
||||||
function getName()
|
|
||||||
{
|
|
||||||
return $this->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renvoi descriptif du lot de triggers
|
|
||||||
*
|
|
||||||
* @return string Descriptif du lot de triggers
|
|
||||||
*/
|
|
||||||
function getDesc()
|
|
||||||
{
|
|
||||||
return $this->description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renvoi version du lot de triggers
|
|
||||||
*
|
|
||||||
* @return string Version du lot de triggers
|
|
||||||
*/
|
|
||||||
function getVersion()
|
|
||||||
{
|
|
||||||
global $langs;
|
|
||||||
$langs->load("admin");
|
|
||||||
|
|
||||||
if ($this->version == 'development') return $langs->trans("Development");
|
|
||||||
elseif ($this->version == 'experimental') return $langs->trans("Experimental");
|
|
||||||
elseif ($this->version == 'dolibarr') return DOL_VERSION;
|
|
||||||
elseif ($this->version) return $this->version;
|
|
||||||
else return $langs->trans("Unknown");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fonction appelee lors du declenchement d'un evenement Dolibarr.
|
|
||||||
* D'autres fonctions run_trigger peuvent etre presentes dans core/triggers
|
|
||||||
*
|
|
||||||
* @param string $action Event action code
|
|
||||||
* @param Object $object Object
|
|
||||||
* @param User $user Object user
|
|
||||||
* @param Translate $langs Object langs
|
|
||||||
* @param conf $conf Object conf
|
|
||||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
|
||||||
*/
|
|
||||||
function run_trigger($action,$object,$user,$langs,$conf)
|
|
||||||
{
|
{
|
||||||
// Mettre ici le code a executer en reaction de l'action
|
// Mettre ici le code a executer en reaction de l'action
|
||||||
// Les donnees de l'action sont stockees dans $object
|
// Les donnees de l'action sont stockees dans $object
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -27,76 +28,25 @@
|
|||||||
* Class of triggers for workflow module
|
* Class of triggers for workflow module
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class InterfaceWorkflowManager
|
class InterfaceWorkflowManager extends DolibarrTriggers
|
||||||
{
|
{
|
||||||
var $db;
|
public $picto = 'paypal@paypal';
|
||||||
|
public $family = 'core';
|
||||||
|
public $description = "Triggers of this module allows to manage workflows";
|
||||||
|
public $version = self::VERSION_DOLIBARR;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Function called when a Dolibarrr business event is done.
|
||||||
*
|
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||||
* @param DoliDB $db Database handler
|
*
|
||||||
*/
|
* @param string $action Event action code
|
||||||
function __construct($db)
|
* @param Object $object Object
|
||||||
{
|
* @param User $user Object user
|
||||||
$this->db = $db;
|
* @param Translate $langs Object langs
|
||||||
|
* @param conf $conf Object conf
|
||||||
$this->name = preg_replace('/^Interface/i','',get_class($this));
|
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||||
$this->family = "core";
|
*/
|
||||||
$this->description = "Triggers of this module allows to manage workflows";
|
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||||
$this->version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' or version
|
|
||||||
$this->picto = 'technic';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return name of trigger file
|
|
||||||
*
|
|
||||||
* @return string Name of trigger file
|
|
||||||
*/
|
|
||||||
function getName()
|
|
||||||
{
|
|
||||||
return $this->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return description of trigger file
|
|
||||||
*
|
|
||||||
* @return string Description of trigger file
|
|
||||||
*/
|
|
||||||
function getDesc()
|
|
||||||
{
|
|
||||||
return $this->description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return version of trigger file
|
|
||||||
*
|
|
||||||
* @return string Version of trigger file
|
|
||||||
*/
|
|
||||||
function getVersion()
|
|
||||||
{
|
|
||||||
global $langs;
|
|
||||||
$langs->load("admin");
|
|
||||||
|
|
||||||
if ($this->version == 'development') return $langs->trans("Development");
|
|
||||||
elseif ($this->version == 'experimental') return $langs->trans("Experimental");
|
|
||||||
elseif ($this->version == 'dolibarr') return DOL_VERSION;
|
|
||||||
elseif ($this->version) return $this->version;
|
|
||||||
else return $langs->trans("Unknown");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function called when a Dolibarrr business event is done.
|
|
||||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
|
||||||
*
|
|
||||||
* @param string $action Event action code
|
|
||||||
* @param Object $object Object
|
|
||||||
* @param User $user Object user
|
|
||||||
* @param Translate $langs Object langs
|
|
||||||
* @param conf $conf Object conf
|
|
||||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
|
||||||
*/
|
|
||||||
function run_trigger($action,$object,$user,$langs,$conf)
|
|
||||||
{
|
{
|
||||||
if (empty($conf->workflow->enabled)) return 0; // Module not active, we do nothing
|
if (empty($conf->workflow->enabled)) return 0; // Module not active, we do nothing
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2009-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2009-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Cedric GROSS <c.gross@kreiz-it.fr>
|
* Copyright (C) 2013 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||||
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -28,123 +29,67 @@
|
|||||||
/**
|
/**
|
||||||
* Class of triggered functions for agenda module
|
* Class of triggered functions for agenda module
|
||||||
*/
|
*/
|
||||||
class InterfaceActionsAuto
|
class InterfaceActionsAuto extends DolibarrTriggers
|
||||||
{
|
{
|
||||||
var $db;
|
public $family = 'agenda';
|
||||||
var $error;
|
public $description = "Triggers of this module add actions in agenda according to setup made in agenda setup.";
|
||||||
|
public $version = self::VERSION_DOLIBARR;
|
||||||
|
public $picto = 'action';
|
||||||
|
|
||||||
var $date;
|
/**
|
||||||
var $duree;
|
* Function called when a Dolibarrr business event is done.
|
||||||
var $texte;
|
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||||
var $desc;
|
*
|
||||||
|
* Following properties must be filled:
|
||||||
|
* $object->actiontypecode (translation action code: AC_OTH, ...)
|
||||||
|
* $object->actionmsg (note, long text)
|
||||||
|
* $object->actionmsg2 (label, short text)
|
||||||
|
* $object->sendtoid (id of contact)
|
||||||
|
* $object->socid
|
||||||
|
* Optionnal:
|
||||||
|
* $object->fk_element
|
||||||
|
* $object->elementtype
|
||||||
|
*
|
||||||
|
* @param string $action Event action code
|
||||||
|
* @param Object $object Object
|
||||||
|
* @param User $user Object user
|
||||||
|
* @param Translate $langs Object langs
|
||||||
|
* @param conf $conf Object conf
|
||||||
|
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||||
|
*/
|
||||||
|
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||||
|
{
|
||||||
|
// Module not active, we do nothing
|
||||||
|
if (empty($conf->agenda->enabled)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
$key = 'MAIN_AGENDA_ACTIONAUTO_'.$action;
|
||||||
* Constructor
|
|
||||||
*
|
|
||||||
* @param DoliDB $db Database handler
|
|
||||||
*/
|
|
||||||
function __construct($db)
|
|
||||||
{
|
|
||||||
$this->db = $db;
|
|
||||||
|
|
||||||
$this->name = preg_replace('/^Interface/i','',get_class($this));
|
// Do not log events not enabled for this action
|
||||||
$this->family = "agenda";
|
if (empty($conf->global->$key)) {
|
||||||
$this->description = "Triggers of this module add actions in agenda according to setup made in agenda setup.";
|
return 0;
|
||||||
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
|
}
|
||||||
$this->picto = 'action';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
$langs->load("agenda");
|
||||||
* Return name of trigger file
|
|
||||||
*
|
|
||||||
* @return string Name of trigger file
|
|
||||||
*/
|
|
||||||
function getName()
|
|
||||||
{
|
|
||||||
return $this->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return description of trigger file
|
|
||||||
*
|
|
||||||
* @return string Description of trigger file
|
|
||||||
*/
|
|
||||||
function getDesc()
|
|
||||||
{
|
|
||||||
return $this->description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return version of trigger file
|
|
||||||
*
|
|
||||||
* @return string Version of trigger file
|
|
||||||
*/
|
|
||||||
function getVersion()
|
|
||||||
{
|
|
||||||
global $langs;
|
|
||||||
$langs->load("admin");
|
|
||||||
|
|
||||||
if ($this->version == 'experimental') return $langs->trans("Experimental");
|
|
||||||
elseif ($this->version == 'dolibarr') return DOL_VERSION;
|
|
||||||
elseif ($this->version) return $this->version;
|
|
||||||
else return $langs->trans("Unknown");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function called when a Dolibarrr business event is done.
|
|
||||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
|
||||||
*
|
|
||||||
* Following properties must be filled:
|
|
||||||
* $object->actiontypecode (translation action code: AC_OTH, ...)
|
|
||||||
* $object->actionmsg (note, long text)
|
|
||||||
* $object->actionmsg2 (label, short text)
|
|
||||||
* $object->sendtoid (id of contact)
|
|
||||||
* $object->socid
|
|
||||||
* Optionnal:
|
|
||||||
* $object->fk_element
|
|
||||||
* $object->elementtype
|
|
||||||
*
|
|
||||||
* @param string $action Event action code
|
|
||||||
* @param Object $object Object
|
|
||||||
* @param User $user Object user
|
|
||||||
* @param Translate $langs Object langs
|
|
||||||
* @param conf $conf Object conf
|
|
||||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
|
||||||
*/
|
|
||||||
function run_trigger($action,$object,$user,$langs,$conf)
|
|
||||||
{
|
|
||||||
$key='MAIN_AGENDA_ACTIONAUTO_'.$action;
|
|
||||||
//dol_syslog("xxxxxxxxxxx".$key);
|
|
||||||
|
|
||||||
if (empty($conf->agenda->enabled)) return 0; // Module not active, we do nothing
|
|
||||||
if (empty($conf->global->$key)) return 0; // Do not log events not enabled for this action
|
|
||||||
|
|
||||||
$ok=0;
|
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
if ($action == 'COMPANY_CREATE')
|
if ($action == 'COMPANY_CREATE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("NewCompanyToDolibarr",$object->nom);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("NewCompanyToDolibarr",$object->nom);
|
||||||
$object->actionmsg=$langs->transnoentities("NewCompanyToDolibarr",$object->nom);
|
$object->actionmsg=$langs->transnoentities("NewCompanyToDolibarr",$object->nom);
|
||||||
if (! empty($object->prefix)) $object->actionmsg.=" (".$object->prefix.")";
|
if (! empty($object->prefix)) $object->actionmsg.=" (".$object->prefix.")";
|
||||||
//$this->desc.="\n".$langs->transnoentities("Customer").': '.yn($object->client);
|
|
||||||
//$this->desc.="\n".$langs->transnoentities("Supplier").': '.yn($object->fournisseur);
|
|
||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$object->socid=$object->id;
|
$object->socid=$object->id;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'COMPANY_SENTBYMAIL')
|
elseif ($action == 'COMPANY_SENTBYMAIL')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
if (empty($object->actiontypecode)) $object->actiontypecode='AC_OTH_AUTO';
|
if (empty($object->actiontypecode)) $object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) dol_syslog('Trigger called with property actionmsg2 on object not defined', LOG_ERR);
|
if (empty($object->actionmsg2)) dol_syslog('Trigger called with property actionmsg2 on object not defined', LOG_ERR);
|
||||||
@ -152,14 +97,11 @@ class InterfaceActionsAuto
|
|||||||
|
|
||||||
// Parameters $object->sendtoid defined by caller
|
// Parameters $object->sendtoid defined by caller
|
||||||
//$object->sendtoid=0;
|
//$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'CONTRACT_VALIDATE')
|
elseif ($action == 'CONTRACT_VALIDATE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("contracts");
|
$langs->load("contracts");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ContractValidatedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ContractValidatedInDolibarr",$object->ref);
|
||||||
@ -167,13 +109,10 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'PROPAL_VALIDATE')
|
elseif ($action == 'PROPAL_VALIDATE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalValidatedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalValidatedInDolibarr",$object->ref);
|
||||||
@ -181,13 +120,10 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'PROPAL_SENTBYMAIL')
|
elseif ($action == 'PROPAL_SENTBYMAIL')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProposalSentByEMail",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProposalSentByEMail",$object->ref);
|
||||||
@ -199,13 +135,10 @@ class InterfaceActionsAuto
|
|||||||
|
|
||||||
// Parameters $object->sendtoid defined by caller
|
// Parameters $object->sendtoid defined by caller
|
||||||
//$object->sendtoid=0;
|
//$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'PROPAL_CLOSE_SIGNED')
|
elseif ($action == 'PROPAL_CLOSE_SIGNED')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
|
||||||
@ -213,13 +146,10 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'PROPAL_CLOSE_REFUSED')
|
elseif ($action == 'PROPAL_CLOSE_REFUSED')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
|
||||||
@ -227,13 +157,10 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'ORDER_VALIDATE')
|
elseif ($action == 'ORDER_VALIDATE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
|
||||||
@ -241,13 +168,10 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'ORDER_SENTBYMAIL')
|
elseif ($action == 'ORDER_SENTBYMAIL')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderSentByEMail",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderSentByEMail",$object->ref);
|
||||||
@ -259,14 +183,11 @@ class InterfaceActionsAuto
|
|||||||
|
|
||||||
// Parameters $object->sendtoid defined by caller
|
// Parameters $object->sendtoid defined by caller
|
||||||
//$object->sendtoid=0;
|
//$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'BILL_VALIDATE')
|
elseif ($action == 'BILL_VALIDATE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
|
||||||
@ -274,14 +195,11 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'BILL_UNVALIDATE')
|
elseif ($action == 'BILL_UNVALIDATE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
|
||||||
@ -289,14 +207,11 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'BILL_SENTBYMAIL')
|
elseif ($action == 'BILL_SENTBYMAIL')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceSentByEMail",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceSentByEMail",$object->ref);
|
||||||
@ -308,14 +223,11 @@ class InterfaceActionsAuto
|
|||||||
|
|
||||||
// Parameters $object->sendtoid defined by caller
|
// Parameters $object->sendtoid defined by caller
|
||||||
//$object->sendtoid=0;
|
//$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'BILL_PAYED')
|
elseif ($action == 'BILL_PAYED')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
// Values for this action can't be defined by caller.
|
// Values for this action can't be defined by caller.
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
@ -324,14 +236,11 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'BILL_CANCEL')
|
elseif ($action == 'BILL_CANCEL')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
|
||||||
@ -339,14 +248,11 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'FICHINTER_VALIDATE')
|
elseif ($action == 'FICHINTER_VALIDATE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("interventions");
|
$langs->load("interventions");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref);
|
||||||
@ -356,14 +262,11 @@ class InterfaceActionsAuto
|
|||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$object->fk_element=0;
|
$object->fk_element=0;
|
||||||
$object->elementtype='';
|
$object->elementtype='';
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'FICHINTER_SENTBYMAIL')
|
elseif ($action == 'FICHINTER_SENTBYMAIL')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("interventions");
|
$langs->load("interventions");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref);
|
||||||
@ -372,14 +275,11 @@ class InterfaceActionsAuto
|
|||||||
|
|
||||||
// Parameters $object->sendtoid defined by caller
|
// Parameters $object->sendtoid defined by caller
|
||||||
//$object->sendtoid=0;
|
//$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'FICHINTER_CLASSIFY_BILLED')
|
elseif ($action == 'FICHINTER_CLASSIFY_BILLED')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("interventions");
|
$langs->load("interventions");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionClassifiedBilled",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionClassifiedBilled",$object->ref);
|
||||||
@ -387,14 +287,11 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'SHIPPING_VALIDATE')
|
elseif ($action == 'SHIPPING_VALIDATE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ShippingValidated",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ShippingValidated",$object->ref);
|
||||||
@ -406,14 +303,11 @@ class InterfaceActionsAuto
|
|||||||
|
|
||||||
// Parameters $object->sendtoid defined by caller
|
// Parameters $object->sendtoid defined by caller
|
||||||
//$object->sendtoid=0;
|
//$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'SHIPPING_SENTBYMAIL')
|
elseif ($action == 'SHIPPING_SENTBYMAIL')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ShippingSentByEMail",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ShippingSentByEMail",$object->ref);
|
||||||
@ -425,13 +319,10 @@ class InterfaceActionsAuto
|
|||||||
|
|
||||||
// Parameters $object->sendtoid defined by caller
|
// Parameters $object->sendtoid defined by caller
|
||||||
//$object->sendtoid=0;
|
//$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'ORDER_SUPPLIER_VALIDATE')
|
elseif ($action == 'ORDER_SUPPLIER_VALIDATE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",$object->ref);
|
||||||
@ -439,13 +330,10 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'ORDER_SUPPLIER_APPROVE')
|
elseif ($action == 'ORDER_SUPPLIER_APPROVE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderApprovedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderApprovedInDolibarr",$object->ref);
|
||||||
@ -453,13 +341,10 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'ORDER_SUPPLIER_REFUSE')
|
elseif ($action == 'ORDER_SUPPLIER_REFUSE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderRefusedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderRefusedInDolibarr",$object->ref);
|
||||||
@ -467,14 +352,11 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL')
|
elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("agenda");
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
@ -487,14 +369,11 @@ class InterfaceActionsAuto
|
|||||||
|
|
||||||
// Parameters $object->sendtoid defined by caller
|
// Parameters $object->sendtoid defined by caller
|
||||||
//$object->sendtoid=0;
|
//$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'BILL_SUPPLIER_VALIDATE')
|
elseif ($action == 'BILL_SUPPLIER_VALIDATE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",$object->ref);
|
||||||
@ -502,14 +381,11 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'BILL_SUPPLIER_SENTBYMAIL')
|
elseif ($action == 'BILL_SUPPLIER_SENTBYMAIL')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("agenda");
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
@ -522,14 +398,11 @@ class InterfaceActionsAuto
|
|||||||
|
|
||||||
// Parameters $object->sendtoid defined by caller
|
// Parameters $object->sendtoid defined by caller
|
||||||
//$object->sendtoid=0;
|
//$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'BILL_SUPPLIER_PAYED')
|
elseif ($action == 'BILL_SUPPLIER_PAYED')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
|
||||||
@ -537,14 +410,11 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'BILL_SUPPLIER_CANCELED')
|
elseif ($action == 'BILL_SUPPLIER_CANCELED')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
|
||||||
@ -552,16 +422,13 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Members
|
// Members
|
||||||
elseif ($action == 'MEMBER_VALIDATE')
|
elseif ($action == 'MEMBER_VALIDATE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref);
|
||||||
@ -571,14 +438,11 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'MEMBER_SUBSCRIPTION')
|
elseif ($action == 'MEMBER_SUBSCRIPTION')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
|
||||||
@ -590,18 +454,11 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
|
||||||
elseif ($action == 'MEMBER_MODIFY')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'MEMBER_RESILIATE')
|
elseif ($action == 'MEMBER_RESILIATE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
|
||||||
@ -611,14 +468,11 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
elseif ($action == 'MEMBER_DELETE')
|
elseif ($action == 'MEMBER_DELETE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
|
||||||
@ -628,16 +482,13 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Projects
|
// Projects
|
||||||
elseif ($action == 'PROJECT_CREATE')
|
elseif ($action == 'PROJECT_CREATE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProjectCreatedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProjectCreatedInDolibarr",$object->ref);
|
||||||
@ -646,15 +497,12 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Project tasks
|
// Project tasks
|
||||||
elseif($action == 'TASK_CREATE') {
|
elseif($action == 'TASK_CREATE') {
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
|
|
||||||
@ -664,14 +512,11 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif($action == 'TASK_MODIFY') {
|
elseif($action == 'TASK_MODIFY') {
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("TaskModifiedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("TaskModifiedInDolibarr",$object->ref);
|
||||||
@ -680,14 +525,11 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif($action == 'TASK_DELETE') {
|
elseif($action == 'TASK_DELETE') {
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$langs->load("agenda");
|
|
||||||
|
|
||||||
$object->actiontypecode='AC_OTH_AUTO';
|
$object->actiontypecode='AC_OTH_AUTO';
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("TaskDeletedInDolibarr",$object->ref);
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("TaskDeletedInDolibarr",$object->ref);
|
||||||
@ -696,7 +538,6 @@ class InterfaceActionsAuto
|
|||||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
$ok=1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The trigger was enabled but we are missing the implementation, let the log know
|
// The trigger was enabled but we are missing the implementation, let the log know
|
||||||
@ -706,63 +547,62 @@ class InterfaceActionsAuto
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
|
|
||||||
// Add entry in event table
|
// Add entry in event table
|
||||||
if ($ok)
|
$now=dol_now();
|
||||||
{
|
|
||||||
$now=dol_now();
|
|
||||||
|
|
||||||
if(isset($_SESSION['listofnames']))
|
if(isset($_SESSION['listofnames']))
|
||||||
|
{
|
||||||
|
$attachs=$_SESSION['listofnames'];
|
||||||
|
if($attachs && strpos($action,'SENTBYMAIL'))
|
||||||
{
|
{
|
||||||
$attachs=$_SESSION['listofnames'];
|
$object->actionmsg.="\n".$langs->transnoentities("AttachedFiles").': '.$attachs;
|
||||||
if($attachs && strpos($action,'SENTBYMAIL'))
|
|
||||||
{
|
|
||||||
$object->actionmsg.="\n".$langs->transnoentities("AttachedFiles").': '.$attachs;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
$contactforaction=new Contact($this->db);
|
$contactforaction=new Contact($this->db);
|
||||||
$societeforaction=new Societe($this->db);
|
$societeforaction=new Societe($this->db);
|
||||||
if ($object->sendtoid > 0) $contactforaction->fetch($object->sendtoid);
|
if ($object->sendtoid > 0) $contactforaction->fetch($object->sendtoid);
|
||||||
if ($object->socid > 0) $societeforaction->fetch($object->socid);
|
if ($object->socid > 0) $societeforaction->fetch($object->socid);
|
||||||
|
|
||||||
// Insertion action
|
// Insertion action
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||||
$actioncomm = new ActionComm($this->db);
|
$actioncomm = new ActionComm($this->db);
|
||||||
$actioncomm->type_code = $object->actiontypecode; // code of parent table llx_c_actioncomm (will be deprecated)
|
$actioncomm->type_code = $object->actiontypecode; // code of parent table llx_c_actioncomm (will be deprecated)
|
||||||
$actioncomm->code='AC_'.$action;
|
$actioncomm->code='AC_'.$action;
|
||||||
$actioncomm->label = $object->actionmsg2;
|
$actioncomm->label = $object->actionmsg2;
|
||||||
$actioncomm->note = $object->actionmsg;
|
$actioncomm->note = $object->actionmsg;
|
||||||
$actioncomm->datep = $now;
|
$actioncomm->datep = $now;
|
||||||
$actioncomm->datef = $now;
|
$actioncomm->datef = $now;
|
||||||
$actioncomm->durationp = 0;
|
$actioncomm->durationp = 0;
|
||||||
$actioncomm->punctual = 1;
|
$actioncomm->punctual = 1;
|
||||||
$actioncomm->percentage = -1; // Not applicable
|
$actioncomm->percentage = -1; // Not applicable
|
||||||
$actioncomm->contact = $contactforaction;
|
$actioncomm->contact = $contactforaction;
|
||||||
$actioncomm->societe = $societeforaction;
|
$actioncomm->societe = $societeforaction;
|
||||||
$actioncomm->author = $user; // User saving action
|
$actioncomm->author = $user; // User saving action
|
||||||
$actioncomm->usertodo = $user; // User owner of action
|
$actioncomm->usertodo = $user; // User owner of action
|
||||||
//$actioncomm->userdone = $user; // User doing action
|
//$actioncomm->userdone = $user; // User doing action
|
||||||
|
|
||||||
$actioncomm->fk_element = $object->id;
|
$actioncomm->fk_element = $object->id;
|
||||||
$actioncomm->elementtype = $object->element;
|
$actioncomm->elementtype = $object->element;
|
||||||
|
|
||||||
$ret=$actioncomm->add($user); // User qui saisit l'action
|
$ret=$actioncomm->add($user); // User qui saisit l'action
|
||||||
if ($ret > 0)
|
if ($ret > 0)
|
||||||
{
|
{
|
||||||
$_SESSION['LAST_ACTION_CREATED'] = $ret;
|
$_SESSION['LAST_ACTION_CREATED'] = $ret;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$error ="Failed to insert event : ".$actioncomm->error." ".join(',',$actioncomm->errors);
|
$error ="Failed to insert event : ".$actioncomm->error." ".join(',',$actioncomm->errors);
|
||||||
$this->error=$error;
|
$this->error=$error;
|
||||||
$this->errors=$actioncomm->errors;
|
$this->errors=$actioncomm->errors;
|
||||||
|
|
||||||
dol_syslog("interface_modAgenda_ActionsAuto.class.php: ".$this->error, LOG_ERR);
|
dol_syslog("interface_modAgenda_ActionsAuto.class.php: ".$this->error, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -27,76 +28,25 @@ require_once (DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php");
|
|||||||
/**
|
/**
|
||||||
* Class of triggers for ldap module
|
* Class of triggers for ldap module
|
||||||
*/
|
*/
|
||||||
class InterfaceLdapsynchro
|
class InterfaceLdapsynchro extends DolibarrTriggers
|
||||||
{
|
{
|
||||||
var $db;
|
public $family = 'ldap';
|
||||||
var $error;
|
public $description = "Triggers of this module allows to synchronize Dolibarr toward a LDAP database.";
|
||||||
|
public $version = self::VERSION_DOLIBARR;
|
||||||
|
public $picto = 'technic';
|
||||||
|
|
||||||
|
/**
|
||||||
/**
|
* Function called when a Dolibarrr business event is done.
|
||||||
* Constructor
|
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param string $action Event action code
|
||||||
*/
|
* @param Object $object Object
|
||||||
function __construct($db)
|
* @param User $user Object user
|
||||||
{
|
* @param Translate $langs Object langs
|
||||||
$this->db = $db;
|
* @param conf $conf Object conf
|
||||||
|
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||||
$this->name = preg_replace('/^Interface/i','',get_class($this));
|
*/
|
||||||
$this->family = "ldap";
|
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||||
$this->description = "Triggers of this module allows to synchronize Dolibarr toward a LDAP database.";
|
|
||||||
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
|
|
||||||
$this->picto = 'technic';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return name of trigger file
|
|
||||||
*
|
|
||||||
* @return string Name of trigger file
|
|
||||||
*/
|
|
||||||
function getName()
|
|
||||||
{
|
|
||||||
return $this->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return description of trigger file
|
|
||||||
*
|
|
||||||
* @return string Description of trigger file
|
|
||||||
*/
|
|
||||||
function getDesc()
|
|
||||||
{
|
|
||||||
return $this->description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return version of trigger file
|
|
||||||
*
|
|
||||||
* @return string Version of trigger file
|
|
||||||
*/
|
|
||||||
function getVersion()
|
|
||||||
{
|
|
||||||
global $langs;
|
|
||||||
$langs->load("admin");
|
|
||||||
|
|
||||||
if ($this->version == 'experimental') return $langs->trans("Experimental");
|
|
||||||
elseif ($this->version == 'dolibarr') return DOL_VERSION;
|
|
||||||
elseif ($this->version) return $this->version;
|
|
||||||
else return $langs->trans("Unknown");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function called when a Dolibarrr business event is done.
|
|
||||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
|
||||||
*
|
|
||||||
* @param string $action Event action code
|
|
||||||
* @param Object $object Object
|
|
||||||
* @param User $user Object user
|
|
||||||
* @param Translate $langs Object langs
|
|
||||||
* @param conf $conf Object conf
|
|
||||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
|
||||||
*/
|
|
||||||
function run_trigger($action,$object,$user,$langs,$conf)
|
|
||||||
{
|
{
|
||||||
if (empty($conf->ldap->enabled)) return 0; // Module not active, we do nothing
|
if (empty($conf->ldap->enabled)) return 0; // Module not active, we do nothing
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -27,77 +28,26 @@ require_once (DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php");
|
|||||||
/**
|
/**
|
||||||
* Class of triggers for MailmanSpip module
|
* Class of triggers for MailmanSpip module
|
||||||
*/
|
*/
|
||||||
class InterfaceMailmanSpipsynchro
|
class InterfaceMailmanSpipsynchro extends DolibarrTriggers
|
||||||
{
|
{
|
||||||
var $db;
|
public $family = 'ldap';
|
||||||
var $error;
|
public $description = "Triggers of this module allows to synchronize Mailman an Spip.";
|
||||||
|
public $version = self::VERSION_DOLIBARR;
|
||||||
|
public $picto = 'technic';
|
||||||
|
|
||||||
|
/**
|
||||||
/**
|
* Function called when a Dolibarrr business event is done.
|
||||||
* Constructor
|
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param string $action Event action code
|
||||||
*/
|
* @param Object $object Object
|
||||||
function __construct($db)
|
* @param User $user Object user
|
||||||
{
|
* @param Translate $langs Object langs
|
||||||
$this->db = $db;
|
* @param conf $conf Object conf
|
||||||
|
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||||
$this->name = preg_replace('/^Interface/i','',get_class($this));
|
*/
|
||||||
$this->family = "ldap";
|
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||||
$this->description = "Triggers of this module allows to synchronize Mailman an Spip.";
|
{
|
||||||
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
|
|
||||||
$this->picto = 'technic';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return name of trigger file
|
|
||||||
*
|
|
||||||
* @return string Name of trigger file
|
|
||||||
*/
|
|
||||||
function getName()
|
|
||||||
{
|
|
||||||
return $this->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return description of trigger file
|
|
||||||
*
|
|
||||||
* @return string Description of trigger file
|
|
||||||
*/
|
|
||||||
function getDesc()
|
|
||||||
{
|
|
||||||
return $this->description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return version of trigger file
|
|
||||||
*
|
|
||||||
* @return string Version of trigger file
|
|
||||||
*/
|
|
||||||
function getVersion()
|
|
||||||
{
|
|
||||||
global $langs;
|
|
||||||
$langs->load("admin");
|
|
||||||
|
|
||||||
if ($this->version == 'experimental') return $langs->trans("Experimental");
|
|
||||||
elseif ($this->version == 'dolibarr') return DOL_VERSION;
|
|
||||||
elseif ($this->version) return $this->version;
|
|
||||||
else return $langs->trans("Unknown");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function called when a Dolibarrr business event is done.
|
|
||||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
|
||||||
*
|
|
||||||
* @param string $action Event action code
|
|
||||||
* @param Object $object Object
|
|
||||||
* @param User $user Object user
|
|
||||||
* @param Translate $langs Object langs
|
|
||||||
* @param conf $conf Object conf
|
|
||||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
|
||||||
*/
|
|
||||||
function run_trigger($action,$object,$user,$langs,$conf)
|
|
||||||
{
|
|
||||||
if (empty($conf->mailmanspip->enabled)) return 0; // Module not active, we do nothing
|
if (empty($conf->mailmanspip->enabled)) return 0; // Module not active, we do nothing
|
||||||
|
|
||||||
if (! function_exists('ldap_connect'))
|
if (! function_exists('ldap_connect'))
|
||||||
@ -106,38 +56,7 @@ class InterfaceMailmanSpipsynchro
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Users
|
if ($action == 'CATEGORY_LINK')
|
||||||
if ($action == 'USER_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
|
|
||||||
}
|
|
||||||
elseif ($action == 'USER_MODIFY')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'USER_NEW_PASSWORD')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'USER_ENABLEDISABLE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'USER_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'USER_SETINGROUP')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'USER_REMOVEFROMGROUP')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
elseif ($action == 'CATEGORY_LINK')
|
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
|
|
||||||
@ -211,10 +130,6 @@ class InterfaceMailmanSpipsynchro
|
|||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
elseif ($action == 'MEMBER_NEW_PASSWORD')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'MEMBER_RESILIATE' || $action == 'MEMBER_DELETE')
|
elseif ($action == 'MEMBER_RESILIATE' || $action == 'MEMBER_DELETE')
|
||||||
{
|
{
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
@ -231,16 +146,10 @@ class InterfaceMailmanSpipsynchro
|
|||||||
{
|
{
|
||||||
$return=1;
|
$return=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If not found
|
|
||||||
/*
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2013-2014 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -27,9 +27,13 @@
|
|||||||
/**
|
/**
|
||||||
* Class of triggers for notification module
|
* Class of triggers for notification module
|
||||||
*/
|
*/
|
||||||
class InterfaceNotification
|
class InterfaceNotification extends DolibarrTriggers
|
||||||
{
|
{
|
||||||
var $db;
|
public $family = 'notification';
|
||||||
|
public $description = "Triggers of this module send email notifications according to Notification module setup.";
|
||||||
|
public $version = self::VERSION_DOLIBARR;
|
||||||
|
public $picto = 'email';
|
||||||
|
|
||||||
var $listofmanagedevents=array(
|
var $listofmanagedevents=array(
|
||||||
'BILL_VALIDATE',
|
'BILL_VALIDATE',
|
||||||
'ORDER_VALIDATE',
|
'ORDER_VALIDATE',
|
||||||
@ -40,187 +44,87 @@ class InterfaceNotification
|
|||||||
'SHIPPING_VALIDATE'
|
'SHIPPING_VALIDATE'
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Function called when a Dolibarrr business event is done.
|
||||||
*
|
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||||
* @param DoliDB $db Database handler
|
*
|
||||||
*/
|
* @param string $action Event action code
|
||||||
function __construct($db)
|
* @param Object $object Object
|
||||||
{
|
* @param User $user Object user
|
||||||
$this->db = $db;
|
* @param Translate $langs Object langs
|
||||||
|
* @param conf $conf Object conf
|
||||||
$this->name = preg_replace('/^Interface/i','',get_class($this));
|
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||||
$this->family = "notification";
|
*/
|
||||||
$this->description = "Triggers of this module send email notifications according to Notification module setup.";
|
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||||
$this->version = 'dolibarr'; // 'experimental' or 'dolibarr' or version
|
{
|
||||||
$this->picto = 'email';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return name of trigger file
|
|
||||||
*
|
|
||||||
* @return string Name of trigger file
|
|
||||||
*/
|
|
||||||
function getName()
|
|
||||||
{
|
|
||||||
return $this->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return description of trigger file
|
|
||||||
*
|
|
||||||
* @return string Description of trigger file
|
|
||||||
*/
|
|
||||||
function getDesc()
|
|
||||||
{
|
|
||||||
return $this->description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return version of trigger file
|
|
||||||
*
|
|
||||||
* @return string Version of trigger file
|
|
||||||
*/
|
|
||||||
function getVersion()
|
|
||||||
{
|
|
||||||
global $langs;
|
|
||||||
$langs->load("admin");
|
|
||||||
|
|
||||||
if ($this->version == 'experimental') return $langs->trans("Experimental");
|
|
||||||
elseif ($this->version == 'dolibarr') return DOL_VERSION;
|
|
||||||
elseif ($this->version) return $this->version;
|
|
||||||
else return $langs->trans("Unknown");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function called when a Dolibarrr business event is done.
|
|
||||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
|
||||||
*
|
|
||||||
* @param string $action Event action code
|
|
||||||
* @param Object $object Object
|
|
||||||
* @param User $user Object user
|
|
||||||
* @param Translate $langs Object langs
|
|
||||||
* @param conf $conf Object conf
|
|
||||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
|
||||||
*/
|
|
||||||
function run_trigger($action,$object,$user,$langs,$conf)
|
|
||||||
{
|
|
||||||
if (empty($conf->notification->enabled)) return 0; // Module not active, we do nothing
|
if (empty($conf->notification->enabled)) return 0; // Module not active, we do nothing
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
|
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
|
||||||
|
|
||||||
if ($action == 'BILL_VALIDATE')
|
$langs->load("other");
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
|
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
switch ($action) {
|
||||||
$filepdf = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
case 'BILL_VALIDATE':
|
||||||
if (! file_exists($filepdf)) $filepdf='';
|
$dir_output = $conf->facture->dir_output;
|
||||||
$filepdf=''; // We can't add PDF as it is not generated yet.
|
$object_type = 'facture';
|
||||||
$langs->load("other");
|
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$object->ref);
|
||||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$object->ref);
|
break;
|
||||||
|
case 'ORDER_VALIDATE':
|
||||||
|
$dir_output = $conf->commande->dir_output;
|
||||||
|
$object_type = 'order';
|
||||||
|
$mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$object->ref);
|
||||||
|
break;
|
||||||
|
case 'PROPAL_VALIDATE':
|
||||||
|
$dir_output = $conf->propal->dir_output;
|
||||||
|
$object_type = 'propal';
|
||||||
|
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$object->ref);
|
||||||
|
break;
|
||||||
|
case 'FICHINTER_VALIDATE':
|
||||||
|
$dir_output = $conf->facture->dir_output;
|
||||||
|
$object_type = 'ficheinter';
|
||||||
|
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
|
||||||
|
break;
|
||||||
|
case 'ORDER_SUPPLIER_APPROVE':
|
||||||
|
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
||||||
|
$object_type = 'order_supplier';
|
||||||
|
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||||
|
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$object->ref,$user->getFullName($langs));
|
||||||
|
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
|
||||||
|
break;
|
||||||
|
case 'ORDER_SUPPLIER_REFUSE':
|
||||||
|
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
||||||
|
$object_type = 'order_supplier';
|
||||||
|
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||||
|
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$object->ref,$user->getFullName($langs));
|
||||||
|
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
|
||||||
|
break;
|
||||||
|
case 'SHIPPING_VALIDATE':
|
||||||
|
$dir_output = $conf->expedition->dir_output.'/sending/';
|
||||||
|
$object_type = 'order_supplier';
|
||||||
|
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$object->ref);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
|
||||||
$notify = new Notify($this->db);
|
|
||||||
$notify->send($action, $object->socid, $mesg, 'facture', $object->id, $filepdf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif ($action == 'ORDER_VALIDATE')
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
|
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
$ref = dol_sanitizeFileName($object->ref);
|
||||||
$filepdf = $conf->commande->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
$pdf_path = "$dir_output/$ref/$ref.pdf";
|
||||||
if (! file_exists($filepdf)) $filepdf='';
|
|
||||||
$filepdf=''; // We can't add PDF as it is not generated yet.
|
|
||||||
$langs->load("other");
|
|
||||||
$mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$object->ref);
|
|
||||||
|
|
||||||
$notify = new Notify($this->db);
|
if (!file_exists($pdf_path)) {
|
||||||
$notify->send($action, $object->socid, $mesg, 'order', $object->id, $filepdf);
|
// We can't add PDF as it is not generated yet.
|
||||||
|
$filepdf = '';
|
||||||
|
} else {
|
||||||
|
$filepdf = $pdf_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
elseif ($action == 'PROPAL_VALIDATE')
|
$notify = new Notify($this->db);
|
||||||
{
|
$notify->send($action, $object->socid, $mesg, $object_type, $object->id, $filepdf);
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
|
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
return 1;
|
||||||
$filepdf = $conf->propal->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
|
||||||
if (! file_exists($filepdf)) $filepdf='';
|
|
||||||
$filepdf=''; // We can't add PDF as it is not generated yet.
|
|
||||||
$langs->load("other");
|
|
||||||
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$object->ref);
|
|
||||||
|
|
||||||
$notify = new Notify($this->db);
|
|
||||||
$notify->send($action, $object->socid, $mesg, 'propal', $object->id, $filepdf);
|
|
||||||
}
|
|
||||||
|
|
||||||
elseif ($action == 'FICHINTER_VALIDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
|
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
|
||||||
$filepdf = $conf->facture->dir_output . '/' . $ref . '/' . $ref . '.pdf';
|
|
||||||
if (! file_exists($filepdf)) $filepdf='';
|
|
||||||
$filepdf=''; // We can't add PDF as it is not generated yet.
|
|
||||||
$langs->load("other");
|
|
||||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
|
|
||||||
|
|
||||||
$notify = new Notify($this->db);
|
|
||||||
$notify->send($action, $object->socid, $mesg, 'ficheinter', $object->id, $filepdf);
|
|
||||||
}
|
|
||||||
|
|
||||||
elseif ($action == 'ORDER_SUPPLIER_APPROVE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
|
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
|
||||||
$filepdf = $conf->fournisseur->dir_output . '/commande/' . $ref . '/' . $ref . '.pdf';
|
|
||||||
if (! file_exists($filepdf)) $filepdf='';
|
|
||||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
|
||||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$object->ref,$user->getFullName($langs));
|
|
||||||
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
|
|
||||||
|
|
||||||
$notify = new Notify($this->db);
|
|
||||||
$notify->send($action, $object->socid, $mesg, 'order_supplier', $object->id, $filepdf);
|
|
||||||
}
|
|
||||||
|
|
||||||
elseif ($action == 'ORDER_SUPPLIER_REFUSE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
|
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
|
||||||
$filepdf = $conf->fournisseur->dir_output . '/commande/' . $ref . '/' . $ref . '.pdf';
|
|
||||||
if (! file_exists($filepdf)) $filepdf='';
|
|
||||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
|
||||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$object->ref,$user->getFullName($langs));
|
|
||||||
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
|
|
||||||
|
|
||||||
$notify = new Notify($this->db);
|
|
||||||
$notify->send($action, $object->socid, $mesg, 'order_supplier', $object->id, $filepdf);
|
|
||||||
}
|
|
||||||
elseif ($action == 'SHIPPING_VALIDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
|
|
||||||
$ref = dol_sanitizeFileName($object->ref);
|
|
||||||
$filepdf = $conf->expedition->dir_output . '/sending/' . $ref . '/' . $ref . '.pdf';
|
|
||||||
if (! file_exists($filepdf)) $filepdf='';
|
|
||||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$object->ref);
|
|
||||||
|
|
||||||
|
|
||||||
$notify = new Notify($this->db);
|
|
||||||
$notify->send($action, $object->socid, $mesg, 'expedition', $object->id, $filepdf);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If not found
|
|
||||||
/*
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' was ran by ".__FILE__." but no handler found for this action.");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -231,7 +135,7 @@ class InterfaceNotification
|
|||||||
*/
|
*/
|
||||||
function getListOfManagedEvents()
|
function getListOfManagedEvents()
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf;
|
||||||
|
|
||||||
$ret=array();
|
$ret=array();
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -32,674 +33,224 @@
|
|||||||
/**
|
/**
|
||||||
* Class of triggers for demo module
|
* Class of triggers for demo module
|
||||||
*/
|
*/
|
||||||
class InterfaceDemo
|
class InterfaceDemo extends DolibarrTriggers
|
||||||
{
|
{
|
||||||
var $db;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*
|
|
||||||
* @param DoliDB $db Database handler
|
|
||||||
*/
|
|
||||||
function __construct($db)
|
|
||||||
{
|
|
||||||
$this->db = $db;
|
|
||||||
|
|
||||||
$this->name = preg_replace('/^Interface/i','',get_class($this));
|
|
||||||
$this->family = "demo";
|
|
||||||
$this->description = "Triggers of this module are empty functions. They have no effect. They are provided for tutorial purpose only.";
|
|
||||||
$this->version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' or version
|
|
||||||
$this->picto = 'technic';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return name of trigger file
|
|
||||||
*
|
|
||||||
* @return string Name of trigger file
|
|
||||||
*/
|
|
||||||
function getName()
|
|
||||||
{
|
|
||||||
return $this->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return description of trigger file
|
|
||||||
*
|
|
||||||
* @return string Description of trigger file
|
|
||||||
*/
|
|
||||||
function getDesc()
|
|
||||||
{
|
|
||||||
return $this->description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
public $family = 'demo';
|
||||||
* Return version of trigger file
|
public $picto = 'technic';
|
||||||
*
|
public $description = "Triggers of this module are empty functions. They have no effect. They are provided for tutorial purpose only.";
|
||||||
* @return string Version of trigger file
|
public $version = self::VERSION_DOLIBARR;
|
||||||
*/
|
|
||||||
function getVersion()
|
|
||||||
{
|
|
||||||
global $langs;
|
|
||||||
$langs->load("admin");
|
|
||||||
|
|
||||||
if ($this->version == 'development') return $langs->trans("Development");
|
/**
|
||||||
elseif ($this->version == 'experimental') return $langs->trans("Experimental");
|
* Function called when a Dolibarrr business event is done.
|
||||||
elseif ($this->version == 'dolibarr') return DOL_VERSION;
|
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||||
elseif ($this->version) return $this->version;
|
|
||||||
else return $langs->trans("Unknown");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function called when a Dolibarrr business event is done.
|
|
||||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
|
||||||
*
|
*
|
||||||
* @param string $action Event action code
|
* @param string $action Event action code
|
||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @param Translate $langs Object langs
|
* @param Translate $langs Object langs
|
||||||
* @param conf $conf Object conf
|
* @param conf $conf Object conf
|
||||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||||
*/
|
*/
|
||||||
function run_trigger($action,$object,$user,$langs,$conf)
|
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||||
{
|
{
|
||||||
// Put here code you want to execute when a Dolibarr business events occurs.
|
// Put here code you want to execute when a Dolibarr business events occurs.
|
||||||
// Data and type of action are stored into $object and $action
|
// Data and type of action are stored into $object and $action
|
||||||
|
|
||||||
// Users
|
switch ($action) {
|
||||||
if ($action == 'USER_LOGIN')
|
|
||||||
{
|
// Users
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'USER_LOGIN':
|
||||||
}
|
case 'USER_UPDATE_SESSION':
|
||||||
elseif ($action == 'USER_UPDATE_SESSION')
|
case 'USER_CREATE':
|
||||||
{
|
case 'USER_CREATE_FROM_CONTACT':
|
||||||
// Warning: To increase performances, this action is triggered only if
|
case 'USER_LOGIN':
|
||||||
// constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1.
|
// Warning: To increase performances, this action is triggered only if
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
// constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1.
|
||||||
}
|
case 'USER_UPDATE_SESSION':
|
||||||
elseif ($action == 'USER_CREATE')
|
case 'USER_CREATE':
|
||||||
{
|
case 'USER_CREATE_FROM_CONTACT':
|
||||||
$object->error=$action;
|
case 'USER_MODIFY':
|
||||||
return -1;
|
case 'USER_NEW_PASSWORD':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'USER_ENABLEDISABLE':
|
||||||
}
|
case 'USER_DELETE':
|
||||||
elseif ($action == 'USER_CREATE_FROM_CONTACT')
|
case 'USER_LOGOUT':
|
||||||
{
|
case 'USER_SETINGROUP':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'USER_REMOVEFROMGROUP':
|
||||||
}
|
|
||||||
elseif ($action == 'USER_MODIFY')
|
// Actions
|
||||||
{
|
case 'ACTION_MODIFY':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'ACTION_CREATE':
|
||||||
}
|
case 'ACTION_DELETE':
|
||||||
elseif ($action == 'USER_NEW_PASSWORD')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'USER_ENABLEDISABLE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'USER_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'USER_LOGOUT')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'USER_SETINGROUP')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'USER_REMOVEFROMGROUP')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Action
|
// Groups
|
||||||
elseif ($action == 'ACTION_MODIFY')
|
case 'GROUP_CREATE':
|
||||||
{
|
case 'GROUP_MODIFY':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'GROUP_DELETE':
|
||||||
}
|
|
||||||
elseif ($action == 'ACTION_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'ACTION_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Groups
|
|
||||||
elseif ($action == 'GROUP_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'GROUP_MODIFY')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'GROUP_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Companies
|
|
||||||
elseif ($action == 'COMPANY_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'COMPANY_MODIFY')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'COMPANY_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Contacts
|
// Companies
|
||||||
elseif ($action == 'CONTACT_CREATE')
|
case 'COMPANY_CREATE':
|
||||||
{
|
case 'COMPANY_MODIFY':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'COMPANY_DELETE':
|
||||||
}
|
|
||||||
elseif ($action == 'CONTACT_MODIFY')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'CONTACT_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'CONTACT_ENABLEDISABLE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Products
|
// Contacts
|
||||||
elseif ($action == 'PRODUCT_CREATE')
|
case 'CONTACT_CREATE':
|
||||||
{
|
case 'CONTACT_MODIFY':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'CONTACT_DELETE':
|
||||||
}
|
case 'CONTACT_ENABLEDISABLE':
|
||||||
elseif ($action == 'PRODUCT_MODIFY')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'PRODUCT_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'PRODUCT_PRICE_MODIFY')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Stock mouvement
|
|
||||||
elseif ($action == 'STOCK_MOVEMENT')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
//MYECMDIR
|
|
||||||
elseif ($action == 'MYECMDIR_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'MYECMDIR_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'MYECMDIR_MODIFY')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Customer orders
|
// Products
|
||||||
elseif ($action == 'ORDER_CREATE')
|
case 'PRODUCT_CREATE':
|
||||||
{
|
case 'PRODUCT_MODIFY':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'PRODUCT_DELETE':
|
||||||
}
|
case 'PRODUCT_PRICE_MODIFY':
|
||||||
elseif ($action == 'ORDER_CLONE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'ORDER_VALIDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'ORDER_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'ORDER_BUILDDOC')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'ORDER_SENTBYMAIL')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'ORDER_CLASSIFY_BILLED')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEORDER_INSERT')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEORDER_UPDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEORDER_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Supplier orders
|
//Stock mouvement
|
||||||
elseif ($action == 'ORDER_SUPPLIER_CREATE')
|
case 'STOCK_MOVEMENT':
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'ORDER_SUPPLIER_CLONE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'ORDER_SUPPLIER_VALIDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'ORDER_SUPPLIER_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'ORDER_SUPPLIER_APPROVE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'ORDER_SUPPLIER_REFUSE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'ORDER_SUPPLIER_CANCEL')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'ORDER_SUPPLIER_BUILDDOC')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEORDER_SUPPLIER_DISPATCH')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEORDER_SUPPLIER_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEORDER_SUPPLIER_UPDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Proposals
|
//MYECMDIR
|
||||||
elseif ($action == 'PROPAL_CREATE')
|
case 'MYECMDIR_DELETE':
|
||||||
{
|
case 'MYECMDIR_CREATE':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'MYECMDIR_MODIFY':
|
||||||
}
|
|
||||||
elseif ($action == 'PROPAL_CLONE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'PROPAL_MODIFY')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'PROPAL_VALIDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'PROPAL_BUILDDOC')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'PROPAL_SENTBYMAIL')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'PROPAL_CLOSE_SIGNED')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'PROPAL_CLOSE_REFUSED')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'PROPAL_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEPROPAL_INSERT')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEPROPAL_UPDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEPROPAL_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Contracts
|
// Customer orders
|
||||||
elseif ($action == 'CONTRACT_CREATE')
|
case 'ORDER_CREATE':
|
||||||
{
|
case 'ORDER_CLONE':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'ORDER_VALIDATE':
|
||||||
}
|
case 'ORDER_DELETE':
|
||||||
elseif ($action == 'CONTRACT_ACTIVATE')
|
case 'ORDER_BUILDDOC':
|
||||||
{
|
case 'ORDER_SENTBYMAIL':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'ORDER_CLASSIFY_BILLED':
|
||||||
}
|
case 'LINEORDER_INSERT':
|
||||||
elseif ($action == 'CONTRACT_CANCEL')
|
case 'LINEORDER_UPDATE':
|
||||||
{
|
case 'LINEORDER_DELETE':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'CONTRACT_CLOSE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'CONTRACT_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINECONTRACT_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINECONTRACT_UPDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINECONTRACT_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bills
|
// Supplier orders
|
||||||
elseif ($action == 'BILL_CREATE')
|
case 'ORDER_SUPPLIER_CREATE':
|
||||||
{
|
case 'ORDER_SUPPLIER_CLONE':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'ORDER_SUPPLIER_VALIDATE':
|
||||||
}
|
case 'ORDER_SUPPLIER_DELETE':
|
||||||
elseif ($action == 'BILL_CLONE')
|
case 'ORDER_SUPPLIER_APPROVE':
|
||||||
{
|
case 'ORDER_SUPPLIER_REFUSE':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'ORDER_SUPPLIER_CANCEL':
|
||||||
}
|
case 'ORDER_SUPPLIER_SENTBYMAIL':
|
||||||
elseif ($action == 'BILL_MODIFY')
|
case 'ORDER_SUPPLIER_BUILDDOC':
|
||||||
{
|
case 'LINEORDER_SUPPLIER_DISPATCH':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'LINEORDER_SUPPLIER_CREATE':
|
||||||
}
|
case 'LINEORDER_SUPPLIER_UPDATE':
|
||||||
elseif ($action == 'BILL_VALIDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'BILL_UNVALIDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'BILL_BUILDDOC')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'BILL_SENTBYMAIL')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'BILL_CANCEL')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'BILL_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'BILL_PAYED')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEBILL_INSERT')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEBILL_UPDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEBILL_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Supplier Bill
|
// Proposals
|
||||||
elseif ($action == 'BILL_SUPPLIER_CREATE')
|
case 'PROPAL_CREATE':
|
||||||
{
|
case 'PROPAL_CLONE':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'PROPAL_MODIFY':
|
||||||
}
|
case 'PROPAL_VALIDATE':
|
||||||
elseif ($action == 'BILL_SUPPLIER_UPDATE')
|
case 'PROPAL_BUILDDOC':
|
||||||
{
|
case 'PROPAL_SENTBYMAIL':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'PROPAL_CLOSE_SIGNED':
|
||||||
}
|
case 'PROPAL_CLOSE_REFUSED':
|
||||||
elseif ($action == 'BILL_SUPPLIER_DELETE')
|
case 'PROPAL_DELETE':
|
||||||
{
|
case 'LINEPROPAL_INSERT':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'LINEPROPAL_UPDATE':
|
||||||
}
|
case 'LINEPROPAL_DELETE':
|
||||||
elseif ($action == 'BILL_SUPPLIER_PAYED')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'BILL_SUPPLIER_UNPAYED')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'BILL_SUPPLIER_VALIDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEBILL_SUPPLIER_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEBILL_SUPPLIER_UPDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEBILL_SUPPLIER_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Payments
|
|
||||||
elseif ($action == 'PAYMENT_CUSTOMER_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'PAYMENT_SUPPLIER_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'PAYMENT_ADD_TO_BANK')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'PAYMENT_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Donation
|
|
||||||
elseif ($action == 'DON_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'DON_UPDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'DON_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Interventions
|
// Contracts
|
||||||
elseif ($action == 'FICHINTER_CREATE')
|
case 'CONTRACT_CREATE':
|
||||||
{
|
case 'CONTRACT_ACTIVATE':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'CONTRACT_CANCEL':
|
||||||
}
|
case 'CONTRACT_CLOSE':
|
||||||
elseif ($action == 'FICHINTER_MODIFY')
|
case 'CONTRACT_DELETE':
|
||||||
{
|
case 'LINECONTRACT_CREATE':
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
case 'LINECONTRACT_UPDATE':
|
||||||
}
|
case 'LINECONTRACT_DELETE':
|
||||||
elseif ($action == 'FICHINTER_VALIDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'FICHINTER_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEFICHINTER_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEFICHINTER_UPDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'LINEFICHINTER_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Members
|
|
||||||
elseif ($action == 'MEMBER_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'MEMBER_VALIDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'MEMBER_SUBSCRIPTION')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'MEMBER_MODIFY')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'MEMBER_NEW_PASSWORD')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'MEMBER_RESILIATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'MEMBER_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Categories
|
|
||||||
elseif ($action == 'CATEGORY_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'CATEGORY_MODIFY')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'CATEGORY_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Projects
|
|
||||||
elseif ($action == 'PROJECT_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'PROJECT_MODIFY')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'PROJECT_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Project tasks
|
|
||||||
elseif ($action == 'TASK_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'TASK_MODIFY')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'TASK_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Task time spent
|
|
||||||
elseif ($action == 'TASK_TIMESPENT_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'TASK_TIMESPENT_MODIFY')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'TASK_TIMESPENT_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Shipping
|
|
||||||
elseif ($action == 'SHIPPING_CREATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'SHIPPING_MODIFY')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'SHIPPING_VALIDATE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'SHIPPING_SENTBYMAIL')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'SHIPPING_DELETE')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
elseif ($action == 'SHIPPING_BUILDDOC')
|
|
||||||
{
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
// Bills
|
||||||
}
|
case 'BILL_CREATE':
|
||||||
|
case 'BILL_CLONE':
|
||||||
|
case 'BILL_MODIFY':
|
||||||
|
case 'BILL_VALIDATE':
|
||||||
|
case 'BILL_UNVALIDATE':
|
||||||
|
case 'BILL_BUILDDOC':
|
||||||
|
case 'BILL_SENTBYMAIL':
|
||||||
|
case 'BILL_CANCEL':
|
||||||
|
case 'BILL_DELETE':
|
||||||
|
case 'BILL_PAYED':
|
||||||
|
case 'LINEBILL_INSERT':
|
||||||
|
case 'LINEBILL_UPDATE':
|
||||||
|
case 'LINEBILL_DELETE':
|
||||||
|
|
||||||
}
|
//Supplier Bill
|
||||||
?>
|
case 'BILL_SUPPLIER_CREATE':
|
||||||
|
case 'BILL_SUPPLIER_UPDATE':
|
||||||
|
case 'BILL_SUPPLIER_DELETE':
|
||||||
|
case 'BILL_SUPPLIER_PAYED':
|
||||||
|
case 'BILL_SUPPLIER_UNPAYED':
|
||||||
|
case 'BILL_SUPPLIER_VALIDATE':
|
||||||
|
case 'LINEBILL_SUPPLIER_CREATE':
|
||||||
|
case 'LINEBILL_SUPPLIER_UPDATE':
|
||||||
|
case 'LINEBILL_SUPPLIER_DELETE':
|
||||||
|
|
||||||
|
// Payments
|
||||||
|
case 'PAYMENT_CUSTOMER_CREATE':
|
||||||
|
case 'PAYMENT_SUPPLIER_CREATE':
|
||||||
|
case 'PAYMENT_ADD_TO_BANK':
|
||||||
|
case 'PAYMENT_DELETE':
|
||||||
|
|
||||||
|
//Donation
|
||||||
|
case 'DON_CREATE':
|
||||||
|
case 'DON_UPDATE':
|
||||||
|
case 'DON_DELETE':
|
||||||
|
|
||||||
|
// Interventions
|
||||||
|
case 'FICHINTER_CREATE':
|
||||||
|
case 'FICHINTER_MODIFY':
|
||||||
|
case 'FICHINTER_VALIDATE':
|
||||||
|
case 'FICHINTER_DELETE':
|
||||||
|
case 'LINEFICHINTER_CREATE':
|
||||||
|
case 'LINEFICHINTER_UPDATE':
|
||||||
|
case 'LINEFICHINTER_DELETE':
|
||||||
|
|
||||||
|
// Members
|
||||||
|
case 'MEMBER_CREATE':
|
||||||
|
case 'MEMBER_VALIDATE':
|
||||||
|
case 'MEMBER_SUBSCRIPTION':
|
||||||
|
case 'MEMBER_MODIFY':
|
||||||
|
case 'MEMBER_NEW_PASSWORD':
|
||||||
|
case 'MEMBER_RESILIATE':
|
||||||
|
case 'MEMBER_DELETE':
|
||||||
|
|
||||||
|
// Categories
|
||||||
|
case 'CATEGORY_CREATE':
|
||||||
|
case 'CATEGORY_MODIFY':
|
||||||
|
case 'CATEGORY_DELETE':
|
||||||
|
|
||||||
|
// Projects
|
||||||
|
case 'PROJECT_CREATE':
|
||||||
|
case 'PROJECT_MODIFY':
|
||||||
|
case 'PROJECT_DELETE':
|
||||||
|
|
||||||
|
// Project tasks
|
||||||
|
case 'TASK_CREATE':
|
||||||
|
case 'TASK_MODIFY':
|
||||||
|
case 'TASK_DELETE':
|
||||||
|
|
||||||
|
// Task time spent
|
||||||
|
case 'TASK_TIMESPENT_CREATE':
|
||||||
|
case 'TASK_TIMESPENT_MODIFY':
|
||||||
|
case 'TASK_TIMESPENT_DELETE':
|
||||||
|
|
||||||
|
// Shipping
|
||||||
|
case 'SHIPPING_CREATE':
|
||||||
|
case 'SHIPPING_MODIFY':
|
||||||
|
case 'SHIPPING_VALIDATE':
|
||||||
|
case 'SHIPPING_SENTBYMAIL':
|
||||||
|
case 'SHIPPING_DELETE':
|
||||||
|
case 'SHIPPING_BUILDDOC':
|
||||||
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -305,7 +305,7 @@ class CategorieTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$localobject=new Categorie($this->savdb);
|
$localobject=new Categorie($this->savdb);
|
||||||
$result=$localobject->fetch($id);
|
$result=$localobject->fetch($id);
|
||||||
$result=$localobject->delete($id);
|
$result=$localobject->delete($user);
|
||||||
|
|
||||||
print __METHOD__." id=".$id." result=".$result."\n";
|
print __METHOD__." id=".$id." result=".$result."\n";
|
||||||
$this->assertGreaterThan(0, $result);
|
$this->assertGreaterThan(0, $result);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user