From 96998d6abce5465e93b6876804766e7f189b7621 Mon Sep 17 00:00:00 2001 From: "jouni%heikniemi.net" <> Date: Thu, 22 Jul 2004 12:14:13 +0000 Subject: Bug 98751: Make it easier to update a stored query. r=gerv, a=justdave --- buglist.cgi | 4 ++++ query.cgi | 3 +++ template/en/default/list/list.html.tmpl | 10 ++++++++-- template/en/default/search/knob.html.tmpl | 13 +++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/buglist.cgi b/buglist.cgi index 63d8cd0dd..b9fc8a52c 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -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 diff --git a/query.cgi b/query.cgi index 9d4838836..17e62f5ec 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/list/list.html.tmpl b/template/en/default/list/list.html.tmpl index c0291024c..80348906f 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 %] - 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..68d279047 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 %]

-- cgit v1.2.3-24-g4f1b