Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1369

Přidáno uživatelem Ondřej Fibich před více než 12 roky(ů)

Implementace #33 a # 96 (Optimalizace e-mailu vyvojarum pro bugy pro Redmine a Integrace Redmine)

Zobrazit rozdíly:

freenetis/branches/testing/application/controllers/email.php
*/
public function send_email_to_developers()
{
// Use connect() method to load Swiftmailer and connect using the parameters set in the email config file
// Use connect() method to load Swiftmailer and connect using the
// parameters set in the email config file
$swift = email::connect();
// From, subject and HTML message
......
$trace = @$_POST['trace'];
$line = @$_POST['line'];
$file = @$_POST['file'];
$ename = @$_POST['ename'];
if (!valid::email($email))
{
......
url::redirect(url::base());
}
$svninfo = "";
foreach ($this->svn as $key => $value)
{
$svninfo .= __('' . inflector::humanize($key)) . ": ";
if (strpos($value, 'http') !== FALSE)
$svninfo .= $value . "<br />";
else
$svninfo .= __('' . $value) . "<br />";
}
$svninfo .= __("DB schema revision") .
": " . Settings::get('db_schema_version');
$subject = __('Freenetis bug report');
$message = '<html><body>' .
'<h1>' . __('Bug report from') . ': ' . $url . '</h1>' .
// Build content
$subject = __('FreenetIS bug report: ' . (empty($ename) ? $url : $ename));
$message_body = nl2br($description);
$attachment = '<html><body>' .
'<h1>' . __('Bug report from') . ": . $url (file: $file, line: $line)</h1>" .
'<p>' . __('Reported by') . ': ' . $uname . '</p>' .
'<p>' . __('Description') . ': ' . nl2br($description) . '</p>' .
'<p>' . __('SVN info') . ': <br />' . $svninfo . '</p>' .
'<h2>' . $error . '</h2>' .
'<p>' . htmlspecialchars_decode($edescription) . '</p>' .
'<p class="message">' . htmlspecialchars_decode($message) . '</p>' .
'<p class="detail">' . htmlspecialchars_decode($detail) . '</p>' .
'<div>' . htmlspecialchars_decode($trace) . '</div>' .
'</body></html>';
$attachment = text::cs_utf2ascii($attachment);
// Build recipient lists
$recipients = new Swift_RecipientList;
$recipients->addTo(DEVELOPER_EMAIL_ADDRESS);
// Build the HTML message
$message = new Swift_Message($subject, $message, "text/html");
$message = new Swift_Message($subject);
$message->attach(new Swift_Message_Part($message_body));
$message->attach(new Swift_Message_Attachment($attachment, 'log.html', 'text/html'));
// Send
$swift->send($message, $recipients, $email);
......
// Redirect
status::success('Thank you for your error report');
url::redirect(url::base());
}
freenetis/branches/testing/system/views/kohana_error_page.php
<td><input type="text" name="uemail" class="required email" /></td>
</tr>
<tr>
<td><label for="ename"><?php echo url_lang::lang('texts.Name of error') ?>:</label></td>
<td><input type="text" name="ename" class="required" /></td>
</tr>
<tr>
<td><label for="udescription"><?php echo url_lang::lang('texts.Description') ?>:</label></td>
<td><textarea cols="80" rows="20"name="udescription" class="required" style="width: 380px; height: 100px;"><?php echo url_lang::lang('texts.Describe what you have been doing, when the error came out') ?>...</textarea></td>
</tr>
freenetis/branches/testing/index.php
);
// Mail to developers
define('DEVELOPER_EMAIL_ADDRESS', 'developers@freenetis.org');
define('DEVELOPER_EMAIL_ADDRESS', 'bugs@freenetis.org');
require SYSPATH.'core/Bootstrap'.EXT;

Také k dispozici: Unified diff