{
if ($this->users["$userid"]['options'][0] & $this->registry->emailoptions['notifications']['assignedto'] AND in_array($userid, $this->roles['-notapplicable-']))
{
- $this->notices["$userid"][] = sprintf(
-_('You are no longer assigned to this bug, per %1$s\'s changes.'),
-
- construct_user_display($this->registry->userinfo, false)
- );
+ $user = construct_user_display($this->registry->userinfo, false);
+ $this->notices["$userid"][] = eval('$part = "' . $this->registry->template->fetch('email/notice_unassigned.part') . '";');
}
}
{
if ($this->users["$userid"]['options'][0] & $this->registry->emailoptions['notifications']['assignedto'] AND in_array($userid, $this->roles['-notapplicable-']))
{
- $this->notices["$userid"][] = sprintf(
-_('You have been assigned to this bug by %1$s.'),
-
- construct_user_display($this->registry->userinfo, false)
- );
+ $user = construct_user_display($this->registry->userinfo, false);
+ $this->notices["$userid"][] = eval('$email = "' . $this->registry->template->fetch('email/notice_assigned.part') . '";');
}
}
$userlist = $this->fetch_users_with_on_bit('statusresolve');
foreach ($userlist AS $userid => $user)
{
- $this->notices["$user[userid]"][] = sprintf(
-_('The status of the bug is now "%2$s", from "%1$s".'),
-
- $this->registry->datastore['status']["$old"]['status'],
- $this->registry->datastore['status']["$new"]['status']
- );
+ $this->notices["$user[userid]"][] = eval('$email = "' . $this->registry->template->fetch('email/notice_status.part') . '";');
}
}
$userlist = $this->fetch_users_with_on_bit('statusresolve');
foreach ($userlist AS $userid => $user)
{
- $this->notices["$user[userid]"][] = sprintf(
-_('This bug has been resolved with resolution "%2$s", from "%1$s".'),
-
- $this->registry->datastore['resolution']["$old"]['resolution'],
- $this->registry->datastore['resolution']["$new"]['resolution']
- );
+ $this->notices["$user[userid]"][] = eval('$email = "' . $this->registry->template->fetch('email/notice_resolution.part') . '";');
}
}
$userlist = $this->fetch_useres_with_on_bit('duplicates');
foreach ($userlist AS $userid => $user)
{
- $this->notices["$user[userid]"][] = sprintf(
-_('The duplicates list has changed from "%1$s" to %2$s".'),
-
- $old,
- $new
- );
+ $this->notices["$user[userid]"][] = eval('$email = "' . $this->registry->template->fetch('email/notice_duplicates.part') . '";');
}
}
$userlist = $this->fetch_users_with_on_bit('otherfield');
foreach ($userlist AS $userid => $user)
{
- $this->notices["$user[userid]"][] = sprintf(
-_('The severity has been elevated from "%1$s" to "%2$s".'),
-
- $this->registry->datastore['severity']["$old"]['severity'],
- $this->registry->datastore['severity']["$new"]['severity']
- );
+ $this->notices["$user[userid]"][] = eval('$email = "' . $this->registry->template->fetch('email/notice_severity.part') . '";');
}
}
$userlist = $this->fetch_users_with_on_bit('otherfield');
foreach ($userlist AS $userid => $user)
{
- $this->notices["$user[userid]"][] = sprintf(
-_('The priority has been elevatd from "%1$s" to "%2$s".'),
-
- $this->registry->datastore['priority']["$old"]['priority'],
- $this->registry->datastore['priority']["$new"]['priority']
- );
+ $this->notices["$user[userid]"][] = eval('$email = "' . $this->registry->template->fetch('email/notice_priority.part') . '";');
}
}
function notice_pcv_change($old, $new)
{
$userlist = $this->fetch_users_with_on_bit('otherfield');
+
+ $old = $this->registry->datastore['product']["$old[0]"]['title'] . '/' . ($old[1] ? $this->registry->datastore['product']["$old[1]"]['title'] . '/' : '') . $this->registry->datastore['version']["$old[2]"]['version'];
+ $new = $this->registry->datastore['product']["$new[0]"]['title'] . '/' . ($new[1] ? $this->registry->datastore['product']["$new[1]"]['title'] . '/' : '') . $this->registry->datastore['version']["$new[2]"]['version'];
+
foreach ($userlist AS $userid => $user)
{
- $this->notices["$user[userid]"][] = sprintf(
-_('The product, component, and version combination has changed from "%1$s" to "%2$s".'),
-
- $this->registry->datastore['product']["$old[0]"]['title'] . '/' . ($old[1] ? $this->registry->datastore['product']["$old[1]"]['title'] . '/' : '') . $this->registry->datastore['version']["$old[2]"]['version'],
- $this->registry->datastore['product']["$new[0]"]['title'] . '/' . ($new[1] ? $this->registry->datastore['product']["$new[1]"]['title'] . '/' : '') . $this->registry->datastore['version']["$new[2]"]['version']
- );
+ $this->notices["$user[userid]"][] = eval('$email = "' . $this->registry->template->fetch('email/notice_product.part') . '";');
}
}
$userlist = $this->fetch_users_with_on_bit('newcomment');
foreach ($userlist AS $userid => $user)
{
- $this->notices["$user[userid]"][] = sprintf(
-_('The following comment was added by %1$s on %2$s:
-============================================
-%3$s
-============================================'),
-
- construct_user_display($this->registry->userinfo, false),
- $this->registry->modules['date']->format($this->registry->options['dateformat'], $comment['dateline']),
- $comment['comment']
- );
+ $user = construct_user_display($this->registry->userinfo, false);
+ $date = $this->registry->modules['date']->format($this->registry->options['dateformat'], $comment['dateline']);
+
+ $this->notices["$user[userid]"][] = eval('$email = "' . $this->registry->template->fetch('email/notice_comment.part') . '";');
}
}
$userlist = $this->fetch_users_with_on_bit('otherfield');
foreach ($userlist AS $userid => $user)
{
- $this->notices["$user[userid]"][] = sprintf(
-_('The %1$s field changed from "%2$s" to "%3$s".'),
-
- $name,
- $old,
- $new
- );
+ $this->notices["$user[userid]"][] = eval('$email = "' . $this->registry->template->fetch('email/notice_other.part') . '";');
}
}
$userlist = $this->fetch_users_with_on_bit('newattachment');
foreach ($userlist AS $userid => $user)
{
- $this->notices["$userid"][] = sprintf(
-_('%1$s has uploaded a new attachment:
-============================================
-File name: %2$s
-Description: %3$s
-File size: %4$s Bytes
-Makes obsolete: %5$s
-View: %6$s
-============================================'),
-
- construct_user_display($this->registry->userinfo, false),
- $attachment['filename'],
- $attachment['description'],
- $attachment['filesize'],
- implode(', ', (array)$obsolete),
- $this->registry->options['trackerurl'] . '/viewattachment.php?attachmentid=' . $id
- );
+ $user = construct_user_display($this->registry->userinfo, false);
+ $obsoletes = implode(', ', (array)$obsolete);
+
+ $this->notices["$userid"][] = eval('$email = "' . $this->registry->template->fetch('email/notice_attachment.part') . '";');
}
}
{
if (!is_array($this->users["$user[userid]"]))
{
- $this->notices["$user[userid]"][] = sprintf(
-_('
-This bug has been added to the database:
-============================================
-Bug ID: %1$s
-Summary: %2$s
-Reporter: %3$s
-Product/Component/Version: %4$s
-Initial report:
---------------------------------------------
-%5$s
---------------------------------------------
-============================================'),
- $bug['bugid'],
- $bug['summary'],
- construct_user_display($this->registry->userinfo, false),
- $this->registry->datastore['product']["$bug[product]"]['title'] . '/' . ($bug['component'] ? $this->registry->datastore['product']["$bug[component]"]['title'] . '/' : '') . $this->registry->datastore['version']["$bug[version]"]['version'],
- $comment['comment']
- );
+ $user = construct_user_display($this->registry->userinfo, false);
+ $product = $this->registry->datastore['product']["$bug[product]"]['title'] . '/' . ($bug['component'] ? $this->registry->datastore['product']["$bug[component]"]['title'] . '/' : '') . $this->registry->datastore['version']["$bug[version]"]['version'];
+ $this->notices["$user[userid]"][] = eval('$email = "' . $this->registry->template->fetch('email/notice_new_bug.part') . '";');
$this->users["$user[userid]"] = $user;
unset($this->users["$user[userid]"]['mask'], $this->users["$user[userid]"]['relation']);
}
{
// get the current bug for permissions checks
$bug = $this->registry->db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = " . $this->bug['bugid']);
- $this->registry->mail->setSubject(sprintf(_('%1$s Bug Notification - %2$s'), $this->registry->options['trackertitle'], $this->bug['summary']));
foreach ($this->notices AS $userid => $noticelist)
{
if ($userid == $this->registry->userinfo['userid'])
continue;
}
- $this->registry->mail->setBodyText(sprintf(_('Hi %1$s,
-
-You are receiving this email because you have opted to get notifications for the %2$s bug tracker.
-
-The bug is "%5$s" (id: %6$s) located at %4$s/showreport.php?bugid=%6$s
-
-Here are the notices:
-###################################################################
-
-%3$s
-
-###################################################################
-If you no longer want to receive email from us, please log into your account and click the "My Controls" tab at the top of the screen to change email preferences.
-
-%4$s'),
- $this->users["$userid"]['displayname'],
- $this->registry->options['trackertitle'],
- implode("\n\n", $noticelist),
- $this->registry->options['trackerurl'],
- $this->bug['summary'],
- $this->bug['bugid']
- ));
+ $parts = implode("\n\n", $noticelist);
+
+ eval('$email = "' . $this->registry->template->fetch('email/bugnotification.xml') . '";');
+ $email = $this->registry->xml->parse($email);
+ $this->registry->mail->setSubject($email['email']['subject']['value']);
+ $this->registry->mail->setBodyText($email['email']['bodyText']['value']);
+
if (!empty($this->users["$userid"]['email']))
{
$this->registry->mail->send($this->users["$userid"]['email'], $this->users["$userid"]['displayname']);