]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 398428: After creating or editing an attachment, immediately display the bug...
authorlpsolit%gmail.com <>
Wed, 3 Oct 2007 22:42:05 +0000 (22:42 +0000)
committerlpsolit%gmail.com <>
Wed, 3 Oct 2007 22:42:05 +0000 (22:42 +0000)
attachment.cgi
template/en/default/attachment/created.html.tmpl
template/en/default/attachment/updated.html.tmpl

index b60f0183b23df26fedc717b15ed7189fba37cf05..13d225bddcfb57a6d9a7328fe1448be718660a34 100755 (executable)
@@ -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();
 
index 69b18c2b70e83593e654346976aa1ddddc7b2da7..58822b89b8c3e72cd0e7a296bbaef03821ee7cb5 100644 (file)
@@ -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 %]
index ca695e6021a1c1db6573fe504903b64cc1c024f4..2cfb217ea70f70f07754b8f9014b4e2188659ca1 100644 (file)
@@ -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 %]