Fix code of triggers (disabled if module not enabled)

This commit is contained in:
Laurent Destailleur 2017-07-13 11:25:25 +02:00
parent 028f1f5133
commit 2141cfb282
7 changed files with 215 additions and 720 deletions

View File

@ -62,10 +62,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
// Module not active, we do nothing
if (empty($conf->agenda->enabled)) {
return 0;
}
if (empty($conf->agenda->enabled)) return 0; // Module not active, we do nothing
$key = 'MAIN_AGENDA_ACTIONAUTO_'.$action;
@ -651,25 +648,25 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("agenda");
$langs->load("other");
$langs->load("projects");
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProjectValidatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("ProjectValidatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Project").': '.$object->ref;
$object->sendtoid=0;
}
elseif($action == 'PROJECT_MODIFY') {
$langs->load("agenda");
$langs->load("other");
$langs->load("projects");
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProjectModifiedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("ProjectModifieddInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref;
$object->sendtoid=0;
}
// Project tasks
elseif($action == 'TASK_CREATE') {
$langs->load("agenda");
@ -708,18 +705,18 @@ class InterfaceActionsAuto extends DolibarrTriggers
}
// TODO Merge all previous cases into this generic one
else {
// Note: We are here only if $conf->global->MAIN_AGENDA_ACTIONAUTO_action is on (tested at begining of this function)
// Note: We are here only if $conf->global->MAIN_AGENDA_ACTIONAUTO_action is on (tested at begining of this function)
$langs->load("agenda");
$langs->load("other");
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities($action."InDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities($action."InDolibarr",$object->ref);
$object->sendtoid=0;
}
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
// Add entry in event table
@ -783,7 +780,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$actioncomm->elementtype = $object->element;
$ret=$actioncomm->create($user); // User creating action
if ($ret > 0 && $conf->global->MAIN_COPY_FILE_IN_EVENT_AUTO)
{
if (is_array($object->attachedfiles) && array_key_exists('paths',$object->attachedfiles) && count($object->attachedfiles['paths'])>0) {
@ -798,9 +795,9 @@ class InterfaceActionsAuto extends DolibarrTriggers
}
}
}
unset($object->actionmsg); unset($object->actionmsg2); unset($object->actiontypecode); // When several action are called on same object, we must be sure to not reuse value of first action.
if ($ret > 0)
{
$_SESSION['LAST_ACTION_CREATED'] = $ret;

View File

@ -46,10 +46,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
// Do not log events not enabled for this action
if (empty($conf->blockedlog->enabled)) {
return 0;
}
if (empty($conf->blockedlog->enabled)) return 0; // Module not active, we do nothing
if($action==='BILL_VALIDATE' || $action === 'BILL_PAYED' || $action==='BILL_UNPAYED'
|| $action === 'BILL_SENTBYMAIL' || $action === 'DOC_DOWNLOAD' || $action === 'DOC_PREVIEW') {

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php";
*/
class InterfaceMailmanSpipsynchro extends DolibarrTriggers
{
public $family = 'ldap';
public $family = 'mailmanspip';
public $description = "Triggers of this module allows to synchronize Mailman an Spip.";
public $version = self::VERSION_DOLIBARR;
public $picto = 'technic';
@ -51,12 +51,6 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers
{
if (empty($conf->mailmanspip->enabled)) return 0; // Module not active, we do nothing
if (! function_exists('ldap_connect'))
{
dol_syslog("Warning, module LDAP is enabled but LDAP functions not available in this PHP", LOG_WARNING);
return 0;
}
if ($action == 'CATEGORY_LINK')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);

View File

@ -65,7 +65,7 @@ class InterfaceNotification extends DolibarrTriggers
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify = new Notify($this->db);
if (! in_array($action, $notify->arrayofnotifsupported)) return 0;
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);

View File

@ -1,275 +0,0 @@
<?php
/* Copyright (C) 2005-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@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/>.
*/
/**
* \file htdocs/core/triggers/interface_90_all_Demo.class.php
* \ingroup core
* \brief Fichier de demo de personalisation des actions du workflow
* \remarks Son propre fichier d'actions peut etre cree par recopie de celui-ci:
* - Le nom du fichier doit etre: interface_99_modMymodule_Mytrigger.class.php
* ou: interface_99_all_Mytrigger.class.php
* - Le fichier doit rester stocke dans core/triggers
* - Le nom de la classe doit etre InterfaceMytrigger
* - Le nom de la propriete name doit etre Mytrigger
*/
require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
/**
* Class of triggers for demo module
*/
class InterfaceDemo extends DolibarrTriggers
{
public $family = 'demo';
public $picto = 'technic';
public $description = "Triggers of this module are empty functions. They have no effect. They are provided for tutorial purpose only.";
public $version = self::VERSION_DOLIBARR;
/**
* Function called when a Dolibarrr business event is done.
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
*
* @param string $action Event action code
* @param Object $object Object concerned. Some context information may also be provided into array property object->context.
* @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 runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
// Put here code you want to execute when a Dolibarr business events occurs.
// Data and type of action are stored into $object and $action
switch ($action) {
// Users
case 'USER_CREATE':
case 'USER_MODIFY':
case 'USER_NEW_PASSWORD':
case 'USER_ENABLEDISABLE':
case 'USER_DELETE':
case 'USER_SETINGROUP':
case 'USER_REMOVEFROMGROUP':
case 'USER_LOGIN':
case 'USER_LOGIN_FAILED':
case 'USER_LOGOUT':
// Actions
case 'ACTION_MODIFY':
case 'ACTION_CREATE':
case 'ACTION_DELETE':
// Groups
case 'GROUP_CREATE':
case 'GROUP_MODIFY':
case 'GROUP_DELETE':
// Companies
case 'COMPANY_CREATE':
case 'COMPANY_MODIFY':
case 'COMPANY_DELETE':
// Contacts
case 'CONTACT_CREATE':
case 'CONTACT_MODIFY':
case 'CONTACT_DELETE':
case 'CONTACT_ENABLEDISABLE':
// Products
case 'PRODUCT_CREATE':
case 'PRODUCT_MODIFY':
case 'PRODUCT_DELETE':
case 'PRODUCT_PRICE_MODIFY':
case 'PRODUCT_SET_MULTILANGS':
case 'PRODUCT_DEL_MULTILANGS':
//Stock mouvement
case 'STOCK_MOVEMENT':
//MYECMDIR
case 'MYECMDIR_DELETE':
case 'MYECMDIR_CREATE':
case 'MYECMDIR_MODIFY':
// Customer orders
case 'ORDER_CREATE':
case 'ORDER_CLONE':
case 'ORDER_VALIDATE':
case 'ORDER_DELETE':
case 'ORDER_CANCEL':
case 'ORDER_SENTBYMAIL':
case 'ORDER_CLASSIFY_BILLED':
case 'ORDER_SETDRAFT':
case 'LINEORDER_INSERT':
case 'LINEORDER_UPDATE':
case 'LINEORDER_DELETE':
// Supplier orders
case 'ORDER_SUPPLIER_CREATE':
case 'ORDER_SUPPLIER_CLONE':
case 'ORDER_SUPPLIER_VALIDATE':
case 'ORDER_SUPPLIER_DELETE':
case 'ORDER_SUPPLIER_APPROVE':
case 'ORDER_SUPPLIER_REFUSE':
case 'ORDER_SUPPLIER_CANCEL':
case 'ORDER_SUPPLIER_SENTBYMAIL':
case 'ORDER_SUPPLIER_DISPATCH':
case 'LINEORDER_SUPPLIER_DISPATCH':
case 'LINEORDER_SUPPLIER_CREATE':
case 'LINEORDER_SUPPLIER_UPDATE':
// Proposals
case 'PROPAL_CREATE':
case 'PROPAL_CLONE':
case 'PROPAL_MODIFY':
case 'PROPAL_VALIDATE':
case 'PROPAL_SENTBYMAIL':
case 'PROPAL_CLOSE_SIGNED':
case 'PROPAL_CLOSE_REFUSED':
case 'PROPAL_DELETE':
case 'LINEPROPAL_INSERT':
case 'LINEPROPAL_UPDATE':
case 'LINEPROPAL_DELETE':
// SupplierProposal
case 'SUPPLIER_PROPOSAL_CREATE':
case 'SUPPLIER_PROPOSAL_CLONE':
case 'SUPPLIER_PROPOSAL_MODIFY':
case 'SUPPLIER_PROPOSAL_VALIDATE':
case 'SUPPLIER_PROPOSAL_SENTBYMAIL':
case 'SUPPLIER_PROPOSAL_CLOSE_SIGNED':
case 'SUPPLIER_PROPOSAL_CLOSE_REFUSED':
case 'SUPPLIER_PROPOSAL_DELETE':
case 'LINESUPPLIER_PROPOSAL_INSERT':
case 'LINESUPPLIER_PROPOSAL_UPDATE':
case 'LINESUPPLIER_PROPOSAL_DELETE':
// Contracts
case 'CONTRACT_CREATE':
case 'CONTRACT_ACTIVATE':
case 'CONTRACT_CANCEL':
case 'CONTRACT_CLOSE':
case 'CONTRACT_DELETE':
case 'LINECONTRACT_INSERT':
case 'LINECONTRACT_UPDATE':
case 'LINECONTRACT_DELETE':
// Bills
case 'BILL_CREATE':
case 'BILL_CLONE':
case 'BILL_MODIFY':
case 'BILL_VALIDATE':
case 'BILL_UNVALIDATE':
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 'BILL_SUPPLIER_UNVALIDATE':
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':
// Online
case 'PAYMENT_PAYBOX_OK':
case 'PAYMENT_PAYPAL_OK':
case 'PAYMENT_STRIPE_OK':
// 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':
case 'CATEGORY_SET_MULTILANGS':
// 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_BILLED':
case 'SHIPPING_CLOSED':
case 'SHIPPING_REOPEN':
case 'SHIPPING_DELETE':
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
break;
}
return 0;
}
}

View File

@ -5,7 +5,7 @@ ErrorAddCurrencyFail=Error in added currency
ErrorDeleteCurrencyFail=Error delete fail
multicurrency_syncronize_error=Synchronisation error: %s
MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE=Use date of document to find currency rate, instead of using latest known rate
multicurrency_useOriginTx=When an object is created from another, keep the original rate of source object (otherwise use the new known rate)
multicurrency_useOriginTx=When an object is created from another, keep the original rate of source object (otherwise use the latest known rate)
CurrencyLayerAccount=CurrencyLayer API
CurrencyLayerAccount_help_to_synchronize=You sould create an account on their website to use this functionnality<br />Get your <b>API key</b><br />If you use a free account you can't change the <b>currency source</b> (USD by default)<br />But if your main currency isn't USD you can use the <b>alternate currency source</b> to force you main currency<br /><br />You are limited at 1000 synchronizations per month
multicurrency_appId=API key

View File

@ -97,439 +97,221 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
*/
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
// Put here code you want to execute when a Dolibarr business events occurs.
if (!empty($conf->mymodule->enabled)) return 0; // Module not active, we do nothing
// Put here code you want to execute when a Dolibarr business events occurs.
// Data and type of action are stored into $object and $action
/** Users */
if ($action == 'USER_LOGIN') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} elseif ($action == 'USER_UPDATE_SESSION') {
// Warning: To increase performances, this action is triggered only if
// constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1.
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} elseif ($action == 'USER_CREATE') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} elseif ($action == 'USER_CREATE_FROM_CONTACT') {
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_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
);
switch ($action) {
/** 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
);
// Users
case 'USER_CREATE':
case 'USER_MODIFY':
case 'USER_NEW_PASSWORD':
case 'USER_ENABLEDISABLE':
case 'USER_DELETE':
case 'USER_SETINGROUP':
case 'USER_REMOVEFROMGROUP':
/** 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
);
case 'USER_LOGIN':
case 'USER_LOGIN_FAILED':
case 'USER_LOGOUT':
case 'USER_UPDATE_SESSION': // Warning: To increase performances, this action is triggered only if constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1.
/** Contacts */
} elseif ($action == 'CONTACT_CREATE') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} 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
);
// Products
} elseif ($action == 'PRODUCT_CREATE') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} 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
);
// Actions
case 'ACTION_MODIFY':
case 'ACTION_CREATE':
case 'ACTION_DELETE':
/** Customer orders */
} elseif ($action == 'ORDER_CREATE') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} 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 == 'LINEORDER_INSERT') {
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
);
// Groups
case 'GROUP_CREATE':
case 'GROUP_MODIFY':
case 'GROUP_DELETE':
/** Supplier orders */
} elseif ($action == 'ORDER_SUPPLIER_CREATE') {
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_SENTBYMAIL') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} elseif ($action == 'SUPPLIER_ORDER_BUILDDOC') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
// Companies
case 'COMPANY_CREATE':
case 'COMPANY_MODIFY':
case 'COMPANY_DELETE':
/** Proposals */
} elseif ($action == 'PROPAL_CREATE') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} 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_MODIFY') {
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
);
// Contacts
case 'CONTACT_CREATE':
case 'CONTACT_MODIFY':
case 'CONTACT_DELETE':
case 'CONTACT_ENABLEDISABLE':
/** Contracts */
} elseif ($action == 'CONTRACT_CREATE') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} elseif ($action == 'CONTRACT_MODIFY') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} elseif ($action == 'CONTRACT_ACTIVATE') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} elseif ($action == 'CONTRACT_CANCEL') {
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
);
// Products
case 'PRODUCT_CREATE':
case 'PRODUCT_MODIFY':
case 'PRODUCT_DELETE':
case 'PRODUCT_PRICE_MODIFY':
case 'PRODUCT_SET_MULTILANGS':
case 'PRODUCT_DEL_MULTILANGS':
/** Bills */
} elseif ($action == 'BILL_CREATE') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} elseif ($action == 'BILL_CLONE') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} elseif ($action == 'BILL_MODIFY') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} elseif ($action == 'BILL_VALIDATE') {
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 == 'LINEBILL_INSERT') {
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
);
//Stock mouvement
case 'STOCK_MOVEMENT':
/** 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
);
//MYECMDIR
case 'MYECMDIR_DELETE':
case 'MYECMDIR_CREATE':
case 'MYECMDIR_MODIFY':
/** Interventions */
} elseif ($action == 'FICHEINTER_CREATE') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} elseif ($action == 'FICHEINTER_MODIFY') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} elseif ($action == 'FICHEINTER_VALIDATE') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} elseif ($action == 'FICHEINTER_DELETE') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
// Customer orders
case 'ORDER_CREATE':
case 'ORDER_CLONE':
case 'ORDER_VALIDATE':
case 'ORDER_DELETE':
case 'ORDER_CANCEL':
case 'ORDER_SENTBYMAIL':
case 'ORDER_CLASSIFY_BILLED':
case 'ORDER_SETDRAFT':
case 'LINEORDER_INSERT':
case 'LINEORDER_UPDATE':
case 'LINEORDER_DELETE':
/** 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
);
// Supplier orders
case 'ORDER_SUPPLIER_CREATE':
case 'ORDER_SUPPLIER_CLONE':
case 'ORDER_SUPPLIER_VALIDATE':
case 'ORDER_SUPPLIER_DELETE':
case 'ORDER_SUPPLIER_APPROVE':
case 'ORDER_SUPPLIER_REFUSE':
case 'ORDER_SUPPLIER_CANCEL':
case 'ORDER_SUPPLIER_SENTBYMAIL':
case 'ORDER_SUPPLIER_DISPATCH':
case 'LINEORDER_SUPPLIER_DISPATCH':
case 'LINEORDER_SUPPLIER_CREATE':
case 'LINEORDER_SUPPLIER_UPDATE':
/** 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
);
// Proposals
case 'PROPAL_CREATE':
case 'PROPAL_CLONE':
case 'PROPAL_MODIFY':
case 'PROPAL_VALIDATE':
case 'PROPAL_SENTBYMAIL':
case 'PROPAL_CLOSE_SIGNED':
case 'PROPAL_CLOSE_REFUSED':
case 'PROPAL_DELETE':
case 'LINEPROPAL_INSERT':
case 'LINEPROPAL_UPDATE':
case 'LINEPROPAL_DELETE':
/** 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
);
// SupplierProposal
case 'SUPPLIER_PROPOSAL_CREATE':
case 'SUPPLIER_PROPOSAL_CLONE':
case 'SUPPLIER_PROPOSAL_MODIFY':
case 'SUPPLIER_PROPOSAL_VALIDATE':
case 'SUPPLIER_PROPOSAL_SENTBYMAIL':
case 'SUPPLIER_PROPOSAL_CLOSE_SIGNED':
case 'SUPPLIER_PROPOSAL_CLOSE_REFUSED':
case 'SUPPLIER_PROPOSAL_DELETE':
case 'LINESUPPLIER_PROPOSAL_INSERT':
case 'LINESUPPLIER_PROPOSAL_UPDATE':
case 'LINESUPPLIER_PROPOSAL_DELETE':
/** 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
);
// Contracts
case 'CONTRACT_CREATE':
case 'CONTRACT_ACTIVATE':
case 'CONTRACT_CANCEL':
case 'CONTRACT_CLOSE':
case 'CONTRACT_DELETE':
case 'LINECONTRACT_INSERT':
case 'LINECONTRACT_UPDATE':
case 'LINECONTRACT_DELETE':
/** 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
);
// Bills
case 'BILL_CREATE':
case 'BILL_CLONE':
case 'BILL_MODIFY':
case 'BILL_VALIDATE':
case 'BILL_UNVALIDATE':
case 'BILL_SENTBYMAIL':
case 'BILL_CANCEL':
case 'BILL_DELETE':
case 'BILL_PAYED':
case 'LINEBILL_INSERT':
case 'LINEBILL_UPDATE':
case 'LINEBILL_DELETE':
/** File */
} elseif ($action == 'FILE_UPLOAD') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
} elseif ($action == 'FILE_DELETE') {
dol_syslog(
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
);
}
//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 'BILL_SUPPLIER_UNVALIDATE':
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':
// Online
case 'PAYMENT_PAYBOX_OK':
case 'PAYMENT_PAYPAL_OK':
case 'PAYMENT_STRIPE_OK':
// 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':
case 'CATEGORY_SET_MULTILANGS':
// 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_BILLED':
case 'SHIPPING_CLOSED':
case 'SHIPPING_REOPEN':
case 'SHIPPING_DELETE':
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
break;
}
return 0;
}