Answers.Body: <p>CiviMobile (new version) works nicely for checking people into an event, but I think it's going to do its own sorting regardless of anything you display in the normal Civi GUI.</p>
  
  <p>If you're on Drupal then a view using the DancePartner relationship with a VBO might do what you need to display the partners and register attendance.</p>
  
  <p>Do you want to register and check in individuals or couples?  </p>
  
  <p>If you are more interested in couples, then you could potentially repurpose/abuse 'household' as 'dance partnership' since you can register households as event participants.  You could then use CiviMobile and check in the 'Marie &amp; Peter partnership' household.  You would need to check the rest of your workflow but it fits the objective of checking in a couple via CiviMobile.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-26T21:12:28.753Z
Answers.Text: Thank you for your comment!
  
  I've been fiddling around with abusing the household for my purpose. It does work nicely for registering and checking in couples. It does create some additional problems with contact information and perhaps even payment issues.
Answers.UserDisplayName: M. van Son
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-25T14:34:08.737Z
Answers.LastActivityDate: 2016-11-25T14:34:08.737Z
Answers.UserDisplayName: Aidan
Answers.Body: <p>Thank you all for helping me. I've decided to go a different route and started messing with reports and I was able to group dancepartners together using a SQL join.</p>
  
  <p>I duplicated an existing report (attendee list) and modified the SQL WHERE clause to this:</p>
  
  <pre><code>  public function from() {
      $this-&gt;_from = "
          FROM civicrm_participant {$this-&gt;_aliases['civicrm_participant']}
               LEFT JOIN civicrm_relationship contact_a_relation
                          ON (participant_civireport.contact_id = contact_a_relation.contact_id_b )
               LEFT JOIN civicrm_relationship contact_b_relation
                          ON (participant_civireport.contact_id = contact_b_relation.contact_id_a )
               LEFT JOIN civicrm_event {$this-&gt;_aliases['civicrm_event']}
                      ON ({$this-&gt;_aliases['civicrm_event']}.id = {$this-&gt;_aliases['civicrm_participant']}.event_id ) AND
                          {$this-&gt;_aliases['civicrm_event']}.is_template = 0
               LEFT JOIN civicrm_contact {$this-&gt;_aliases['civicrm_contact']}
                      ON ({$this-&gt;_aliases['civicrm_participant']}.contact_id  = {$this-&gt;_aliases['civicrm_contact']}.id  )
               {$this-&gt;_aclFrom}
               LEFT JOIN civicrm_address {$this-&gt;_aliases['civicrm_address']}
                      ON {$this-&gt;_aliases['civicrm_contact']}.id = {$this-&gt;_aliases['civicrm_address']}.contact_id AND
                         {$this-&gt;_aliases['civicrm_address']}.is_primary = 1
               LEFT JOIN  civicrm_email {$this-&gt;_aliases['civicrm_email']}
                      ON ({$this-&gt;_aliases['civicrm_contact']}.id = {$this-&gt;_aliases['civicrm_email']}.contact_id AND
                         {$this-&gt;_aliases['civicrm_email']}.is_primary = 1)
               LEFT  JOIN civicrm_phone  {$this-&gt;_aliases['civicrm_phone']}
                       ON {$this-&gt;_aliases['civicrm_contact']}.id = {$this-&gt;_aliases['civicrm_phone']}.contact_id AND
                           {$this-&gt;_aliases['civicrm_phone']}.is_primary = 1
        ";
  </code></pre>
  
  <p>After that, I disabled to GROUP BY statement and that gave me the reports I want. I'm fairly confident that this will also work with the CiviMobile pages.</p>
  
  <p>I've used this blogpost to get me started: <a href="https://alastaira.wordpress.com/2011/03/17/civicrm-creating-a-custom-report/" rel="nofollow noreferrer">https://alastaira.wordpress.com/2011/03/17/civicrm-creating-a-custom-report/</a></p>
  
  <p>Thanks again!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-20T22:03:32.953Z
Answers.LastActivityDate: 2017-01-20T22:03:32.953Z
Answers.UserDisplayName: M. van Son
Answers.Body: <p>Does this have to be the actual event participants view, or just available somewhere? You could create a report (use the "Relationship Report" template under "Contact Reports") which would then show the names side by side.</p>
  
  <p>You could filter it to just the event participants either by creating a smart group, or by setting up the event registration process to automatically put the attendees in a group.</p>
  
  <p>(You might get duplication though, because both members of the couple are participants)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-26T13:29:18.513Z
Answers.LastActivityDate: 2016-11-26T13:29:18.513Z
Answers.UserDisplayName: naomi
Answers.Body: <p>You might consider a participant custom field for partner.  It would be a contact reference, and you could fill it with the partner's name.  The field isn't reciprocal, so you'll need to manually confirm that if Marie's partner is Peter, Peter's partner is Marie.  However, you should be able to get this into a stock participant report without much difficulty.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-28T02:46:14.483Z
Answers.LastActivityDate: 2016-11-28T02:46:14.483Z
Answers.UserDisplayName: Andie Hunt
Body: <p>I'm currently setting up CiviCRM for a dance institution. They want to create an event for each lesson (weekly) and use CiviMobile on an iPad or something similar to manage attendance.</p>
  
  <p>Now there's a need to group dance partners together. To this end I've set up an extra relationship called 'Dancepartner of' to tie them together.</p>
  
  <p>An example:</p>
  
  <ul>
  <li>Marie dances with Peter</li>
  <li>Kate dances with Micheal</li>
  <li>Emma dances with Adam</li>
  </ul>
  
  <p>I would like the event participants view to look like:</p>
  
  <ul>
  <li>Marie</li>
  <li>Peter</li>
  <li>Kate</li>
  <li>Micheal</li>
  <li>Emma</li>
  <li>Adam</li>
  </ul>
  
  <p>I think an SQL join for the relations and a GROUP_BY would do the trick but I have no idea where to begin coding this.</p>
  
  <p>Can anyone point me in the right direction of am I going about this all wrong and should I perhaps use groups ?</p>
  
  <p>Thanks in advance,</p>
  
Tags: <civievent><groups><relationships>
Title: CiviEvent, group by relationship
ThreadText: # CiviEvent, group by relationship
  
  (Asked by: username_0 on 2016-11-25)
  
  I'm currently setting up CiviCRM for a dance institution. They want to create an event for each lesson (weekly) and use CiviMobile on an iPad or something similar to manage attendance.
  
  Now there's a need to group dance partners together. To this end I've set up an extra relationship called 'Dancepartner of' to tie them together.
  
  An example:
  
  * Marie dances with Peter
  * Kate dances with Micheal
  * Emma dances with Adam
  
  I would like the event participants view to look like:
  
  * Marie
  * Peter
  * Kate
  * Micheal
  * Emma
  * Adam
  
  I think an SQL join for the relations and a GROUP\_BY would do the trick but I have no idea where to begin coding this.
  
  Can anyone point me in the right direction of am I going about this all wrong and should I perhaps use groups ?
  
  Thanks in advance,
  
  **Tags:** civievent, groups, relationships
  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_1 on 2016-11-25. Score: 2
  
  CiviMobile (new version) works nicely for checking people into an event, but I think it's going to do its own sorting regardless of anything you display in the normal Civi GUI.
  
  If you're on Drupal then a view using the DancePartner relationship with a VBO might do what you need to display the partners and register attendance.
  
  Do you want to register and check in individuals or couples?
  
  If you are more interested in couples, then you could potentially repurpose/abuse 'household' as 'dance partnership' since you can register households as event participants. You could then use CiviMobile and check in the 'Marie & Peter partnership' household. You would need to check the rest of your workflow but it fits the objective of checking in a couple via CiviMobile.
  
  > **Comments:**
  > **username_0**: Thank you for your comment!  I've been fiddling around with abusing the household for my purpose. It does work nicely for registering and checking in couples. It does create some additional problems with contact information and perhaps even payment issues.  
  
  ---
  
  ### Answer by username_0 on 2017-01-20. Score: 2
  
  Thank you all for helping me. I've decided to go a different route and started messing with reports and I was able to group dancepartners together using a SQL join.
  I duplicated an existing report (attendee list) and modified the SQL WHERE clause to this:
    public function from() {
      $this->_from = "
          FROM civicrm_participant {$this->_aliases['civicrm_participant']}
               LEFT JOIN civicrm_relationship contact_a_relation
                          ON (participant_civireport.contact_id = contact_a_relation.contact_id_b )
               LEFT JOIN civicrm_relationship contact_b_relation
                          ON (participant_civireport.contact_id = contact_b_relation.contact_id_a )
               LEFT JOIN civicrm_event {$this->_aliases['civicrm_event']}
                      ON ({$this->_aliases['civicrm_event']}.id = {$this->_aliases['civicrm_participant']}.event_id ) AND
                          {$this->_aliases['civicrm_event']}.is_template = 0
               LEFT JOIN civicrm_contact {$this->_aliases['civicrm_contact']}
                      ON ({$this->_aliases['civicrm_participant']}.contact_id  = {$this->_aliases['civicrm_contact']}.id  )
               {$this->_aclFrom}
               LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']}
                      ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_address']}.contact_id AND
                         {$this->_aliases['civicrm_address']}.is_primary = 1
               LEFT JOIN  civicrm_email {$this->_aliases['civicrm_email']}
                      ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_email']}.contact_id AND
                         {$this->_aliases['civicrm_email']}.is_primary = 1)
               LEFT  JOIN civicrm_phone  {$this->_aliases['civicrm_phone']}
                       ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_phone']}.contact_id AND
                           {$this->_aliases['civicrm_phone']}.is_primary = 1
        ";
  
  After that, I disabled to GROUP BY statement and that gave me the reports I want. I'm fairly confident that this will also work with the CiviMobile pages.
  I've used this blogpost to get me started: https://alastaira.wordpress.com/2011/03/17/civicrm-creating-a-custom-report/
  Thanks again!
  
  
  ---
  
  ### Answer by username_2 on 2016-11-26. Score: 1
  
  Does this have to be the actual event participants view, or just available somewhere? You could create a report (use the "Relationship Report" template under "Contact Reports") which would then show the names side by side.
  
  You could filter it to just the event participants either by creating a smart group, or by setting up the event registration process to automatically put the attendees in a group.
  
  (You might get duplication though, because both members of the couple are participants)
  
  
  ---
  
  ### Answer by username_3 on 2016-11-28. Score: 0
  
  You might consider a participant custom field for partner. It would be a contact reference, and you could fill it with the partner's name. The field isn't reciprocal, so you'll need to manually confirm that if Marie's partner is Peter, Peter's partner is Marie. However, you should be able to get this into a stock participant report without much difficulty.
  
  
  ---
  
  