From 40e63525a8bda9132a4d2c0d296b2b7e89fe75de Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Thu, 19 Apr 2007 15:05:20 +0000 Subject: Bug 369933: Use Bugzilla::Util::correct_urlbase() everywhere in templates to get the correct URL to the Bugzilla installation - Patch by Alex Eiser r/a=LpSolit --- Bugzilla/Template.pm | 3 +++ template/en/default/account/email/change-new.txt.tmpl | 4 ++-- template/en/default/account/email/change-old.txt.tmpl | 2 +- template/en/default/account/email/request-new.txt.tmpl | 4 ++-- .../account/password/forgotten-password.txt.tmpl | 4 ++-- template/en/default/bug/edit.html.tmpl | 2 +- template/en/default/bug/show.xml.tmpl | 4 ++-- template/en/default/config.js.tmpl | 2 +- template/en/default/config.rdf.tmpl | 18 +++++++++--------- template/en/default/email/newchangedmail.txt.tmpl | 4 ++-- template/en/default/email/sanitycheck.txt.tmpl | 2 +- template/en/default/email/sudo.txt.tmpl | 2 +- template/en/default/email/votes-removed.txt.tmpl | 2 +- template/en/default/email/whine.txt.tmpl | 8 ++++---- template/en/default/global/header.html.tmpl | 2 +- template/en/default/global/site-navigation.html.tmpl | 2 +- template/en/default/index.html.tmpl | 4 ++-- template/en/default/list/list-simple.html.tmpl | 2 +- template/en/default/list/list.atom.tmpl | 10 +++++----- template/en/default/list/list.ics.tmpl | 4 ++-- template/en/default/list/list.rdf.tmpl | 6 +++--- template/en/default/reports/duplicates.rdf.tmpl | 4 ++-- template/en/default/request/email.txt.tmpl | 4 ++-- template/en/default/search/search-plugin.xml.tmpl | 4 ++-- template/en/default/sidebar.xul.tmpl | 6 +++--- template/en/default/whine/mail.html.tmpl | 4 ++-- template/en/default/whine/mail.txt.tmpl | 4 ++-- 27 files changed, 60 insertions(+), 57 deletions(-) diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 42e335f95..8a3917c02 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -804,6 +804,9 @@ sub create { Bugzilla::BugMail::Send($id, $mailrecipients); }, + # Allow templates to access the "corect" URLBase value + 'urlbase' => sub { return Bugzilla::Util::correct_urlbase(); }, + # These don't work as normal constants. DB_MODULE => \&Bugzilla::Constants::DB_MODULE, REQUIRED_MODULES => diff --git a/template/en/default/account/email/change-new.txt.tmpl b/template/en/default/account/email/change-new.txt.tmpl index d3494e62a..e7d3d6ba1 100644 --- a/template/en/default/account/email/change-new.txt.tmpl +++ b/template/en/default/account/email/change-new.txt.tmpl @@ -32,12 +32,12 @@ for the account [% oldemailaddress %] to your address. To confirm the change, visit the following link: -[%+ Param('urlbase') %]token.cgi?t=[% token FILTER url_quote %]&a=cfmem +[%+ urlbase %]token.cgi?t=[% token FILTER url_quote %]&a=cfmem If you are not the person who made this request, or you wish to cancel this request, visit the following link: -[%+ Param('urlbase') %]token.cgi?t=[% token FILTER url_quote %]&a=cxlem +[%+ urlbase %]token.cgi?t=[% token FILTER url_quote %]&a=cxlem If you do nothing, the request will lapse after [%+ max_token_age %] days (on [%+ time2str("%B %o, %Y at %H:%M %Z", expiration_ts) %]). diff --git a/template/en/default/account/email/change-old.txt.tmpl b/template/en/default/account/email/change-old.txt.tmpl index b50cbfa1b..7b229977b 100644 --- a/template/en/default/account/email/change-old.txt.tmpl +++ b/template/en/default/account/email/change-old.txt.tmpl @@ -41,7 +41,7 @@ for your account to [%+ newemailaddress %]. If you are not the person who made this request, or you wish to cancel this request, visit the following link: -[%+ Param('urlbase') %]token.cgi?t=[% token FILTER url_quote %]&a=cxlem +[%+ urlbase %]token.cgi?t=[% token FILTER url_quote %]&a=cxlem If you do nothing, and [%+ newemailaddress %] confirms this request, the change will be made permanent after [%+ max_token_age %] days diff --git a/template/en/default/account/email/request-new.txt.tmpl b/template/en/default/account/email/request-new.txt.tmpl index 3fcdddfd1..3248e4b38 100644 --- a/template/en/default/account/email/request-new.txt.tmpl +++ b/template/en/default/account/email/request-new.txt.tmpl @@ -34,12 +34,12 @@ using your email address ([% email %]). To confirm that you want to create an account using that email address, visit the following link: -[%+ Param('urlbase') %]token.cgi?t=[% token FILTER url_quote %]&a=request_new_account +[%+ urlbase %]token.cgi?t=[% token FILTER url_quote %]&a=request_new_account If you are not the person who made this request, or you wish to cancel this request, visit the following link: -[%+ Param('urlbase') %]token.cgi?t=[% token FILTER url_quote %]&a=cancel_new_account +[%+ urlbase %]token.cgi?t=[% token FILTER url_quote %]&a=cancel_new_account If you do nothing, the request will lapse after [%+ constants.MAX_TOKEN_AGE %] days (on [%+ time2str("%B %o, %Y at %H:%M %Z", expiration_ts) %]). diff --git a/template/en/default/account/password/forgotten-password.txt.tmpl b/template/en/default/account/password/forgotten-password.txt.tmpl index 75720e7c8..bd6cd3db9 100644 --- a/template/en/default/account/password/forgotten-password.txt.tmpl +++ b/template/en/default/account/password/forgotten-password.txt.tmpl @@ -30,12 +30,12 @@ X-Bugzilla-Type: admin You have (or someone impersonating you has) requested to change your [%+ terms.Bugzilla %] password. To complete the change, visit the following link: -[%+ Param('urlbase') %]token.cgi?t=[% token FILTER url_quote %]&a=cfmpw +[%+ urlbase %]token.cgi?t=[% token FILTER url_quote %]&a=cfmpw If you are not the person who made this request, or you wish to cancel this request, visit the following link: -[%+ Param('urlbase') %]token.cgi?t=[% token FILTER url_quote %]&a=cxlpw +[%+ urlbase %]token.cgi?t=[% token FILTER url_quote %]&a=cxlpw If you do nothing, the request will lapse after [%+ max_token_age +%] days (at precisely [%+ time2str("%H:%M on the %o of %B, %Y", expiration_ts) -%]) or when you diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 037ea443d..215595e5a 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -556,7 +556,7 @@ [% terms.Bug %]#: - + [% bug.bug_id %] diff --git a/template/en/default/bug/show.xml.tmpl b/template/en/default/bug/show.xml.tmpl index 61b597f72..6db4aab27 100644 --- a/template/en/default/bug/show.xml.tmpl +++ b/template/en/default/bug/show.xml.tmpl @@ -22,10 +22,10 @@ #%] [% PROCESS bug/time.html.tmpl %] - + - + [% constants.BUGZILLA_VERSION FILTER html %] [% Param('maintainer') FILTER html %] @@ -107,13 +107,13 @@ [% FOREACH product = products %]
  • - + [% product.name FILTER html %] [% FOREACH component = product.components %] -
  • +
  • [% END %] @@ -121,7 +121,7 @@ [% FOREACH version = product.versions %] -
  • +
  • [% END %] @@ -130,7 +130,7 @@ [% FOREACH milestone = product.milestones %] -
  • +
  • [% END %] @@ -147,7 +147,7 @@ [% FOREACH product = products %] [% FOREACH component = product.components %]
  • - + [% component.name FILTER html %]
  • @@ -161,7 +161,7 @@ [% FOREACH product = products %] [% FOREACH version = product.versions %]
  • - + [% version.name FILTER html %]
  • @@ -176,7 +176,7 @@ [% FOREACH product = products %] [% FOREACH milestone = product.milestones %]
  • - + [% milestone.name FILTER html %]
  • @@ -191,7 +191,7 @@ [% PROCESS "global/field-descs.none.tmpl" %] [% FOREACH item = field %]
  • - + [% item.name FILTER html %] [% (field_descs.${item.name} OR item.description) FILTER html %] diff --git a/template/en/default/email/newchangedmail.txt.tmpl b/template/en/default/email/newchangedmail.txt.tmpl index cbe162ed3..ba24dc1dd 100644 --- a/template/en/default/email/newchangedmail.txt.tmpl +++ b/template/en/default/email/newchangedmail.txt.tmpl @@ -38,12 +38,12 @@ X-Bugzilla-Target-Milestone: [% targetmilestone %] X-Bugzilla-Changed-Fields: [% changedfields %] [%+ threadingmarker %] -[%+ Param('urlbase') %]show_bug.cgi?id=[% bugid %] +[%+ urlbase %]show_bug.cgi?id=[% bugid %] [%+ diffs %] -- -Configure bugmail: [% Param('urlbase') %]userprefs.cgi?tab=email +Configure bugmail: [% urlbase %]userprefs.cgi?tab=email ------- You are receiving this mail because: ------- [% FOREACH relationship = reasons %] [% SWITCH relationship %] diff --git a/template/en/default/email/sanitycheck.txt.tmpl b/template/en/default/email/sanitycheck.txt.tmpl index fd5b9151b..97b1c0cd1 100644 --- a/template/en/default/email/sanitycheck.txt.tmpl +++ b/template/en/default/email/sanitycheck.txt.tmpl @@ -25,7 +25,7 @@ To: [% addressee %] Subject: [[% terms.Bugzilla %]] Sanity Check Results X-Bugzilla-Type: sanitycheck -[%+ Param('urlbase') %]sanitycheck.cgi +[%+ urlbase %]sanitycheck.cgi Below can you read the sanity check results. [% IF error_found %] diff --git a/template/en/default/email/sudo.txt.tmpl b/template/en/default/email/sudo.txt.tmpl index 758c67b02..0c01bef4f 100644 --- a/template/en/default/email/sudo.txt.tmpl +++ b/template/en/default/email/sudo.txt.tmpl @@ -41,4 +41,4 @@ X-Bugzilla-Type: admin If you feel that this action was inappropiate, please contact [%+ Param("maintainer") %]. For more information on this feature, -visit <[% Param("urlbase") %]page.cgi?id=sudo.html>. +visit <[% urlbase %]page.cgi?id=sudo.html>. diff --git a/template/en/default/email/votes-removed.txt.tmpl b/template/en/default/email/votes-removed.txt.tmpl index 6bf2afd8c..69ad2b962 100644 --- a/template/en/default/email/votes-removed.txt.tmpl +++ b/template/en/default/email/votes-removed.txt.tmpl @@ -35,5 +35,5 @@ Some or all of your votes have been removed from [% terms.bug %] [%+ bugid %]. Reason: [% reason %] -[% Param("urlbase") %]show_bug.cgi?id=[% bugid %] +[% urlbase %]show_bug.cgi?id=[% bugid %] diff --git a/template/en/default/email/whine.txt.tmpl b/template/en/default/email/whine.txt.tmpl index 764b581e8..57f2d13c5 100644 --- a/template/en/default/email/whine.txt.tmpl +++ b/template/en/default/email/whine.txt.tmpl @@ -28,7 +28,7 @@ X-Bugzilla-Type: whine [This e-mail has been automatically generated.] You have one or more [% terms.bugs %] assigned to you in the [% terms.Bugzilla %] -[% terms.bug %] tracking system ([% Param("urlbase") %]) that require +[% terms.bug %] tracking system ([% urlbase %]) that require attention. All of these [% terms.bugs %] are in the [% get_status("NEW") %] or @@ -50,10 +50,10 @@ Generally, this means one of three things: To get a list of all [% get_status("NEW") %]/[% get_status("REOPENED") %] [%+ terms.bugs %], you can use this URL (bookmark it if you like!): - [% Param("urlbase") %]buglist.cgi?bug_status=NEW&bug_status=REOPENED&assigned_to=[% email %] + [% urlbase %]buglist.cgi?bug_status=NEW&bug_status=REOPENED&assigned_to=[% email %] Or, you can use the general query page, at -[%+ Param("urlbase") %]query.cgi +[%+ urlbase %]query.cgi Appended below are the individual URLs to get to all of your [% get_status("NEW") %] [%+ terms.bugs %] that haven't been touched for a week or more. @@ -62,5 +62,5 @@ You will get this message once a day until you've dealt with these [% terms.bugs [% FOREACH bug = bugs %] [%+ bug.summary %] - -> [% Param("urlbase") %]show_bug.cgi?id=[% bug.id %] + -> [% urlbase %]show_bug.cgi?id=[% bug.id %] [% END %] diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl index ad1df396d..ea64c362f 100644 --- a/template/en/default/global/header.html.tmpl +++ b/template/en/default/global/header.html.tmpl @@ -218,7 +218,7 @@ #%] diff --git a/template/en/default/global/site-navigation.html.tmpl b/template/en/default/global/site-navigation.html.tmpl index 507b779c8..64d91a30c 100644 --- a/template/en/default/global/site-navigation.html.tmpl +++ b/template/en/default/global/site-navigation.html.tmpl @@ -31,7 +31,7 @@ [% cgi = Bugzilla.cgi %] [% IF NOT (cgi.user_agent("MSIE [1-6]") OR cgi.user_agent("Mozilla/4")) %] - + [%# *** Bug List Navigation *** %] [% IF bug && bug_list && bug_list.size > 0 %] diff --git a/template/en/default/index.html.tmpl b/template/en/default/index.html.tmpl index d7c74e188..132b77c74 100644 --- a/template/en/default/index.html.tmpl +++ b/template/en/default/index.html.tmpl @@ -46,7 +46,7 @@ function addSidebar() { var sidebarname=window.location.host; if (!/bug/i.test(sidebarname)) sidebarname="[% terms.Bugzilla %] "+sidebarname; - window.sidebar.addPanel (sidebarname, "[% Param('urlbase') %]sidebar.cgi", ""); + window.sidebar.addPanel (sidebarname, "[% urlbase FILTER html %]sidebar.cgi", ""); } else { @@ -129,7 +129,7 @@ function addSidebar() { [% END %]
  • - Install + Install the Quick Search plugin (requires Firefox 2 or Internet Explorer 7)
  • diff --git a/template/en/default/list/list-simple.html.tmpl b/template/en/default/list/list-simple.html.tmpl index 8494baf60..60f1a4f3a 100644 --- a/template/en/default/list/list-simple.html.tmpl +++ b/template/en/default/list/list-simple.html.tmpl @@ -39,7 +39,7 @@ [% title FILTER html %] - + diff --git a/template/en/default/list/list.atom.tmpl b/template/en/default/list/list.atom.tmpl index 630f04638..cf9b8080e 100644 --- a/template/en/default/list/list.atom.tmpl +++ b/template/en/default/list/list.atom.tmpl @@ -33,23 +33,23 @@ [% title FILTER xml %] [% date.format(format=>"%Y-%m-%dT%H:%M:%SZ", time=>bugs.nsort('changedtime').last.changedtime, gmt=>1) FILTER xml %] - [% Param('urlbase') %]buglist.cgi?[% urlquerypart FILTER xml %] + [% urlbase FILTER html %]buglist.cgi?[% urlquerypart FILTER xml %] [% FOREACH bug = bugs %] [% "@" IF bug.secure_mode %][[% terms.Bug %] [%+ bug.bug_id FILTER xml %]] [% bug.short_desc FILTER xml %] - [% Param('urlbase') FILTER xml %]show_bug.cgi?id=[% bug.bug_id FILTER xml %] + [% urlbase FILTER xml %]show_bug.cgi?id=[% bug.bug_id FILTER xml %] [% bug.reporter_realname FILTER xml %] diff --git a/template/en/default/list/list.ics.tmpl b/template/en/default/list/list.ics.tmpl index 814a397aa..6eb9ed731 100644 --- a/template/en/default/list/list.ics.tmpl +++ b/template/en/default/list/list.ics.tmpl @@ -27,8 +27,8 @@ VERSION:2.0 BEGIN:VTODO [%+ PROCESS ics_dtstart +%] [%+ PROCESS ics_summary +%] -[%+ PROCESS ics_uid base_url=Param('urlbase') bug_id=bug.bug_id +%] -[%+ PROCESS ics_url base_url=Param('urlbase') bug_id=bug.bug_id +%] +[%+ PROCESS ics_uid base_url=urlbase bug_id=bug.bug_id +%] +[%+ PROCESS ics_url base_url=urlbase bug_id=bug.bug_id +%] [%+ PROCESS ics_status bug_status = bug.bug_status +%] [%+ PROCESS ics_dtstamp +%] [% IF bug.changeddate %] diff --git a/template/en/default/list/list.rdf.tmpl b/template/en/default/list/list.rdf.tmpl index 06376aca9..dfba7cb16 100644 --- a/template/en/default/list/list.rdf.tmpl +++ b/template/en/default/list/list.rdf.tmpl @@ -26,14 +26,14 @@ xmlns:bz="http://www.bugzilla.org/rdf#" xmlns:nc="http://home.netscape.com/NC-rdf#"> - - + + [% FOREACH bug = bugs %]
  • - + [% bug.bug_id %] diff --git a/template/en/default/reports/duplicates.rdf.tmpl b/template/en/default/reports/duplicates.rdf.tmpl index 15594c7ca..beb95f186 100644 --- a/template/en/default/reports/duplicates.rdf.tmpl +++ b/template/en/default/reports/duplicates.rdf.tmpl @@ -26,12 +26,12 @@ xmlns:bz="http://www.bugzilla.org/rdf#" xmlns:nc="http://home.netscape.com/NC-rdf#"> - + [% FOREACH bug = bugs %]
  • - + [% bug.id %] [% bug.resolution FILTER html %] [% bug.count %] diff --git a/template/en/default/request/email.txt.tmpl b/template/en/default/request/email.txt.tmpl index a5fd17b88..1a20a4115 100644 --- a/template/en/default/request/email.txt.tmpl +++ b/template/en/default/request/email.txt.tmpl @@ -50,13 +50,13 @@ X-Bugzilla-Type: request [% terms.Bug %] [%+ bugidsummary %] [% END %] -[%+ Param('urlbase') %]show_bug.cgi?id=[% bug.bug_id %] +[%+ urlbase %]show_bug.cgi?id=[% bug.bug_id %] [% IF attachment %] [% FILTER bullet = wrap(80) %] Attachment [% attidsummary %] [%- END %] -[%+ Param('urlbase') %]attachment.cgi?id=[% attachment.id %]&action=edit +[%+ urlbase %]attachment.cgi?id=[% attachment.id %]&action=edit [%- END %] [%- FILTER bullet = wrap(80) %] diff --git a/template/en/default/search/search-plugin.xml.tmpl b/template/en/default/search/search-plugin.xml.tmpl index 649c6e958..804c15471 100644 --- a/template/en/default/search/search-plugin.xml.tmpl +++ b/template/en/default/search/search-plugin.xml.tmpl @@ -21,8 +21,8 @@ [% terms.Bugzilla %] Quick Search UTF-8 data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAABGdBTUEAAK%2FINwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgS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jz%2B8P8lw4fXn5l4eRlwA4AAYmaTkBFg%2FKvJwfbkwZuXN57y%2Fv%2F34stXGR4uRmxpGwgAAgwA4%2FkfrfCWvLQAAAAASUVORK5CYII%3D - + -[% Param('urlbase') %] +[% urlbase FILTER xml %] diff --git a/template/en/default/sidebar.xul.tmpl b/template/en/default/sidebar.xul.tmpl index 6742889da..e2d0d8e22 100644 --- a/template/en/default/sidebar.xul.tmpl +++ b/template/en/default/sidebar.xul.tmpl @@ -26,7 +26,7 @@ - + - reload + reload diff --git a/template/en/default/whine/mail.html.tmpl b/template/en/default/whine/mail.html.tmpl index 0d7f91911..a3953afeb 100644 --- a/template/en/default/whine/mail.html.tmpl +++ b/template/en/default/whine/mail.html.tmpl @@ -51,7 +51,7 @@

    [% IF author.login == recipient.login %] - Click + Click here to edit your whine schedule [% ELSE %] This search was scheduled by [% author.login FILTER html %]. @@ -77,7 +77,7 @@ [% FOREACH bug=query.bugs %] - [% bug.bug_id %] [% bug.bug_severity FILTER html %] [% bug.priority FILTER html %] diff --git a/template/en/default/whine/mail.txt.tmpl b/template/en/default/whine/mail.txt.tmpl index 02078b7bd..351452114 100644 --- a/template/en/default/whine/mail.txt.tmpl +++ b/template/en/default/whine/mail.txt.tmpl @@ -40,7 +40,7 @@ [% IF author.login == recipient.login %] To edit your whine schedule, visit the following URL: - [%+ Param('urlbase') %]editwhines.cgi + [%+ urlbase %]editwhines.cgi [% ELSE %] This search was scheduled by [% author.login %]. [% END %] @@ -53,7 +53,7 @@ [% FOREACH bug=query.bugs %] [% terms.Bug +%] [%+ bug.bug_id %]: - [%+ Param('urlbase') %]show_bug.cgi?id=[% bug.bug_id +%] + [%+ urlbase %]show_bug.cgi?id=[% bug.bug_id +%] Priority: [%+ bug.priority -%] Severity: [%+ bug.bug_severity -%] Platform: [%+ bug.rep_platform %] -- cgit v1.2.3-24-g4f1b