From 403c31d61db0b9a9624d3dcbe6c72e45ff046c78 Mon Sep 17 00:00:00 2001 From: "jocuri%softhome.net" <> Date: Sun, 26 Dec 2004 03:39:47 +0000 Subject: Patch for bug 274392: Preserve search name when clicking Edit from Saves Searches in user prefs; patch by Byron Jones (glob) , r=jake, a=justdave. --- buglist.cgi | 4 ++++ query.cgi | 3 +++ template/en/default/account/prefs/saved-searches.html.tmpl | 2 +- template/en/default/list/list.html.tmpl | 10 ++++++++-- template/en/default/search/knob.html.tmpl | 13 +++++++++++++ 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 diff --git a/query.cgi b/query.cgi index bd60e5b67..4c3fa97d3 100755 --- a/query.cgi +++ b/query.cgi @@ -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 @@ Run - Edit + Edit - Edit Search + [% editqueryname = searchname OR defaultsavename OR '' %] + Edit Search [% IF searchtype == "saved" %] @@ -179,7 +184,8 @@ value="[% urlquerypart FILTER html %]"> - + [% 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 #%] +[%# 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 @@

+ [% IF known_name %] + + [% END %]

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". + [% IF known_name %] + + [% END %] -- cgit v1.2.3-65-gdbad