From c87cca60cfe149bf4ffe7ed1746189b936e87bac Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Mon, 28 Jan 2008 05:14:14 +0000 Subject: Bug 325487: Admin pages should require less "clicks" (remove useless confirmation pages) - Patch by Frédéric Buclin r=justdave r=mkanat a=LpSolit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- editflagtypes.cgi | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'editflagtypes.cgi') diff --git a/editflagtypes.cgi b/editflagtypes.cgi index 47eac753e..4117c91e8 100755 --- a/editflagtypes.cgi +++ b/editflagtypes.cgi @@ -332,15 +332,17 @@ sub insert { $dbh->bz_commit_transaction(); - $vars->{'name'} = $cgi->param('name'); + $vars->{'name'} = $name; $vars->{'message'} = "flag_type_created"; delete_token($token); + $vars->{'bug_types'} = Bugzilla::FlagType::match({'target_type' => 'bug'}); + $vars->{'attachment_types'} = Bugzilla::FlagType::match({'target_type' => 'attachment'}); + # Return the appropriate HTTP response headers. print $cgi->header(); - # Generate and return the UI (HTML page) from the appropriate template. - $template->process("global/message.html.tmpl", $vars) + $template->process("admin/flag-type/list.html.tmpl", $vars) || ThrowTemplateError($template->error()); } @@ -427,15 +429,17 @@ sub update { undef, $id); } - $vars->{'name'} = $cgi->param('name'); + $vars->{'name'} = $name; $vars->{'message'} = "flag_type_changes_saved"; delete_token($token); + $vars->{'bug_types'} = Bugzilla::FlagType::match({'target_type' => 'bug'}); + $vars->{'attachment_types'} = Bugzilla::FlagType::match({'target_type' => 'attachment'}); + # Return the appropriate HTTP response headers. print $cgi->header(); - # Generate and return the UI (HTML page) from the appropriate template. - $template->process("global/message.html.tmpl", $vars) + $template->process("admin/flag-type/list.html.tmpl", $vars) || ThrowTemplateError($template->error()); } @@ -484,11 +488,13 @@ sub deleteType { $vars->{'message'} = "flag_type_deleted"; delete_token($token); + $vars->{'bug_types'} = Bugzilla::FlagType::match({'target_type' => 'bug'}); + $vars->{'attachment_types'} = Bugzilla::FlagType::match({'target_type' => 'attachment'}); + # Return the appropriate HTTP response headers. print $cgi->header(); - # Generate and return the UI (HTML page) from the appropriate template. - $template->process("global/message.html.tmpl", $vars) + $template->process("admin/flag-type/list.html.tmpl", $vars) || ThrowTemplateError($template->error()); } @@ -509,11 +515,14 @@ sub deactivate { $vars->{'flag_type'} = $flag_type; delete_token($token); + $vars->{'bug_types'} = Bugzilla::FlagType::match({'target_type' => 'bug'}); + $vars->{'attachment_types'} = Bugzilla::FlagType::match({'target_type' => 'attachment'}); + # Return the appropriate HTTP response headers. print $cgi->header(); # Generate and return the UI (HTML page) from the appropriate template. - $template->process("global/message.html.tmpl", $vars) + $template->process("admin/flag-type/list.html.tmpl", $vars) || ThrowTemplateError($template->error()); } -- cgit v1.2.3-24-g4f1b