Fix: Bad ref used into notification message
This commit is contained in:
parent
5fe5ec939d
commit
293495467f
@ -109,7 +109,7 @@ class Commande extends CommonOrder
|
||||
// Pour board
|
||||
var $nbtodo;
|
||||
var $nbtodolate;
|
||||
|
||||
|
||||
/**
|
||||
* ERR Not engouch stock
|
||||
*/
|
||||
@ -299,7 +299,7 @@ class Commande extends CommonOrder
|
||||
// Rename directory if dir was a temporary ref
|
||||
if (preg_match('/^[\(]?PROV/i', $this->ref))
|
||||
{
|
||||
// On renomme repertoire ($this->ref = ancienne ref, $numfa = nouvelle ref)
|
||||
// On renomme repertoire ($this->ref = ancienne ref, $num = nouvelle ref)
|
||||
// in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
$newref = dol_sanitizeFileName($num);
|
||||
|
||||
@ -171,6 +171,8 @@ class Notify
|
||||
return 0;
|
||||
}
|
||||
|
||||
$oldref=(empty($object->oldref)?$object->ref:$object->oldref);
|
||||
$newref=(empty($object->newref)?$object->ref:$object->newref);
|
||||
|
||||
// Check notification per third party
|
||||
$sql = "SELECT s.nom, c.email, c.rowid as cid, c.lastname, c.firstname, c.default_lang,";
|
||||
@ -215,32 +217,32 @@ class Notify
|
||||
$link='/compta/facture.php?facid='.$object->id;
|
||||
$dir_output = $conf->facture->dir_output;
|
||||
$object_type = 'facture';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$object->ref);
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$newref);
|
||||
break;
|
||||
case 'ORDER_VALIDATE':
|
||||
$link='/commande/card.php?id='.$object->id;
|
||||
$dir_output = $conf->commande->dir_output;
|
||||
$object_type = 'order';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$object->ref);
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$newref);
|
||||
break;
|
||||
case 'PROPAL_VALIDATE':
|
||||
$link='/comm/propal.php?id='.$object->id;
|
||||
$dir_output = $conf->propal->dir_output;
|
||||
$object_type = 'propal';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$object->ref);
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref);
|
||||
break;
|
||||
case 'FICHINTER_VALIDATE':
|
||||
$link='/fichinter/card.php?id='.$object->id;
|
||||
$dir_output = $conf->facture->dir_output;
|
||||
$object_type = 'ficheinter';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$newref);
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_APPROVE':
|
||||
$link='/fourn/commande/card.php?id='.$object->id;
|
||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$object->ref,$user->getFullName($langs));
|
||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs));
|
||||
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_REFUSE':
|
||||
@ -248,16 +250,16 @@ class Notify
|
||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$object->ref,$user->getFullName($langs));
|
||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($langs));
|
||||
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
|
||||
break;
|
||||
case 'SHIPPING_VALIDATE':
|
||||
$dir_output = $conf->expedition->dir_output.'/sending/';
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$object->ref);
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$newref);
|
||||
break;
|
||||
}
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
$ref = dol_sanitizeFileName($newref);
|
||||
$pdf_path = $dir_output."/".$ref."/".$ref.".pdf";
|
||||
if (! dol_is_file($pdf_path))
|
||||
{
|
||||
@ -344,32 +346,32 @@ class Notify
|
||||
$link='/compta/facture.php?facid='.$object->id;
|
||||
$dir_output = $conf->facture->dir_output;
|
||||
$object_type = 'facture';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$object->ref);
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoiceValidated",$newref);
|
||||
break;
|
||||
case 'ORDER_VALIDATE':
|
||||
$link='/commande/card.php?id='.$object->id;
|
||||
$dir_output = $conf->commande->dir_output;
|
||||
$object_type = 'order';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$object->ref);
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$newref);
|
||||
break;
|
||||
case 'PROPAL_VALIDATE':
|
||||
$link='/comm/propal.php?id='.$object->id;
|
||||
$dir_output = $conf->propal->dir_output;
|
||||
$object_type = 'propal';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$object->ref);
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref);
|
||||
break;
|
||||
case 'FICHINTER_VALIDATE':
|
||||
$link='/fichinter/card.php?id='.$object->id;
|
||||
$dir_output = $conf->facture->dir_output;
|
||||
$object_type = 'ficheinter';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$object->ref);
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionValidated",$newref);
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_APPROVE':
|
||||
$link='/fourn/commande/card.php?id='.$object->id;
|
||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$object->ref,$user->getFullName($langs));
|
||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs));
|
||||
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_REFUSE':
|
||||
@ -377,16 +379,16 @@ class Notify
|
||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$object->ref,$user->getFullName($langs));
|
||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($langs));
|
||||
$mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n";
|
||||
break;
|
||||
case 'SHIPPING_VALIDATE':
|
||||
$dir_output = $conf->expedition->dir_output.'/sending/';
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$object->ref);
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$newref);
|
||||
break;
|
||||
}
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
$ref = dol_sanitizeFileName($newref);
|
||||
$pdf_path = $dir_output."/".$ref."/".$ref.".pdf";
|
||||
if (! dol_is_file($pdf_path))
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user