Export user_id with Export Registrants

  • Roshan
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 8 months ago #101684 by Roshan
Hi,

I was wondering how to export the user_id as a field in the Export Registrants sheet. Is there a simple way to do it that I am missing through Joomla!, or can I edit some code in the files that will allow this?

Thanks

Please Log in or Create an account to join the conversation.

More
8 years 8 months ago #101695 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Export user_id with Export Registrants
Hi Roshan

This will require code modification. You can look at the method prepareRegistrantsExportData in the file components/com_eventbooking/helper/data.php, modify it to add new column user_id

Just add new element to $headers and $fields array and you should be OK

Tuan

Please Log in or Create an account to join the conversation.

  • Roshan
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 8 months ago - 8 years 8 months ago #101727 by Roshan
Replied by Roshan on topic Export user_id with Export Registrants
Hi Tuan,

So I tried to add the user_id to the method prepareRegistrantsExportData like this:

$user = JFactory::getUser();
$userId = $user->get('id');

$headers[] = 'user_id';
$fields[] = $userId;

But for some reason it does not fill the sheet with the id value.

Also, I would like to have the user_id as an available tag or value in the admin email sent when users register for an event.

Thanks
Last edit: 8 years 8 months ago by Roshan.

Please Log in or Create an account to join the conversation.

More
8 years 8 months ago #101745 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Export user_id with Export Registrants
Hi

The code is not correct. You can change it to:

$headers[] = 'User ID'; // It is the label of the column
$fields[] = 'user_id'; // It is the name of field stored in database

If you want to use [USER_ID] tag in the email, you will need to modify the code of buildTags method in components/com_eventbooking/helper/registration.php

Regards,

Tuan
The following user(s) said Thank You: Roshan

Please Log in or Create an account to join the conversation.

  • Roshan
  • Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 8 months ago #101797 by Roshan
Replied by Roshan on topic Export user_id with Export Registrants
Thanks Tuan, this worked perfectly!

I was also able to use the [USER_ID] tag successfully.

Thanks again

Please Log in or Create an account to join the conversation.

More
8 years 8 months ago #101819 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Export user_id with Export Registrants
Great Roshan. Happy to hear that it works well now :)

Tuan

Please Log in or Create an account to join the conversation.

More
8 years 7 months ago - 8 years 7 months ago #103129 by Marc Kettemann
Replied by Marc Kettemann on topic Export user_id with Export Registrants
I need this feature too. Maybe you can implemente in the componente?
Last edit: 8 years 7 months ago by Marc Kettemann.

Please Log in or Create an account to join the conversation.

More
8 years 7 months ago - 8 years 7 months ago #103132 by Roberto Bonazza
Replied by Roberto Bonazza on topic Export user_id with Export Registrants
Hi all, It would be useful also for me if it were implemented
Last edit: 8 years 7 months ago by Roberto Bonazza.

Please Log in or Create an account to join the conversation.

More
8 years 7 months ago #103140 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Export user_id with Export Registrants
Hi All

I just updated download package on server with this small changes. If you need it, access to My Downloads menu item, download the package (still version 3.0.3), upgrade it to your site to use this feature

Tuan
The following user(s) said Thank You: Marc Kettemann, Roberto Bonazza

Please Log in or Create an account to join the conversation.

More
8 years 7 months ago #103151 by Roberto Bonazza
Replied by Roberto Bonazza on topic Export user_id with Export Registrants
Great, thank you very much Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc