diff options
author | wurblzap%gmail.com <> | 2006-07-14 05:07:57 +0200 |
---|---|---|
committer | wurblzap%gmail.com <> | 2006-07-14 05:07:57 +0200 |
commit | f0c7611262b3948e72e8a18a036569a78f3b51f2 (patch) | |
tree | 54b0e146d4f8fd3c466002728261c895d7709034 /template/en | |
parent | 09495a118b165d60d17780a8623318c19d6ffae6 (diff) | |
download | bugzilla-f0c7611262b3948e72e8a18a036569a78f3b51f2.tar.gz bugzilla-f0c7611262b3948e72e8a18a036569a78f3b51f2.tar.xz |
Bug 69000: Permit a stored query to be marked "shared" and accessible by other users.
Patch by Marc Schumann <wurblzap@gmail.com>,
r=vladd, a=myk
Diffstat (limited to 'template/en')
7 files changed, 179 insertions, 22 deletions
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 <gerv@gerv.net> #%] +[%# 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). + #%] + <p>Your saved searches are as follows:</p> <blockquote> @@ -40,6 +47,17 @@ Show in Footer </th> + [% querysharegroup_regexp = '^' _ Param('querysharegroup') _ '$' %] + [% may_share = user.groups.keys.grep($querysharegroup_regexp).size %] + [% IF may_share %] + <th> + Share With + a Group + [% UNLESS queryshare_groups.size %] + (there are no groups you may share queries with) + [% END %] + </th> + [% END %] </tr> <tr> <td>My Bugs</td> @@ -59,8 +77,12 @@ value="1" [% " checked" IF user.showmybugslink %]> </td> + <td> + — + </td> </tr> [% FOREACH q = queries %] + [% NEXT UNLESS q.userid == user.id %] <tr> <td>[% q.name FILTER html %]</td> <td> @@ -79,9 +101,71 @@ </td> <td align="center"> <input type="checkbox" - name="linkinfooter_[% q.name FILTER html %]" + name="link_in_footer_[% q.id FILTER html %]" + value="1" + [% " checked" IF q.link_in_footer %]> + </td> + <td> + [% IF queryshare_groups.size %] + <select name="share_[% q.id FILTER html %]"> + <option value="">Don't share</option> + [% FOREACH group = queryshare_groups %] + <option value="[% group.id %]" + [% ' selected="selected"' IF q.shared_with_group == group.id %]>[% group.name FILTER html %]</option> + [% END %] + </select> + [% ELSE %] + — + [% END %] + </td> + </tr> + [% END %] + </table> +</blockquote> + +<p>You may use these searches saved and shared by others:</p> + +<blockquote> + <table border="1" cellpadding="3"> + <tr> + <th> + Search + </th> + <th> + Shared By + </th> + <th> + Run + </th> + <th> + Show in + Footer + </th> + </tr> + [% found_shared_query = 0 %] + [% FOREACH q = queries %] + [% NEXT IF q.userid == user.id %] + [% found_shared_query = 1 %] + <tr> + <td>[% q.name FILTER html %]</td> + <td>[% q.user.identity FILTER html %]</td> + <td> + <a href="buglist.cgi?cmdtype=dorem&remaction=run&namedcmd= + [% q.name FILTER url_quote %]&sharer_id= + [% q.userid FILTER url_quote %]">Run</a> + </td> + <td align="center"> + <input type="checkbox" + name="link_in_footer_[% q.id FILTER html %]" value="1" - [% " checked" IF q.linkinfooter %]> + [% " checked" IF q.link_in_footer %]> + </td> + </tr> + [% END %] + [% IF !found_shared_query %] + <tr> + <td colspan="4" style="text-align: center"> + <None> </td> </tr> [% 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.</p> [% END %] + [% IF shared_queries %] + <p> + <b>There + [% IF shared_queries > 1 %] + are [% shared_queries %] saved searches + [% ELSE %] + is a saved search + [% END %] + being shared with this group.</b> + If you delete this group, + [% IF shared_queries > 1 %] + these saved searches + [% ELSE %] + this saved search + [% END %] + will fall back to being private again. + </p> + [% END %] + <h2>Confirmation</h2> <p>Do you really want to delete this group?</p> 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 %] <li> [% 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 %] </li> [% 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 <gerv@gerv.net> # Svetlana Harisova <light@rathedg.com> + # Marc Schumann <wurblzap@gmail.com> #%] [%# Migration note: this whole file corresponds to the old %commandmenu% @@ -67,23 +68,40 @@ <div id="links-saved"> <div class="label"> [% IF user.showmybugslink OR user.queries.size %] - Saved Searches: + Saved Searches: [% END %] </div> <div class="links"> - [% IF user.showmybugslink %] - [% filtered_username = user.login FILTER url_quote %] - <a href="[% Param('mybugstemplate').replace('%userid%', filtered_username) %]">My [% terms.Bugs %]</a> + [% IF user.showmybugslink %] + [% filtered_username = user.login FILTER url_quote %] + <a href="[% Param('mybugstemplate').replace('%userid%', filtered_username) %]">My [% terms.Bugs %]</a> + [% print_pipe = 1 %] + [% END %] + + [% FOREACH q = user.queries %] + [% NEXT IF q.userid != user.id %] + [% IF q.link_in_footer %] + [% " | " IF print_pipe %] + <a href="buglist.cgi?cmdtype=dorem&remaction=run&namedcmd= + [% q.name FILTER url_quote %]">[% q.name FILTER html FILTER no_break %]</a> [% print_pipe = 1 %] [% END %] + [% END %] - [% FOREACH q = user.queries %] - [% IF q.linkinfooter %] - [% " | " IF print_pipe %] - <a href="buglist.cgi?cmdtype=runnamed&namedcmd=[% q.name FILTER url_quote %]">[% q.name FILTER html FILTER no_break %]</a> - [% print_pipe = 1 %] - [% END %] + [% " <br> " IF print_pipe %] + [% print_pipe = 0 %] + [% FOREACH q = user.queries %] + [% NEXT IF q.userid == user.id %] + [% IF q.link_in_footer %] + [% " | " IF print_pipe %] + <a href="buglist.cgi?cmdtype=dorem&remaction=run&namedcmd= + [% q.name FILTER url_quote %]&sharer_id= + [% q.userid FILTER url_quote %]" + class="shared" + title="Shared by [% q.user.identity FILTER html %]">[% q.name FILTER html FILTER no_break %]</a> + [% print_pipe = 1 %] [% END %] + [% END %] </div> </div> 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 <em>[% queryname FILTER html %]</em> does not - exist. + [% docslinks = {'query.html' => "Searching for $terms.bugs", + 'list.html' => "$terms.Bug lists"} %] + The search named <em>[% queryname FILTER html %]</em> + [% 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 %] |