diff options
author | jocuri%softhome.net <> | 2004-12-26 03:39:47 +0000 |
---|---|---|
committer | jocuri%softhome.net <> | 2004-12-26 03:39:47 +0000 |
commit | 403c31d61db0b9a9624d3dcbe6c72e45ff046c78 (patch) | |
tree | 7f72b1f4968a04b1fd5a69ab665aef29e258415a | |
parent | Patch for bug 264160: Make all default groups inherit the admin group on a ne... (diff) | |
download | bugzilla-403c31d61db0b9a9624d3dcbe6c72e45ff046c78.tar.gz bugzilla-403c31d61db0b9a9624d3dcbe6c72e45ff046c78.tar.bz2 bugzilla-403c31d61db0b9a9624d3dcbe6c72e45ff046c78.zip |
Patch for bug 274392: Preserve search name when clicking Edit from Saves Searches in user prefs; patch by Byron Jones (glob) <bugzilla@glob.com.au>, r=jake, a=justdave.
-rwxr-xr-x | buglist.cgi | 4 | ||||
-rwxr-xr-x | query.cgi | 3 | ||||
-rw-r--r-- | template/en/default/account/prefs/saved-searches.html.tmpl | 2 | ||||
-rw-r--r-- | template/en/default/list/list.html.tmpl | 10 | ||||
-rw-r--r-- | template/en/default/search/knob.html.tmpl | 13 | ||||
-rw-r--r-- | template/en/default/search/search-specific.html.tmpl | 4 |
6 files changed, 33 insertions, 3 deletions
diff --git a/buglist.cgi b/buglist.cgi index 7858f9590..1ae44467f 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -921,6 +921,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 @@ -395,6 +395,9 @@ if (($::FORM{'query_format'} || $::FORM{'format'} || "") eq "create-series") { $vars->{'category'} = Bugzilla::Chart::getVisibleSeries(); } +$vars->{'known_name'} = $cgi->param('known_name'); + + # Add in the defaults. $vars->{'default'} = \%default; diff --git a/template/en/default/account/prefs/saved-searches.html.tmpl b/template/en/default/account/prefs/saved-searches.html.tmpl index 5055565e3..a99b9ed85 100644 --- a/template/en/default/account/prefs/saved-searches.html.tmpl +++ b/template/en/default/account/prefs/saved-searches.html.tmpl @@ -67,7 +67,7 @@ <a href="buglist.cgi?[% q.query FILTER html %]">Run</a> </td> <td> - <a href="query.cgi?[% q.query FILTER html %]">Edit</a> + <a href="query.cgi?[% q.query FILTER html %]&known_name=[% q.name FILTER url_quote %]">Edit</a> </td> <td> <a href="buglist.cgi?cmdtype=dorem&remaction=forget&namedcmd= diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl index c0291024c..5a3926c5e 100644 --- a/template/en/default/list/list.html.tmpl +++ b/template/en/default/list/list.html.tmpl @@ -22,6 +22,7 @@ [%# INTERFACE: # searchtype: string. Type of search - either "series", "saved" or undef. # ... + # defaultsavename: string. The default name for saving the query. #%] [%############################################################################%] @@ -159,7 +160,11 @@ [% END %] <td valign="middle"> - <a href="query.cgi?[% urlquerypart FILTER html %]">Edit Search</a> + [% editqueryname = searchname OR defaultsavename OR '' %] + <a href="query.cgi?[% urlquerypart FILTER html %] + [% IF editqueryname != '' %]&known_name= + [% editqueryname FILTER url_quote %] + [% END %]">Edit Search</a> </td> [% IF searchtype == "saved" %] @@ -179,7 +184,8 @@ value="[% urlquerypart FILTER html %]"> <input type="hidden" name="cmdtype" value="doit"> <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> </td> [% END %] diff --git a/template/en/default/search/knob.html.tmpl b/template/en/default/search/knob.html.tmpl index c92ad92cc..6c87cc4b9 100644 --- a/template/en/default/search/knob.html.tmpl +++ b/template/en/default/search/knob.html.tmpl @@ -21,6 +21,15 @@ # 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 %] [%# This is not necessary for English templates, but useful for localisers. %] @@ -46,6 +55,10 @@ <p> <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> diff --git a/template/en/default/search/search-specific.html.tmpl b/template/en/default/search/search-specific.html.tmpl index b50307552..e57566bd0 100644 --- a/template/en/default/search/search-specific.html.tmpl +++ b/template/en/default/search/search-specific.html.tmpl @@ -100,6 +100,10 @@ for "crash secure SSL flash". <td></td> <td> <input type="submit" value="Search"> + [% IF known_name %] + <input type="hidden" name="query_based_on" + value="[% known_name FILTER html %]"> + [% END %] </td> </tr> </table> |