From f0c7611262b3948e72e8a18a036569a78f3b51f2 Mon Sep 17 00:00:00 2001 From: "wurblzap%gmail.com" <> Date: Fri, 14 Jul 2006 03:07:57 +0000 Subject: Bug 69000: Permit a stored query to be marked "shared" and accessible by other users. Patch by Marc Schumann , r=vladd, a=myk --- .../default/account/prefs/saved-searches.html.tmpl | 88 +++++++++++++++++++++- template/en/default/admin/groups/delete.html.tmpl | 20 +++++ .../default/admin/params/groupsecurity.html.tmpl | 3 + .../default/admin/users/confirm-delete.html.tmpl | 33 ++++++-- template/en/default/filterexceptions.pl | 9 ++- template/en/default/global/useful-links.html.tmpl | 38 +++++++--- template/en/default/global/user-error.html.tmpl | 10 ++- 7 files changed, 179 insertions(+), 22 deletions(-) (limited to 'template/en/default') diff --git a/template/en/default/account/prefs/saved-searches.html.tmpl b/template/en/default/account/prefs/saved-searches.html.tmpl index 7f0052bba..16ec67876 100644 --- a/template/en/default/account/prefs/saved-searches.html.tmpl +++ b/template/en/default/account/prefs/saved-searches.html.tmpl @@ -19,6 +19,13 @@ # Contributor(s): Gervase Markham #%] +[%# INTERFACE: + # queries: list of the named queries visible to the user, both own and shared + # by others. Cleaned-up result of Bugzilla::User::queries. + # queryshare_groups: list of groups the user may share queries with + # (id, name). + #%] +

Your saved searches are as follows:

@@ -40,6 +47,17 @@ Show in Footer + [% querysharegroup_regexp = '^' _ Param('querysharegroup') _ '$' %] + [% may_share = user.groups.keys.grep($querysharegroup_regexp).size %] + [% IF may_share %] + + Share With + a Group + [% UNLESS queryshare_groups.size %] + (there are no groups you may share queries with) + [% END %] + + [% END %] My Bugs @@ -59,8 +77,12 @@ value="1" [% " checked" IF user.showmybugslink %]> + + — + [% FOREACH q = queries %] + [% NEXT UNLESS q.userid == user.id %] [% q.name FILTER html %] @@ -79,9 +101,71 @@ + + + [% IF queryshare_groups.size %] + + [% ELSE %] + — + [% END %] + + + [% END %] + +
+ +

You may use these searches saved and shared by others:

+ +
+ + + + + + + + [% found_shared_query = 0 %] + [% FOREACH q = queries %] + [% NEXT IF q.userid == user.id %] + [% found_shared_query = 1 %] + + + + + + + [% END %] + [% IF !found_shared_query %] + + [% END %] diff --git a/template/en/default/admin/groups/delete.html.tmpl b/template/en/default/admin/groups/delete.html.tmpl index cca19981b..d0c50f69a 100644 --- a/template/en/default/admin/groups/delete.html.tmpl +++ b/template/en/default/admin/groups/delete.html.tmpl @@ -30,6 +30,7 @@ # hasbugs: boolean int. True if the group includes bugs in it. # hasproduct: boolean int. True if the group is binded to a product. # hasflags: boolean int. True if the group is used by a flag type. + # shared_queries: int. Number of saved searches being shared with this group. # buglist: string. The list of bugs included in this group. #%] @@ -92,6 +93,25 @@ flag types from this group for me.

[% END %] + [% IF shared_queries %] +

+ There + [% IF shared_queries > 1 %] + are [% shared_queries %] saved searches + [% ELSE %] + is a saved search + [% END %] + being shared with this group. + If you delete this group, + [% IF shared_queries > 1 %] + these saved searches + [% ELSE %] + this saved search + [% END %] + will fall back to being private again. +

+ [% END %] +

Confirmation

Do you really want to delete this group?

