Description: Added the message title to message notifications sent by mail
 As requested by a local user
Author: Gunnar Wolf <gwolf@debian.org>
Forwarded: http://collabtive.o-dyn.de/forum/viewtopic.php?f=10&t=3987&p=8795#p8795
Last-Update: 2010-08-17

Index: collabtive-0.7.5/managemessage.php
===================================================================
--- collabtive-0.7.5.orig/managemessage.php	2012-01-20 14:04:54.000000000 -0600
+++ collabtive-0.7.5/managemessage.php	2012-01-20 14:05:01.000000000 -0600
@@ -102,20 +102,21 @@
             {
                 if (!empty($user["email"]))
                 {
+		    $mailtitle = $langfile["taskassignedsubject"] . " - " . $title;
                     if (is_array($sendto))
                     {
                         if (in_array($user["ID"], $sendto))
                         {
                             // send email
                             $themail = new emailer($settings);
-							$themail->send_mail($user["email"], $langfile["messagewasaddedsubject"], $langfile["hello"] . ",<br /><br/>" . $langfile["messagewasaddedtext"] . "<br /><br />". $message . "<br /><br /><a href = \"" . $url . "managemessage.php?action=showmessage&id=$id&mid=$themsg\">$title</a>");
+							$themail->send_mail($user["email"], $mailtitle, $langfile["hello"] . ",<br /><br/>" . $langfile["messagewasaddedtext"] . "<br /><br />". $message . "<br /><br /><a href = \"" . $url . "managemessage.php?action=showmessage&id=$id&mid=$themsg\">$title</a>");
                         }
                     }
                     else
                     {
                         // send email
                         $themail = new emailer($settings);
-						$themail->send_mail($user["email"], $langfile["messagewasaddedsubject"], $langfile["hello"] . ",<br /><br/>" . $langfile["messagewasaddedtext"] . "<br /><br />". $message . "<br /><br /><a href = \"" . $url . "managemessage.php?action=showmessage&id=$id&mid=$themsg\">$title</a>");
+						$themail->send_mail($user["email"], $mailtitle, $langfile["hello"] . ",<br /><br/>" . $langfile["messagewasaddedtext"] . "<br /><br />". $message . "<br /><br /><a href = \"" . $url . "managemessage.php?action=showmessage&id=$id&mid=$themsg\">$title</a>");
                     }
                 }
             }
Index: collabtive-0.7.5/managetask.php
===================================================================
--- collabtive-0.7.5.orig/managetask.php	2012-01-20 14:04:54.000000000 -0600
+++ collabtive-0.7.5/managetask.php	2012-01-20 14:05:01.000000000 -0600
@@ -76,6 +76,7 @@
         }
 
         if ($settings["mailnotify"]) {
+	    $mailtitle = $langfile["taskassignedsubject"] . " - " . $title;
             foreach($assigned as $member) {
                 $usr = (object) new user();
                 $user = $usr->getProfile($member);
@@ -83,7 +84,7 @@
                 if (!empty($user["email"]) && $userid != $user["ID"]) {
                     // send email
                     $themail = new emailer($settings);
-                    $themail->send_mail($user["email"], $langfile["taskassignedsubject"] , $langfile["hello"] . ",<br /><br/>" . $langfile["taskassignedtext"] . " <a href = \"" . $url . "managetask.php?action=showtask&id=$id&tid=$tid\">$title</a>");
+                    $themail->send_mail($user["email"], $mailtitle , $langfile["hello"] . ",<br /><br/>" . $langfile["taskassignedtext"] . " <a href = \"" . $url . "managetask.php?action=showtask&id=$id&tid=$tid\">$title</a>");
                 }
             }
         }
@@ -148,11 +149,12 @@
                     if ($settings["mailnotify"]) {
                         $usr = (object) new user();
                         $user = $usr->getProfile($assignee);
+			$mailtitle = $langfile["taskassignedsubject"] . " - " . $title;
 
                         if (!empty($user["email"])) {
                             // send email
                             $themail = new emailer($settings);
-                            $themail->send_mail($user["email"], $langfile["taskassignedsubject"] , $langfile["hello"] . ",<br /><br/>" . $langfile["taskassignedtext"] . " <a href = \"" . $url . "managetask.php?action=showtask&id=$id&tid=$tid\">$title</a>");
+                            $themail->send_mail($user["email"], $mailtitle , $langfile["hello"] . ",<br /><br/>" . $langfile["taskassignedtext"] . " <a href = \"" . $url . "managetask.php?action=showtask&id=$id&tid=$tid\">$title</a>");
                         }
                     }
                 }
@@ -234,11 +236,12 @@
         if ($settings["mailnotify"]) {
             $usr = (object) new user();
             $user = $usr->getProfile($user);
+	    $mailtitle = $langfile["taskassignedsubject"] . " - " . $title;
 
             if (!empty($user["email"])) {
                 // send email
                 $themail = new emailer($settings);
-                $themail->send_mail($user["email"], $langfile["taskassignedsubject"] , $langfile["hello"] . ",<br /><br/>" . $langfile["taskassignedtext"] . " <a href = \"" . $url . "managetask.php?action=showtask&id=$id&tid=$tid\">$title</a>");
+                $themail->send_mail($user["email"], $title , $langfile["hello"] . ",<br /><br/>" . $langfile["taskassignedtext"] . " <a href = \"" . $url . "managetask.php?action=showtask&id=$id&tid=$tid\">$title</a>");
             }
         }
         $template->assign("assigntask", 1);
