Merge lp:~andersdd/eventum/edit-reporter into lp:eventum

Proposed by Dave Anderson
Status: Merged
Merged at revision: 4464
Proposed branch: lp:~andersdd/eventum/edit-reporter
Merge into: lp:eventum
Diff against target: 27 lines (+10/-0)
1 file modified
lib/eventum/class.edit_reporter.php (+10/-0)
To merge this branch: bzr merge lp:~andersdd/eventum/edit-reporter
Reviewer Review Type Date Requested Status
Eventum Development Team Pending
Review via email: mp+92419@code.launchpad.net

Description of the change

Fixed issue with email address that did not have a system account. Added automatic addition of new reporter to notification list

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/eventum/class.edit_reporter.php'
2--- lib/eventum/class.edit_reporter.php 2012-01-03 18:25:20 +0000
3+++ lib/eventum/class.edit_reporter.php 2012-02-10 06:43:24 +0000
4@@ -49,6 +49,11 @@
5 $email = strtolower(Mail_Helper::getEmailAddress($email));
6 $usr_id = User::getUserIDByEmail($email, true);
7
8+// If no valid user found reset to system account
9+ if ($usr_id == 0){
10+ $usr_id = 1;
11+ }
12+
13 $sql = "UPDATE
14 " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue
15 SET
16@@ -67,6 +72,11 @@
17 $summary = 'Reporter was changed to ' . $email . ' by ' . User::getFullName(Auth::getUserID());
18 History::add($issue_id, Auth::getUserID(), History::getTypeID('issue_updated'), $summary);
19 }
20+
21+ // Add new user to notification list
22+ if ($usr_id > 0){
23+ Notification::subscribeEmail($usr_id, $issue_id, $email, Notification::getDefaultActions());
24+ }
25 return 1;
26 }
27 }

Subscribers

People subscribed via source and target branches