Merge pull request #28888 from JonBendtsen/new_notification_action_triggers
NEW notification action triggers for cancelling orders and invoices
This commit is contained in:
commit
eb1a9727ea
3 changed files with 16 additions and 2 deletions
File diff suppressed because one or more lines are too long
|
|
@ -66,8 +66,10 @@ class Notify
|
|||
|
||||
// This codes actions are defined into table llx_notify_def
|
||||
public static $arrayofnotifsupported = array(
|
||||
'BILL_CANCEL',
|
||||
'BILL_VALIDATE',
|
||||
'BILL_PAYED',
|
||||
'ORDER_CANCEL',
|
||||
'ORDER_CREATE',
|
||||
'ORDER_VALIDATE',
|
||||
'ORDER_CLOSE',
|
||||
|
|
@ -485,6 +487,12 @@ class Notify
|
|||
$subject = '['.$appli.'] '.$outputlangs->transnoentitiesnoconv("DolibarrNotification").($projtitle ? ' '.$projtitle : '');
|
||||
|
||||
switch ($notifcode) {
|
||||
case 'BILL_CANCEL':
|
||||
$link = '<a href="'.$urlwithroot.'/compta/facture/card.php?facid='.$object->id.'&entity='.$object->entity.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->facture->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'invoice');
|
||||
$object_type = 'facture';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoiceCancelled", $link);
|
||||
break;
|
||||
case 'BILL_VALIDATE':
|
||||
$link = '<a href="'.$urlwithroot.'/compta/facture/card.php?facid='.$object->id.'&entity='.$object->entity.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->facture->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'invoice');
|
||||
|
|
@ -497,6 +505,12 @@ class Notify
|
|||
$object_type = 'facture';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoicePayed", $link);
|
||||
break;
|
||||
case 'ORDER_CANCEL':
|
||||
$link = '<a href="'.$urlwithroot.'/commande/card.php?id='.$object->id.'&entity='.$object->entity.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->commande->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'commande');
|
||||
$object_type = 'order';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextOrderCancelled", $link);
|
||||
break;
|
||||
case 'ORDER_VALIDATE':
|
||||
$link = '<a href="'.$urlwithroot.'/commande/card.php?id='.$object->id.'&entity='.$object->entity.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->commande->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'commande');
|
||||
|
|
|
|||
|
|
@ -60,7 +60,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 ('BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_MODIFY','Customer invoice modified','Executed when a customer invoice is modified','facture',7);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is canceled','facture',8);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',9);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_DELETE','Customer invoice deleted','Executed when a customer invoice is deleted','facture',9);
|
||||
|
|
|
|||
Loading…
Reference in a new issue