Clean some code for type of event deprecated since 3.3

This commit is contained in:
Laurent Destailleur 2017-05-19 12:58:38 +02:00
parent ff2a268831
commit aec4cef5de
22 changed files with 638 additions and 685 deletions

View File

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

View File

@ -644,7 +644,7 @@ if (empty($reshook))
*/
// Actions to send emails
$actiontypecode='AC_PROP';
$actiontypecode='AC_OTH_AUTO';
$trigger_name='PROPAL_SENTBYMAIL';
$paramname='id';
$mode='emailfromproposal';

View File

@ -1259,7 +1259,6 @@ if (empty($reshook))
// Actions to send emails
$actiontypecode='AC_COM';
$trigger_name='ORDER_SENTBYMAIL';
$paramname='id';
$mode='emailfromorder';

View File

@ -1911,7 +1911,6 @@ if (empty($reshook))
// Actions to send emails
if (empty($id)) $id=$facid;
$actiontypecode='AC_FAC';
$trigger_name='BILL_SENTBYMAIL';
$paramname='id';
$mode='emailfrominvoice';

View File

@ -953,7 +953,6 @@ if (empty($reshook))
*/
// Actions to send emails
$actiontypecode='AC_CONT';
$trigger_name='CONTRACT_SENTBYMAIL';
$paramname='id';
$mode='emailfromcontract';

View File

@ -274,12 +274,12 @@ if (! $error && $massaction == 'confirm_presend')
// Insert logs into agenda
foreach($listofqualifiedinvoice as $invid => $object)
{
if ($objectclass == 'Propale') $actiontypecode='AC_PROP';
/*if ($objectclass == 'Propale') $actiontypecode='AC_PROP';
if ($objectclass == 'Commande') $actiontypecode='AC_COM';
if ($objectclass == 'Facture') $actiontypecode='AC_FAC';
if ($objectclass == 'Supplier_Proposal') $actiontypecode='AC_SUP_PRO';
if ($objectclass == 'CommandeFournisseur') $actiontypecode='AC_SUP_ORD';
if ($objectclass == 'FactureFournisseur') $actiontypecode='AC_SUP_INV';
if ($objectclass == 'FactureFournisseur') $actiontypecode='AC_SUP_INV';*/
$actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
if ($message)
@ -289,10 +289,10 @@ if (! $error && $massaction == 'confirm_presend')
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
$actionmsg = dol_concatdesc($actionmsg, $message);
}
$actionmsg2='';
// Initialisation donnees
$object->sendtoid = 0;
$object->actiontypecode = $actiontypecode;
$object->actionmsg = $actionmsg; // Long text
$object->actionmsg2 = $actionmsg2; // Short text
$object->fk_element = $invid;

View File

