Commit 05d101e5 authored by gerv%gerv.net's avatar gerv%gerv.net

Bug 138588 - change to use new template structure. Patch by gerv, r=myk, afranke.

parent c29a6dcb
...@@ -71,9 +71,8 @@ sub IssueEmailChangeToken { ...@@ -71,9 +71,8 @@ sub IssueEmailChangeToken {
$vars->{'emailaddress'} = $old_email . &::Param('emailsuffix'); $vars->{'emailaddress'} = $old_email . &::Param('emailsuffix');
my $message; my $message;
$template->process("token/emailchangeold.txt.tmpl", $vars, \$message) $template->process("account/email/change-old.txt.tmpl", $vars, \$message)
|| &::DisplayError("Template process failed: " . $template->error()) || &::ThrowTemplateError($template->error());
&& exit;
open SENDMAIL, "|/usr/lib/sendmail -t -i"; open SENDMAIL, "|/usr/lib/sendmail -t -i";
print SENDMAIL $message; print SENDMAIL $message;
...@@ -83,9 +82,8 @@ sub IssueEmailChangeToken { ...@@ -83,9 +82,8 @@ sub IssueEmailChangeToken {
$vars->{'emailaddress'} = $new_email . &::Param('emailsuffix'); $vars->{'emailaddress'} = $new_email . &::Param('emailsuffix');
$message = ""; $message = "";
$template->process("token/emailchangenew.txt.tmpl", $vars, \$message) $template->process("account/email/change-new.txt.tmpl", $vars, \$message)
|| &::DisplayError("Template process failed: " . $template->error()) || &::ThrowTemplateError($template->error());
&& exit;
open SENDMAIL, "|/usr/lib/sendmail -t -i"; open SENDMAIL, "|/usr/lib/sendmail -t -i";
print SENDMAIL $message; print SENDMAIL $message;
...@@ -222,9 +220,8 @@ sub Cancel { ...@@ -222,9 +220,8 @@ sub Cancel {
# Notify the user via email about the cancellation. # Notify the user via email about the cancellation.
my $message; my $message;
$template->process("token/tokencancel.txt.tmpl", $vars, \$message) $template->process("account/cancel-token.txt.tmpl", $vars, \$message)
|| &::DisplayError("Template process failed: " . $template->error()) || &::ThrowTemplateError($template->error());
&& exit;
open SENDMAIL, "|/usr/lib/sendmail -t -i"; open SENDMAIL, "|/usr/lib/sendmail -t -i";
print SENDMAIL $message; print SENDMAIL $message;
......
...@@ -69,7 +69,7 @@ if (Param("shutdownhtml") && $0 !~ m:[\\/](do)?editparams.cgi$:) { ...@@ -69,7 +69,7 @@ if (Param("shutdownhtml") && $0 !~ m:[\\/](do)?editparams.cgi$:) {
# Generate and return an HTML message about the downtime. # Generate and return an HTML message about the downtime.
$::template->process("global/message.html.tmpl", $::vars) $::template->process("global/message.html.tmpl", $::vars)
|| DisplayError("Template process failed: " . $::template->error()); || ThrowTemplateError($::template->error());
exit; exit;
} }
......
...@@ -71,9 +71,8 @@ sub IssueEmailChangeToken { ...@@ -71,9 +71,8 @@ sub IssueEmailChangeToken {
$vars->{'emailaddress'} = $old_email . &::Param('emailsuffix'); $vars->{'emailaddress'} = $old_email . &::Param('emailsuffix');
my $message; my $message;
$template->process("token/emailchangeold.txt.tmpl", $vars, \$message) $template->process("account/email/change-old.txt.tmpl", $vars, \$message)
|| &::DisplayError("Template process failed: " . $template->error()) || &::ThrowTemplateError($template->error());
&& exit;
open SENDMAIL, "|/usr/lib/sendmail -t -i"; open SENDMAIL, "|/usr/lib/sendmail -t -i";
print SENDMAIL $message; print SENDMAIL $message;
...@@ -83,9 +82,8 @@ sub IssueEmailChangeToken { ...@@ -83,9 +82,8 @@ sub IssueEmailChangeToken {
$vars->{'emailaddress'} = $new_email . &::Param('emailsuffix'); $vars->{'emailaddress'} = $new_email . &::Param('emailsuffix');
$message = ""; $message = "";
$template->process("token/emailchangenew.txt.tmpl", $vars, \$message) $template->process("account/email/change-new.txt.tmpl", $vars, \$message)
|| &::DisplayError("Template process failed: " . $template->error()) || &::ThrowTemplateError($template->error());
&& exit;
open SENDMAIL, "|/usr/lib/sendmail -t -i"; open SENDMAIL, "|/usr/lib/sendmail -t -i";
print SENDMAIL $message; print SENDMAIL $message;
...@@ -222,9 +220,8 @@ sub Cancel { ...@@ -222,9 +220,8 @@ sub Cancel {
# Notify the user via email about the cancellation. # Notify the user via email about the cancellation.
my $message; my $message;
$template->process("token/tokencancel.txt.tmpl", $vars, \$message) $template->process("account/cancel-token.txt.tmpl", $vars, \$message)
|| &::DisplayError("Template process failed: " . $template->error()) || &::ThrowTemplateError($template->error());
&& exit;
open SENDMAIL, "|/usr/lib/sendmail -t -i"; open SENDMAIL, "|/usr/lib/sendmail -t -i";
print SENDMAIL $message; print SENDMAIL $message;
......
...@@ -416,9 +416,8 @@ sub viewall ...@@ -416,9 +416,8 @@ sub viewall
print "Content-Type: text/html\n\n"; print "Content-Type: text/html\n\n";
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/viewall.atml", $vars) $template->process("attachment/show-multiple.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
...@@ -459,9 +458,8 @@ sub enter ...@@ -459,9 +458,8 @@ sub enter
print "Content-Type: text/html\n\n"; print "Content-Type: text/html\n\n";
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/enter.atml", $vars) $template->process("attachment/create.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
...@@ -527,9 +525,8 @@ sub insert ...@@ -527,9 +525,8 @@ sub insert
print "Content-Type: text/html\n\n"; print "Content-Type: text/html\n\n";
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/created.atml", $vars) $template->process("attachment/created.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
...@@ -603,9 +600,8 @@ sub edit ...@@ -603,9 +600,8 @@ sub edit
print "Content-Type: text/html\n\n"; print "Content-Type: text/html\n\n";
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/edit.atml", $vars) $template->process("attachment/edit.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
...@@ -787,8 +783,6 @@ sub update ...@@ -787,8 +783,6 @@ sub update
print "Content-Type: text/html\n\n"; print "Content-Type: text/html\n\n";
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/updated.atml", $vars) $template->process("attachment/updated.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
...@@ -67,8 +67,8 @@ sub show_bug { ...@@ -67,8 +67,8 @@ sub show_bug {
my $id = $::FORM{'id'}; my $id = $::FORM{'id'};
if (!defined($id)) { if (!defined($id)) {
$template->process("show/choose_bug.html.tmpl", $vars) $template->process("bug/choose.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()); || ThrowTemplateError($template->error());
exit; exit;
} }
...@@ -312,9 +312,8 @@ sub show_bug { ...@@ -312,9 +312,8 @@ sub show_bug {
$vars->{'user'} = \%user; $vars->{'user'} = \%user;
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("show/show_bug.html.tmpl", $vars) $template->process("bug/edit.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
1; 1;
...@@ -69,7 +69,7 @@ ConnectToDatabase(); ...@@ -69,7 +69,7 @@ ConnectToDatabase();
# Determine the format in which the user would like to receive the output. # 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; # 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. # 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. # Whether or not the user wants to change multiple bugs.
my $dotweak = $::FORM{'tweak'} ? 1 : 0; my $dotweak = $::FORM{'tweak'} ? 1 : 0;
...@@ -117,7 +117,7 @@ if ($::buffer =~ /&cmd-/) { ...@@ -117,7 +117,7 @@ if ($::buffer =~ /&cmd-/) {
$vars->{'url'} = $url; $vars->{'url'} = $url;
$vars->{'link'} = "Click here if the page does not redisplay automatically."; $vars->{'link'} = "Click here if the page does not redisplay automatically.";
$template->process("global/message.html.tmpl", $vars) $template->process("global/message.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()); || ThrowTemplateError($template->error());
exit; exit;
} }
...@@ -1053,7 +1053,7 @@ CMD: for ($::FORM{'cmdtype'}) { ...@@ -1053,7 +1053,7 @@ CMD: for ($::FORM{'cmdtype'}) {
$vars->{'url'} = $url; $vars->{'url'} = $url;
$vars->{'link'} = "Click here if the page does not redisplay automatically."; $vars->{'link'} = "Click here if the page does not redisplay automatically.";
$template->process("global/message.html.tmpl", $vars) $template->process("global/message.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()); || ThrowTemplateError($template->error());
exit; exit;
}; };
...@@ -1069,7 +1069,7 @@ CMD: for ($::FORM{'cmdtype'}) { ...@@ -1069,7 +1069,7 @@ CMD: for ($::FORM{'cmdtype'}) {
$vars->{'url'} = "query.cgi"; $vars->{'url'} = "query.cgi";
$vars->{'link'} = "Go back to the query page."; $vars->{'link'} = "Go back to the query page.";
$template->process("global/message.html.tmpl", $vars) $template->process("global/message.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()); || ThrowTemplateError($template->error());
exit; exit;
}; };
...@@ -1088,7 +1088,7 @@ CMD: for ($::FORM{'cmdtype'}) { ...@@ -1088,7 +1088,7 @@ CMD: for ($::FORM{'cmdtype'}) {
$vars->{'url'} = "query.cgi"; $vars->{'url'} = "query.cgi";
$vars->{'link'} = "Go back to the query page, using the new default."; $vars->{'link'} = "Go back to the query page, using the new default.";
$template->process("global/message.html.tmpl", $vars) $template->process("global/message.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()); || ThrowTemplateError($template->error());
exit; exit;
}; };
...@@ -1128,7 +1128,7 @@ CMD: for ($::FORM{'cmdtype'}) { ...@@ -1128,7 +1128,7 @@ CMD: for ($::FORM{'cmdtype'}) {
$vars->{'url'} = "query.cgi"; $vars->{'url'} = "query.cgi";
$vars->{'link'} = "Go back to the query page."; $vars->{'link'} = "Go back to the query page.";
$template->process("global/message.html.tmpl", $vars) $template->process("global/message.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()); || ThrowTemplateError($template->error());
exit; exit;
}; };
} }
...@@ -1361,9 +1361,8 @@ if ($serverpush) { ...@@ -1361,9 +1361,8 @@ if ($serverpush) {
print "Content-Type: text/html\n\n"; print "Content-Type: text/html\n\n";
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("buglist/server-push.html.tmpl", $vars) $template->process("list/server-push.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
# Connect to the shadow database if this installation is using one to improve # Connect to the shadow database if this installation is using one to improve
...@@ -1565,9 +1564,8 @@ print "\n"; # end HTTP headers ...@@ -1565,9 +1564,8 @@ print "\n"; # end HTTP headers
################################################################################ ################################################################################
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("buglist/$format->{'template'}", $vars) $template->process("list/$format->{'template'}", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
################################################################################ ################################################################################
......
...@@ -119,7 +119,6 @@ $vars->{buffer} = $::buffer; ...@@ -119,7 +119,6 @@ $vars->{buffer} = $::buffer;
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$template->process("buglist/colchange.tmpl", $vars) $template->process("list/change-columns.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
...@@ -68,8 +68,8 @@ if (defined($login)) { ...@@ -68,8 +68,8 @@ if (defined($login)) {
if (!ValidateNewUser($login)) { if (!ValidateNewUser($login)) {
# Account already exists # Account already exists
$template->process("admin/account_exists.tmpl", $vars) $template->process("account/exists.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()); || ThrowTemplateError($template->error());
exit; exit;
} }
...@@ -77,12 +77,11 @@ if (defined($login)) { ...@@ -77,12 +77,11 @@ if (defined($login)) {
my $password = InsertNewUser($login, $realname); my $password = InsertNewUser($login, $realname);
MailPassword($login, $password); MailPassword($login, $password);
$template->process("admin/account_created.tmpl", $vars) $template->process("account/created.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()); || DisplayError($template->error());
exit; exit;
} }
# Show the standard "would you like to create an account?" form. # Show the standard "would you like to create an account?" form.
$template->process("admin/create_account.tmpl", $vars) $template->process("account/create.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
...@@ -67,8 +67,8 @@ if (!defined $::FORM{'product'}) { ...@@ -67,8 +67,8 @@ if (!defined $::FORM{'product'}) {
"Please specify the product whose components you want described."; "Please specify the product whose components you want described.";
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$::template->process("global/choose_product.tmpl", $::vars) $::template->process("global/choose-product.html.tmpl", $::vars)
|| DisplayError("Template process failed: " . $::template->error()); || ThrowTemplateError($::template->error());
exit; exit;
} }
...@@ -123,6 +123,6 @@ $::vars->{'product'} = $product; ...@@ -123,6 +123,6 @@ $::vars->{'product'} = $product;
$::vars->{'components'} = \@components; $::vars->{'components'} = \@components;
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$::template->process("info/describe-components.tmpl", $::vars) $::template->process("reports/components.html.tmpl", $::vars)
|| DisplayError("Template process failed: " . $::template->error()); || ThrowTemplateError($::template->error());
...@@ -54,6 +54,5 @@ $vars->{'keywords'} = \@keywords; ...@@ -54,6 +54,5 @@ $vars->{'keywords'} = \@keywords;
$vars->{'caneditkeywords'} = UserInGroup("editkeywords"); $vars->{'caneditkeywords'} = UserInGroup("editkeywords");
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$template->process("info/describe-keywords.html.tmpl", $vars) $template->process("reports/keywords.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
...@@ -197,9 +197,8 @@ $vars->{'products'} = \@::legal_product; ...@@ -197,9 +197,8 @@ $vars->{'products'} = \@::legal_product;
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("report/duplicates.html.tmpl", $vars) $template->process("reports/duplicates.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
sub days_ago { sub days_ago {
......
...@@ -201,9 +201,8 @@ sub list ...@@ -201,9 +201,8 @@ sub list
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachstatus/list.atml", $vars) $template->process("admin/attachstatus/list.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
...@@ -223,9 +222,8 @@ sub create ...@@ -223,9 +222,8 @@ sub create
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachstatus/create.atml", $vars) $template->process("admin/attachstatus/create.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
...@@ -272,9 +270,8 @@ sub edit ...@@ -272,9 +270,8 @@ sub edit
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachstatus/edit.atml", $vars) $template->process("admin/attachstatus/edit.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
...@@ -322,9 +319,8 @@ sub confirmDelete ...@@ -322,9 +319,8 @@ sub confirmDelete
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$template->process("attachstatus/delete.atml", $vars) $template->process("admin/attachstatus/delete.html.tmpl", $vars)
|| DisplayError("Template process failed: " . & $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
else { else {
deleteStatus(); deleteStatus();
......
...@@ -86,8 +86,8 @@ if (!defined $::FORM{'product'}) { ...@@ -86,8 +86,8 @@ if (!defined $::FORM{'product'}) {
"First, you must pick a product on which to enter a bug."; "First, you must pick a product on which to enter a bug.";
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$template->process("global/choose_product.tmpl", $vars) $template->process("global/choose-product.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()); || ThrowTemplateError($template->error());
exit; exit;
} }
...@@ -355,6 +355,6 @@ if ($::usergroupset ne '0') { ...@@ -355,6 +355,6 @@ if ($::usergroupset ne '0') {
$vars->{'default'} = \%default; $vars->{'default'} = \%default;
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$template->process("entry/enter_bug.tmpl", $vars) $template->process("bug/create/create.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()); || ThrowTemplateError($template->error());
exit; exit;
...@@ -60,6 +60,5 @@ $vars->{'subst'} = { 'userid' => $vars->{'username'} }; ...@@ -60,6 +60,5 @@ $vars->{'subst'} = { 'userid' => $vars->{'username'} };
print "Content-Type: text/html\n\n"; print "Content-Type: text/html\n\n";
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("index.tmpl", $vars) $template->process("index.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
...@@ -112,6 +112,5 @@ print "Content-Type: text/html\n"; ...@@ -112,6 +112,5 @@ print "Content-Type: text/html\n";
print "Content-Disposition: inline; filename=$filename\n\n"; print "Content-Disposition: inline; filename=$filename\n\n";
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("show/multiple.tmpl", $vars) $template->process("bug/show-multiple.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
...@@ -57,7 +57,8 @@ confirm_login(); ...@@ -57,7 +57,8 @@ confirm_login();
my $comment; my $comment;
$vars->{'form'} = \%::FORM; $vars->{'form'} = \%::FORM;
$template->process("entry/comment.txt.tmpl", $vars, \$comment)
$template->process("bug/create/initial-comment.txt.tmpl", $vars, \$comment)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
ValidateComment($comment); ValidateComment($comment);
...@@ -80,8 +81,8 @@ if (defined $::FORM{'maketemplate'}) { ...@@ -80,8 +81,8 @@ if (defined $::FORM{'maketemplate'}) {
$vars->{'url'} = $::buffer; $vars->{'url'} = $::buffer;
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$template->process("entry/create-template.html.tmpl", $vars) $template->process("bug/create/make-template.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()); || ThrowTemplateError($template->error());
exit; exit;
} }
...@@ -301,5 +302,5 @@ $vars->{'bug_id'} = $id; ...@@ -301,5 +302,5 @@ $vars->{'bug_id'} = $id;
$vars->{'mailresults'} = $mailresults; $vars->{'mailresults'} = $mailresults;
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$template->process("entry/post-bug.html.tmpl", $vars) $template->process("bug/create/created.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()); || ThrowTemplateError($template->error());
...@@ -108,7 +108,7 @@ print "Content-type: text/html\n\n"; ...@@ -108,7 +108,7 @@ print "Content-type: text/html\n\n";
# Start displaying the response page. # Start displaying the response page.
$vars->{'title'} = "Bug processed"; $vars->{'title'} = "Bug processed";
$template->process("global/header", $vars) $template->process("global/header.html.tmpl", $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
$vars->{'header_done'} = 1; $vars->{'header_done'} = 1;
...@@ -210,7 +210,7 @@ if ((($::FORM{'id'} && $::FORM{'product'} ne $::oldproduct) ...@@ -210,7 +210,7 @@ if ((($::FORM{'id'} && $::FORM{'product'} ne $::oldproduct)
$vars->{'verify_bug_group'} = (Param('usebuggroups') $vars->{'verify_bug_group'} = (Param('usebuggroups')
&& !defined($::FORM{'addtonewgroup'})); && !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()); || ThrowTemplateError($template->error());
exit; exit;
} }
...@@ -332,7 +332,7 @@ sub DuplicateUserConfirm { ...@@ -332,7 +332,7 @@ sub DuplicateUserConfirm {
# Confirm whether or not to add the reporter to the cc: list # Confirm whether or not to add the reporter to the cc: list
# of the original bug (the one this bug is being duped against). # of the original bug (the one this bug is being duped against).
print "Content-type: text/html\n\n"; 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()); || ThrowTemplateError($template->error());
exit; exit;
} # end DuplicateUserConfirm() } # end DuplicateUserConfirm()
...@@ -873,7 +873,7 @@ foreach my $id (@idlist) { ...@@ -873,7 +873,7 @@ foreach my $id (@idlist) {
SendSQL("UNLOCK TABLES"); SendSQL("UNLOCK TABLES");
# Warn the user about the mid-air collision and ask them what to do. # 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()); || ThrowTemplateError($template->error());
exit; exit;
} }
...@@ -1251,7 +1251,7 @@ foreach my $id (@idlist) { ...@@ -1251,7 +1251,7 @@ foreach my $id (@idlist) {
# Let the user know the bug was changed and who did and didn't # Let the user know the bug was changed and who did and didn't
# receive email about the change. # receive email about the change.
$template->process("process/results.html.tmpl", $vars) $template->process("bug/process/results.html.tmpl", $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
if ($duplicate) { if ($duplicate) {
...@@ -1281,7 +1281,7 @@ foreach my $id (@idlist) { ...@@ -1281,7 +1281,7 @@ foreach my $id (@idlist) {
$vars->{'type'} = "dupe"; $vars->{'type'} = "dupe";
# Let the user know a duplication notation was added to the original bug. # 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()); || ThrowTemplateError($template->error());
} }
...@@ -1297,7 +1297,7 @@ foreach my $id (@idlist) { ...@@ -1297,7 +1297,7 @@ foreach my $id (@idlist) {
# Let the user know we checked to see if we should email notice # Let the user know we checked to see if we should email notice
# of this change to users with a relationship to the dependent # of this change to users with a relationship to the dependent
# bug and who did and didn't receive email about it. # 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()); || ThrowTemplateError($template->error());
} }
...@@ -1316,7 +1316,7 @@ if ($::COOKIE{"BUGLIST"} && $::FORM{'id'}) { ...@@ -1316,7 +1316,7 @@ if ($::COOKIE{"BUGLIST"} && $::FORM{'id'}) {
$vars->{'next_id'} = $next_bug; $vars->{'next_id'} = $next_bug;
# Let the user know we are about to display the next bug in their list. # 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()); || ThrowTemplateError($template->error());
show_bug("header is already done"); show_bug("header is already done");
...@@ -1327,7 +1327,7 @@ if ($::COOKIE{"BUGLIST"} && $::FORM{'id'}) { ...@@ -1327,7 +1327,7 @@ if ($::COOKIE{"BUGLIST"} && $::FORM{'id'}) {
} }
# End the response page. # End the response page.
$template->process("show/navigate.html.tmpl", $vars) $template->process("bug/navigate.html.tmpl", $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
$template->process("global/footer", $vars) $template->process("global/footer.html.tmpl", $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
...@@ -381,6 +381,5 @@ $vars->{'default'} = \%default; ...@@ -381,6 +381,5 @@ $vars->{'default'} = \%default;
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$template->process("query/query.atml", $vars) $template->process("search/search.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
...@@ -70,6 +70,5 @@ if ($action eq "add") { ...@@ -70,6 +70,5 @@ if ($action eq "add") {
} }
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$template->process("info/quips.tmpl", $vars) $template->process("list/quips.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
...@@ -69,8 +69,7 @@ delete $::COOKIE{"Bugzilla_login"}; ...@@ -69,8 +69,7 @@ delete $::COOKIE{"Bugzilla_login"};
print "Content-Type: text/html\n\n"; print "Content-Type: text/html\n\n";
$template->process("global/message.html.tmpl", $vars) $template->process("global/message.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
exit; exit;
...@@ -57,7 +57,6 @@ $vars->{'bug_id'} = $::FORM{'id'}; ...@@ -57,7 +57,6 @@ $vars->{'bug_id'} = $::FORM{'id'};
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$template->process("show/bug-activity.html.tmpl", $vars) $template->process("bug/activity/show.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
...@@ -190,6 +190,5 @@ $vars->{'showsummary'} = $::FORM{'showsummary'}; ...@@ -190,6 +190,5 @@ $vars->{'showsummary'} = $::FORM{'showsummary'};
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$template->process("show/dependency-graph.html.tmpl", $vars) $template->process("bug/dependency-graph.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
...@@ -94,9 +94,8 @@ $vars->{'hide_resolved'} = $hide_resolved; ...@@ -94,9 +94,8 @@ $vars->{'hide_resolved'} = $hide_resolved;
$vars->{'canedit'} = UserInGroup("editbugs"); $vars->{'canedit'} = UserInGroup("editbugs");
print "Content-Type: text/html\n\n"; print "Content-Type: text/html\n\n";
$template->process("show/dependency-tree.html.tmpl", $vars) $template->process("bug/dependency-tree.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
################################################################################ ################################################################################
# Recursive Tree Generation Function # # Recursive Tree Generation Function #
......
...@@ -73,9 +73,8 @@ my $useragent = $ENV{HTTP_USER_AGENT}; ...@@ -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) { 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"; print "Content-type: application/vnd.mozilla.xul+xml\n\n";
# Generate and return the XUL from the appropriate template. # Generate and return the XUL from the appropriate template.
$template->process("sidebar/xul.tmpl", $vars) $template->process("sidebar.xul.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} else { } else {
DisplayError("sidebar.cgi currently only supports Mozilla based web browsers"); DisplayError("sidebar.cgi currently only supports Mozilla based web browsers");
exit; exit;
......
...@@ -178,8 +178,7 @@ sub requestChangePassword { ...@@ -178,8 +178,7 @@ sub requestChangePassword {
print "Content-Type: text/html\n\n"; print "Content-Type: text/html\n\n";
$template->process("global/message.html.tmpl", $vars) $template->process("global/message.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
sub confirmChangePassword { sub confirmChangePassword {
...@@ -187,9 +186,8 @@ sub confirmChangePassword { ...@@ -187,9 +186,8 @@ sub confirmChangePassword {
$vars->{'token'} = $::token; $vars->{'token'} = $::token;
print "Content-Type: text/html\n\n"; print "Content-Type: text/html\n\n";
$template->process("admin/change-password.html.tmpl", $vars) $template->process("account/password/set-forgotten-password.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
sub cancelChangePassword { sub cancelChangePassword {
...@@ -200,8 +198,7 @@ sub cancelChangePassword { ...@@ -200,8 +198,7 @@ sub cancelChangePassword {
print "Content-Type: text/html\n\n"; print "Content-Type: text/html\n\n";
$template->process("global/message.html.tmpl", $vars) $template->process("global/message.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
sub changePassword { sub changePassword {
...@@ -229,8 +226,7 @@ sub changePassword { ...@@ -229,8 +226,7 @@ sub changePassword {
print "Content-Type: text/html\n\n"; print "Content-Type: text/html\n\n";
$template->process("global/message.html.tmpl", $vars) $template->process("global/message.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
sub confirmChangeEmail { sub confirmChangeEmail {
...@@ -240,9 +236,8 @@ sub confirmChangeEmail { ...@@ -240,9 +236,8 @@ sub confirmChangeEmail {
$vars->{'title'} = "Confirm Change Email"; $vars->{'title'} = "Confirm Change Email";
$vars->{'token'} = $::token; $vars->{'token'} = $::token;
$template->process("token/confirmemail.html.tmpl", $vars) $template->process("account/email/confirm.html.tmpl", $vars)
|| &::DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
sub changeEmail { sub changeEmail {
...@@ -287,8 +282,7 @@ sub changeEmail { ...@@ -287,8 +282,7 @@ sub changeEmail {
$vars->{'message'} = "Your Bugzilla login has been changed."; $vars->{'message'} = "Your Bugzilla login has been changed.";
$template->process("global/message.html.tmpl", $vars) $template->process("global/message.html.tmpl", $vars)
|| &::DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
sub cancelChangeEmail { sub cancelChangeEmail {
...@@ -336,7 +330,6 @@ sub cancelChangeEmail { ...@@ -336,7 +330,6 @@ sub cancelChangeEmail {
$vars->{'title'} = "Cancel Request to Change Email Address"; $vars->{'title'} = "Cancel Request to Change Email Address";
$template->process("global/message.html.tmpl", $vars) $template->process("global/message.html.tmpl", $vars)
|| &::DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
...@@ -409,7 +409,6 @@ SWITCH: for ($current_tab_name) { ...@@ -409,7 +409,6 @@ SWITCH: for ($current_tab_name) {
# Generate and return the UI (HTML page) from the appropriate template. # Generate and return the UI (HTML page) from the appropriate template.
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$template->process("prefs/userprefs.tmpl", $vars) $template->process("account/prefs/prefs.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
...@@ -110,9 +110,8 @@ sub show_bug { ...@@ -110,9 +110,8 @@ sub show_bug {
$vars->{'total'} = $total; $vars->{'total'} = $total;
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$template->process("voting/show-bug-votes.html.tmpl", $vars) $template->process("bug/votes/list-for-bug.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
# Display all the votes for a particular user. If it's the user # Display all the votes for a particular user. If it's the user
...@@ -218,9 +217,8 @@ sub show_user { ...@@ -218,9 +217,8 @@ sub show_user {
$vars->{'products'} = \@products; $vars->{'products'} = \@products;
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$template->process("voting/show-user-votes.html.tmpl", $vars) $template->process("bug/votes/list-for-user.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit;
} }
# Update the user's votes in the database. # Update the user's votes in the database.
...@@ -239,8 +237,8 @@ sub record_votes { ...@@ -239,8 +237,8 @@ sub record_votes {
if (scalar(@buglist) == 0) { if (scalar(@buglist) == 0) {
if (!defined($::FORM{'delete_all_votes'})) { if (!defined($::FORM{'delete_all_votes'})) {
print "Content-type: text/html\n\n"; print "Content-type: text/html\n\n";
$template->process("voting/delete-all-votes.html.tmpl", $vars) $template->process("bug/votes/delete-all.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()); || ThrowTemplateError($template->error());
exit(); exit();
} }
elsif ($::FORM{'delete_all_votes'} == 0) { elsif ($::FORM{'delete_all_votes'} == 0) {
......
...@@ -34,10 +34,9 @@ use vars qw($template $vars); ...@@ -34,10 +34,9 @@ use vars qw($template $vars);
if (!defined $::FORM{'id'} || !$::FORM{'id'}) { if (!defined $::FORM{'id'} || !$::FORM{'id'}) {
print "Content-Type: text/html\n\n"; print "Content-Type: text/html\n\n";
$template->process("show/choose_xml.html.tmpl", $vars) $template->process("bug/choose-xml.html.tmpl", $vars)
|| DisplayError("Template process failed: " . $template->error()) || ThrowTemplateError($template->error());
&& exit; exit;
exit;
} }
quietly_check_login(); quietly_check_login();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment