progressivetech / net.ourpowerbase.qrcodecheckin

QRCode Checkin allows you to send an email that contains a scanable code to the registered participants for your event.
Other
16 stars 15 forks source link

Add Role ID to Check In Screen #24

Closed themak1985 closed 2 years ago

themak1985 commented 2 years ago

Not sure if this is worthy of merge, but thought I would give it a try - I get the option value to display, but not the label.

I tested this on our live site and it worked.

I am not really a developer, just a tinkerer, thanks for all your help. I should also note I tried using participant_role instead but that did not work.

Screen Shot 2022-05-06 at 1 08 29 AM

jmcclelland commented 2 years ago

This looks clean and elegant - nice work. Here's some code that would allow you to convert the role_id to the label:

$roles = CRM_Core_PseudoConstant::get('CRM_Event_DAO_Participant', 'role_id');
$this->assign('role', $roles[$dao->role_id]);

Then you could use the template variable "role" instead of "role_id" to get the label.

themak1985 commented 2 years ago

Thank you so much, that worked.

jmcclelland commented 2 years ago

Thanks for the improvement!