diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 6ab6b6943a7e8..d93737ca6391c 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -615,6 +615,9 @@ if ($triggername == 'SUPPLIERPROPOSAL_SENTBYMAIL') { $triggername = 'PROPOSAL_SUPPLIER_SENTBYMAIL'; } + if ($triggername == 'PROJET_SENTBYMAIL') { + $triggername = 'PROJECT_SENTBYMAIL'; + } if (!empty($triggername)) { // Call trigger diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 60ea49928c94a..f31a4c2c93e29 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -848,6 +848,19 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf } $object->sendtoid = 0; + } elseif ($action == 'PROJECT_SENTBYMAIL') { + // Load translation files required by the page + $langs->loadLangs(array("agenda", "other", "projects")); + + if (empty($object->actionmsg2)) { + $object->actionmsg2 = $langs->transnoentities("ProjectSentByEMail", $object->ref); + } + if (empty($object->actionmsg)) { + $object->actionmsg = $langs->transnoentities("ProjectSentByEMail", $object->ref); + } + + // Parameters $object->sendtoid defined by caller + //$object->sendtoid=0; } elseif ($action == 'TASK_CREATE') { // Project tasks // Load translation files required by the page diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql index e4936c53ba374..83d4bb6e775a3 100644 --- a/htdocs/install/mysql/data/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql @@ -126,6 +126,7 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_VALIDATE','Project validation','Executed when a project is validated','project',141); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_MODIFY','Project modified','Executed when a project is modified','project',142); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_DELETE','Project deleted','Executed when a project is deleted','project',143); +insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_SENTBYMAIL','Project sent by mail','Executed when a project is sent by email','project',144); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_CREATE','Ticket created','Executed when a ticket is created','ticket',161); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_MODIFY','Ticket modified','Executed when a ticket is modified','ticket',163); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TICKET_ASSIGNED','Ticket assigned','Executed when a ticket is modified','ticket',164); diff --git a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql index d0e9cdc7b9554..84cd1b5665ce5 100644 --- a/htdocs/install/mysql/migration/16.0.0-17.0.0.sql +++ b/htdocs/install/mysql/migration/16.0.0-17.0.0.sql @@ -177,3 +177,4 @@ ALTER TABLE llx_element_categorie ADD UNIQUE INDEX idx_element_categorie_idx (fk ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_categorie(rowid); +INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('PROJECT_SENTBYMAIL','Project sent by mail','Executed when a project is sent by email','project',144); diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 9dffacf774c06..4eca4b1734aea 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -87,6 +87,7 @@ SupplierInvoiceSentByEMail=Vendor invoice %s sent by email ShippingSentByEMail=Shipment %s sent by email ShippingValidated= Shipment %s validated InterventionSentByEMail=Intervention %s sent by email +ProjectSentByEMail=Project %s sent by email ProposalDeleted=Proposal deleted OrderDeleted=Order deleted InvoiceDeleted=Invoice deleted