alextselegidis / easyappointments

:date: Easy!Appointments - Self Hosted Appointment Scheduler
https://easyappointments.org
GNU General Public License v3.0
3.33k stars 1.27k forks source link

Service oriented working plans. #296

Open LukeMcLachlan opened 7 years ago

LukeMcLachlan commented 7 years ago

Hi Alex, I had two services currently via the same provider, problem was that one service I could only perform whilst in the office whilst the other one is a skype meeting. So I did what you've suggested, created two providers and assigning one service to each. The problem however is that the calendars aren't synced between each provider, so there is the risk of double booking. Obviously when I'm in an office meeting I can't be in a skype meeting. Do you know how I can overcome this? Thanks

LukeMcLachlan commented 7 years ago

as a little update, I've been playing around trying to solve this problem. For example when I set up synchronisation I synchronised provider 1 to provider 2's calendar and visa versa. I made a booking on provider 1's calendar and it has shown up on the Google calendar of provider 2. I thought this was the solution, until I went to book at time with provider 2 to find that the time slot was available, despite the fact that his google calendar was showing him as busy. This is a real head scratcher.

alextselegidis commented 7 years ago

Hmm I see your point and unfortunately there is no elegant solution for this till now. It's a very interesting feature though so I'll will mark this ticket as an enhancement for a future release.

  Alex Tselegidis, Easy!Appointments Creator
  Need a customization? Contact me in person!

LukeMcLachlan commented 7 years ago

Thank you Alex, For now, when I receive a booking for one provider, I quickly mark the other provider as unavailable during these times. Such an enhancement would be amazing!

JVitorst commented 7 years ago

I am also going through a similar problem, I need the services to have their own working plans, because each service will have a time slot that will be available. I'm burning my brain to try to find a way out :/

flopreyser commented 5 years ago

hi @alextselegidis! is this already in development? if not, i would plan to implement this and make a pull request :)

drscream commented 3 years ago

I assume this is still an open feature request? Because I have the same problem I provided a simple workaround. It simple create unavailable entries on all other providers calendars.

diff --git a/application/controllers/Appointments.php b/application/controllers/Appointments.php
index ff6c6b4f..53aeb013 100755
--- a/application/controllers/Appointments.php
+++ b/application/controllers/Appointments.php
@@ -468,6 +472,17 @@ class Appointments extends EA_Controller {
                 $appointment['location'] = $service['location'];
             }

+            // Simple block all other providers calendar
+            foreach($this->providers_model->get_available_providers() as $providers) {
+                if ($providers['id'] == $appointment['id_users_provider']) continue;
+                $this->appointments_model->add_unavailable(array(
+                    'start_datetime' => $appointment['start_datetime'],
+                    'end_datetime' => $appointment['end_datetime'],
+                    'notes' => 'Automatically added',
+                    'id_users_provider' => $providers['id']
+                ));
+            }
+
             // Save customer language (the language which is used to render the booking page).
             $customer['language'] = config('language');
             $customer_id = $this->customers_model->add($customer);