if ($this->users["$userid"]['options'][0] & bugdar::$emailOptions['notifications']['assignedto'] && in_array($userid, $this->roles['-notapplicable-']))
{
$user = construct_user_display(bugdar::$userinfo, false);
- eval('$part = "' . $this->registry->template->fetch(FetchEmailPath('notice_unassigned.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$userid"][] = $part;
+
+ $email = get_email_text('notice_unassigned');
+ $this->notices["$userid"][] = sprintf($email['part'], $user);
}
}
if ($this->users["$userid"]['options'][0] & bugdar::$emailOptions['notifications']['assignedto'] && in_array($userid, $this->roles['-notapplicable-']))
{
$user = construct_user_display(bugdar::$userinfo, false);
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_assigned.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$userid"][] = $email;
+
+ $email = get_email_text('notice_assigned');
+ $this->notices["$userid"][] = sprintf($email['part'], $user);
}
}
private function _noticeStatusChange($old, $new)
{
$userlist = $this->_fetchUsersWithOnBit('statusresolve');
+
+ $old = bugdar::$datastore['status'][$old]['status'];
+ $new = bugdar::$datastore['status'][$new]['status'];
+
foreach ($userlist as $userid => $user)
{
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_status.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$user[userid]"][] = $email;
+ $email = get_email_text('notice_status');
+ $this->notices["$user[userid]"][] = sprintf($email['part'], $new, $old);
}
}
private function _noticeResolutionChange($old, $new)
{
$userlist = $this->_fetchUsersWithOnBit('statusresolve');
+
+ $old = bugdar::$datastore['resolution'][$old]['resolution'];
+ $new = bugdar::$datastore['resolution'][$new]['resolution'];
+
foreach ($userlist as $userid => $user)
{
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_resolution.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$user[userid]"][] = $email;
+ $email = get_email_text('notice_resolution');
+ $this->notices["$user[userid]"][] = sprintf($email['part'], $new, $old);
}
}
private function _noticeDuplicatesChange($old, $new)
{
$userlist = $this->_fetchUsersWithOnBit('duplicates');
+
foreach ($userlist as $userid => $user)
{
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_duplicates.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$user[userid]"][] = $email;
+ $email = get_email_text('notice_duplicates');
+ $this->notices["$user[userid]"][] = sprintf($email['part'], $old, $new);
}
}
private function _noticeSeverityChange($old, $new)
{
$userlist = $this->_fetchUsersWithOnBit('otherfield');
+
+ $old = bugdar::$datastore['severity'][$old]['severity'];
+ $new = bugdar::$datastore['severity'][$new]['severity'];
+
foreach ($userlist as $userid => $user)
{
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_severity.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$user[userid]"][] = $email;
+ $this->notices["$user[userid]"][] = sprintf($email['part'], $old, $new);
}
}
private function _noticePriorityChange($old, $new)
{
$userlist = $this->_fetchUsersWithOnBit('otherfield');
+
+ $old = bugdar::$datastore['priority'][$old]['priority'];
+ $new = bugdar::$datastore['priority'][$new]['priority'];
+
foreach ($userlist as $userid => $user)
{
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_priority.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$user[userid]"][] = $email;
+ $email = get_email_text('notice_priority');
+ $this->notices["$user[userid]"][] = sprintf($email['part'], $old, $new);
}
}
{
$userlist = $this->_fetchUsersWithOnBit('otherfield');
- $old = bugdar::$datastore['product']["$old[0]"]['title'] . '/' . ($old[1] ? bugdar::$datastore['product']["$old[1]"]['title'] . '/' : '') . bugdar::$datastore['version']["$old[2]"]['version'];
- $new = bugdar::$datastore['product']["$new[0]"]['title'] . '/' . ($new[1] ? bugdar::$datastore['product']["$new[1]"]['title'] . '/' : '') . bugdar::$datastore['version']["$new[2]"]['version'];
+ $products = &bugdar::$datastore['product'];
+ $versions = &bugdar::$datastore['version'];
+
+ $old = $products[$old[0]]['title'] . '/' . ($old[1] ? $products[$old[1]]['title'] . '/' : '') . $versions[$old[2]]['version'];
+ $new = $products[$new[0]]['title'] . '/' . ($new[1] ? $products[$new[1]]['title'] . '/' : '') . $versions[$new[2]]['version'];
foreach ($userlist as $userid => $user)
{
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_product.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$user[userid]"][] = $email;
+ $email = get_email_text('notice_product');
+ $this->notices["$user[userid]"][] = sprintf($email['part'], $old, $new);
}
}
foreach ($userlist as $userid => $user)
{
$user = construct_user_display(bugdar::$userinfo, false);
- $date = $this->registry->modules['date']->format(bugdar::$options['dateformat'], $comment['dateline']);
+ $date = BSApp::$date->format(bugdar::$options['dateformat'], $comment['dateline']);
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_comment.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$userid"][] = $email;
+ $email = get_email_text('notice_comment');
+ $this->notices["$userid"][] = sprintf($email['part'], $user, $date, $comment['comment']);
}
}
$userlist = $this->_fetchUsersWithOnBit('otherfield');
foreach ($userlist as $userid => $user)
{
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_other.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$user[userid]"][] = $email;
+ $email = get_email_text('notice_other');
+ $this->notices["$user[userid]"][] = sprintf($email['part'], $name, $old, $new);
}
}
$user = construct_user_display(bugdar::$userinfo, false);
$obsoletes = implode(', ', (array)$obsolete);
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_attachment.part', $this->_localeFromUserId($userid))) . '";');
- $this->notices["$userid"][] = $email;
+ $email = get_email_text('notice_attachment');
+ $this->notices["$userid"][] = sprintf($email['part'], $user, $attachment['filename'], $attachment['description'], $attachment['filesize'], $obsoletes, bugdar::$options['trackerurl'], $attachment['attachmentid']);
}
}
$user = construct_user_display(bugdar::$userinfo, false);
$this->users["$userInfo[userid]"] = $userInfo;
$product = bugdar::$datastore['product']["$bug[product]"]['title'] . '/' . ($bug['component'] ? bugdar::$datastore['product']["$bug[component]"]['title'] . '/' : '') . bugdar::$datastore['version']["$bug[version]"]['version'];
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('notice_new_bug.part', $this->_localeFromUserId($userInfo['userid']))) . '";');
- $this->notices["$userInfo[userid]"][] = $email;
+
+ $email = get_email_text('notice_new_bug');
+ $this->notices["$userInfo[userid]"][] = sprintf($email['part'], $bug['bugid'], $bug['summary'], $user, $product, $comment['comment']);
unset($this->users["$userInfo[userid]"]['mask'], $this->users["$userInfo[userid]"]['relation']);
}
$this->users["$userInfo[userid]"]['options']["$userInfo[relation]"] = $userInfo['mask'];
$return = array();
foreach ($masters as $userid)
{
- $return["$userid"] =& $this->users["$userid"];
+ $return["$userid"] = &$this->users["$userid"];
}
return $return;
$parts = implode("\n\n", $noticelist);
- eval('$email = "' . $this->registry->template->fetch(FetchEmailPath('bugnotification.xml', $this->_localeFromUserId($userid))) . '";');
- $email = $this->registry->xml->parse($email, true);
- $this->registry->mail->setSubject($email['email']['subject']['value']);
- $this->registry->mail->setBodyText($email['email']['bodyText']['value']);
+ $email = get_email_text('bug_notification');
+
+ $body = sprintf($email['bodyText'], $this->users[$userid]['displayname'], bugdar::$options['trackertitle'], $this->bug['summary'], $this->bug['bugid'], bugdar::$options['trackerurl'], $parts);
+
+ $mail = new BSMail();
+ $mail->setSubject(sprintf($email['subject'], bugdar::$options['trackertitle'], $this->bug['summary']));
+ $mail->setBodyText($body);
+ $mail->setFromAddress(MAIL_FROM_ADDRESS);
+ $mail->setFromName(MAIL_FROM_NAME);
if (!empty($this->users["$userid"]['email']))
{
- $this->registry->mail->send($this->users["$userid"]['email'], $this->users["$userid"]['displayname']);
+ $mail->send($this->users["$userid"]['email'], $this->users["$userid"]['displayname']);
}
else
{
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.
%5$s')
+ ),
+
+ // assigned to bug
+ // vars
+ 'notice_assigned' => array(
+ 'part' => T('You have been assigned to this bug by %1$s.')
+ ),
+
+ // unassigned from bug
+ // vars: changer.displayname
+ 'notice_unassigned' => array(
+ 'part' => T('You are no longer assigned to this bug, per %1$s\'s changes.')
+ ),
+
+ // status change
+ // vars: new, old
+ 'notice_status' => array(
+ 'part' => T('The status of the bug is now "%1$s", from "%2$s".')
+ ),
+
+ // resolution change
+ // vars: new, old
+ 'notice_resolution' => array(
+ 'part' => T('This bug has been resolved with resolution "%1$s", from "%2$s".')
+ ),
+
+ // duplicates list change
+ // vars: old, new
+ 'notice_duplicates' => array(
+ 'part' => T('The duplicates list has changed from "%1$s" to "%2$s".')
+ ),
+
+ // severity change
+ // vars: old, new
+ 'notice_severity' => array(
+ 'part' => T('The severity has been elevated from "%1$s" to "%2$s".')
+ ),
+
+ // priority change
+ // vars: old, new
+ 'notice_priority' => array(
+ 'part' => T('The priority has been elevatd from "%1$s" to "%2$s".')
+ ),
+
+ // PCV change
+ // vars: old, new
+ 'notice_product' => array(
+ 'part' => T('The product, component, and version combination has changed from "%1$s" to "%2$s".')
+ ),
+
+ // new comment
+ // vars: user, date, comment
+ 'notice_comment' => array(
+ 'part' => T('The following comment was added by %1$s on %2$s:
+============================================
+%3$s
+============================================')
+ ),
+
+ // other change
+ // vars: field, old, new
+ 'notice_other' => array(
+ 'part' => T('The %1$s field changed from "%2$s" to "%3$s".')
+ ),
+
+ // new attachment
+ // vars: username, filename, description, filesize, obsoletes, trackerurl, attachmentid
+ 'notice_attachment' => array(
+ 'part' => T('%1$s has uploaded a new attachment:
+============================================
+File name: %2$s
+Description: %3$s
+File size: %4$d Bytes
+Makes obsolete: %5$s
+View: %6$s/viewattachment.php?attachmentid=%7$d
+============================================')
+ ),
+
+ // new bug
+ // vars: bugid, summary, reporter, product, initial comment
+ 'notice_new_bug' => array(
+ 'part' => T('This bug has been added to the database:
+============================================
+Bug ID: %1$d
+Summary: %2$s
+Reporter: %3$s
+Product/Component/Version: %4$s
+Initial report:
+--------------------------------------------
+%5$s
+--------------------------------------------
+============================================')
+ ),
+
+ // bug notification
+ // vars: trackertitle, bug.summary
+ // vars: displayname, trackertitle, bug.summary, bug.id, trackerurl, parts
+ 'bug_notification' => array(
+ 'subject' => T('%1$s Bug Notification - %2$s'),
+ 'bodyText' => T('Hi %1$s,
+
+You are receiving this email because you have opted to get notifications for the %2$s bug tracker.
+
+The bug is "%3$s" (id: %4$d) located at %4$s/showreport.php?bugid=%5$d
+
+Here are the notices:
+###################################################################
+
+%6$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')
)
);