summaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-04-08 08:37:35 +0200
committerlpsolit%gmail.com <>2005-04-08 08:37:35 +0200
commit0ca4c4c49583b2dc680ace8ac9b7c80ea62d7f37 (patch)
tree44701b14670822af4b24a6f3628d447d72efb667 /template
parent004d0c1cf93ac47317b490f83523c799f8651afd (diff)
downloadbugzilla-0ca4c4c49583b2dc680ace8ac9b7c80ea62d7f37.tar.gz
bugzilla-0ca4c4c49583b2dc680ace8ac9b7c80ea62d7f37.tar.xz
Bug 238878: Make hidden-fields template, User Matching and Flags use direct CGI instead of [% form.foo %] - Patch by Teemu Mannermaa <wicked@etlicon.fi> r=LpSolit a=justdave
Diffstat (limited to 'template')
-rw-r--r--template/en/default/global/confirm-user-match.html.tmpl2
-rw-r--r--template/en/default/global/hidden-fields.html.tmpl23
2 files changed, 11 insertions, 14 deletions
diff --git a/template/en/default/global/confirm-user-match.html.tmpl b/template/en/default/global/confirm-user-match.html.tmpl
index 456af1fc2..fd09f89a6 100644
--- a/template/en/default/global/confirm-user-match.html.tmpl
+++ b/template/en/default/global/confirm-user-match.html.tmpl
@@ -21,8 +21,6 @@
#%]
[%# INTERFACE:
- # form: hash; the form values submitted to the script
- # mform: hash; the form multi-values submitted to the script
# fields: hash/record; the fields being matched, each of which has:
# type: single|multi: whether or not the user can select multiple matches
# flag_type: for flag requestee fields, the type of flag being requested
diff --git a/template/en/default/global/hidden-fields.html.tmpl b/template/en/default/global/hidden-fields.html.tmpl
index 2fa577b43..7327e43cf 100644
--- a/template/en/default/global/hidden-fields.html.tmpl
+++ b/template/en/default/global/hidden-fields.html.tmpl
@@ -20,23 +20,22 @@
#%]
[%# INTERFACE:
- # form: hash; the form fields/values for which to generate hidden fields.
- # mform: hash; the form fields/values with multiple values for which to
- # generate hidden fields.
# exclude: string; a regular expression matching fields to exclude
# from the list of hidden fields generated by this template
#%]
+[%# The global Bugzilla->cgi object is used to obtain form variable values. %]
+[% USE Bugzilla %]
+[% cgi = Bugzilla.cgi %]
+
[%# Generate hidden form fields for non-excluded fields. %]
-[% FOREACH field = form %]
- [% NEXT IF exclude && field.key.search(exclude) %]
- [% IF mform.${field.key}.size > 1 %]
- [% FOREACH mvalue = mform.${field.key} %]
- <input type="hidden" name="[% field.key FILTER html %]"
+[% FOREACH field = cgi.param() %]
+ [% NEXT IF exclude && field.search(exclude) %]
+ [%# The '.slice(0)' bit is here to force the 'param(field)' to be evaluated
+ in a list context, so we can avoid extra code checking for single valued or
+ empty fields %]
+ [% FOREACH mvalue = cgi.param(field).slice(0) %]
+ <input type="hidden" name="[% field FILTER html %]"
value="[% mvalue FILTER html FILTER html_linebreak %]">
[% END %]
- [% ELSE %]
- <input type="hidden" name="[% field.key FILTER html %]"
- value="[% field.value FILTER html FILTER html_linebreak %]">
- [% END %]
[% END %]