From: jocuri%softhome.net <> Date: Sun, 26 Dec 2004 03:39:47 +0000 (+0000) Subject: Patch for bug 274392: Preserve search name when clicking Edit from Saves Searches... X-Git-Tag: bugzilla-2.18~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=403c31d61db0b9a9624d3dcbe6c72e45ff046c78;p=thirdparty%2Fbugzilla.git 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. --- diff --git a/buglist.cgi b/buglist.cgi index 7858f95901..1ae44467fc 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 bd60e5b670..4c3fa97d35 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 5055565e3c..a99b9ed851 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 c92ad92cc1..6c87cc4b9c 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 b503075523..e57566bd05 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 %]