Browse Source

Pro calendar - show short appt. status before patient name

Vijayakrishnan 4 năm trước cách đây
mục cha
commit
4c141feabe
1 tập tin đã thay đổi với 25 bổ sung4 xóa
  1. 25 4
      app/Http/Controllers/AppointmentController.php

+ 25 - 4
app/Http/Controllers/AppointmentController.php

@@ -58,14 +58,35 @@ class AppointmentController extends Controller
                 " (" . strtolower($appointment->status) . ")";
 
             if($clientId == "-1") {
+
+                $shortStatus = '';
+                switch($appointment->status) {
+                    case 'CREATED':
+                        $shortStatus = 'new';
+                        break;
+                    case 'CONFIRMED':
+                        $shortStatus = 'conf';
+                        break;
+                    case 'CANCELLED':
+                        $shortStatus = 'canc';
+                        break;
+                    case 'COMPLETED':
+                        $shortStatus = 'done';
+                        break;
+                    case 'ABANDONED':
+                        $shortStatus = 'aban';
+                        break;
+                    case 'REJECTED':
+                        $shortStatus = 'rej';
+                        break;
+                }
+
                 if(count($proIds) === 1) {
-                    $title = $appointment->client->displayName() .
-                    " (" . strtolower($appointment->status) . ")";
+                    $title = "($shortStatus) " . $appointment->client->displayName();
                 }
                 else {
                     $title = '[' . $appointment->pro->initials()  . '] ' .
-                        $appointment->client->displayName() .
-                        " (" . strtolower($appointment->status) . ")";
+                        "($shortStatus) " . $appointment->client->displayName();
                 }
             }