Merge pull request #9634 from grandoc/new_branch_29_09_2018

add some significant info within notification mail
This commit is contained in:
Laurent Destailleur 2018-10-04 19:31:31 +02:00 committed by GitHub
commit 29cafc78d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -51,16 +52,15 @@ class Notify
public $errors = array();
var $author;
/**
* @var string Ref
*/
public $ref;
var $ref;
var $date;
var $duree;
var $note;
var $fk_project;
/**
* @var int Project ID
*/
public $fk_project;
// Les codes actions sont definis dans la table llx_notify_def
@ -369,6 +369,14 @@ class Notify
if ($result)
{
$num = $this->db->num_rows($result);
$projtitle='';
if (! empty($object->fk_project))
{
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$proj = new Project($this->db);
$proj->fetch($object->fk_project);
$projtitle='('.$proj->title.')';
}
if ($num > 0)
{
@ -390,7 +398,7 @@ class Notify
$outputlangs->setDefaultLang($obj->default_lang);
}
$subject = '['.$mysoc->name.'] '.$outputlangs->transnoentitiesnoconv("DolibarrNotification");
$subject = '['.$mysoc->name.'] '.$outputlangs->transnoentitiesnoconv("DolibarrNotification").($projtitle?' '.$projtitle:'');
switch ($notifcode) {
case 'BILL_VALIDATE':
@ -572,7 +580,7 @@ class Notify
$link = '';
$num++;
$subject = '['.$mysoc->name.'] '.$langs->transnoentitiesnoconv("DolibarrNotification");
$subject = '['.$mysoc->name.'] '.$langs->transnoentitiesnoconv("DolibarrNotification").($projtitle?' '.$projtitle:'');
switch ($notifcode) {
case 'BILL_VALIDATE':
@ -734,5 +742,6 @@ class Notify
if (! $error) return $num;
else return -1 * $error;
}
}