FIX links into emails of notifications
This commit is contained in:
parent
6d894b7abd
commit
d4400cf80f
@ -416,34 +416,34 @@ class Notify
|
||||
|
||||
switch ($notifcode) {
|
||||
case 'BILL_VALIDATE':
|
||||
$link='/compta/facture/card.php?facid='.$object->id;
|
||||
$link = '<a href="' . $urlwithroot . '/compta/facture/card.php?facid=' . $object->id . '">' . $newref . '</a>';
|
||||
$dir_output = $conf->facture->dir_output;
|
||||
$object_type = 'facture';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoiceValidated", $newref);
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoiceValidated", $link);
|
||||
break;
|
||||
case 'BILL_PAYED':
|
||||
$link='/compta/facture/card.php?facid='.$object->id;
|
||||
$link ='<a href="' . $urlwithroot . '/compta/facture/card.php?facid='.$object->id . '">' . $newref . '</a>';
|
||||
$dir_output = $conf->facture->dir_output;
|
||||
$object_type = 'facture';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoicePayed", $newref);
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextInvoicePayed", $link);
|
||||
break;
|
||||
case 'ORDER_VALIDATE':
|
||||
$link='/commande/card.php?id='.$object->id;
|
||||
$link = '<a href="' . $urlwithroot . '/commande/card.php?id='.$object->id . '">' . $newref . '</a>';
|
||||
$dir_output = $conf->commande->dir_output;
|
||||
$object_type = 'order';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextOrderValidated", $newref);
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextOrderValidated", $link);
|
||||
break;
|
||||
case 'PROPAL_VALIDATE':
|
||||
$link='/comm/propal/card.php?id='.$object->id;
|
||||
$link = '<a href="' . $urlwithroot . '/comm/propal/card.php?id='.$object->id . '">' . $newref . '</a>';
|
||||
$dir_output = $conf->propal->multidir_output[$object->entity];
|
||||
$object_type = 'propal';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalValidated", $newref);
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalValidated", $link);
|
||||
break;
|
||||
case 'PROPAL_CLOSE_SIGNED':
|
||||
$link='/comm/propal/card.php?id='.$object->id;
|
||||
$link = '<a href="' . $urlwithroot . '/comm/propal/card.php?id='.$object->id . '">' . $newref . '</a>';
|
||||
$dir_output = $conf->propal->multidir_output[$object->entity];
|
||||
$object_type = 'propal';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalClosedSigned", $newref);
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextProposalClosedSigned", $link);
|
||||
break;
|
||||
case 'FICHINTER_ADD_CONTACT':
|
||||
$link='/fichinter/card.php?id='.$object->id;
|
||||
@ -452,17 +452,17 @@ class Notify
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextInterventionAddedContact", $newref);
|
||||
break;
|
||||
case 'FICHINTER_VALIDATE':
|
||||
$link='/fichinter/card.php?id='.$object->id;
|
||||
$link = '<a href="' . $urlwithroot . '/fichinter/card.php?id='.$object->id . '">' . $newref . '</a>';
|
||||
$dir_output = $conf->ficheinter->dir_output;
|
||||
$object_type = 'ficheinter';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextInterventionValidated", $newref);
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextInterventionValidated", $link);
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_VALIDATE':
|
||||
$link='/fourn/commande/card.php?id='.$object->id;
|
||||
$dir_output = $conf->fournisseur->commande->dir_output;
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n";
|
||||
$mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderValidatedBy", $newref, $user->getFullName($outputlangs));
|
||||
$mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderValidatedBy", $link, $user->getFullName($outputlangs));
|
||||
$mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n";
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_APPROVE':
|
||||
@ -470,46 +470,46 @@ class Notify
|
||||
$dir_output = $conf->fournisseur->commande->dir_output;
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n";
|
||||
$mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderApprovedBy", $newref, $user->getFullName($outputlangs));
|
||||
$mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderApprovedBy", $link, $user->getFullName($outputlangs));
|
||||
$mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n";
|
||||
break;
|
||||
case 'ORDER_SUPPLIER_REFUSE':
|
||||
$link='/fourn/commande/card.php?id='.$object->id;
|
||||
$link = '<a href="' . $urlwithroot . '/fourn/commande/card.php?id='.$object->id . '">' . $newref . '</a>';
|
||||
$dir_output = $conf->fournisseur->commande->dir_output;
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n";
|
||||
$mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderRefusedBy", $newref, $user->getFullName($outputlangs));
|
||||
$mesg.= $outputlangs->transnoentitiesnoconv("EMailTextOrderRefusedBy", $link, $user->getFullName($outputlangs));
|
||||
$mesg.= "\n\n".$outputlangs->transnoentitiesnoconv("Sincerely").".\n\n";
|
||||
break;
|
||||
case 'SHIPPING_VALIDATE':
|
||||
$link = '<a href="'.$urlwithroot.'/expedition/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->expedition->dir_output.'/sending/';
|
||||
$object_type = 'expedition';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated", $newref);
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpeditionValidated", $link);
|
||||
break;
|
||||
case 'EXPENSE_REPORT_VALIDATE':
|
||||
$link = '<a href="'.$urlwithroot.'/expensereport/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->expensereport->dir_output;
|
||||
$object_type = 'expensereport';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $newref);
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $link);
|
||||
break;
|
||||
case 'EXPENSE_REPORT_APPROVE':
|
||||
$link = '<a href="'.$urlwithroot.'/expensereport/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->expensereport->dir_output;
|
||||
$object_type = 'expensereport';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $newref);
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $link);
|
||||
break;
|
||||
case 'HOLIDAY_VALIDATE':
|
||||
$link = '<a href="'.$urlwithroot.'/holiday/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->holiday->dir_output;
|
||||
$object_type = 'holiday';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayValidated", $newref);
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayValidated", $link);
|
||||
break;
|
||||
case 'HOLIDAY_APPROVE':
|
||||
$link = '<a href="'.$urlwithroot.'/holiday/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->holiday->dir_output;
|
||||
$object_type = 'holiday';
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayApproved", $newref);
|
||||
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayApproved", $link);
|
||||
break;
|
||||
}
|
||||
$ref = dol_sanitizeFileName($newref);
|
||||
@ -528,7 +528,6 @@ class Notify
|
||||
$message.= $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n";
|
||||
$message.= "\n";
|
||||
$message.= $mesg;
|
||||
if ($link) $message.= "\n" . $urlwithroot . $link; // if link is already added around the ref into the translation text, then $link must be set to ''
|
||||
|
||||
$parameters = array('notifcode'=>$notifcode, 'sendto'=>$sendto, 'replyto'=>$replyto, 'file'=>$filename_list, 'mimefile'=>$mimetype_list, 'filename'=>$mimefilename_list);
|
||||
if (!isset($action)) $action = '';
|
||||
@ -655,7 +654,7 @@ class Notify
|
||||
break;
|
||||
case 'FICHINTER_ADD_CONTACT':
|
||||
$link = '<a href="' . $urlwithroot . '/fichinter/card.php?id='.$object->id . '">' . $newref . '</a>';
|
||||
$dir_output = $conf->facture->dir_output;
|
||||
$dir_output = $conf->ficheinter->dir_output;
|
||||
$object_type = 'ficheinter';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInterventionAddedContact", $link);
|
||||
break;
|
||||
@ -701,31 +700,31 @@ class Notify
|
||||
$link = '<a href="'.$urlwithroot.'/expedition/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->expedition->dir_output.'/sending/';
|
||||
$object_type = 'order_supplier';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated", $newref);
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated", $link);
|
||||
break;
|
||||
case 'EXPENSE_REPORT_VALIDATE':
|
||||
$link = '<a href="'.$urlwithroot.'/expensereport/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->expensereport->dir_output;
|
||||
$object_type = 'expensereport';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $newref);
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportValidated", $link);
|
||||
break;
|
||||
case 'EXPENSE_REPORT_APPROVE':
|
||||
$link = '<a href="'.$urlwithroot.'/expensereport/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->expensereport->dir_output;
|
||||
$object_type = 'expensereport';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $newref);
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextExpenseReportApproved", $link);
|
||||
break;
|
||||
case 'HOLIDAY_VALIDATE':
|
||||
$link = '<a href="'.$urlwithroot.'/holiday/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->holiday->dir_output;
|
||||
$object_type = 'holiday';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextHolidayValidated", $newref);
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextHolidayValidated", $link);
|
||||
break;
|
||||
case 'HOLIDAY_APPROVE':
|
||||
$link = '<a href="'.$urlwithroot.'/holiday/card.php?id='.$object->id.'">'.$newref.'</a>';
|
||||
$dir_output = $conf->holiday->dir_output;
|
||||
$object_type = 'holiday';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextHolidayApproved", $newref);
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextHolidayApproved", $link);
|
||||
break;
|
||||
}
|
||||
$ref = dol_sanitizeFileName($newref);
|
||||
@ -744,7 +743,6 @@ class Notify
|
||||
$message.= $langs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n";
|
||||
$message.= "\n";
|
||||
$message.= $mesg;
|
||||
if ($link) $message.= "\n" . $urlwithroot . $link; // if link is already added around the ref into the translation text, then $link must be set to ''
|
||||
|
||||
$message = nl2br($message);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user