diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 439e9b60d3c..d52166659ea 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2005 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2014 Juanjo Menent + * Copyright (C) 2018 Philippe Grand * * 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; } + }