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.6.5/managemessage.php
===================================================================
--- collabtive-0.6.5.orig/managemessage.php	2010-07-01 02:19:06.000000000 -0500
+++ collabtive-0.6.5/managemessage.php	2010-08-31 16:59:02.000000000 -0500
@@ -101,20 +101,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.6.5/managetask.php
===================================================================
--- collabtive-0.6.5.orig/managetask.php	2010-08-26 01:24:20.000000000 -0500
+++ collabtive-0.6.5/managetask.php	2010-08-31 17:01:29.000000000 -0500
@@ -75,6 +75,7 @@
             $task->assign($tid, $member);
         }
         if ($settings["mailnotify"]) {
+	    $mailtitle = $langfile["taskassignedsubject"] . " - " . $title;
             foreach($assigned as $member) {
                 $usr = (object) new user();
                 $user = $usr->getProfile($member);
@@ -82,7 +83,7 @@
                 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>");
                 }
             }
         }
@@ -147,11 +148,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>");
                         }
                     }
                 }
@@ -237,11 +239,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);
