summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-10-04 00:42:05 +0200
committerlpsolit%gmail.com <>2007-10-04 00:42:05 +0200
commit4c93d5fbcc1e5b8777ef26ea217c8de38d290fa6 (patch)
treecd941118d5e2dc1cc31f44265bc00acd83166709
parent76e5ced1875498b9f4de15019abcb54a73ed09bc (diff)
downloadbugzilla-4c93d5fbcc1e5b8777ef26ea217c8de38d290fa6.tar.gz
bugzilla-4c93d5fbcc1e5b8777ef26ea217c8de38d290fa6.tar.xz
Bug 398428: After creating or editing an attachment, immediately display the bug it belongs to - Patch by Frédéric Buclin <LpSolit@gmail.com> r=ghendricks a=LpSolit
-rwxr-xr-xattachment.cgi19
-rw-r--r--template/en/default/attachment/created.html.tmpl6
-rw-r--r--template/en/default/attachment/updated.html.tmpl4
3 files changed, 19 insertions, 10 deletions
diff --git a/attachment.cgi b/attachment.cgi
index b60f0183b..13d225bdd 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -72,6 +72,12 @@ local our $vars = {};
# Determine whether to use the action specified by the user or the default.
my $action = $cgi->param('action') || 'view';
+# Determine if PatchReader is installed
+eval {
+ require PatchReader;
+ $vars->{'patchviewerinstalled'} = 1;
+};
+
if ($action eq "view")
{
view();
@@ -397,6 +403,10 @@ sub insert {
$vars->{'mailrecipients'} = { 'changer' => $user->login,
'owner' => $owner };
$vars->{'attachment'} = $attachment;
+ # We cannot reuse the $bug object as delta_ts has eventually been updated
+ # since the object was created.
+ $vars->{'bugs'} = [new Bugzilla::Bug($bugid)];
+ $vars->{'header_done'} = 1;
$vars->{'contenttypemethod'} = $cgi->param('contenttypemethod');
print $cgi->header();
@@ -439,11 +449,6 @@ sub edit {
$vars->{'bugsummary'} = $bugsummary;
$vars->{'attachments'} = $bugattachments;
- # Determine if PatchReader is installed
- eval {
- require PatchReader;
- $vars->{'patchviewerinstalled'} = 1;
- };
print $cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
@@ -591,6 +596,10 @@ sub update {
# Define the variables and functions that will be passed to the UI template.
$vars->{'mailrecipients'} = { 'changer' => Bugzilla->user->login };
$vars->{'attachment'} = $attachment;
+ # We cannot reuse the $bug object as delta_ts has eventually been updated
+ # since the object was created.
+ $vars->{'bugs'} = [new Bugzilla::Bug($bug->id)];
+ $vars->{'header_done'} = 1;
print $cgi->header();
diff --git a/template/en/default/attachment/created.html.tmpl b/template/en/default/attachment/created.html.tmpl
index 69b18c2b7..58822b89b 100644
--- a/template/en/default/attachment/created.html.tmpl
+++ b/template/en/default/attachment/created.html.tmpl
@@ -27,7 +27,7 @@
[% PROCESS global/variables.none.tmpl %]
[% PROCESS global/header.html.tmpl
- title = "Changes Submitted"
+ title = "Attachment $attachment.id added to $terms.Bug $attachment.bug_id"
%]
<dl>
@@ -60,7 +60,7 @@
<p>
<a href="attachment.cgi?bugid=[% attachment.bug_id %]&amp;action=enter">Create
- Another Attachment to [% terms.Bug %] #[% attachment.bug_id %]</a>
+ Another Attachment to [% terms.Bug %] [%+ attachment.bug_id %]</a>
</p>
-[% PROCESS global/footer.html.tmpl %]
+[% PROCESS bug/show.html.tmpl %]
diff --git a/template/en/default/attachment/updated.html.tmpl b/template/en/default/attachment/updated.html.tmpl
index ca695e602..2cfb217ea 100644
--- a/template/en/default/attachment/updated.html.tmpl
+++ b/template/en/default/attachment/updated.html.tmpl
@@ -26,7 +26,7 @@
[% PROCESS global/variables.none.tmpl %]
[% PROCESS global/header.html.tmpl
- title = "Changes Submitted"
+ title = "Changes Submitted to Attachment $attachment.id of $terms.Bug $attachment.bug_id"
%]
<dl>
@@ -41,4 +41,4 @@
</dd>
</dl>
-[% PROCESS global/footer.html.tmpl %]
+[% PROCESS bug/show.html.tmpl %]