summaryrefslogtreecommitdiffstats
path: root/template/en/default
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2009-08-19 16:46:55 +0200
committerlpsolit%gmail.com <>2009-08-19 16:46:55 +0200
commitb973fa3aa78197c0df5dfa519502d4f144f61edf (patch)
tree3cb1df68e35712eb93b0199cc15ae2aca3296449 /template/en/default
parent908feaf0555d4fae610db81e1cf4a0574ac439b7 (diff)
downloadbugzilla-b973fa3aa78197c0df5dfa519502d4f144f61edf.tar.gz
bugzilla-b973fa3aa78197c0df5dfa519502d4f144f61edf.tar.xz
Bug 505015: Selections are not persistent across submissions - Patch by Frédéric Buclin <LpSolit@gmail.com> r=ghendricks a=LpSolit
Diffstat (limited to 'template/en/default')
-rw-r--r--template/en/default/reports/create-chart.html.tmpl30
-rw-r--r--template/en/default/reports/series-common.html.tmpl10
2 files changed, 14 insertions, 26 deletions
diff --git a/template/en/default/reports/create-chart.html.tmpl b/template/en/default/reports/create-chart.html.tmpl
index 4762c62c0..0466b11c1 100644
--- a/template/en/default/reports/create-chart.html.tmpl
+++ b/template/en/default/reports/create-chart.html.tmpl
@@ -50,6 +50,7 @@ function subcatSelected() {
i++;
}
+ namewidget.disabled = false;
namewidget.options[0].selected = true;
checkNewState();
@@ -98,23 +99,16 @@ function subcatSelected() {
<td>
<noscript>
<input type="submit" name="action-assemble" value="Update --&gt;"
- id="action-assemble">
+ id="action-assemble2">
</noscript>
</td>
- <td align="left">
- <select name="name" id="name" style="width: 15em"
- size="5" multiple="multiple"
- [%+ "disabled=\"disabled\"" UNLESS name.keys.size %]>
- [% FOREACH x = name.keys.sort %]
- <option value="[% name.$x FILTER html %]">
- [% x FILTER html %]</option>
- [% END %]
- [% UNLESS name.keys.size %]
- <option value="" disabled="disabled"></option>
- [% END %]
- </select>
- </td>
+ [% PROCESS series_select sel = { name => 'name',
+ size => 5,
+ multiple => 1,
+ # We want to use the series ID as value,
+ # not its name.
+ value_in_hash => 1 } %]
<td align="center" valign="middle">
<input type="submit" name="action-add" value="Add To List"
@@ -124,14 +118,6 @@ function subcatSelected() {
[% END %]
</table>
- <script type="text/javascript">
- document.chartform.category[0].selected = true;
- document.chartform.subcategory.disabled = '';
- document.chartform.name.disabled = '';
- catSelected();
- subcatSelected();
- </script>
-
<h3>List Of Data Sets To Plot</h3>
[% IF chart.lines.size > 0 %]
diff --git a/template/en/default/reports/series-common.html.tmpl b/template/en/default/reports/series-common.html.tmpl
index 35586cb47..cecf288ec 100644
--- a/template/en/default/reports/series-common.html.tmpl
+++ b/template/en/default/reports/series-common.html.tmpl
@@ -48,7 +48,6 @@ var series = {
[% END %]
};
-[%# Should attempt to preserve selection across invocations @@@ %]
[%# This function takes necessary action on selection of a category %]
function catSelected() {
var cat = document.chartform.category.value;
@@ -67,7 +66,8 @@ function catSelected() {
[% IF newtext %]
subcatwidget.options[i] = new Option("[% newtext FILTER js %]", "");
[% END %]
-
+
+ subcatwidget.disabled = false;
subcatwidget.options[0].selected = true;
if (document.chartform.action[1]) {
@@ -100,11 +100,13 @@ function checkNewState() {
<td align="left">
<select name="[% sel.name %]" id="[% sel.name %]"
size="[% sel.size %]" style="width: 15em"
+ [%+ 'multiple="multiple"' IF sel.multiple %]
[%+ "disabled=\"disabled\"" UNLESS ${sel.name}.keys.size || newtext %]
[%+ "onchange=\"$sel.onchange\"" IF sel.onchange %]>
[% FOREACH x = ${sel.name}.keys.sort %]
- <option value="[% x FILTER html %]"
- [% " selected" IF default.${sel.name} == x %]>
+ [% value = sel.value_in_hash ? ${sel.name}.$x : x %]
+ <option value="[% value FILTER html %]"
+ [% " selected" IF default.${sel.name} == value %]>
[% x FILTER html %]</option>
[% END %]
[% IF newtext %]