Sfoglia il codice sorgente

Bring tickets to the front

Vijayakrishnan 3 anni fa
parent
commit
63e337df78

+ 1 - 1
app/Http/Controllers/PracticeManagementController.php

@@ -517,7 +517,7 @@ SELECT effective_date, count(*), sum(number_of_units) as units FROM bill WHERE c
                 ->orWhere('manager_pro_id', $performer->pro_id)
                 ->orWhere('ordering_pro_id', $performer->pro_id)
                 ->orWhere('initiating_pro_id', $performer->pro_id);
-        });
+        })->where('category', 'other');
         if ($filter === 'open') {
             $myTickets = $myTickets->where('is_open', true);
         } else if ($filter === 'closed') {

+ 13 - 0
app/Models/Pro.php

@@ -1057,6 +1057,19 @@ WHERE
         return 0;
     }
 
+    public function get_open_tickets_count_as_mcp(){
+        $self = $this;
+        return Ticket::where(function ($q) use ($self) {
+                $q->where('assigned_pro_id', $self->id)
+                    ->orWhere('manager_pro_id', $self->id)
+                    ->orWhere('ordering_pro_id', $self->id)
+                    ->orWhere('initiating_pro_id', $self->id);
+            })
+            ->where('category', 'other')
+            ->where('is_open', true)
+            ->count();
+    }
+
     //DNA_DASHBOARD
     
     //queries

+ 9 - 0
resources/views/app/dashboard-admin.blade.php

@@ -98,6 +98,15 @@
                                     <th class="px-2 text-center">{{$pro->get_supply_orders_awaiting_signature_count_as_mcp()}}</th>
                                     <th class="pl-2">Supply Orders Pending Signature</th>
                                 </tr>
+                                <tr>
+                                    <th class="px-2 text-center">{{$pro->get_open_tickets_count_as_mcp()}}</th>
+                                    <th class="pl-2">
+                                        <a href="{{ route('practice-management.myTickets') }}">
+                                            Open Tickets
+                                        </a>
+                                    </th>
+                                </tr>
+
                                 </tbody>
                             </table>
                         </div>

+ 6 - 3
resources/views/app/practice-management/my-tickets.blade.php

@@ -21,8 +21,8 @@
             <table class="table table-sm table-striped p-0 m-0">
                 <thead class="bg-light">
                 <tr>
+                    <th class="border-0">Created</th>
                     <th class="border-0">Patient</th>
-                    <th class="border-0">Type</th>
                     <th class="border-0 w-50">Details</th>
                     <th class="border-0">Role</th>
                     <th class="border-0"></th>
@@ -31,10 +31,10 @@
                 <tbody>
                 @foreach($myTickets as $ticket)
                     <tr>
+                        <td>{{friendlier_date($ticket->created_at)}}</td>
                         <td class="text-nowrap">
                             <a href="/patients/view/{{ $ticket->patient->uid }}">{{ $ticket->patient->displayName() }}</a>
                         </td>
-                        <td>{{ strtoupper($ticket->category) }}</td>
                         <td>
                             <?php
                             $display = '-';
@@ -62,6 +62,9 @@
                                         }
                                     }
                                     break;
+                                case 'other':
+                                    $display = @$parsed->title;
+                                    break;
                             }
                             ?>
                             {!! $display !!}
@@ -78,7 +81,7 @@
                             {{ $roles }}
                         </td>
                         <td>
-                            <a href="/patients/view/{{ $ticket->patient->uid }}/action-items-{{ $ticket->category }}/view/{{ $ticket->uid }}">Open</a>
+                            <a href="/patients/view/{{ $ticket->patient->uid }}/tickets/other/{{ $ticket->uid }}">Open</a>
                         </td>
                     </tr>
                 @endforeach