Commit 96998d6a authored by jouni%heikniemi.net's avatar jouni%heikniemi.net

Bug 98751: Make it easier to update a stored query.

r=gerv, a=justdave
parent bf43cc08
...@@ -902,6 +902,10 @@ if ($dotweak) { ...@@ -902,6 +902,10 @@ if ($dotweak) {
} }
} }
# If we're editing a stored query, use the existing query name as default for
# the "Remember search as" field.
$vars->{'defaultsavename'} = $cgi->param('query_based_on');
################################################################################ ################################################################################
# HTTP Header Generation # HTTP Header Generation
......
...@@ -395,6 +395,9 @@ if (($::FORM{'query_format'} || $::FORM{'format'} || "") eq "create-series") { ...@@ -395,6 +395,9 @@ if (($::FORM{'query_format'} || $::FORM{'format'} || "") eq "create-series") {
$vars->{'category'} = Bugzilla::Chart::getVisibleSeries(); $vars->{'category'} = Bugzilla::Chart::getVisibleSeries();
} }
$vars->{'known_name'} = $cgi->param('known_name');
# Add in the defaults. # Add in the defaults.
$vars->{'default'} = \%default; $vars->{'default'} = \%default;
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
[%# INTERFACE: [%# INTERFACE:
# searchtype: string. Type of search - either "series", "saved" or undef. # searchtype: string. Type of search - either "series", "saved" or undef.
# ... # ...
# defaultsavename: string. The default name for saving the query.
#%] #%]
[%############################################################################%] [%############################################################################%]
...@@ -159,7 +160,11 @@ ...@@ -159,7 +160,11 @@
[% END %] [% END %]
<td valign="middle"> <td valign="middle">
<a href="query.cgi?[% urlquerypart FILTER html %]">Edit&nbsp;Search</a> [% editqueryname = searchname OR defaultsavename OR '' %]
<a href="query.cgi?[% urlquerypart FILTER html %]
[% IF editqueryname != '' %]&amp;known_name=
[% editqueryname FILTER url_quote %]
[% END %]">Edit&nbsp;Search</a>
</td> </td>
[% IF searchtype == "saved" %] [% IF searchtype == "saved" %]
...@@ -179,7 +184,8 @@ ...@@ -179,7 +184,8 @@
value="[% urlquerypart FILTER html %]"> value="[% urlquerypart FILTER html %]">
<input type="hidden" name="cmdtype" value="doit"> <input type="hidden" name="cmdtype" value="doit">
<input type="hidden" name="remtype" value="asnamed"> <input type="hidden" name="remtype" value="asnamed">
<input type="text" name="newqueryname" size="20"> <input type="text" name="newqueryname" size="20"
value="[% defaultsavename FILTER html %]">
</form> </form>
</td> </td>
[% END %] [% END %]
......
...@@ -21,6 +21,15 @@ ...@@ -21,6 +21,15 @@
# Jouni Heikniemi <jouni@heikniemi.net> # Jouni Heikniemi <jouni@heikniemi.net>
#%] #%]
[%# INTERFACE:
# (incomplete!)
# ...
# known_name: string. Possibly known stored name for the query being
# edited. This value is just passed through in a
# hidden field.
#%]
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
[%# This is not necessary for English templates, but useful for localisers. %] [%# This is not necessary for English templates, but useful for localisers. %]
...@@ -46,6 +55,10 @@ ...@@ -46,6 +55,10 @@
<p> <p>
<input type="submit" value="[% button_name FILTER html %]"> <input type="submit" value="[% button_name FILTER html %]">
[% IF known_name %]
<input type="hidden" name="query_based_on"
value="[% known_name FILTER html %]">
[% END %]
</p> </p>
<p> <p>
......
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