Fix name of variable $trigger_name into $triggersendname

This commit is contained in:
Laurent Destailleur 2019-12-02 09:38:16 +01:00
parent b678100c8d
commit 92070fa491
37 changed files with 60 additions and 59 deletions

View File

@ -822,7 +822,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name = 'MEMBER_SENTBYMAIL'; $triggersendname = 'MEMBER_SENTBYMAIL';
$paramname = 'id'; $paramname = 'id';
$mode = 'emailfrommember'; $mode = 'emailfrommember';
$trackid = 'mem'.$object->id; $trackid = 'mem'.$object->id;

View File

@ -95,7 +95,7 @@ if ($action == 'update' && empty($_POST["cancel"]))
// Actions to send emails // Actions to send emails
$id = 0; $id = 0;
$actiontypecode = ''; // Not an event for agenda $actiontypecode = ''; // Not an event for agenda
$trigger_name = ''; // Disable triggers $triggersendname = ''; // Disable triggers
$paramname = 'id'; $paramname = 'id';
$mode = 'emailfortest'; $mode = 'emailfortest';
$trackid = (($action == 'testhtml') ? "testhtml" : "test"); $trackid = (($action == 'testhtml') ? "testhtml" : "test");

View File

@ -77,7 +77,7 @@ if ($action == 'update' && empty($_POST["cancel"]))
// Actions to send emails // Actions to send emails
$id=0; $id=0;
$actiontypecode=''; // Not an event for agenda $actiontypecode=''; // Not an event for agenda
$trigger_name=''; // Disable triggers $triggersendname = ''; // Disable triggers
$paramname='id'; $paramname='id';
$mode='emailfortest'; $mode='emailfortest';
$trackid=(($action == 'testhtml')?"testhtml":"test"); $trackid=(($action == 'testhtml')?"testhtml":"test");

View File