@ -23,11 +23,11 @@
// $mysoc must be defined
// $id must be defined
// $actiontypecode must be defined
// $paramname must be defined
// $mode must be defined
// $object and $uobject may be defined.
// $trigger_name must be set (can be '')
// $actiontypecode can be set
// $object and $uobject may be defined
/*
* Add file in email form
@ -155,7 +155,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
}
}
}
else dol_print_error('','Use actions_sendmails.in.php for a type that is not supported');
else dol_print_error('','Use actions_sendmails.in.php for an element/object that is not supported');
}
else $thirdparty = $mysoc;
@ -347,7 +347,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
{
$error=0;
// FIXME This must be moved into a trigger for action $trigger_name
// FIXME This must be moved into the trigger for action $trigger_name
if (! empty($conf->dolimail->enabled))
{
$mid = (GETPOST('mid','int') ? GETPOST('mid','int') : 0); // Original mail id is set ?
@ -370,21 +370,26 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
// Initialisation of datas
if (is_object($object))
{
$object->socid = $sendtosocid; // To link to a company
$object->sendtoid = $sendtoid; // To link to contacts/addresses. This is an array.
$object->actiontypecode = $actiontypecode;
$object->actionmsg = $actionmsg; // Long text
$object->actionmsg2 = $actionmsg2; // Short text
if (empty($actiontypecode)) $actiontypecode='AC_OTH_AUTO'; // Event insert into agenda automatically
$object->socid = $sendtosocid; // To link to a company
$object->sendtoid = $sendtoid; // To link to contacts/addresses. This is an array.
$object->actiontypecode = $actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
$object->actionmsg = $actionmsg; // Long text
$object->actionmsg2 = $actionmsg2; // Short text
$object->trackid = $trackid;
$object->fk_element = $object->id;
$object->elementtype = $object->element;
// Call of triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
$result=$interface->run_triggers($trigger_name,$object,$user,$langs,$conf);
if ($result < 0) {
$error++; $errors=$interface->errors;
if (! empty($trigger_name))
{
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
$result=$interface->run_triggers($trigger_name,$object,$user,$langs,$conf);
if ($result < 0) {
$error++; $errors=$interface->errors;
}
}
}
@ -398,8 +403,12 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
// This avoid sending mail twice if going out and then back to page
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2));
setEventMessages($mesg, null, 'mesgs');
if ($conf->dolimail->enabled) header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id.'&'.($paramname2?$paramname2:'mid').'='.$parm2val);
else header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id);
if ($conf->dolimail->enabled)
{
header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.(is_object($object)?$object->id:'').'&'.($paramname2?$paramname2:'mid').'='.$parm2val);
exit;
}
header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.(is_object($object)?$object->id:''));
exit;
}
}

View File

@ -297,7 +297,7 @@ class FormMail extends Form
$arraydefaultmessage=$this->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, $model_id);
//var_dump($arraydefaultmessage);
$out.= "\n<!-- Begin form mail -->\n";
$out.= "\n".'<!-- Begin form mail --><div id="mailformdiv"></div>'."\n";
if ($this->withform == 1)
{
$out.= '<form method="POST" name="mailform" id="mailform" enctype="multipart/form-data" action="'.$this->param["returnurl"].'#formmail">'."\n";

View File

@ -145,7 +145,7 @@ function user_prepare_head($object)
{
// Bank
$head[$h][0] = DOL_URL_ROOT.'/user/bank.php?id='.$object->id;
$head[$h][1] = $langs->trans("BankAccounts");
$head[$h][1] = $langs->trans("HR");
$head[$h][2] = 'bank';
$h++;
}

View File

@ -76,6 +76,8 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("agenda");
if (empty($object->actiontypecode)) $object->actiontypecode='AC_OTH_AUTO';
// Actions
if ($action == 'COMPANY_CREATE')
{
@ -83,7 +85,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("companies");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("NewCompanyToDolibarr",$object->name);
$object->actionmsg=$langs->transnoentities("NewCompanyToDolibarr",$object->name);
if (! empty($object->prefix)) $object->actionmsg.=" (".$object->prefix.")";
@ -97,7 +98,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("orders");
if (empty($object->actiontypecode)) $object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) dol_syslog('Trigger called with property actionmsg2 on object not defined', LOG_ERR);
// Parameters $object->sendtoid defined by caller
@ -109,7 +109,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("contracts");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ContractValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg=$langs->transnoentities("ContractValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
@ -121,7 +120,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("propal");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg=$langs->transnoentities("PropalValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
@ -133,7 +131,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("propal");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProposalSentByEMail",$object->ref);
if (empty($object->actionmsg))
{
@ -149,7 +146,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("propal");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("PropalClosedSignedInDolibarr",$object->ref);
@ -161,7 +157,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("propal");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClassifiedBilledInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("PropalClassifiedBilledInDolibarr",$object->ref);
@ -173,7 +168,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("propal");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("PropalClosedRefusedInDolibarr",$object->ref);
@ -184,7 +178,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("agenda");
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
@ -196,7 +189,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderDeliveredInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("OrderDeliveredInDolibarr",$object->ref);
@ -208,7 +200,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderBilledInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("OrderBilledInDolibarr",$object->ref);
@ -220,7 +211,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderCanceledInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("OrderCanceledInDolibarr",$object->ref);
@ -232,7 +222,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderSentByEMail",$object->ref);
if (empty($object->actionmsg))
{
@ -248,7 +237,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("bills");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
@ -260,7 +248,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("bills");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
@ -272,7 +259,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("bills");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceSentByEMail",$object->ref);
if (empty($object->actionmsg))
{
@ -289,7 +275,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("bills");
// Values for this action can't be defined by caller.
$object->actiontypecode='AC_OTH_AUTO';
$object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
@ -301,7 +286,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("bills");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
@ -313,7 +297,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("interventions");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionCreatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InterventionCreatedInDolibarr",$object->ref);
@ -327,7 +310,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("interventions");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg=$langs->transnoentities("InterventionValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
@ -341,7 +323,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("interventions");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionModifiedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InterventionModifiedInDolibarr",$object->ref);
@ -355,7 +336,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("interventions");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionSentByEMail",$object->ref);
$object->actionmsg=$langs->transnoentities("InterventionSentByEMail",$object->ref);
@ -368,7 +348,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("interventions");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionClassifiedBilledInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InterventionClassifiedBilledInDolibarr",$object->ref);
@ -380,7 +359,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("interventions");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionClassifiedUnbilledInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InterventionClassifiedUnbilledInDolibarr",$object->ref);
@ -392,7 +370,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("interventions");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InterventionDeletedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InterventionDeletedInDolibarr",$object->ref);
@ -406,7 +383,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("sendings");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ShippingValidated",($object->newref?$object->newref:$object->ref));
if (empty($object->actionmsg))
{
@ -422,7 +398,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("sendings");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ShippingSentByEMail",$object->ref);
if (empty($object->actionmsg))
{
@ -438,7 +413,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderCreatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg=$langs->transnoentities("OrderCreatedInDolibarr",($object->newref?$object->newref:$object->ref));
@ -450,7 +424,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg=$langs->transnoentities("OrderValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
@ -462,7 +435,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderApprovedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("OrderApprovedInDolibarr",$object->ref);
@ -474,7 +446,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderRefusedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("OrderRefusedInDolibarr",$object->ref);
@ -486,7 +457,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierOrderSubmitedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg=$langs->transnoentities("SupplierOrderSubmitedInDolibarr",($object->newref?$object->newref:$object->ref));
@ -498,7 +468,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierOrderReceivedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg=$langs->transnoentities("SupplierOrderReceivedInDolibarr",($object->newref?$object->newref:$object->ref));
@ -511,7 +480,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("bills");
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierOrderSentByEMail",$object->ref);
if (empty($object->actionmsg))
{
@ -528,7 +496,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("bills");
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierOrderClassifiedBilled",$object->ref);
if (empty($object->actionmsg))
{
@ -543,7 +510,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("bills");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
@ -555,7 +521,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("bills");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref);
@ -568,7 +533,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("bills");
$langs->load("orders");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("SupplierInvoiceSentByEMail",$object->ref);
if (empty($object->actionmsg))
{
@ -584,7 +548,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("bills");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoicePaidInDolibarr",$object->ref);
@ -596,7 +559,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("bills");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("InvoiceCanceledInDolibarr",$object->ref);
@ -610,7 +572,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("members");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg=$langs->transnoentities("MemberValidatedInDolibarr",($object->newref?$object->newref:$object->ref));
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
@ -624,7 +585,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("members");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberModifiedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberModifiedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
@ -638,7 +598,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("members");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
@ -654,7 +613,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("members");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
@ -668,7 +626,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("members");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
@ -684,7 +641,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("projects");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProjectCreatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("ProjectCreatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Project").': '.$object->ref;
@ -696,8 +652,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("projects");
$object->actiontypecode='AC_OTH_AUTO';
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;
@ -709,7 +663,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("projects");
$object->actiontypecode='AC_OTH_AUTO';
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;
@ -723,8 +676,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("projects");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("TaskCreatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("TaskCreatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref;
@ -737,7 +688,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("projects");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("TaskModifiedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("TaskModifieddInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref;
@ -750,7 +700,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("other");
$langs->load("projects");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("TaskDeletedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("TaskDeletedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref;
@ -763,7 +712,6 @@ class InterfaceActionsAuto extends DolibarrTriggers
$langs->load("agenda");
$langs->load("other");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities($action."InDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities($action."InDolibarr",$object->ref);
@ -805,7 +753,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
// Insertion action
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
$actioncomm = new ActionComm($this->db);
$actioncomm->type_code = $object->actiontypecode; // code of parent table llx_c_actioncomm (will be deprecated)
$actioncomm->type_code = $object->actiontypecode; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
$actioncomm->code = 'AC_'.$action;
$actioncomm->label = $object->actionmsg2;
$actioncomm->note = $object->actionmsg; // TODO Replace with $actioncomm->email_msgid ? $object->email_content : $object->actionmsg

View File

@ -595,7 +595,6 @@ if (empty($reshook))
// Actions to send emails
if (empty($id)) $id=$facid;
$actiontypecode='AC_SHIP';
$trigger_name='SHIPPING_SENTBYMAIL';
$paramname='id';
$mode='emailfromshipment';

View File

@ -719,8 +719,6 @@ if (empty($reshook))
*/
// Actions to send emails
$actiontypecode='AC_OTH_AUTO';
$trigger_name='FICHINTER_SENTBYMAIL';
$paramname='id';
$mode='emailfromintervention';
$trackid='int'.$object->id;

