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

TOPIC: [HOWTO] Allow one usergroup to edit frontend attendees list

[HOWTO] Allow one usergroup to edit frontend attendees list 2 years 1 month ago #23941

  • albs
  • albs's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 62
  • Karma: 2
  • Thank you received: 9
Hi all,

At the moment, only the creator of an event can edit its list of attendees. For those who don't know, in the Event view, if you're the creator of an event, the number next to the Booked Places line is a hyperlink. You click on the link, and will be taken to a page where you can add attendees, remove attendees, and change attendee status.

This quick tutorial shows you how to change it, so that one group of users can edit attendees. I don't know about you, but being the only person who can edit attendees suck! I'm often in charge of a paddling club with over 120 active members, who register for up to 9 training sessions per week. It's a nightmare and I want to share this nightmare :-)

The solution is also not as configurable as I would have liked, but I don't have the time to code it all pretty (and paddle and play hockey and keep a job). So, here it is:

1. Go to your components/com_jem/views/event/view.html.php file, and on line 192, from:
// Check if user can edit attendees

$isAuthor = ....

$permissions->canEditAttendees = $isAuthor;
Change to:
// Check if user can edit attendees
		if (in_array('33', $user->groups, true)) {
			$isCommittee = 'true';
			}
		$permissions->canEditAttendees = $isCommittee;

For me, I need my club committee members to all be able to edit attendees. 33 is the Joomla user group ID (i.e. go to Joomla, users, groups and get this ID)

2. Go to components/com_jem/models/attendees.php, and comment out line 278. It looks like this:
$where[] = ' a.created_by = '.$this->_db->Quote($user->id);
Done!
The following user(s) said Thank You: Kralyk

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

[HOWTO] Allow one usergroup to edit frontend attendees list 2 years 1 month ago #23952

Hi Albs, that's a coincidence.
I also make a web for our paddle group ( www.vodacitjunion.cz ), so we probably have similar requirements for JEM functionality. I'm not a big programmer, so I'm happy for any advice and help.

1) I tried to make your settings but I did not understand where and how users from that group can register for other users.
Where is the link for users to editing attendees in an event?

2) One thing would be good for me. How do I view comments attendees in an event for everyone in the list of attendee names?

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

[HOWTO] Allow one usergroup to edit frontend attendees list 2 years 1 month ago #23953

  • jojo12
  • jojo12's Avatar
  • Away
  • Moderator
  • Moderator
  • Posts: 3074
  • Karma: 45
  • Thank you received: 322
@Kralyk:

where and how users from that group can register for other users.

One question is: Do they want register other users for an event, who are registered in joomla or not.
If they are not registered in Joomla, you can use the comment with your own eventregistration (to say that others are attending too)
or you use a contact mail or the solution with breezingforms.
But in my own experience, the problem is if I register friends for an event, and after they don't participate, this costs nerves and money (sometimes)
If they are registered in Joomla, it should be possible for groupmembers to open the attending view, and to add there other users.
I will test, but I think if I am member of a JEM group which is associated to the category of an event, and if the rights in the settings are that group members can edit events, it should be possible to access the attending view!

EDIT:
I tried with my own joomla group and his ID, but the version of albs did not succeed. I don't know why
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.

Last edit: by jojo12.

[HOWTO] Allow one usergroup to edit frontend attendees list 2 years 1 month ago #23955

I understand it this way:

A user who does not have a Joomla site account can not register for an event.
So I would not do it more complicated and it would be great for it to work like this:

Now:
Event Creator can register other users (who have an account) to their event. Only Creator of event sees attendee comments. In event users' comments can not be seen for anyone.

My dream:
All users (from a joomlar group, for example) can register the user to any event created, and can see individual users' comments in the event.

Hope I explained it well, my English is not very good ... ;-)
The following user(s) said Thank You: jojo12

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

[HOWTO] Allow one usergroup to edit frontend attendees list 2 years 1 month ago #23956

  • jojo12
  • jojo12's Avatar
  • Away
  • Moderator
  • Moderator
  • Posts: 3074
  • Karma: 45
  • Thank you received: 322
We need access for all users who have the permission to edit events (=admins and JEM group members of the associated group (in categorie)
So I tried in views/event/view.html.php about line 192
// Check if user can edit attendees
		$isAuthor = $userId && ($userId == $item->created_by);
		//$permissions->canEditAttendees = $isAuthor;
		$permissions->canEditAttendees = $user->can('edit', 'event', $item->id, $item->created_by);
in addition comment out about line 278
components/com_jem/models/attendees.php, and comment out line 278.
// $where[] = ' a.created_by = '.$this->_db->Quote($user->id);
EDIT:
Like that it seems, each member of the associated group can enter in attendees view and add in joomla registrated users to the attendees list, in addition he can see the comments.
EDIT 2:
Please hold in mind, that this is a hack (view.html.php). You have to renew it everytime you update!
EDIT 3: in attendees view you can't edit attending users. You can switch them between waitinglist and attending list. The rest you have to delete and create an other one.
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.

Last edit: by jojo12.

[HOWTO] Allow one usergroup to edit frontend attendees list 2 years 1 month ago #23960

Hello, jojo12,
I tried it, but I still did not understand it.
I still do not know how to display a for non-creator all event table where you can click on the number of attendees to edit the status of all users.

Creator can display this table via the "My Events" link. But in this link every user sees only their events and not the events of other creators.

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

  • Page:
  • 1
  • 2
Time to create page: 0.236 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.