@ -97,7 +97,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name = 'ASSET_SENTBYMAIL'; $triggersendname = 'ASSET_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_ASSET_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_ASSET_TO';
$trackid = 'asset'.$object->id; $trackid = 'asset'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -119,7 +119,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name = 'BOM_SENTBYMAIL'; $triggersendname = 'BOM_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_BOM_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_BOM_TO';
$trackid = 'bom'.$object->id; $trackid = 'bom'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -781,7 +781,7 @@ if (empty($reshook))
// Actions to send emails // Actions to send emails
$actiontypecode = 'AC_OTH_AUTO'; $actiontypecode = 'AC_OTH_AUTO';
$trigger_name = 'PROPAL_SENTBYMAIL'; $triggersendname = 'PROPAL_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_PROPOSAL_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_PROPOSAL_TO';
$trackid = 'pro'.$object->id; $trackid = 'pro'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -2501,11 +2501,11 @@ class Propal extends CommonObject
if ($resql) if ($resql)
{ {
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->modelpdf; $modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->modelpdf;
$trigger_name = 'PROPAL_CLOSE_REFUSED'; $triggerName = 'PROPAL_CLOSE_REFUSED';
if ($statut == self::STATUS_SIGNED) if ($statut == self::STATUS_SIGNED)
{ {
$trigger_name = 'PROPAL_CLOSE_SIGNED'; $triggerName = 'PROPAL_CLOSE_SIGNED';
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL : $this->modelpdf; $modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL : $this->modelpdf;
// The connected company is classified as a client // The connected company is classified as a client
@ -2522,7 +2522,7 @@ class Propal extends CommonObject
} }
if ($statut == self::STATUS_BILLED) // Why this ? if ($statut == self::STATUS_BILLED) // Why this ?
{ {
$trigger_name = 'PROPAL_CLASSIFY_BILLED'; $triggerName = 'PROPAL_CLASSIFY_BILLED';
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
@ -2550,7 +2550,7 @@ class Propal extends CommonObject
if (!$notrigger && empty($error)) if (!$notrigger && empty($error))
{ {
// Call trigger // Call trigger
$result = $this->call_trigger($trigger_name, $user); $result = $this->call_trigger($triggerName, $user);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
// End call triggers // End call triggers
} }

View File

@ -1415,7 +1415,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name = 'ORDER_SENTBYMAIL'; $triggersendname = 'ORDER_SENTBYMAIL';
$paramname = 'id'; $paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_ORDER_TO'; // used to know the automatic BCC to add $autocopy = 'MAIN_MAIL_AUTOCOPY_ORDER_TO'; // used to know the automatic BCC to add
$trackid = 'ord'.$object->id; $trackid = 'ord'.$object->id;

View File

@ -223,7 +223,7 @@ if (empty($reshook))
$permissiontoread = $user->rights->commande->lire; $permissiontoread = $user->rights->commande->lire;
$permissiontodelete = $user->rights->commande->supprimer; $permissiontodelete = $user->rights->commande->supprimer;
$uploaddir = $conf->commande->multidir_output[$conf->entity]; $uploaddir = $conf->commande->multidir_output[$conf->entity];
$trigger_name = 'ORDER_SENTBYMAIL'; $triggersendname = 'ORDER_SENTBYMAIL';
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
} }

View File

@ -2481,7 +2481,7 @@ if (empty($reshook))
// Actions to send emails // Actions to send emails
if (empty($id)) $id = $facid; if (empty($id)) $id = $facid;
$trigger_name = 'BILL_SENTBYMAIL'; $triggersendname = 'BILL_SENTBYMAIL';
$paramname = 'id'; $paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_INVOICE_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_INVOICE_TO';
$trackid = 'inv'.$object->id; $trackid = 'inv'.$object->id;

View File

@ -482,7 +482,7 @@ if (empty($reshook))
} }
// Actions to send emails // Actions to send emails
$trigger_name = 'CONTACT_SENTBYMAIL'; $triggersendname = 'CONTACT_SENTBYMAIL';
$paramname = 'id'; $paramname = 'id';
$mode = 'emailfromcontact'; $mode = 'emailfromcontact';
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -1002,7 +1002,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name = 'CONTRACT_SENTBYMAIL'; $triggersendname = 'CONTRACT_SENTBYMAIL';
$paramname = 'id'; $paramname = 'id';
$mode = 'emailfromcontract'; $mode = 'emailfromcontract';
$trackid = 'con'.$object->id; $trackid = 'con'.$object->id;

View File