View File

@ -1154,7 +1154,6 @@ if (empty($reshook))
*/
// Actions to send emails
$actiontypecode='AC_SUP_ORD';
$trigger_name='ORDER_SUPPLIER_SENTBYMAIL';
$paramname='id';
$mode='emailfromsupplierorder';

View File

@ -1188,7 +1188,6 @@ if (empty($reshook))
*/
// Actions to send emails
$actiontypecode='AC_SUP_INV';
$trigger_name='BILL_SUPPLIER_SENTBYMAIL';
$paramname='id';
$mode='emailfromsupplierinvoice';

View File

@ -38,12 +38,12 @@ insert into llx_c_actioncomm (id, code, type, libelle, module, active, position)
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 5,'AC_RDV','system','Rendez-vous',NULL, 1, 1);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values (11,'AC_INT','system','Intervention on site',NULL, 1, 4);
-- Code kept for backward compatibility < 3.3
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 3,'AC_PROP','systemauto', 'Send commercial proposal by email','propal',0,10);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 8,'AC_COM','systemauto','Send customer order by email','order', 0,8);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 9,'AC_FAC','systemauto', 'Send customer invoice by email','invoice',0,6);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 10,'AC_SHIP','systemauto', 'Send shipping by email','shipping',0,11);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 30,'AC_SUP_ORD','systemauto','Send supplier order by email','order_supplier',0,9);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 31,'AC_SUP_INV','systemauto','Send supplier invoice by email','invoice_supplier',0,7);
--insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 3,'AC_PROP','systemauto', 'Send commercial proposal by email','propal',0,10);
--insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 8,'AC_COM','systemauto','Send customer order by email','order', 0,8);
--insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 9,'AC_FAC','systemauto', 'Send customer invoice by email','invoice',0,6);
--insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 10,'AC_SHIP','systemauto', 'Send shipping by email','shipping',0,11);
--insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 30,'AC_SUP_ORD','systemauto','Send supplier order by email','order_supplier',0,9);
--insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 31,'AC_SUP_INV','systemauto','Send supplier invoice by email','invoice_supplier',0,7);
-- Code used from 3.3+ when type of event is not used
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 40,'AC_OTH_AUTO','systemauto','Other (automatically inserted events)',NULL, 1, 20);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 50,'AC_OTH','system','Other (manually inserted events)',NULL, 1, 5);

