From 4c4edf2e8527920576ffa36972c0dc1855f1d9b3 Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Mon, 8 Mar 2004 16:40:16 +0000 Subject: Bug 232176 - Add a preferences panel for saved searches, to allow management all in one place. Patch by gerv; r,a=justdave. --- template/en/default/account/prefs/prefs.html.tmpl | 2 ++ .../default/account/prefs/saved-searches.html.tmpl | 38 ++++++++++++++++++++++ userprefs.cgi | 12 +++++++ 3 files changed, 52 insertions(+) create mode 100644 template/en/default/account/prefs/saved-searches.html.tmpl diff --git a/template/en/default/account/prefs/prefs.html.tmpl b/template/en/default/account/prefs/prefs.html.tmpl index a6ff2c89c..03d49ccb3 100644 --- a/template/en/default/account/prefs/prefs.html.tmpl +++ b/template/en/default/account/prefs/prefs.html.tmpl @@ -52,6 +52,8 @@ saveable => "1" }, { name => "email", description => "Email settings", saveable => "1" }, + { name => "saved-searches", description => "Saved searches", + saveable => "0" }, { 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 new file mode 100644 index 000000000..d5a030877 --- /dev/null +++ b/template/en/default/account/prefs/saved-searches.html.tmpl @@ -0,0 +1,38 @@ +[%# 1.0@bugzilla.org %] +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # The Initial Developer of the Original Code is Netscape Communications + # Corporation. Portions created by Netscape are + # Copyright (C) 1998 Netscape Communications Corporation. All + # Rights Reserved. + # + # Contributor(s): Gervase Markham + #%] + +

Your saved searches are as follows:

+ +
+ + [% FOREACH q = queries %] + + + + + [% END %] +
[% q.name FILTER html %]: + Run | + Edit | + Forget +
+
diff --git a/userprefs.cgi b/userprefs.cgi index 3b320fa74..f2b9445ed 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -294,6 +294,14 @@ sub DoPermissions { # No SavePermissions() because this panel has no changeable fields. + +sub DoSavedSearches() { + $vars->{'queries'} = Bugzilla->user->queries; +} + +# No SaveSavedSearches() because this panel has no changeable fields (yet). + + ############################################################################### # Live code (not subroutine definitions) starts here ############################################################################### @@ -330,6 +338,10 @@ SWITCH: for ($current_tab_name) { DoPermissions(); last SWITCH; }; + /^saved-searches$/ && do { + DoSavedSearches(); + last SWITCH; + }; ThrowUserError("unknown_tab", { current_tab_name => $current_tab_name }); } -- cgit v1.2.3-24-g4f1b