summaryrefslogtreecommitdiffstats
path: root/userprefs.cgi
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2004-05-14 01:04:26 +0200
committerbugreport%peshkin.net <>2004-05-14 01:04:26 +0200
commit95b84377992077442427a25786387285f994cb97 (patch)
treee4cffdae54811e0a713cac7f15a3369b5845910d /userprefs.cgi
parenta8de93fcc5c9a63482bd6461574750b470af5fa1 (diff)
downloadbugzilla-95b84377992077442427a25786387285f994cb97.tar.gz
bugzilla-95b84377992077442427a25786387285f994cb97.tar.xz
Bug 236779: Add UI for changing "linkinfooter" flag for saved searches
r=gerv,preed a=justdave
Diffstat (limited to 'userprefs.cgi')
-rwxr-xr-xuserprefs.cgi17
1 files changed, 16 insertions, 1 deletions
diff --git a/userprefs.cgi b/userprefs.cgi
index eefe40205..cd73678c9 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;
};