Prechádzať zdrojové kódy

Highlight "otherClients" appts in calendar

Vijayakrishnan 4 rokov pred
rodič
commit
4e038ddfce

+ 2 - 1
app/Http/Controllers/AppointmentController.php

@@ -37,7 +37,7 @@ class AppointmentController extends Controller
         $events = [];
         foreach ($appointments as $appointment) {
             $events[] = [
-                "title" => $appointment->pro->displayName(),
+                "title" => ($appointment->client->id != $clientId ? '* ' : '') . $appointment->pro->displayName(),
                 "_title" => $appointment->title,
                 "description" => $appointment->description,
                 "clientName" => $appointment->client->displayName(),
@@ -48,6 +48,7 @@ class AppointmentController extends Controller
                 "start" => $this->convertToTimezone($appointment->start_time, $timeZone),
                 "end" => $this->convertToTimezone($appointment->end_time, $timeZone),
                 "clientOnly" => !in_array($appointment->pro->id, $proIds),
+                "otherClient" => ($appointment->client->id != $clientId),
                 "editable" => true
             ];
         }

+ 4 - 5
public/css/style.css

@@ -938,11 +938,10 @@ span.select2-container.select2-container--default.select2-container--open {
 .stag-popup .stag-popup-title>span {
     font-size: 17px;
 }
-.fc .client-only {
+.fc .other-client {
     box-shadow: 1px 1px 2px deeppink !important;
-    opacity: 0.7;
+    opacity: 0.5;
 }
-.fc .client-only:hover {
-    box-shadow: 1px 1px 2px deeppink !important;
-    opacity: 1;
+.fc .other-client:hover {
+    opacity: 0.8;
 }

+ 6 - 2
resources/views/app/patient/appointment-calendar.blade.php

@@ -478,10 +478,14 @@
                                     }, 'json');
                                 },
                                 eventClassNames: function(arg) {
+                                    let classes = [];
                                     if (arg.event.extendedProps.clientOnly) {
-                                        return [ 'client-only' ];
+                                        classes.push('client-only');
                                     }
-                                    return [];
+                                    if (arg.event.extendedProps.otherClient) {
+                                        classes.push('other-client');
+                                    }
+                                    return classes;
                                 },
                                 loading: function(bool) {