help to better help you:

Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!

[HOWTO] Show persons on the waiting list, in Event view

[HOWTO] Show persons on the waiting list, in Event view

7 years 5 months ago
#23939
Hi all,

I've been able to modify JEM to display people who are on the waiting list. If this is useful for your web site, read on.

1. Go to your components/com_jem/models/event.php, and in line 525, change:
Code:
. $name . ' AS name, r.uid' . $avatar
into
Code:
. $name . ' AS name, r.uid, r.waiting' . $avatar
This asks the query to retrieve that extra piece of data.

2. In the same file, in line 514, comment out the line:
Code:
$where[] = 'waiting = 0';
This stops the query filtering out rows where the user is on the waiting list.

3. Now edit your view file. If you haven't created any template overrides, you can go to components/com_jem/views/event/tmpl/default_attendees.php. If you have, look for the corresponding file in your template folder. Keep this in mind - otherwise you'll waste time editing the wrong file.

From the Foreach loop in line 63, running to its corresponding endforeach, you'll see a few different options for displaying attendees. They are: showing a Community Builder avatar and link, Community Builder link only, text etc. The code reads:
Code:
$register->name . '</span></a></li>';

If you clearly know which of these display options you're using, then just edit that, otherwise you can edit all the options. The code you need to change to is:
Code:
$register->name; if ($register->waiting == 1) : echo ' - waiting'; endif; echo '</span></a></li>';

Enjoy. I'm also going to look for a way to modify the code so that administrators/managers etc can edit event attendees on the front-end - my mostly non-technical users find it daunting to visit the administrator interface to perform this function.
The following user(s) said Thank You: Kralyk

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

Re: [HOWTO] Show persons on the waiting list, in Event view

7 years 5 months ago
#23940
Albs, that's great.

This is how I imagined that the list also shows, including "not Attended" and "invitation" users. How to properly adjust to make it work?

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

Re: [HOWTO] Show persons on the waiting list, in Event view

7 years 5 months ago
#23942
Hi Kralyk,

Ok I found this in line 444 of com_jem/models/event.php:
/**
* Method to check if the user is already registered
*
* @access public
* @return mixed false if not registered, -1 if not attending,
* 0 if invited, 1 if attending, 2 if on waiting list
*
*/

The above refers to the Status field in the jem_register table in the database. So, we want our code to retrieve this data and do something with it.

So in line 525, add r.status to the query as well. So if I was doing it for myself:
Code:
. $name . ' AS name, r.uid, r.waiting, r.status' . $avatar

Then, in components/com_jem/views/event/tmpl/default_attendees.php, change:
Code:
$register->name . '</span></a></li>';
into:
Code:
$register->name; if ($register->waiting == 1) : echo ' - waiting'; endif; if ($register->status == -1) : echo ' - not attending'; endif; if ($register->status == 0) : echo ' - invited'; endif; echo '</span></a></li>';

You can probably write it better, with elseif statements. You can also write a groupby statement in the models file, so that those invited would be displayed together, those attending displayed together etc. But the above should get you what you asked for.

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

Re: [HOWTO] Show persons on the waiting list, in Event view

7 years 5 months ago - 7 years 5 months ago
#23943
Hello albs,
So I tried to adjust it according to your instructions, but no change. Only the attentdees names are still displayed. Status is not displayed.

Edit: I've run tests yet and after the changes have been made, the attendees and users in the waiting list are listed in the event. Only names, no status.
Last edit: 7 years 5 months ago by Kralyk.

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

Re: [HOWTO] Show persons on the waiting list, in Event view

7 years 5 months ago
#23944
If you updated to JEM 2.2.1, the model is just prepared for this. You don't gave to hack the core!

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

Re: [HOWTO] Show persons on the waiting list, in Event view

7 years 5 months ago
#23945
Hello jojo12.
??? So I'm confused. Yes, I tested version 2.2.1. So I understand that this version is already able to display the names of the participants, including their statuses, in the event? Can I set it right somewhere in the settings? Where? So how do I set it up correctly?

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

Time to create page: 0.425 seconds