From 83ce1f0a5fbd9a718534bd5a85d6257c5bf70421 Mon Sep 17 00:00:00 2001 From: "bugreport%peshkin.net" Date: Thu, 13 May 2004 16:04:27 +0000 Subject: [PATCH] Bug 236779: Add UI for changing "linkinfooter" flag for saved searches r=gerv,preed a=justdave git-svn-id: svn://10.0.0.236/trunk@156358 18797224-902f-48f8-a5cc-f745e15eee43 --- .../en/default/account/prefs/prefs.html.tmpl | 2 +- .../account/prefs/saved-searches.html.tmpl | 36 ++++++++++++++++--- .../en/default/global/useful-links.html.tmpl | 8 +++-- mozilla/webtools/bugzilla/userprefs.cgi | 17 ++++++++- 4 files changed, 54 insertions(+), 9 deletions(-) diff --git a/mozilla/webtools/bugzilla/template/en/default/account/prefs/prefs.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/account/prefs/prefs.html.tmpl index 03d49ccb3c3..00e7f89131b 100644 --- a/mozilla/webtools/bugzilla/template/en/default/account/prefs/prefs.html.tmpl +++ b/mozilla/webtools/bugzilla/template/en/default/account/prefs/prefs.html.tmpl @@ -53,7 +53,7 @@ { name => "email", description => "Email settings", saveable => "1" }, { name => "saved-searches", description => "Saved searches", - saveable => "0" }, + saveable => "1" }, { name => "permissions", description => "Permissions", saveable => "0" } ] %] diff --git a/mozilla/webtools/bugzilla/template/en/default/account/prefs/saved-searches.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/account/prefs/saved-searches.html.tmpl index d5a0308773a..a11c1c380f6 100644 --- a/mozilla/webtools/bugzilla/template/en/default/account/prefs/saved-searches.html.tmpl +++ b/mozilla/webtools/bugzilla/template/en/default/account/prefs/saved-searches.html.tmpl @@ -22,13 +22,41 @@

Your saved searches are as follows:

- +
+ + + + + + + [% FOREACH q = queries %] - + + + + diff --git a/mozilla/webtools/bugzilla/template/en/default/global/useful-links.html.tmpl b/mozilla/webtools/bugzilla/template/en/default/global/useful-links.html.tmpl index 806edfcf70e..d238a42538f 100644 --- a/mozilla/webtools/bugzilla/template/en/default/global/useful-links.html.tmpl +++ b/mozilla/webtools/bugzilla/template/en/default/global/useful-links.html.tmpl @@ -106,9 +106,11 @@ [% END %] [% FOREACH q = user.queries %] - [% " | " IF print_pipe %] - [% q.name FILTER html %] - [% print_pipe = 1 %] + [% IF q.linkinfooter %] + [% " | " IF print_pipe %] + [% q.name FILTER html %] + [% print_pipe = 1 %] + [% END %] [% END %] diff --git a/mozilla/webtools/bugzilla/userprefs.cgi b/mozilla/webtools/bugzilla/userprefs.cgi index eefe40205b9..cd73678c9b3 100755 --- a/mozilla/webtools/bugzilla/userprefs.cgi +++ b/mozilla/webtools/bugzilla/userprefs.cgi @@ -301,7 +301,21 @@ sub DoSavedSearches() { $vars->{'queries'} = Bugzilla->user->queries; } -# No SaveSavedSearches() because this panel has no changeable fields (yet). +sub SaveSavedSearches() { + my $cgi = Bugzilla->cgi; + my $dbh = Bugzilla->dbh; + my @queries = @{Bugzilla->user->queries}; + my $sth = $dbh->prepare("UPDATE namedqueries SET linkinfooter = ? + WHERE userid = ? + AND name = ?"); + foreach my $q (@queries) { + my $linkinfooter = + defined($cgi->param("linkinfooter_$q->{'name'}")) ? 1 : 0; + $sth->execute($linkinfooter, $userid, $q->{'name'}); + } + + Bugzilla->user->flush_queries_cache; +} ############################################################################### @@ -340,6 +354,7 @@ SWITCH: for ($current_tab_name) { last SWITCH; }; /^saved-searches$/ && do { + SaveSavedSearches() if $cgi->param('dosave'); DoSavedSearches(); last SWITCH; };
+ Show in
+ Footer +
+ Search + + Run + + Edit + + Forget +
[% q.name FILTER html %]: - Run | - Edit | + + [% q.name FILTER html %] + Run + + Edit + Forget