Support

Home Forums Event Espresso Premium Sharing access to staff manager

Sharing access to staff manager

Posted: September 20, 2015 at 3:49 am

Viewing 11 reply threads


Angus Russell

September 20, 2015 at 3:49 am

Hi,

Some time back Josh created a snippet that allows us to access all the admin’s questions and choose from them to create question groups as per this post https://eventespresso.com/topic/transferring-or-copying-ownership-of-questionsquestion-groups/

Glad to see that others are making use of it too 🙂

We’re now looking for the same kind of filter for the staff manager plugin – is this possible? i.e. for admin’s to be able to access all staff details on the Event Overview page and assign them to a given event.

Thanks
Angus


Josh

  • Support Staff

September 21, 2015 at 3:43 pm

Hi Angus,

It turns out it’s a similar hook to the other one with the questions, and there’s some example code you can use in this gist:


Angus Russell

September 21, 2015 at 9:19 pm

Thanks Josh. That works for the staff members.

I noticed that within the event overview page we are not being offered all the question groups, but only our own, so I tried adding this to my questions snippet but it didn’t work!

Presumably it’ll be different because of the R_P & Pro plugins.

add_action( ‘init’, ‘ee3_modify_question_groups_box_list’ );

function ee3_modify_question_groups_box_list() {
remove_filter(‘filter_hook_espresso_personal_cb_where’, ‘espresso_filter_question_groups_box_list’, 10, 2);

There are too many variables for me to work it out by trial & error, can you help me out again please?

Also, going back to the question snippet, I realised I’d missed out the 2nd piece of coding for the PRO so I added that in the other day, however, when I want to add questions to a question group I am still only being offered the questions I created, not those from other admins.

In summary, we have access to all questions, and all questions groups in their respective pages “Manage Question Groups” & “Manage Questions” but we can not add questions from other admins to our groups, and in the Event Overview page we can not access question groups created by other admins.

Thanks
Angus


Josh

  • Support Staff

September 22, 2015 at 12:35 pm

Hi Angus,

If you’re using the Roles and Permissions Pro add-on, the code you posted in the above reply will not work. Instead, you’ll need to load up the code that’s in the modify_permissions_pro.php file, in this gist. That’s the second box.


Angus Russell

September 22, 2015 at 11:36 pm

OK, thanks Josh, I used both pieces of code!

I thought both plugins had to be instructed, but I’m now assuming that the pro plugin overrides the std R&P, despite them both needing to be installed to work?

What I pasted was me trying to make sure all the questions groups were offered in the Event Overview box.

Thanks
Angus


Angus Russell

September 22, 2015 at 11:48 pm

I’ve pasted only the contents of the second box, but still I can not choose from all the questions to add to a question group, and in the Events Overview page I still can not choose from all the question groups in the metabox.

I am only allowed to add my questions to my groups, and only my question groups are available in the metabox on the Event Overview page.

However, the staff code works and I can choose from any staff member in the metabox on the Event Overview page.

BTW your login is still active.

Thanks


Angus Russell

September 23, 2015 at 8:17 am

Addendum to the above – the creator of the event seems to play a part in all this too, in terms of controlling which question groups appear in the metabox. Possibly more effect than the logged in user.


Josh

  • Support Staff

September 23, 2015 at 11:46 am

Hi Angus,

I suspect your custom code isn’t loading, or it’s loading too late so that it doesn’t execute. Are you loading the code from a plugin, your theme’s functions.php file, or elsewhere? You might try loading the code directly from /wp-content/uploads/espresso/custom_functions.php to see if it will execute from there.


Angus Russell

September 23, 2015 at 12:21 pm

Hey Josh,

I created a separate plugin. I have a folder for this snippets, with 3 files, this one, the staff one and an AED currency one.

I’ll try placing the code into the file you suggest. If definitely is not over-riding the creator of events.

Thanks


Angus Russell

September 23, 2015 at 12:41 pm

I did as you suggested and placed it in the /wp-content/uploads/espresso/custom_functions.php

If offers more questions to add to question groups, but still doesn’t offer all groups to choose from in the metabox on the event overview page as the staff coding did. Also, I;m not sure all the questions are being offered to add to groups either.

Also, I managed to screw up with my users, and now I have questions still linked to an admin user name that was deleted. How can I get rid of those – they didn’t delete, I think because I changed the details on one user for someone else to use the account! I’ve learnt my lesson now!

Please advise

Thanks


Angus Russell

September 24, 2015 at 10:54 am

I see what is happening, but would like a way around this please.

The problem is the event creator – only question groups created by the event creator are being loaded in to the metabox, can we circumvent this please?

Thanks
Angus


Josh

  • Support Staff

September 25, 2015 at 2:42 pm

Hi Angus,

You could end up with a real mess if you try to get every question group for every user to load for all users (a lot of duplicates of the Personal Information and Address Information would be the end result).

Instead, you can reassign the missing custom question groups to the admin (usually admin has user_ID 1), then everyone will be able to access the question groups when the filter function that allows access to those questions is active.

Viewing 11 reply threads

The support post ‘Sharing access to staff manager’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso