From: bugreport%peshkin.net <> Date: Thu, 13 May 2004 23:04:26 +0000 (+0000) Subject: Bug 236779: Add UI for changing "linkinfooter" flag for saved searches X-Git-Tag: bugzilla-2.18rc1~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95b84377992077442427a25786387285f994cb97;p=thirdparty%2Fbugzilla.git Bug 236779: Add UI for changing "linkinfooter" flag for saved searches r=gerv,preed a=justdave --- diff --git a/template/en/default/account/prefs/prefs.html.tmpl b/template/en/default/account/prefs/prefs.html.tmpl index 03d49ccb3c..00e7f89131 100644 --- a/template/en/default/account/prefs/prefs.html.tmpl +++ b/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/template/en/default/account/prefs/saved-searches.html.tmpl b/template/en/default/account/prefs/saved-searches.html.tmpl index d5a0308773..a11c1c380f 100644 --- a/template/en/default/account/prefs/saved-searches.html.tmpl +++ b/template/en/default/account/prefs/saved-searches.html.tmpl @@ -22,13 +22,41 @@
Your saved searches are as follows:
-+
+
+ [% FOREACH q = queries %]+ Show in +
+ Footer ++ Search + ++ Run + ++ Edit + ++ Forget + +- diff --git a/userprefs.cgi b/userprefs.cgi index eefe40205b..cd73678c9b 100755 --- a/userprefs.cgi +++ b/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; };[% q.name FILTER html %]: - Run | - Edit | + + +[% q.name FILTER html %] ++ Run + ++ Edit + +Forget diff --git a/template/en/default/global/useful-links.html.tmpl b/template/en/default/global/useful-links.html.tmpl index 806edfcf70..d238a42538 100644 --- a/template/en/default/global/useful-links.html.tmpl +++ b/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 %]