Fix dashboard issues. #535

This commit is contained in:
Korina Cordero 2021-02-10 07:05:00 +00:00
parent bd75e159bd
commit 032489d736
3 changed files with 10 additions and 4 deletions

View file

@ -3,6 +3,7 @@ class DashboardMap {
this.options = options; this.options = options;
this.rider_markers = rider_markers; this.rider_markers = rider_markers;
this.cust_markers = cust_markers; this.cust_markers = cust_markers;
this.rider_availability = {};
// layer groups // layer groups
this.layer_groups = { this.layer_groups = {
@ -253,10 +254,13 @@ class DashboardMap {
var lat = data.latitude; var lat = data.latitude;
var lng = data.longitude; var lng = data.longitude;
if (data.has_jo) if (data.has_jo) {
my.rider_availability[id] = false;
my.putRiderActiveJOMarker(id, lat, lng); my.putRiderActiveJOMarker(id, lat, lng);
else } else {
my.rider_availability[id] = true;
my.putRiderAvailableMarker(id, lat, lng); my.putRiderAvailableMarker(id, lat, lng);
}
}); });
// console.log(rider_markers); // console.log(rider_markers);

View file

@ -145,6 +145,7 @@ class MapEventHandler {
break; break;
} }
}); });
break;
} }
break; break;
} }

View file

@ -602,8 +602,9 @@ class RiderController extends Controller
*/ */
public function ajaxAvailable(EntityManagerInterface $em, Rider $rider) public function ajaxAvailable(EntityManagerInterface $em, Rider $rider)
{ {
$jo = $rider->getRiderActiveJobOrder(); //$jo = $rider->getRiderActiveJobOrder();
if ($jo == null || $jo->isClosed()) $jo_results = $rider->getActiveJobOrder();
if (empty($jo_results))
$avail = 'available'; $avail = 'available';
else else
$avail = 'unavailable'; $avail = 'unavailable';