View File

@ -296,7 +296,6 @@ ALTER TABLE llx_events MODIFY COLUMN ip varchar(250);
ALTER TABLE llx_facture ADD COLUMN fk_fac_rec_source integer;
DELETE from llx_c_actioncomm where code in ('AC_PROP','AC_COM','AC_FAC','AC_SHIP','AC_SUP_ORD','AC_SUP_INV') AND id NOT IN (SELECT DISTINCT fk_action FROM llx_actioncomm);

View File

@ -771,6 +771,7 @@ ModuleBuilder=Module Builder
SetMultiCurrencyCode=Set currency
BulkActions=Bulk actions
ClickToShowHelp=Click to show tooltip help
HR=HR
# Week day
Monday=Monday
Tuesday=Tuesday

View File

@ -750,7 +750,6 @@ if (empty($reshook))
// Actions to send emails
$id=$socid;
$actiontypecode='AC_OTH_AUTO';
$trigger_name='COMPANY_SENTBYMAIL';
$paramname='socid';
$mode='emailfromthirdparty';

View File

@ -466,7 +466,6 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to send emails
$actiontypecode='AC_ASKPRICE';
$trigger_name='SUPPLIER_PROPOSAL_SENTBYMAIL';
$paramname='id';
$mode='emailfromsupplierproposal';

View File

@ -1101,6 +1101,7 @@ div.nopadding {
padding-top: 1px;
padding-bottom: 1px;
width: 44px;
text-align:center;
}
div.attacharea {
padding-top: 18px;

View File

@ -1145,6 +1145,7 @@ img.hideonsmartphone.pictoactionview {
padding-top: 1px;
padding-bottom: 1px;
width: 44px;
text-align:center;
}
div.attacharea {
padding-top: 18px;
@ -3054,7 +3055,7 @@ div.info {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
background: #EaE4Ea;
background: #868;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

File diff suppressed because it is too large Load Diff