Browse Source

Log in as loop issue fix

Vijayakrishnan 3 năm trước cách đây
mục cha
commit
b038392394

+ 1 - 1
config/app.php

@@ -65,7 +65,7 @@ return [
 
     'hrm2_url' => env('HRM2_URL'),
 
-    'asset_version' => 46,
+    'asset_version' => 47,
 
     'temp_dir' => env('TEMP_DIR'),
 

+ 2 - 2
js-dev/mc.js

@@ -121,7 +121,7 @@ function initFastLoad(_parent = false) {
     // find links without event handlers
     allAs.each(function () {
         if (!$(this).closest('[moe]').length) {
-            if ($(this).closest('.dropdown-menu[aria-labelledby="practice-management"]').length) {
+            if ($(this).closest('.dropdown-menu').length) {
                 enableFastLoad(this, true);
             } else {
                 // var handlers = findEventHandlers('click', this);
@@ -137,7 +137,7 @@ function initFastLoad(_parent = false) {
             .off('click.fast-load')
             .on('click.fast-load', function () {
                 fastLoad(this.href, true, true);
-                $('.dropdown-menu[aria-labelledby="practice-management"]')
+                $('.dropdown-menu')
                     .removeClass('show')
                     .prev('.dropdown-toggle').attr('aria-expanded', 'false');
                 return false;

+ 10 - 9
resources/views/app/log-in-as.blade.php

@@ -13,11 +13,12 @@
         <div class="row">
             <div class="col-12 col-md-7">
 
+                <div class="mb-2">
+                    Total records: <b>{{ $logInAsPros->total() }}</b>&nbsp;&nbsp;@if($logInAsPros->lastPage() > 1) ({{ $logInAsPros->perPage() }} per page) @endif
+                </div>
+
                 <div class="d-flex align-items-center">
                     {{ $logInAsPros->withQueryString()->links() }}
-                    <span class="{{ $logInAsPros->lastPage() > 1 ? 'ml-3' : '' }} mb-3">
-                        Total records: <b>{{ $logInAsPros->total() }}</b>&nbsp;&nbsp;@if($logInAsPros->lastPage() > 1) ({{ $logInAsPros->perPage() }} per page) @endif
-                    </span>
                     <form class="ml-auto width-200px mb-3 log-in-as-form" method="GET" action="/log_in_as" target="_top">
                         <input type="text" placeholder="Name/email/phone" class="form-control form-control-sm" name="q"
                                value="{{request()->input('q')}}">
@@ -38,15 +39,15 @@
                         </tr>
                         </thead>
                         <tbody>
-                        @foreach($logInAsPros as $pro)
+                        @foreach($logInAsPros as $laPro)
                             <tr>
-                                <td class="pl-2">{{$pro->displayName()}}</td>
-                                <td>{{$pro->cell_number}}</td>
-                                <td>{{$pro->email_address}}</td>
+                                <td class="pl-2">{{$laPro->displayName()}}</td>
+                                <td>{{$laPro->cell_number}}</td>
+                                <td>{{$laPro->email_address}}</td>
                                 <td class="text-right pr-2">
-                                    <form action="{{route('process-log-in-as')}}" onsubmit="saveProUid('{{$pro->uid}}')" method="POST" target="_top">
+                                    <form action="{{route('process-log-in-as')}}" onsubmit="saveProUid('{{$laPro->uid}}')" method="POST" target="_top">
                                         @csrf
-                                        <input type="hidden" name="proUid" value="{{$pro->uid}}">
+                                        <input type="hidden" name="proUid" value="{{$laPro->uid}}">
                                         <button class="btn btn-sm btn-primary font-weight-bold px-4 py-1">Login</button>
                                     </form>
                                 </td>

+ 1 - 1
resources/views/layouts/template.blade.php

@@ -245,7 +245,7 @@
                             </form>
                         @endif
                         @if($pro->pro_type == 'ADMIN')
-                            <a href="{{route('log-in-as')}}" native target="_top" class="d-block ml-2 pt-1">Log In As</a>
+                            <a href="{{route('log-in-as')}}" class="d-block ml-2 pt-1">Log In As</a>
                         @endif
                         @if($pro->pro_type == 'ADMIN')
                             <a native target="_top" class="d-block ml-2 pt-1"