Indefero

Indefero Commit Details


Date:2009-01-28 07:59:51 (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:be7cbabe8d5d44cbb687df5862b104cc4369a78b
Parents: ee5044fb1ce20cace1fc434179334bad6b6a9207
Message:Added the notification of changes for the documentation pages.

Changes:

File differences

src/IDF/Form/WikiCreate.php
199199
200200
201201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
202221
203222
204223
$rev->submitter = $this->user;
$rev->summary = __('Initial page creation');
$rev->create();
// send the notification
if ('' != $this->project->getConf()->getVal('wiki_notification_email', '')) {
$context = new Pluf_Template_Context(
array(
'page' => $page,
'rev' => $rev,
'project' => $this->project,
'url_base' => Pluf::f('url_base'),
)
);
$tmpl = new Pluf_Template('idf/wiki/wiki-created-email.txt');
$text_email = $tmpl->render($context);
$email = new Pluf_Mail(Pluf::f('from_email'),
$this->project->getConf()->getVal('wiki_notification_email'),
sprintf(__('New Documentation Page %s - %s (%s)'),
$page->title, $page->summary, $this->project->shortname));
$email->addTextMessage($text_email);
$email->sendMail();
}
return $page;
}
}
src/IDF/Form/WikiUpdate.php
236236
237237
238238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
239258
240259
241260
$rev->summary = $this->cleaned_data['comment'];
$rev->changes = $changes;
$rev->create();
// send the notification
if ('' != $this->project->getConf()->getVal('wiki_notification_email', '')) {
$context = new Pluf_Template_Context(
array(
'page' => $this->page,
'rev' => $rev,
'project' => $this->project,
'url_base' => Pluf::f('url_base'),
)
);
$tmpl = new Pluf_Template('idf/wiki/wiki-updated-email.txt');
$text_email = $tmpl->render($context);
$email = new Pluf_Mail(Pluf::f('from_email'),
$this->project->getConf()->getVal('wiki_notification_email'),
sprintf(__('Documentation Page Changed %s - %s (%s)'),
$this->page->title, $this->page->summary, $this->project->shortname));
$email->addTextMessage($text_email);
$email->sendMail();
}
return $this->page;
}
}
src/IDF/templates/idf/wiki/wiki-created-email.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{trans 'Hello,'}
{blocktrans}A new documentation page has been created:{/blocktrans}
{$page.title|safe} - {$page.summary|safe}
{trans 'Project:'} {$project.name|safe}
{trans 'Created by:'} {$rev.get_submitter|safe}
{assign $tags = $page.get_tags_list()}{if $tags.count()}{trans 'Labels:'}
{foreach $tags as $tag} {$tag.class|safe}:{$tag.name|safe}
{/foreach}{/if}
{trans 'Content:'}
{$rev.content}
--
{trans 'Documentation page:'} {$url_base}{url 'IDF_Views_Wiki::view', array($project.shortname, $page.title)}
src/IDF/templates/idf/wiki/wiki-updated-email.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{trans 'Hello,'}
{blocktrans}The following documentation page has been updated:{/blocktrans}
{$page.title|safe} - {$page.summary|safe}
{trans 'Project:'} {$project.name|safe}
{trans 'Summary:'} {$rev.summary|safe}
{trans 'Updated by:'} {$page.get_submitter|safe}
{trans 'Created by:'} {$rev.get_submitter|safe}
{assign $tags = $page.get_tags_list()}{if $tags.count()}{trans 'Labels:'}
{foreach $tags as $tag} {$tag.class|safe}:{$tag.name|safe}
{/foreach}{/if}{if $rev.changedRevision()}{trans 'Changes:'}
{foreach $rev.changes as $w => $v}
{if $w == 'su'}{trans 'Summary:'}{/if}{if $w == 'lb'}{trans 'Labels:'}{/if} {if $w == 'lb'}{assign $l = implode(', ', $v)}{$l}{else}{$v}{/if}{/foreach}{/if}
{trans 'New content:'}
{$rev.content}
--
{trans 'Documentation page:'} {$url_base}{url 'IDF_Views_Wiki::view', array($project.shortname, $page.title)}

Archive Download the corresponding diff file

Page rendered in 0.08221s using 13 queries.