Indefero

Indefero Commit Details


Date:2008-12-01 14:39:17 (16 years 20 days 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:da23f2b915183cdd13028f749da65c1ed9ea8b50
Parents: fefff591b63c595152adadb8616bec7bfe8e700c
Message:Added review update notification.

Changes:

File differences

src/IDF/Views/Review.php
153153
154154
155155
156
156157
157
158
158
159
159160
160161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
161191
162192
163193
));
if ($form->isValid()) {
$patch = $form->save();
$review = $patch->get_review();
$urlr = Pluf_HTTP_URL_urlForView('IDF_Views_Review::view',
array($prj->shortname, $patch->get_review()->id));
$request->user->setMessage(sprintf(__('Your <a href="%s">code review %d</a> has been published.'), $urlr, $patch->get_review()->id));
array($prj->shortname, $review->id));
$request->user->setMessage(sprintf(__('Your <a href="%s">code review %d</a> has been published.'), $urlr, $review->id));
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Review::index',
array($prj->shortname));
// Get the list of reviewers + submitter
$reviewers = $review->get_reviewers_list();
if (!Pluf_Model_InArray($review->get_submitter(), $reviewers)) {
$reviewers[] = $review->get_submitter();
}
$comments = $patch->get_filecomments_list(array('order' => 'id DESC'));
$context = new Pluf_Template_Context(
array(
'review' => $review,
'patch' => $patch,
'comments' => $comments,
'project' => $prj,
'url_base' => Pluf::f('url_base'),
)
);
$tmpl = new Pluf_Template('idf/review/review-updated-email.txt');
$text_email = $tmpl->render($context);
$email = new Pluf_Mail_Batch(Pluf::f('from_email'));
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();
}
}
$email->close();
return new Pluf_HTTP_Response_Redirect($url);
}
} else {
src/IDF/templates/idf/review/review-updated-email.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{trans 'Hello,'}
{blocktrans}The following review has been updated:{/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 'Comments (last first):'}
{foreach $comments as $c}{assign $who = $c.get_submitter()}# {blocktrans}By {$who|safe}, {$c.creation_dtime|date}, on file:
{$c.cfile|safe}
{/blocktrans}
{$c.content|safe}
{/foreach}
--
{trans 'Review:'} {$url_base}{url 'IDF_Views_Review::view', array($project.shortname, $review.id)}

Archive Download the corresponding diff file

Page rendered in 0.07451s using 13 queries.