diff --git a/template/en/default/admin/params/groupsecurity.html.tmpl b/template/en/default/admin/params/groupsecurity.html.tmpl index 9016a7038..630777998 100644 --- a/template/en/default/admin/params/groupsecurity.html.tmpl +++ b/template/en/default/admin/params/groupsecurity.html.tmpl @@ -46,6 +46,9 @@ timetrackinggroup => "The name of the group of users who can see/change time tracking " _ "information.", + querysharegroup => "The name of the group of users who can share their " _ + "saved searches with others.", + usevisibilitygroups => "Do you wish to restrict visibility of users to members of " _ "specific groups?", diff --git a/template/en/default/admin/users/confirm-delete.html.tmpl b/template/en/default/admin/users/confirm-delete.html.tmpl index 6b7bdcf10..e5f3a392b 100644 --- a/template/en/default/admin/users/confirm-delete.html.tmpl +++ b/template/en/default/admin/users/confirm-delete.html.tmpl @@ -31,7 +31,8 @@ # flags.requestee: number of flags the viewed user is being asked for # flags.setter: number of flags the viewed user has set # longdescs: number of bug comments the viewed user has written - # namedqueries: number of named queries the user has created + # namedqueries: array of IDs of named queries the user has created + # namedquery_group_map: number of named queries the user has shared # profiles_activity: number of named queries the user has created # series: number of series the viewed user has created # votes: number of bugs the viewed user has voted on @@ -301,17 +302,35 @@ [% IF namedqueries %]
  • [% otheruser.login FILTER html %] has - [% IF namedqueries == 1 %] - a named query + [% IF namedqueries.size == 1 %] + a [% 'shared' IF namedquery_group_map %] named search [% ELSE %] - [%+ namedqueries %] named queries + [%+ namedqueries.size %] named searches [% END %]. - [% IF namedqueries == 1 %] - This named query + [% IF namedqueries.size == 1 %] + This named search [% ELSE %] - These named queries + These named searches [% END %] will be deleted along with the user account. + [% IF namedquery_group_map %] + [% IF namedqueries.size > 1 %] + Of these, + [% IF namedquery_group_map > 1 %] + [%+ namedquery_group_map FILTER html %] are + [% ELSE %] + one is + [% END %] + shared. + [% END %] + Other users will not be able to use + [% IF namedquery_group_map > 1 %] + these shared named searches + [% ELSE %] + this shared named search + [% END %] + any more. + [% END %]
  • [% END %] [% IF profile_setting %] diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index 14043a9bf..8008036d7 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -545,6 +545,10 @@ 'comp.bug_count' ], +'admin/groups/delete.html.tmpl' => [ + 'shared_queries' +], + 'admin/users/confirm-delete.html.tmpl' => [ 'andstring', 'responsibilityterms.$responsibility', @@ -554,7 +558,6 @@ 'flags.requestee', 'flags.setter', 'longdescs', - 'namedqueries', 'votes', 'series', 'watch.watched', @@ -600,6 +603,10 @@ 'current_tab.name', ], +'account/prefs/saved-searches.html.tmpl' => [ + 'group.id', +], + 'account/prefs/settings.html.tmpl' => [ 'name', 'default_name' diff --git a/template/en/default/global/useful-links.html.tmpl b/template/en/default/global/useful-links.html.tmpl index 9d97b095b..44a990279 100644 --- a/template/en/default/global/useful-links.html.tmpl +++ b/template/en/default/global/useful-links.html.tmpl @@ -18,6 +18,7 @@ # # Contributor(s): Gervase Markham # Svetlana Harisova + # Marc Schumann #%] [%# Migration note: this whole file corresponds to the old %commandmenu% @@ -67,23 +68,40 @@ diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index c615598b9..b8dbeb24f 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -920,8 +920,14 @@ [% ELSIF error == "missing_query" %] [% title = "Missing Search" %] - The search named [% queryname FILTER html %] does not - exist. + [% docslinks = {'query.html' => "Searching for $terms.bugs", + 'list.html' => "$terms.Bug lists"} %] + The search named [% queryname FILTER html %] + [% IF sharer_id %] + has not been made visible to you. + [% ELSE %] + does not exist. + [% END %] [% ELSIF error == "move_bugs_disabled" %] [% title = BLOCK %][% terms.Bug %] Moving Disabled[% END %] -- cgit v1.2.1
    + Search + + Shared By + + Run + + Show in + Footer +
    [% q.name FILTER html %][% q.user.identity FILTER html %] + Run + + + [% " checked" IF q.link_in_footer %]> +
    + <None>