@ -26,7 +26,7 @@
// $id must be defined // $id must be defined
// $paramname may be defined // $paramname may be defined
// $autocopy may be defined (used to know the automatic BCC to add) // $autocopy may be defined (used to know the automatic BCC to add)
// $trigger_name must be set (can be '') // $triggersendname must be set (can be '')
// $actiontypecode can be set // $actiontypecode can be set
// $object and $uobject may be defined // $object and $uobject may be defined
@ -453,12 +453,12 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
$object->email_subject = $subject; $object->email_subject = $subject;
$object->email_msgid = $mailfile->msgid; $object->email_msgid = $mailfile->msgid;
// Call of triggers // Call of triggers (you should have set $triggersendname to execute trigger. $trigger_name is deprcated)
if (! empty($trigger_name)) if (! empty($triggersendname) || ! empty($trigger_name))
{ {
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db); $interface=new Interfaces($db);
$result=$interface->run_triggers($trigger_name, $object, $user, $langs, $conf); $result=$interface->run_triggers(empty($triggersendname)?$trigger_name:$triggersendname, $object, $user, $langs, $conf);
if ($result < 0) { if ($result < 0) {
setEventMessages($interface->error, $interface->errors, 'errors'); setEventMessages($interface->error, $interface->errors, 'errors');
} }

View File

@ -4956,11 +4956,11 @@ abstract class CommonObject
* NB: Error from trigger are stacked in interface->errors * NB: Error from trigger are stacked in interface->errors
* NB2: If return code of triggers are < 0, action calling trigger should cancel all transaction. * NB2: If return code of triggers are < 0, action calling trigger should cancel all transaction.
* *
* @param string $trigger_name trigger's name to execute * @param string $triggerName trigger's name to execute
* @param User $user Object user * @param User $user Object user
* @return int Result of run_triggers * @return int Result of run_triggers
*/ */
public function call_trigger($trigger_name, $user) public function call_trigger($triggerName, $user)
{ {
// phpcs:enable // phpcs:enable
global $langs, $conf; global $langs, $conf;
@ -4972,7 +4972,7 @@ abstract class CommonObject
include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/interfaces.class.php';
$interface = new Interfaces($this->db); $interface = new Interfaces($this->db);
$result = $interface->run_triggers($trigger_name, $this, $user, $langs, $conf); $result = $interface->run_triggers($triggerName, $this, $user, $langs, $conf);
if ($result < 0) if ($result < 0)
{ {

View File

@ -795,18 +795,18 @@ class EcmDirectory // extends CommonObject
* NB2: if trigger fail, action should be canceled. * NB2: if trigger fail, action should be canceled.
* NB3: Should be deleted if EcmDirectory extend CommonObject * NB3: Should be deleted if EcmDirectory extend CommonObject
* *
* @param string $trigger_name trigger's name to execute * @param string $triggerName trigger's name to execute
* @param User $user Object user * @param User $user Object user
* @return int Result of run_triggers * @return int Result of run_triggers
*/ */
public function call_trigger($trigger_name, $user) public function call_trigger($triggerName, $user)
{ {
// phpcs:enable // phpcs:enable
global $langs,$conf; global $langs,$conf;
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($this->db); $interface=new Interfaces($this->db);
$result=$interface->run_triggers($trigger_name, $this, $user, $langs, $conf); $result=$interface->run_triggers($triggerName, $this, $user, $langs, $conf);
if ($result < 0) { if ($result < 0) {
if (!empty($this->errors)) if (!empty($this->errors))
{ {

View File

@ -849,7 +849,7 @@ if (empty($reshook))
// Actions to send emails // Actions to send emails
if (empty($id)) $id = $facid; if (empty($id)) $id = $facid;
$trigger_name = 'SHIPPING_SENTBYMAIL'; $triggersendname = 'SHIPPING_SENTBYMAIL';
$paramname = 'id'; $paramname = 'id';
$mode = 'emailfromshipment'; $mode = 'emailfromshipment';
$trackid = 'shi'.$object->id; $trackid = 'shi'.$object->id;

View File

@ -1411,7 +1411,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name = 'EXPENSEREPORT_SENTBYMAIL'; $triggersendname = 'EXPENSEREPORT_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_EXPENSEREPORT_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_EXPENSEREPORT_TO';
$trackid = 'exp'.$object->id; $trackid = 'exp'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -721,7 +721,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name = 'FICHINTER_SENTBYMAIL'; $triggersendname = 'FICHINTER_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_FICHINTER_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_FICHINTER_TO';
$trackid = 'int'.$object->id; $trackid = 'int'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -2420,18 +2420,19 @@ class CommandeFournisseur extends CommonOrder
if ($resql) if ($resql)
{ {
// Trigger names for each status // Trigger names for each status
$trigger_name[0] = 'DRAFT'; $triggerName = array();
$trigger_name[1] = 'VALIDATED'; $triggerName[0] = 'DRAFT';
$trigger_name[2] = 'APPROVED'; $triggerName[1] = 'VALIDATED';
$trigger_name[3] = 'ORDERED'; // Ordered $triggerName[2] = 'APPROVED';
$trigger_name[4] = 'RECEIVED_PARTIALLY'; $triggerName[3] = 'ORDERED'; // Ordered
$trigger_name[5] = 'RECEIVED_COMPLETELY'; $triggerName[4] = 'RECEIVED_PARTIALLY';
$trigger_name[6] = 'CANCELED'; $triggerName[5] = 'RECEIVED_COMPLETELY';
$trigger_name[7] = 'CANCELED'; $triggerName[6] = 'CANCELED';
$trigger_name[9] = 'REFUSED'; $triggerName[7] = 'CANCELED';
$triggerName[9] = 'REFUSED';
// Call trigger // Call trigger
$result = $this->call_trigger("ORDER_SUPPLIER_STATUS_".$trigger_name[$status], $user); $result = $this->call_trigger("ORDER_SUPPLIER_STATUS_".$triggerName[$status], $user);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
// End call triggers // End call triggers
} }

View File

@ -1028,7 +1028,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name = 'ORDER_SUPPLIER_SENTBYMAIL'; $triggersendname = 'ORDER_SUPPLIER_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO';
$trackid = 'sor'.$object->id; $trackid = 'sor'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -1497,7 +1497,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name = 'BILL_SUPPLIER_SENTBYMAIL'; $triggersendname = 'BILL_SUPPLIER_SENTBYMAIL';
$paramname = 'id'; $paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO';
$trackid = 'sin'.$object->id; $trackid = 'sin'.$object->id;

View File

@ -872,7 +872,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name='HOLIDAY_SENTBYMAIL'; $triggersendname = 'HOLIDAY_SENTBYMAIL';
$autocopy='MAIN_MAIL_AUTOCOPY_HOLIDAY_TO'; $autocopy='MAIN_MAIL_AUTOCOPY_HOLIDAY_TO';
$trackid='leav'.$object->id; $trackid='leav'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -160,7 +160,7 @@ if (empty($reshook))
} }
// Actions to send emails // Actions to send emails
$trigger_name = 'MYOBJECT_SENTBYMAIL'; $triggersendname = 'MYOBJECT_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_MYOBJECT_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
$trackid = 'myobject'.$object->id; $trackid = 'myobject'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -146,7 +146,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name = 'MO_SENTBYMAIL'; $triggersendname = 'MO_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_MO_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_MO_TO';
$trackid = 'mo'.$object->id; $trackid = 'mo'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -133,7 +133,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name = 'MO_SENTBYMAIL'; $triggersendname = 'MO_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_MO_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_MO_TO';
$trackid = 'mo'.$object->id; $trackid = 'mo'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -112,7 +112,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails // Actions to send emails
/*$trigger_name='MYOBJECT_SENTBYMAIL'; /*$triggersendname = 'MYOBJECT_SENTBYMAIL';
$autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO'; $autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
$trackid='myobject'.$object->id; $trackid='myobject'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/ include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/

View File

@ -119,7 +119,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails // Actions to send emails
/*$trigger_name='MYOBJECT_SENTBYMAIL'; /*$triggersendname = 'MYOBJECT_SENTBYMAIL';
$autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO'; $autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
$trackid='myobject'.$object->id; $trackid='myobject'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/ include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/

View File

@ -456,7 +456,7 @@ if (empty($reshook))
} }
// Actions to send emails // Actions to send emails
$trigger_name = 'PROJECT_SENTBYMAIL'; $triggersendname = 'PROJECT_SENTBYMAIL';
$paramname = 'id'; $paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_PROJECT_TO'; // used to know the automatic BCC to add $autocopy = 'MAIN_MAIL_AUTOCOPY_PROJECT_TO'; // used to know the automatic BCC to add
$trackid = 'proj'.$object->id; $trackid = 'proj'.$object->id;

View File

@ -198,7 +198,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
//$object->doActions($action); //$object->doActions($action);
// Actions to send emails (for ticket, we need to manage the addfile and removefile only) // Actions to send emails (for ticket, we need to manage the addfile and removefile only)
$trigger_name = 'TICKET_SENTBYMAIL'; $triggersendname = 'TICKET_SENTBYMAIL';
$paramname = 'id'; $paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add $autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add
$trackid = 'tic'.$object->id; $trackid = 'tic'.$object->id;

View File

@ -688,7 +688,7 @@ if (empty($reshook))
// Actions to send emails // Actions to send emails
if (empty($id)) $id = $facid; if (empty($id)) $id = $facid;
$trigger_name = 'RECEPTION_SENTBYMAIL'; $triggersendname = 'RECEPTION_SENTBYMAIL';
$paramname = 'id'; $paramname = 'id';
$mode = 'emailfromreception'; $mode = 'emailfromreception';
$trackid = 'shi'.$object->id; $trackid = 'shi'.$object->id;

View File

@ -862,7 +862,7 @@ if (empty($reshook))
$object->fetch($socid); $object->fetch($socid);
// Actions to send emails // Actions to send emails
$trigger_name = 'COMPANY_SENTBYMAIL'; $triggersendname = 'COMPANY_SENTBYMAIL';
$paramname = 'socid'; $paramname = 'socid';
$mode = 'emailfromthirdparty'; $mode = 'emailfromthirdparty';
$trackid = 'thi'.$object->id; $trackid = 'thi'.$object->id;

View File

@ -491,7 +491,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name = 'PROPOSAL_SUPPLIER_SENTBYMAIL'; $triggersendname = 'PROPOSAL_SUPPLIER_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO';
$trackid = 'spr'.$object->id; $trackid = 'spr'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -1729,11 +1729,11 @@ class SupplierProposal extends CommonObject
if ($resql) if ($resql)
{ {
$modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED:$this->modelpdf; $modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_CLOSED:$this->modelpdf;
$trigger_name='SUPPLIER_PROPOSAL_CLOSE_REFUSED'; $triggerName = 'SUPPLIER_PROPOSAL_CLOSE_REFUSED';
if ($status == 2) if ($status == 2)
{ {
$trigger_name='SUPPLIER_PROPOSAL_CLOSE_SIGNED'; $triggerName='SUPPLIER_PROPOSAL_CLOSE_SIGNED';
$modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL:$this->modelpdf; $modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL:$this->modelpdf;
if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) // TODO This option was not tested correctly. Error if product ref does not exists if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) // TODO This option was not tested correctly. Error if product ref does not exists
@ -1743,7 +1743,7 @@ class SupplierProposal extends CommonObject
} }
if ($status == 4) if ($status == 4)
{ {
$trigger_name='SUPPLIER_PROPOSAL_CLASSIFY_BILLED'; $triggerName='SUPPLIER_PROPOSAL_CLASSIFY_BILLED';
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
@ -1760,7 +1760,7 @@ class SupplierProposal extends CommonObject
} }
// Call trigger // Call trigger
$result=$this->call_trigger($trigger_name, $user); $result=$this->call_trigger($triggerName, $user);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
// End call triggers // End call triggers

View File

@ -593,7 +593,7 @@ $permissiontoadd = $user->rights->ticket->write;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name = 'TICKET_SENTBYMAIL'; $triggersendname = 'TICKET_SENTBYMAIL';
$paramname = 'id'; $paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add $autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add
$trackid = 'tic'.$object->id; $trackid = 'tic'.$object->id;

View File

@ -657,7 +657,7 @@ if (empty($reshook)) {
} }
// Actions to send emails // Actions to send emails
$trigger_name = 'USER_SENTBYMAIL'; $triggersendname = 'USER_SENTBYMAIL';
$paramname = 'id'; // Name of param key to open the card $paramname = 'id'; // Name of param key to open the card
$mode = 'emailfromuser'; $mode = 'emailfromuser';
$trackid = 'use'.$id; $trackid = 'use'.$id;

View File

@ -97,7 +97,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name = 'WEBSITEACCOUNT_SENTBYMAIL'; $triggersendname = 'WEBSITEACCOUNT_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_WEBSITEACCOUNT_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_WEBSITEACCOUNT_TO';
$trackid = 'websiteaccount'.$object->id; $trackid = 'websiteaccount'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';

View File

@ -138,7 +138,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails // Actions to send emails
$trigger_name = 'MYOBJECT_SENTBYMAIL'; $triggersendname = 'MYOBJECT_SENTBYMAIL';
$autocopy = 'MAIN_MAIL_AUTOCOPY_MYOBJECT_TO'; $autocopy = 'MAIN_MAIL_AUTOCOPY_MYOBJECT_TO';
$trackid = 'myobject'.$object->id; $trackid = 'myobject'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';