Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //- variation on this recipe: https://community.rockrms.com/recipes/282/add-a-bookmarked-groups-panel-to-the-person-profile#NoteRef-482a9b716687460f997e56ab63267926
- //- Find all groups the logged in users is following and this individual is a member of
- {% sql loggedInPersonId:'{{ CurrentPerson.Id }}' personId:'{{ Context.Person.Id }}' %}
- SELECT G.Id, G.[Name]
- FROM [dbo].[Following] F
- JOIN PersonAlias PA on PA.Id = F.PersonAliasId
- JOIN Person P on P.Id = PA.PersonId
- JOIN [Group] G on G.Id = F.EntityId
- JOIN GroupMember GM on GM.GroupId = G.Id
- WHERE EntityTypeId = 16
- AND P.ID = @loggedInPersonId -- CurrentLogged in User
- AND GM.PersonId = @personId -- Current Person
- {% endsql %}
- //- Format the display
- <div class='panel panel-persondetails'>
- <div class='panel-heading rollover-container clearfix'>
- <h3 class='panel-title pull-left'><i class='fa fa-bookmark'></i> Bookmarked Groups</h3>
- <div class="actions rollover-item pull-right">
- <a title="Click to learn how to bookmark/follow groups" href="https://community.rockrms.com/documentation/BookContent/7#groupfollowing">
- <i class="fas fa-info-circle"></i>
- </a>
- <a title="View groups I have bookmarked/followed" class="edit" href="/page/302"><i class="fa fa-cog"></i></a>
- </div>
- </div>
- <div class="panel-body">
- <ul>
- {% for item in results %}
- <li>
- <a href='/Group/{{ item.Id }}' style='padding-left:24px'>{{ item.Name }}</a>
- </li>
- {% endfor %}
- </ul>
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement