Merge pull request #22396 from aspangaro/17p1

NEW #20912 Add trigger to record the event of sending an email from a project
This commit is contained in:
Laurent Destailleur 2022-09-25 13:05:15 +02:00 committed by GitHub
commit b0162e3bea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 0 deletions

View File

@ -615,6 +615,9 @@ if (!$error && $massaction == 'confirm_presend') {
if ($triggername == 'SUPPLIERPROPOSAL_SENTBYMAIL') {
$triggername = 'PROPOSAL_SUPPLIER_SENTBYMAIL';
}
if ($triggername == 'PROJET_SENTBYMAIL') {
$triggername = 'PROJECT_SENTBYMAIL';
}
if (!empty($triggername)) {
// Call trigger

View File

@ -848,6 +848,19 @@ class InterfaceActionsAuto extends DolibarrTriggers
}
$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

View File

@ -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);

View File

@ -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);

View File

@ -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