Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

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

[HOWTO] Show persons on the waiting list, in Event view 2 years 1 month ago #23939

  • albs
  • albs's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 62
  • Karma: 2
  • Thank you received: 9
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:
. $name . ' AS name, r.uid' . $avatar
into
. $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:
$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:
$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:
$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.

[HOWTO] Show persons on the waiting list, in Event view 2 years 1 month 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.

[HOWTO] Show persons on the waiting list, in Event view 2 years 1 month ago #23942

  • albs
  • albs's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 62
  • Karma: 2
  • Thank you received: 9
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:
. $name . ' AS name, r.uid, r.waiting, r.status' . $avatar

Then, in components/com_jem/views/event/tmpl/default_attendees.php, change:
$register->name . '</span></a></li>';
into:
$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.

[HOWTO] Show persons on the waiting list, in Event view 2 years 1 month 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.

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

Last edit: by Kralyk.

[HOWTO] Show persons on the waiting list, in Event view 2 years 1 month ago #23944

  • jojo12
  • jojo12's Avatar
  • Away
  • Moderator
  • Moderator
  • Posts: 3074
  • Karma: 45
  • Thank you received: 322
If you updated to JEM 2.2.1, the model is just prepared for this. You don't gave to hack the core!
5.5.5-10.0.30-MariaDB-0+deb8u1
PHP 7.2.9 on different sites
Apache
JEM 2.3.0dev 2.0M and specials with Joomla! 3.9.3 stable on livesites
ja_simply, ja_purity_iii, multilingual DE EN IT FR

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

[HOWTO] Show persons on the waiting list, in Event view 2 years 1 month 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.

  • Page:
  • 1
  • 2
Time to create page: 0.222 seconds

Donate

If you find JEM useful and if you use it on your site, please consider a donation to the project.

Private Messages

You are not logged in.