Have provider view only Their appointments only in appointments admin page

Have provider view only Their appointments only in appointments admin page. Can this be done?

Right now if the provider is loged into their editor account and viewing the appointments page, they can see all appointments for all providers. how do I restrict a provider to see only their appointments?

  • Predrag Dubajic

    Hi Matt,

    Thanks for the additional info.

    There's no actual way to filter this panel but what you can do is go to Appointments > Settings > Add-ons tab and enable Administrative Permissions.
    After that you will see Administrative Permissions section in Appointments > Settings > General tab.

    From there you can restrict editor access to Appointments so they would be able to access only their own appointments in Profile page.

    Would this work for you?

    Best regards,
    Predrag

  • Adam Czajczyk

    Hello Mattbkelly!

    If just has a check box to confirm it which does noting.

    Please go to your dashboard's "Appointments -> Settings (page) -> General (tab)" and check if "Allow service provider confirm own appointments" option is set to "Yes".

    If you have enabled the "Administrative permissions" add-on suggested by my colleague @Predrag Dubajic, on the same settings page (at the end) you will find a section that lets you define usage permissions for "Appointments+" on "per user-role" basis.

    For example, in order to allow all users of "Editor" WP role to manage appointments you would want to add "Editor" role to "Appointments page" option. You could create separate WP role for your service providers and grant that role selected privileges then.

    Best regards,
    Adam

  • Mattbkelly

    I think we are running around in a circle. I understand that if I add the user level of the appointment page option that they can edit the appointments page, but they can also have control of all the other staff members appointments. I want to only allow them control over their appointments. The profile view is extremely limited and not a good option. How can I let them control only their appointments?
    thanks,
    matt

  • Predrag Dubajic

    Hi Matt,

    Currently closest thing would be by using this shortcode:
    [app_my_appointments status="paid,confirmed,pending,completed,removed,reserved" allow_cancel="1"]
    It would allow providers to see their own appointments and cancel them.

    There might be a way to filter the appointments on backend by user ID but this would require some coding to make it work, I'll need to ping our second level support guys here to give us more info.
    Please note that, developer response might be slower than usual staff response, so we appreciate your patience on this.

    Best regards,
    Predrag

  • Panos

    Hello Mattbkelly ,

    While doing some house cleaning I found this old thread missed in the queue, sorry about that.

    I find your request quite interesting I admit, but the plugin follows other path regarding this matter.
    Currently every provider can access his appointments from his admin menu > Profile where the list of his appointments will be somewhere close the bottom of the profile page.

    In case you are still willing to display Appointments per Provider you can ask us to move this thread at the Features and Feedback forum.

    For now though I can provide a simple solution by replacing file:
    wp-content/plugins/appointments/admin/pages/class-admin-appointments-page.php
    with the file I have attached.

    This file will be overridden though with the next Appointments plugin, that's why I will decribe what you need to change in that file. In line ~170 or 171 simply paste the following:

    global $current_user;
    
    		if ( ! current_user_can('administrator') && appointments_is_worker( $current_user->ID ) ) {
    			$worker_id = $current_user->ID;
    		}

    Make sure this snipped is placed before this part:
    // Count appointments by statuses

    Hope this helps

    Cheers!
    Panos

  • Mattbkelly

    I am not sure what you are referring to as the as the profile page. I do not see a change in the shortcode [app_my_appointments allow_cancel="1" provider_id="33"]

    I also do not see a change in Users- my profile either.

    What is this code doing? What I would like it to do is add the clients name to the shortcode list.

    Right now if has the category of Client but in the list it is still the providers name.

    thanks,
    matt

  • Panos

    Hello Mattbkelly ,

    Just want to make sure we are talking about the same thing here

    I am actually asking about this admin page that shows all the appointments. I need to restrict it to the user that is signed in as an editor to show only their appointments as a provider and not show all appointments.

    The snippet I suggested in my previous reply should display only appointments assigned to the service provider that is logged in, without using the shortcode. You only need to add that little piece of code as I described.

    I have attached two screenshots to better explain what I mean. In the first screenshot you can see the appointments without the snipped:

    In the second screenshot you can see that only appointments assigned to user are listed, after inserting the code snippet:

    As you can see in the second one, only appointments of provider "AAA AAA" are listed. You may notice the "Filter by Service provider" but this is overridden by the snippet.

    Could you please confirm that this is the functionality that you were describing or was it something else? I see that the screenshot you provided is from the front end and not from the admin so it would be helpful to have some more information of what you are looking for.

    Regarding this:

    Currently every provider can access his appointments from his admin menu > Profile where the list of his appointments will be somewhere close the bottom of the profile page.

    When logged in as a Service Provider, you should be able to see pending appointments from your profile page. In the following screenshot there are no pending appointments but you can see what I was talking about:

    Kind regards,
    Panos

  • Mattbkelly

    I do not have that profile Tab on the left column. I may have disabled it at some point I just have the users tab. But it does not reveal appointments if I hover over it or click on it.

    The feature that I would like is on the front end for admins and non tech staff. Using that shortcode [app_my_appointments allow_cancel="1" provider_id="33"] but showing the clients name so that the admin or staff can cancel the appointment by just checking the box.

    thanks,
    matt

  • Nastia

    Hello Matt,

    I hope you are doing well today!

    I do not have that profile Tab on the left column. I may have disabled it at some point I just have the users tab. But it does not reveal appointments if I hover over it or click on it.

    If I have understood you correctly, you mean the User Profile menu. Scroll down to "My Appointments" section in the Users > Your Profile to see all your appointments as a service provider.

    The feature that I would like is on the front end for admins and non tech staff. Using that shortcode [app_my_appointments allow_cancel="1" provider_id="33"] but showing the client's name so that the admin or staff can cancel the appointment by just checking the box.

    Currently the allow_cancel="1" attribute inside this shortcode give the ability to cancel an appointment by the clients only.

    Service Providers cannot cancel appointmens from the front end. It would be better, to not confuse other members, to create a new thread with this request in a Features & Feedback forum. This way other members can vote "+1s" on this feature.

    You can create a new thread here:
    https://premium.wpmudev.org/forums/forum/feature-suggestions#question-modal

    I hope this helps!

    Kind Regards,
    Nastia