Add better message for notifications
This commit is contained in:
parent
d3e54348e9
commit
3eb7bd2ed0
@ -120,11 +120,11 @@ class Notify
|
|||||||
* \param objet_type Type of object the notification deals on (facture, order, propal, order_supplier...). Just for log in llx_notify.
|
* \param objet_type Type of object the notification deals on (facture, order, propal, order_supplier...). Just for log in llx_notify.
|
||||||
* \param objet_id Id of object the notification deals on
|
* \param objet_id Id of object the notification deals on
|
||||||
* \param file Attach a file
|
* \param file Attach a file
|
||||||
* \return int <0 if KO or number of changes if OK
|
* \return int <0 if KO, or number of changes if OK
|
||||||
*/
|
*/
|
||||||
function send($action, $socid, $texte, $objet_type, $objet_id, $file="")
|
function send($action, $socid, $texte, $objet_type, $objet_id, $file="")
|
||||||
{
|
{
|
||||||
global $conf,$langs;
|
global $conf,$langs,$mysoc,$dolibarr_main_url_root;
|
||||||
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
|
|
||||||
@ -154,11 +154,42 @@ class Notify
|
|||||||
|
|
||||||
if (strlen($sendto))
|
if (strlen($sendto))
|
||||||
{
|
{
|
||||||
$application=(defined('MAIN_APPLICATION_TITLE')?MAIN_APPLICATION_TITLE:'Dolibarr');
|
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
||||||
$subject = '['.$application.'] '.$langs->transnoentitiesnoconv("DolibarrNotification");
|
$application=($conf->global->MAIN_APPLICATION_TITLE?$conf->global->MAIN_APPLICATION_TITLE:'Dolibarr ERP/CRM');
|
||||||
$message = $texte;
|
|
||||||
$filename = explode("/",$file);
|
$subject = '['.$application.'] '.$langs->transnoentitiesnoconv("DolibarrNotification");
|
||||||
$msgishtml=0;
|
|
||||||
|
$message = $langs->transnoentities("YouReceiveMailBecauseOfNotification",$application,$mysoc->name)."\n";
|
||||||
|
$message = $langs->transnoentities("YouReceiveMailBecauseOfNotification2",$application,$mysoc->name)."\n";
|
||||||
|
$message.= "\n";
|
||||||
|
$message.= $texte;
|
||||||
|
// Add link
|
||||||
|
switch($objet_type)
|
||||||
|
{
|
||||||
|
case 'ficheinter':
|
||||||
|
$link=DOL_URL_ROOT.'/fichinter/fiche.php?id='.$objet_id;
|
||||||
|
break;
|
||||||
|
case 'propal':
|
||||||
|
$link=DOL_URL_ROOT.'/comm/propal.php?id='.$objet_id;
|
||||||
|
break;
|
||||||
|
case 'facture':
|
||||||
|
$link=DOL_URL_ROOT.'/facture/fiche.php?facid='.$objet_id;
|
||||||
|
break;
|
||||||
|
case 'order':
|
||||||
|
$link=DOL_URL_ROOT.'/commande/fiche.php?facid='.$objet_id;
|
||||||
|
break;
|
||||||
|
case 'order_supplier':
|
||||||
|
$link=DOL_URL_ROOT.'/fourn/commande/fiche.php?facid='.$objet_id;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$dolibarr_main_url_root);
|
||||||
|
if ($link) $message.="\n".$urlwithouturlroot.$link;
|
||||||
|
|
||||||
|
$filename = basename($file);
|
||||||
|
|
||||||
|
$mimefile=dol_mimetype($file);
|
||||||
|
|
||||||
|
$msgishtml=0;
|
||||||
|
|
||||||
$replyto = $conf->notification->email_from;
|
$replyto = $conf->notification->email_from;
|
||||||
|
|
||||||
@ -167,7 +198,7 @@ class Notify
|
|||||||
$replyto,
|
$replyto,
|
||||||
$message,
|
$message,
|
||||||
array($file),
|
array($file),
|
||||||
array("application/pdf"),
|
array($mimefile),
|
||||||
array($filename[sizeof($filename)-1]),
|
array($filename[sizeof($filename)-1]),
|
||||||
'', '', 0, $msgishtml
|
'', '', 0, $msgishtml
|
||||||
);
|
);
|
||||||
|
|||||||
@ -131,6 +131,8 @@ NewHeight=New height
|
|||||||
NewSizeAfterCropping=New size after cropping
|
NewSizeAfterCropping=New size after cropping
|
||||||
DefineNewAreaToPick=Define new area on image to pick (left click on image then drag until you reach the opposite corner)
|
DefineNewAreaToPick=Define new area on image to pick (left click on image then drag until you reach the opposite corner)
|
||||||
CurrentInformationOnImage=Informations on current image
|
CurrentInformationOnImage=Informations on current image
|
||||||
|
YouReceiveMailBecauseOfNotification=You receive this message because your email has been added to list of targets to be informed of particular events into %s software of %s.
|
||||||
|
YouReceiveMailBecauseOfNotification2=This event is the following:
|
||||||
|
|
||||||
##### Bookmark #####
|
##### Bookmark #####
|
||||||
Bookmark=Bookmark
|
Bookmark=Bookmark
|
||||||
|
|||||||
@ -131,6 +131,8 @@ NewHeight=Nouvelle hauteur
|
|||||||
NewSizeAfterCropping=Nouvelles dimensions après recadrage
|
NewSizeAfterCropping=Nouvelles dimensions après recadrage
|
||||||
DefineNewAreaToPick=Définissez la zone d'image à conserver (clic gauche sur l'image puis drag vers les coins opposés)
|
DefineNewAreaToPick=Définissez la zone d'image à conserver (clic gauche sur l'image puis drag vers les coins opposés)
|
||||||
CurrentInformationOnImage=Informations courantes sur l'image
|
CurrentInformationOnImage=Informations courantes sur l'image
|
||||||
|
YouReceiveMailBecauseOfNotification=Vous recevez ce message car votre email a été abonnée à certaines notifications automatiques pour vous informer d'évenements particuliers issus du logiciel %s de %s.
|
||||||
|
YouReceiveMailBecauseOfNotification2=L'évenement en question est le suivant:
|
||||||
|
|
||||||
##### Bookmark #####
|
##### Bookmark #####
|
||||||
Bookmark=Marque-page
|
Bookmark=Marque-page
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user