fixed [ 1298851 ] forum subscribers still get notif. after subscr. expired

This commit is contained in:
JT Smith 2005-10-13 14:23:27 +00:00
parent 872fd3c628
commit e4c2bc9969
3 changed files with 19 additions and 6 deletions

View file

@ -6,6 +6,7 @@
- fix [ 1307043 ] Can't Adjust Order of Nav Menu - fix [ 1307043 ] Can't Adjust Order of Nav Menu
- fix [ 1298896 ] 6.7.4 - reordering stops working after moving assets - fix [ 1298896 ] 6.7.4 - reordering stops working after moving assets
- fix [ 1324170 ] assetId has no hoverhelp. - fix [ 1324170 ] assetId has no hoverhelp.
- fix [ 1298851 ] forum subscribers still get notif. after subscr. expired
6.7.6 6.7.6

View file

@ -585,10 +585,10 @@ Send notifications to the thread and forum subscribers that a new post has been
sub notifySubscribers { sub notifySubscribers {
my $self = shift; my $self = shift;
my %subscribers; my %subscribers;
foreach my $userId (@{WebGUI::Grouping::getUsersInGroup($self->getThread->get("subscriptionGroupId"))}) { foreach my $userId (@{WebGUI::Grouping::getUsersInGroup($self->getThread->get("subscriptionGroupId"),undef,1)}) {
$subscribers{$userId} = $userId unless ($userId eq $self->get("ownerUserId")); $subscribers{$userId} = $userId unless ($userId eq $self->get("ownerUserId"));
} }
foreach my $userId (@{WebGUI::Grouping::getUsersInGroup($self->getThread->getParent->get("subscriptionGroupId"))}) { foreach my $userId (@{WebGUI::Grouping::getUsersInGroup($self->getThread->getParent->get("subscriptionGroupId"),undef,1)}) {
$subscribers{$userId} = $userId unless ($userId eq $self->get("ownerUserId")); $subscribers{$userId} = $userId unless ($userId eq $self->get("ownerUserId"));
} }
my %lang; my %lang;

View file

@ -288,7 +288,7 @@ sub getGroupsInGroup {
#------------------------------------------------------------------- #-------------------------------------------------------------------
=head2 getUsersInGroup ( groupId [, recursive ] ) =head2 getUsersInGroup ( groupId [, recursive, withoutExpired ] )
Returns an array reference containing a list of users that belong to the specified group. Returns an array reference containing a list of users that belong to the specified group.
@ -300,16 +300,28 @@ A unique identifier for the group.
A boolean value to determine whether the method should return the users directly in the group or to follow the entire groups of groups hierarchy. Defaults to "0". A boolean value to determine whether the method should return the users directly in the group or to follow the entire groups of groups hierarchy. Defaults to "0".
=head3 withoutExpired
A boolean that if set true will return the users list minus the expired groupings.
=cut =cut
sub getUsersInGroup { sub getUsersInGroup {
my $clause = "groupId=".quote($_[0]); my $groupId = shift;
if ($_[1]) { my $recursive = shift;
my $groups = getGroupsInGroup($_[0],1); my $withoutExpired = shift;
my $clause;
if ($withoutExpired) {
$clause = "expireDate > ".time()." and ";
}
$clause .= "(groupId=".quote($groupId);
if ($recursive) {
my $groups = getGroupsInGroup($groupId,1);
if ($#$groups >= 0) { if ($#$groups >= 0) {
$clause .= " or groupId in (".quoteAndJoin($groups).")"; $clause .= " or groupId in (".quoteAndJoin($groups).")";
} }
} }
$clause .= ")";
return WebGUI::SQL->buildArrayRef("select userId from groupings where $clause"); return WebGUI::SQL->buildArrayRef("select userId from groupings where $clause");
} }