From 05d101e58b400b1a52adcc86515b5442b85cd2f5 Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Wed, 24 Apr 2002 14:24:43 +0000 Subject: Bug 138588 - change to use new template structure. Patch by gerv, r=myk, afranke. --- Bugzilla/Token.pm | 15 ++++++--------- CGI.pl | 2 +- Token.pm | 15 ++++++--------- attachment.cgi | 26 ++++++++++---------------- bug_form.pl | 9 ++++----- buglist.cgi | 22 ++++++++++------------ colchange.cgi | 5 ++--- createaccount.cgi | 13 ++++++------- describecomponents.cgi | 8 ++++---- describekeywords.cgi | 5 ++--- duplicates.cgi | 5 ++--- editattachstatuses.cgi | 20 ++++++++------------ enter_bug.cgi | 8 ++++---- index.cgi | 5 ++--- long_list.cgi | 5 ++--- post_bug.cgi | 11 ++++++----- process_bug.cgi | 20 ++++++++++---------- query.cgi | 5 ++--- quips.cgi | 5 ++--- relogin.cgi | 3 +-- show_activity.cgi | 5 ++--- showdependencygraph.cgi | 5 ++--- showdependencytree.cgi | 5 ++--- sidebar.cgi | 5 ++--- token.cgi | 25 +++++++++---------------- userprefs.cgi | 5 ++--- votes.cgi | 14 ++++++-------- xml.cgi | 7 +++---- 28 files changed, 118 insertions(+), 160 deletions(-) diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm index 9c136184b..39584bd9c 100644 --- a/Bugzilla/Token.pm +++ b/Bugzilla/Token.pm @@ -71,9 +71,8 @@ sub IssueEmailChangeToken { $vars->{'emailaddress'} = $old_email . &::Param('emailsuffix'); my $message; - $template->process("token/emailchangeold.txt.tmpl", $vars, \$message) - || &::DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("account/email/change-old.txt.tmpl", $vars, \$message) + || &::ThrowTemplateError($template->error()); open SENDMAIL, "|/usr/lib/sendmail -t -i"; print SENDMAIL $message; @@ -83,9 +82,8 @@ sub IssueEmailChangeToken { $vars->{'emailaddress'} = $new_email . &::Param('emailsuffix'); $message = ""; - $template->process("token/emailchangenew.txt.tmpl", $vars, \$message) - || &::DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("account/email/change-new.txt.tmpl", $vars, \$message) + || &::ThrowTemplateError($template->error()); open SENDMAIL, "|/usr/lib/sendmail -t -i"; print SENDMAIL $message; @@ -222,9 +220,8 @@ sub Cancel { # Notify the user via email about the cancellation. my $message; - $template->process("token/tokencancel.txt.tmpl", $vars, \$message) - || &::DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("account/cancel-token.txt.tmpl", $vars, \$message) + || &::ThrowTemplateError($template->error()); open SENDMAIL, "|/usr/lib/sendmail -t -i"; print SENDMAIL $message; diff --git a/CGI.pl b/CGI.pl index b7a513f2a..983513306 100644 --- a/CGI.pl +++ b/CGI.pl @@ -69,7 +69,7 @@ if (Param("shutdownhtml") && $0 !~ m:[\\/](do)?editparams.cgi$:) { # Generate and return an HTML message about the downtime. $::template->process("global/message.html.tmpl", $::vars) - || DisplayError("Template process failed: " . $::template->error()); + || ThrowTemplateError($::template->error()); exit; } diff --git a/Token.pm b/Token.pm index 9c136184b..39584bd9c 100644 --- a/Token.pm +++ b/Token.pm @@ -71,9 +71,8 @@ sub IssueEmailChangeToken { $vars->{'emailaddress'} = $old_email . &::Param('emailsuffix'); my $message; - $template->process("token/emailchangeold.txt.tmpl", $vars, \$message) - || &::DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("account/email/change-old.txt.tmpl", $vars, \$message) + || &::ThrowTemplateError($template->error()); open SENDMAIL, "|/usr/lib/sendmail -t -i"; print SENDMAIL $message; @@ -83,9 +82,8 @@ sub IssueEmailChangeToken { $vars->{'emailaddress'} = $new_email . &::Param('emailsuffix'); $message = ""; - $template->process("token/emailchangenew.txt.tmpl", $vars, \$message) - || &::DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("account/email/change-new.txt.tmpl", $vars, \$message) + || &::ThrowTemplateError($template->error()); open SENDMAIL, "|/usr/lib/sendmail -t -i"; print SENDMAIL $message; @@ -222,9 +220,8 @@ sub Cancel { # Notify the user via email about the cancellation. my $message; - $template->process("token/tokencancel.txt.tmpl", $vars, \$message) - || &::DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("account/cancel-token.txt.tmpl", $vars, \$message) + || &::ThrowTemplateError($template->error()); open SENDMAIL, "|/usr/lib/sendmail -t -i"; print SENDMAIL $message; diff --git a/attachment.cgi b/attachment.cgi index 66c3236a7..f45b4efd3 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -416,9 +416,8 @@ sub viewall print "Content-Type: text/html\n\n"; # Generate and return the UI (HTML page) from the appropriate template. - $template->process("attachment/viewall.atml", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("attachment/show-multiple.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } @@ -459,9 +458,8 @@ sub enter print "Content-Type: text/html\n\n"; # Generate and return the UI (HTML page) from the appropriate template. - $template->process("attachment/enter.atml", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("attachment/create.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } @@ -527,9 +525,8 @@ sub insert print "Content-Type: text/html\n\n"; # Generate and return the UI (HTML page) from the appropriate template. - $template->process("attachment/created.atml", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("attachment/created.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } @@ -603,9 +600,8 @@ sub edit print "Content-Type: text/html\n\n"; # Generate and return the UI (HTML page) from the appropriate template. - $template->process("attachment/edit.atml", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("attachment/edit.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } @@ -787,8 +783,6 @@ sub update print "Content-Type: text/html\n\n"; # Generate and return the UI (HTML page) from the appropriate template. - $template->process("attachment/updated.atml", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; - + $template->process("attachment/updated.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } diff --git a/bug_form.pl b/bug_form.pl index 792e816ad..b074cdb15 100644 --- a/bug_form.pl +++ b/bug_form.pl @@ -67,8 +67,8 @@ sub show_bug { my $id = $::FORM{'id'}; if (!defined($id)) { - $template->process("show/choose_bug.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()); + $template->process("bug/choose.html.tmpl", $vars) + || ThrowTemplateError($template->error()); exit; } @@ -312,9 +312,8 @@ sub show_bug { $vars->{'user'} = \%user; # Generate and return the UI (HTML page) from the appropriate template. - $template->process("show/show_bug.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("bug/edit.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } 1; diff --git a/buglist.cgi b/buglist.cgi index 53685e96d..31f15b02e 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -69,7 +69,7 @@ ConnectToDatabase(); # Determine the format in which the user would like to receive the output. # Uses the default format if the user did not specify an output format; # otherwise validates the user's choice against the list of available formats. -my $format = ValidateOutputFormat($::FORM{'format'}); +my $format = ValidateOutputFormat($::FORM{'format'}, "list"); # Whether or not the user wants to change multiple bugs. my $dotweak = $::FORM{'tweak'} ? 1 : 0; @@ -117,7 +117,7 @@ if ($::buffer =~ /&cmd-/) { $vars->{'url'} = $url; $vars->{'link'} = "Click here if the page does not redisplay automatically."; $template->process("global/message.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()); + || ThrowTemplateError($template->error()); exit; } @@ -1053,7 +1053,7 @@ CMD: for ($::FORM{'cmdtype'}) { $vars->{'url'} = $url; $vars->{'link'} = "Click here if the page does not redisplay automatically."; $template->process("global/message.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()); + || ThrowTemplateError($template->error()); exit; }; @@ -1069,7 +1069,7 @@ CMD: for ($::FORM{'cmdtype'}) { $vars->{'url'} = "query.cgi"; $vars->{'link'} = "Go back to the query page."; $template->process("global/message.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()); + || ThrowTemplateError($template->error()); exit; }; @@ -1088,7 +1088,7 @@ CMD: for ($::FORM{'cmdtype'}) { $vars->{'url'} = "query.cgi"; $vars->{'link'} = "Go back to the query page, using the new default."; $template->process("global/message.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()); + || ThrowTemplateError($template->error()); exit; }; @@ -1128,7 +1128,7 @@ CMD: for ($::FORM{'cmdtype'}) { $vars->{'url'} = "query.cgi"; $vars->{'link'} = "Go back to the query page."; $template->process("global/message.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()); + || ThrowTemplateError($template->error()); exit; }; } @@ -1361,9 +1361,8 @@ if ($serverpush) { print "Content-Type: text/html\n\n"; # Generate and return the UI (HTML page) from the appropriate template. - $template->process("buglist/server-push.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("list/server-push.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } # Connect to the shadow database if this installation is using one to improve @@ -1565,9 +1564,8 @@ print "\n"; # end HTTP headers ################################################################################ # Generate and return the UI (HTML page) from the appropriate template. -$template->process("buglist/$format->{'template'}", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; +$template->process("list/$format->{'template'}", $vars) + || ThrowTemplateError($template->error()); ################################################################################ diff --git a/colchange.cgi b/colchange.cgi index f2ac55aa9..ea21042e2 100755 --- a/colchange.cgi +++ b/colchange.cgi @@ -119,7 +119,6 @@ $vars->{buffer} = $::buffer; # Generate and return the UI (HTML page) from the appropriate template. print "Content-type: text/html\n\n"; -$template->process("buglist/colchange.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; +$template->process("list/change-columns.html.tmpl", $vars) + || ThrowTemplateError($template->error()); diff --git a/createaccount.cgi b/createaccount.cgi index 9f87f4612..2456b9343 100755 --- a/createaccount.cgi +++ b/createaccount.cgi @@ -68,8 +68,8 @@ if (defined($login)) { if (!ValidateNewUser($login)) { # Account already exists - $template->process("admin/account_exists.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()); + $template->process("account/exists.html.tmpl", $vars) + || ThrowTemplateError($template->error()); exit; } @@ -77,12 +77,11 @@ if (defined($login)) { my $password = InsertNewUser($login, $realname); MailPassword($login, $password); - $template->process("admin/account_created.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()); + $template->process("account/created.html.tmpl", $vars) + || DisplayError($template->error()); exit; } # Show the standard "would you like to create an account?" form. -$template->process("admin/create_account.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; +$template->process("account/create.html.tmpl", $vars) + || ThrowTemplateError($template->error()); diff --git a/describecomponents.cgi b/describecomponents.cgi index 57eef27cf..8d2c219f4 100755 --- a/describecomponents.cgi +++ b/describecomponents.cgi @@ -67,8 +67,8 @@ if (!defined $::FORM{'product'}) { "Please specify the product whose components you want described."; print "Content-type: text/html\n\n"; - $::template->process("global/choose_product.tmpl", $::vars) - || DisplayError("Template process failed: " . $::template->error()); + $::template->process("global/choose-product.html.tmpl", $::vars) + || ThrowTemplateError($::template->error()); exit; } @@ -123,6 +123,6 @@ $::vars->{'product'} = $product; $::vars->{'components'} = \@components; print "Content-type: text/html\n\n"; -$::template->process("info/describe-components.tmpl", $::vars) - || DisplayError("Template process failed: " . $::template->error()); +$::template->process("reports/components.html.tmpl", $::vars) + || ThrowTemplateError($::template->error()); diff --git a/describekeywords.cgi b/describekeywords.cgi index d588100c6..503e0d5a3 100755 --- a/describekeywords.cgi +++ b/describekeywords.cgi @@ -54,6 +54,5 @@ $vars->{'keywords'} = \@keywords; $vars->{'caneditkeywords'} = UserInGroup("editkeywords"); print "Content-type: text/html\n\n"; -$template->process("info/describe-keywords.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; +$template->process("reports/keywords.html.tmpl", $vars) + || ThrowTemplateError($template->error()); diff --git a/duplicates.cgi b/duplicates.cgi index 11eb52f49..98e7e0a22 100755 --- a/duplicates.cgi +++ b/duplicates.cgi @@ -197,9 +197,8 @@ $vars->{'products'} = \@::legal_product; print "Content-type: text/html\n\n"; # Generate and return the UI (HTML page) from the appropriate template. -$template->process("report/duplicates.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; +$template->process("reports/duplicates.html.tmpl", $vars) + || ThrowTemplateError($template->error()); sub days_ago { diff --git a/editattachstatuses.cgi b/editattachstatuses.cgi index 61e1a15ae..f4176a321 100755 --- a/editattachstatuses.cgi +++ b/editattachstatuses.cgi @@ -201,9 +201,8 @@ sub list print "Content-type: text/html\n\n"; # Generate and return the UI (HTML page) from the appropriate template. - $template->process("attachstatus/list.atml", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("admin/attachstatus/list.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } @@ -223,9 +222,8 @@ sub create print "Content-type: text/html\n\n"; # Generate and return the UI (HTML page) from the appropriate template. - $template->process("attachstatus/create.atml", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("admin/attachstatus/create.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } @@ -272,9 +270,8 @@ sub edit print "Content-type: text/html\n\n"; # Generate and return the UI (HTML page) from the appropriate template. - $template->process("attachstatus/edit.atml", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("admin/attachstatus/edit.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } @@ -322,9 +319,8 @@ sub confirmDelete print "Content-type: text/html\n\n"; - $template->process("attachstatus/delete.atml", $vars) - || DisplayError("Template process failed: " . & $template->error()) - && exit; + $template->process("admin/attachstatus/delete.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } else { deleteStatus(); diff --git a/enter_bug.cgi b/enter_bug.cgi index ec008b9d6..dce3dd4ac 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -86,8 +86,8 @@ if (!defined $::FORM{'product'}) { "First, you must pick a product on which to enter a bug."; print "Content-type: text/html\n\n"; - $template->process("global/choose_product.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()); + $template->process("global/choose-product.html.tmpl", $vars) + || ThrowTemplateError($template->error()); exit; } @@ -355,6 +355,6 @@ if ($::usergroupset ne '0') { $vars->{'default'} = \%default; print "Content-type: text/html\n\n"; -$template->process("entry/enter_bug.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()); +$template->process("bug/create/create.html.tmpl", $vars) + || ThrowTemplateError($template->error()); exit; diff --git a/index.cgi b/index.cgi index 2fe393391..05f15d288 100755 --- a/index.cgi +++ b/index.cgi @@ -60,6 +60,5 @@ $vars->{'subst'} = { 'userid' => $vars->{'username'} }; print "Content-Type: text/html\n\n"; # Generate and return the UI (HTML page) from the appropriate template. -$template->process("index.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; +$template->process("index.html.tmpl", $vars) + || ThrowTemplateError($template->error()); diff --git a/long_list.cgi b/long_list.cgi index b25c10ebf..a828b8711 100755 --- a/long_list.cgi +++ b/long_list.cgi @@ -112,6 +112,5 @@ print "Content-Type: text/html\n"; print "Content-Disposition: inline; filename=$filename\n\n"; # Generate and return the UI (HTML page) from the appropriate template. -$template->process("show/multiple.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; +$template->process("bug/show-multiple.html.tmpl", $vars) + || ThrowTemplateError($template->error()); diff --git a/post_bug.cgi b/post_bug.cgi index a50369592..b727396d0 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -57,7 +57,8 @@ confirm_login(); my $comment; $vars->{'form'} = \%::FORM; -$template->process("entry/comment.txt.tmpl", $vars, \$comment) + +$template->process("bug/create/initial-comment.txt.tmpl", $vars, \$comment) || ThrowTemplateError($template->error()); ValidateComment($comment); @@ -80,8 +81,8 @@ if (defined $::FORM{'maketemplate'}) { $vars->{'url'} = $::buffer; print "Content-type: text/html\n\n"; - $template->process("entry/create-template.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()); + $template->process("bug/create/make-template.html.tmpl", $vars) + || ThrowTemplateError($template->error()); exit; } @@ -301,5 +302,5 @@ $vars->{'bug_id'} = $id; $vars->{'mailresults'} = $mailresults; print "Content-type: text/html\n\n"; -$template->process("entry/post-bug.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()); +$template->process("bug/create/created.html.tmpl", $vars) + || ThrowTemplateError($template->error()); diff --git a/process_bug.cgi b/process_bug.cgi index e89fea970..35c24e24e 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -108,7 +108,7 @@ print "Content-type: text/html\n\n"; # Start displaying the response page. $vars->{'title'} = "Bug processed"; -$template->process("global/header", $vars) +$template->process("global/header.html.tmpl", $vars) || ThrowTemplateError($template->error()); $vars->{'header_done'} = 1; @@ -210,7 +210,7 @@ if ((($::FORM{'id'} && $::FORM{'product'} ne $::oldproduct) $vars->{'verify_bug_group'} = (Param('usebuggroups') && !defined($::FORM{'addtonewgroup'})); - $template->process("process/verify-new-product.html.tmpl", $vars) + $template->process("bug/process/verify-new-product.html.tmpl", $vars) || ThrowTemplateError($template->error()); exit; } @@ -332,7 +332,7 @@ sub DuplicateUserConfirm { # Confirm whether or not to add the reporter to the cc: list # of the original bug (the one this bug is being duped against). print "Content-type: text/html\n\n"; - $template->process("process/confirm-dupe.html.tmpl", $vars) + $template->process("bug/process/confirm-duplicate.html.tmpl", $vars) || ThrowTemplateError($template->error()); exit; } # end DuplicateUserConfirm() @@ -873,7 +873,7 @@ foreach my $id (@idlist) { SendSQL("UNLOCK TABLES"); # Warn the user about the mid-air collision and ask them what to do. - $template->process("process/mid-air.html.tmpl", $vars) + $template->process("bug/process/midair.html.tmpl", $vars) || ThrowTemplateError($template->error()); exit; } @@ -1251,7 +1251,7 @@ foreach my $id (@idlist) { # Let the user know the bug was changed and who did and didn't # receive email about the change. - $template->process("process/results.html.tmpl", $vars) + $template->process("bug/process/results.html.tmpl", $vars) || ThrowTemplateError($template->error()); if ($duplicate) { @@ -1281,7 +1281,7 @@ foreach my $id (@idlist) { $vars->{'type'} = "dupe"; # Let the user know a duplication notation was added to the original bug. - $template->process("process/results.html.tmpl", $vars) + $template->process("bug/process/results.html.tmpl", $vars) || ThrowTemplateError($template->error()); } @@ -1297,7 +1297,7 @@ foreach my $id (@idlist) { # Let the user know we checked to see if we should email notice # of this change to users with a relationship to the dependent # bug and who did and didn't receive email about it. - $template->process("process/results.html.tmpl", $vars) + $template->process("bug/process/results.html.tmpl", $vars) || ThrowTemplateError($template->error()); } @@ -1316,7 +1316,7 @@ if ($::COOKIE{"BUGLIST"} && $::FORM{'id'}) { $vars->{'next_id'} = $next_bug; # Let the user know we are about to display the next bug in their list. - $template->process("process/next-bug.html.tmpl", $vars) + $template->process("bug/process/next.html.tmpl", $vars) || ThrowTemplateError($template->error()); show_bug("header is already done"); @@ -1327,7 +1327,7 @@ if ($::COOKIE{"BUGLIST"} && $::FORM{'id'}) { } # End the response page. -$template->process("show/navigate.html.tmpl", $vars) +$template->process("bug/navigate.html.tmpl", $vars) || ThrowTemplateError($template->error()); -$template->process("global/footer", $vars) +$template->process("global/footer.html.tmpl", $vars) || ThrowTemplateError($template->error()); diff --git a/query.cgi b/query.cgi index fe6fe1622..c2d5a3ba6 100755 --- a/query.cgi +++ b/query.cgi @@ -381,6 +381,5 @@ $vars->{'default'} = \%default; # Generate and return the UI (HTML page) from the appropriate template. print "Content-type: text/html\n\n"; -$template->process("query/query.atml", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; +$template->process("search/search.html.tmpl", $vars) + || ThrowTemplateError($template->error()); diff --git a/quips.cgi b/quips.cgi index 1b5213e97..e685fb207 100755 --- a/quips.cgi +++ b/quips.cgi @@ -70,6 +70,5 @@ if ($action eq "add") { } print "Content-type: text/html\n\n"; -$template->process("info/quips.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; +$template->process("list/quips.html.tmpl", $vars) + || ThrowTemplateError($template->error()); diff --git a/relogin.cgi b/relogin.cgi index 03670158d..d07de9ef6 100755 --- a/relogin.cgi +++ b/relogin.cgi @@ -69,8 +69,7 @@ delete $::COOKIE{"Bugzilla_login"}; print "Content-Type: text/html\n\n"; $template->process("global/message.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + || ThrowTemplateError($template->error()); exit; diff --git a/show_activity.cgi b/show_activity.cgi index ca0e52fa2..59e43b672 100755 --- a/show_activity.cgi +++ b/show_activity.cgi @@ -57,7 +57,6 @@ $vars->{'bug_id'} = $::FORM{'id'}; print "Content-type: text/html\n\n"; -$template->process("show/bug-activity.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; +$template->process("bug/activity/show.html.tmpl", $vars) + || ThrowTemplateError($template->error()); diff --git a/showdependencygraph.cgi b/showdependencygraph.cgi index f30e4d24f..21725b8f9 100755 --- a/showdependencygraph.cgi +++ b/showdependencygraph.cgi @@ -190,6 +190,5 @@ $vars->{'showsummary'} = $::FORM{'showsummary'}; # Generate and return the UI (HTML page) from the appropriate template. print "Content-type: text/html\n\n"; -$template->process("show/dependency-graph.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; +$template->process("bug/dependency-graph.html.tmpl", $vars) + || ThrowTemplateError($template->error()); diff --git a/showdependencytree.cgi b/showdependencytree.cgi index 0288faaa1..7f5d12d5c 100755 --- a/showdependencytree.cgi +++ b/showdependencytree.cgi @@ -94,9 +94,8 @@ $vars->{'hide_resolved'} = $hide_resolved; $vars->{'canedit'} = UserInGroup("editbugs"); print "Content-Type: text/html\n\n"; -$template->process("show/dependency-tree.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; +$template->process("bug/dependency-tree.html.tmpl", $vars) + || ThrowTemplateError($template->error()); ################################################################################ # Recursive Tree Generation Function # diff --git a/sidebar.cgi b/sidebar.cgi index 385086b5b..2f1b92a69 100755 --- a/sidebar.cgi +++ b/sidebar.cgi @@ -73,9 +73,8 @@ my $useragent = $ENV{HTTP_USER_AGENT}; if ($useragent =~ m:Mozilla/([1-9][0-9]*):i && $1 >= 5 && $useragent !~ m/compatible/i) { print "Content-type: application/vnd.mozilla.xul+xml\n\n"; # Generate and return the XUL from the appropriate template. - $template->process("sidebar/xul.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("sidebar.xul.tmpl", $vars) + || ThrowTemplateError($template->error()); } else { DisplayError("sidebar.cgi currently only supports Mozilla based web browsers"); exit; diff --git a/token.cgi b/token.cgi index e8fb3f90f..e1ae0b35b 100755 --- a/token.cgi +++ b/token.cgi @@ -178,8 +178,7 @@ sub requestChangePassword { print "Content-Type: text/html\n\n"; $template->process("global/message.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + || ThrowTemplateError($template->error()); } sub confirmChangePassword { @@ -187,9 +186,8 @@ sub confirmChangePassword { $vars->{'token'} = $::token; print "Content-Type: text/html\n\n"; - $template->process("admin/change-password.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("account/password/set-forgotten-password.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } sub cancelChangePassword { @@ -200,8 +198,7 @@ sub cancelChangePassword { print "Content-Type: text/html\n\n"; $template->process("global/message.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + || ThrowTemplateError($template->error()); } sub changePassword { @@ -229,8 +226,7 @@ sub changePassword { print "Content-Type: text/html\n\n"; $template->process("global/message.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + || ThrowTemplateError($template->error()); } sub confirmChangeEmail { @@ -240,9 +236,8 @@ sub confirmChangeEmail { $vars->{'title'} = "Confirm Change Email"; $vars->{'token'} = $::token; - $template->process("token/confirmemail.html.tmpl", $vars) - || &::DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("account/email/confirm.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } sub changeEmail { @@ -287,8 +282,7 @@ sub changeEmail { $vars->{'message'} = "Your Bugzilla login has been changed."; $template->process("global/message.html.tmpl", $vars) - || &::DisplayError("Template process failed: " . $template->error()) - && exit; + || ThrowTemplateError($template->error()); } sub cancelChangeEmail { @@ -336,7 +330,6 @@ sub cancelChangeEmail { $vars->{'title'} = "Cancel Request to Change Email Address"; $template->process("global/message.html.tmpl", $vars) - || &::DisplayError("Template process failed: " . $template->error()) - && exit; + || ThrowTemplateError($template->error()); } diff --git a/userprefs.cgi b/userprefs.cgi index ddeb0f1f7..79690563c 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -409,7 +409,6 @@ SWITCH: for ($current_tab_name) { # Generate and return the UI (HTML page) from the appropriate template. print "Content-type: text/html\n\n"; -$template->process("prefs/userprefs.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; +$template->process("account/prefs/prefs.html.tmpl", $vars) + || ThrowTemplateError($template->error()); diff --git a/votes.cgi b/votes.cgi index a6a86f426..eee96b960 100755 --- a/votes.cgi +++ b/votes.cgi @@ -110,9 +110,8 @@ sub show_bug { $vars->{'total'} = $total; print "Content-type: text/html\n\n"; - $template->process("voting/show-bug-votes.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("bug/votes/list-for-bug.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } # Display all the votes for a particular user. If it's the user @@ -218,9 +217,8 @@ sub show_user { $vars->{'products'} = \@products; print "Content-type: text/html\n\n"; - $template->process("voting/show-user-votes.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; + $template->process("bug/votes/list-for-user.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } # Update the user's votes in the database. @@ -239,8 +237,8 @@ sub record_votes { if (scalar(@buglist) == 0) { if (!defined($::FORM{'delete_all_votes'})) { print "Content-type: text/html\n\n"; - $template->process("voting/delete-all-votes.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()); + $template->process("bug/votes/delete-all.html.tmpl", $vars) + || ThrowTemplateError($template->error()); exit(); } elsif ($::FORM{'delete_all_votes'} == 0) { diff --git a/xml.cgi b/xml.cgi index 1773ec6cf..8356c3d89 100755 --- a/xml.cgi +++ b/xml.cgi @@ -34,10 +34,9 @@ use vars qw($template $vars); if (!defined $::FORM{'id'} || !$::FORM{'id'}) { print "Content-Type: text/html\n\n"; - $template->process("show/choose_xml.html.tmpl", $vars) - || DisplayError("Template process failed: " . $template->error()) - && exit; - exit; + $template->process("bug/choose-xml.html.tmpl", $vars) + || ThrowTemplateError($template->error()); + exit; } quietly_check_login(); -- cgit v1.2.3-24-g4f1b