Indefero

Indefero Commit Details


Date:2009-02-27 07:21:09 (15 years 9 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:8da821eef4647e4026d16bfc3a444335f7c32b7c
Parents: 7cc5a2dc5817e1073835877650cb4972baa67f6c
Message:Fixed issue 131, added ability to preview before submitting an issue.

Changes:

File differences

src/IDF/Views/Issue.php
142142
143143
144144
145
146
145147
146148
147149
148150
149
151
150152
151153
152154
......
187189
188190
189191
192
190193
191194
192195
......
252255
253256
254257
258
259
255260
256261
257262
......
263268
264269
265270
266
271
267272
268273
269274
......
324329
325330
326331
332
327333
328334
329335
$params = array(
'project' => $prj,
'user' => $request->user);
$preview = (isset($request->POST['preview'])) ?
$request->POST['content'] : false;
if ($request->method == 'POST') {
$form = new IDF_Form_IssueCreate(array_merge($request->POST,
$request->FILES),
$params);
if ($form->isValid()) {
if (!isset($request->POST['preview']) and $form->isValid()) {
$issue = $form->save();
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::index',
array($prj->shortname));
array('project' => $prj,
'form' => $form,
'page_title' => $title,
'preview' => $preview,
),
self::autoCompleteArrays($prj)
);
$starred = false;
$closed = in_array($issue->status, $prj->getTagIdsByStatus('closed'));
$interested = $issue->get_interested_list();
$preview = (isset($request->POST['preview'])) ?
$request->POST['content'] : false;
if (!$request->user->isAnonymous()) {
$starred = Pluf_Model_InArray($request->user, $issue->get_interested_list());
$params = array(
$form = new IDF_Form_IssueUpdate(array_merge($request->POST,
$request->FILES),
$params);
if ($form->isValid()) {
if (!isset($request->POST['preview']) && $form->isValid()) {
$issue = $form->save();
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::index',
array($prj->shortname));
'starred' => $starred,
'page_title' => $title,
'closed' => $closed,
'preview' => $preview,
'interested' =>$interested->count(),
),
$arrays),
src/IDF/templates/idf/issues/create.html
1010
1111
1212
13
14
15
16
17
18
19
20
1321
1422
1523
......
6775
6876
6977
70
78
79
80
81
7182
7283
7384
</div>
{/if}
{if $preview}
<h2 class="top">{trans 'Preview'}</h2>
<div class="issue-comment issue-comment-first issue-comment-last">
<br /><pre class="issue-comment-text">{issuetext $preview, $request}</pre>
</div>
<hr />
{/if}
<form method="post" enctype="multipart/form-data" action="{url 'IDF_Views_Issue::create', array($project.shortname)}" >
<table class="form" summary="">
<tr>
</tr>{/if}
<tr>
<td>&nbsp;</td>
<td><input type="submit" value="{trans 'Submit Issue'}" name="submit" /> | <a href="{url 'IDF_Views_Issue::index', array($project.shortname)}">{trans 'Cancel'}</a>
<td>
<input type="submit" value="{trans 'Submit Issue'}" name="submit" />
<input type="submit" value="{trans 'Preview'}" name="preview" /> |
<a href="{url 'IDF_Views_Issue::index', array($project.shortname)}">{trans 'Cancel'}</a>
</td>
</tr>
</table>
src/IDF/templates/idf/issues/view.html
5050
5151
5252
53
5354
55
56
57
58
59
60
5461
62
5563
5664
5765
......
109117
110118
111119
112
120
121
122
123
113124
114125
115126
{if $closed and (!$isOwner and !$isMember)}
<p><img src="{media '/idf/img/warning.png'}" style="vertical-align: text-bottom;" alt=" " /> {blocktrans}This issue is marked as closed, add a comment only if you think this issue is still valid and more work is needed to fully fix it.{/blocktrans}</p>
{/if}
{if $preview}
<h2>{trans 'Preview'}</h2>
<div class="issue-comment issue-comment-first issue-comment-last">
<br /><pre class="issue-comment-text">{issuetext $preview, $request}</pre>
</div>
<hr />
{/if}
<form method="post" enctype="multipart/form-data" action="{url 'IDF_Views_Issue::view', array($project.shortname, $issue.id)}" >
<table class="form" summary="">
<tr>
</tr>{/if}
<tr>
<td>&nbsp;</td>
<td><input type="submit" value="{trans 'Submit Changes'}" name="submit" /> | <a href="{url 'IDF_Views_Issue::view', array($project.shortname, $issue.id)}">{trans 'Cancel'}</a>
<td>
<input type="submit" value="{trans 'Submit Changes'}" name="submit" />
<input type="submit" value="{trans 'Preview'}" name="preview" /> |
<a href="{url 'IDF_Views_Issue::view', array($project.shortname, $issue.id)}">{trans 'Cancel'}</a>
</td>
</tr>
</table>

Archive Download the corresponding diff file

Page rendered in 0.08434s using 14 queries.