From: lpsolit%gmail.com <> Date: Sat, 21 Jul 2007 16:00:59 +0000 (+0000) Subject: Bug 365890: Searches shared by users with bless rights are in the footer by default... X-Git-Tag: bugzilla-3.0.1~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5737518b15cdd7a22ed060b613e2f59af261ce07;p=thirdparty%2Fbugzilla.git Bug 365890: Searches shared by users with bless rights are in the footer by default, with no warning - Patch by Teemu Mannermaa r/a=LpSolit --- diff --git a/template/en/default/account/prefs/saved-searches.html.tmpl b/template/en/default/account/prefs/saved-searches.html.tmpl index 9af0efef5b..4beb0e8231 100644 --- a/template/en/default/account/prefs/saved-searches.html.tmpl +++ b/template/en/default/account/prefs/saved-searches.html.tmpl @@ -22,8 +22,35 @@ [%# INTERFACE: # queryshare_groups: list of groups the user may share queries with # (id, name). + # bless_group_ids: list of group ids the user may bless. #%] +[% IF user.can_bless %] + +[% END %] +

Your saved searches are as follows:

@@ -103,7 +130,8 @@ [% IF may_share %] - [% FOREACH group = queryshare_groups %] [% END %] + [% IF user.can_bless %] + + + [% END %] [% END %] [% END %] +[% IF user.can_bless %] +

Note that for every search that has the "Add to footer" selected, a + link to the shared search is added to the footer of every user that is + a direct member of the group at the time you click Submit Changes.

+[% END %]

You may use these searches saved and shared by others:

diff --git a/userprefs.cgi b/userprefs.cgi index 1ad7f906e6..8f2e69f1e4 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -399,6 +399,7 @@ sub DoSavedSearches { $vars->{'queryshare_groups'} = Bugzilla::Group->new_from_list($user->queryshare_groups); } + $vars->{'bless_group_ids'} = [map {$_->{'id'}} @{$user->bless_groups}]; } sub SaveSavedSearches { @@ -458,10 +459,9 @@ sub SaveSavedSearches { } # If we're sharing our query with a group we can bless, we - # subscribe direct group members to our search automatically. - # Otherwise, the group members need to opt in. This behaviour - # is deemed most likely to fit users' needs. - if ($user->can_bless($group_id)) { + # have the ability to add link to our search to the footer of + # direct group members automatically. + if ($user->can_bless($group_id) && $cgi->param('force_' . $q->id)) { my $group = new Bugzilla::Group($group_id); my $members = $group->members_non_inherited; foreach my $member (@$members) {