Indefero

Indefero Commit Details


Date:2009-01-28 07:03:34 (15 years 10 months ago)
Author:Loic d'Anterroches
Branch:dev, develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:ee5044fb1ce20cace1fc434179334bad6b6a9207
Parents: 2ec653ad43d95bf643a7218a59e7516f46461ceb
Message:Added the notifications for the code review.

Changes:

File differences

src/IDF/Form/ReviewCreate.php
179179
180180
181181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
182202
183203
184204
$patch->commit = self::findCommit($this->cleaned_data['commit']);
$patch->patch = $this->cleaned_data['patch'];
$patch->create();
// Send create notification
if ('' != $this->project->getConf()->getVal('review_notification_email', '')) {
$context = new Pluf_Template_Context(
array(
'review' => $review,
'patch' => $patch,
'comments' => array(),
'project' => $this->project,
'url_base' => Pluf::f('url_base'),
)
);
$tmpl = new Pluf_Template('idf/review/review-created-email.txt');
$text_email = $tmpl->render($context);
$email = new Pluf_Mail(Pluf::f('from_email'),
$this->project->getConf()->getVal('review_notification_email'),
sprintf(__('New Code Review %s - %s (%s)'),
$review->id, $review->summary, $this->project->shortname));
$email->addTextMessage($text_email);
$email->sendMail();
}
return $review;
}
src/IDF/Views/Review.php
177177
178178
179179
180
180181
181182
182
183
184
185
186
187
183
188184
189185
186
187
188
189
190
191
192
193
194
195
196
190197
191198
192199
$tmpl = new Pluf_Template('idf/review/review-updated-email.txt');
$text_email = $tmpl->render($context);
$email = new Pluf_Mail_Batch(Pluf::f('from_email'));
$to_emails = array();
foreach ($reviewers as $user) {
if ($user->id != $request->user->id) {
$email->setSubject(sprintf(__('Updated Code Review %s - %s (%s)'),
$review->id, $review->summary, $prj->shortname));
$email->setTo($user->email);
$email->setReturnPath(Pluf::f('from_email'));
$email->addTextMessage($text_email);
$email->sendMail();
$to_emails[] = $user->email;
}
}
if ('' != $request->conf->getVal('review_notification_email', '')) {
$to_emails[] = $request->conf->getVal('review_notification_email');
}
foreach ($to_emails as $oemail) {
$email->setSubject(sprintf(__('Updated Code Review %s - %s (%s)'),
$review->id, $review->summary, $prj->shortname));
$email->setTo($oemail);
$email->setReturnPath(Pluf::f('from_email'));
$email->addTextMessage($text_email);
$email->sendMail();
}
$email->close();
return new Pluf_HTTP_Response_Redirect($url);
}
src/IDF/templates/idf/review/review-created-email.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{trans 'Hello,'}
{blocktrans}The following review has been created:{/blocktrans}
{$review.id} - {$review.summary|safe}
{trans 'Project:'} {$project.name|safe}
{trans 'Status:'} {$review.get_status.name}
{trans 'Reported by:'} {$review.get_submitter|safe}
{trans 'URL:'} {$url_base}{url 'IDF_Views_Review::view', array($project.shortname, $review.id)}
{assign $tags = $review.get_tags_list()}{if $tags.count()}{trans 'Labels:'}
{foreach $tags as $tag} {$tag.class|safe}:{$tag.name|safe}
{/foreach}
{/if}
--
{trans 'Review:'} {$url_base}{url 'IDF_Views_Review::view', array($project.shortname, $review.id)}

Archive Download the corresponding diff file

Page rendered in 0.07482s using 13 queries.