diff --git a/src/Service/JobOrderHandler/ResqJobOrderHandler.php b/src/Service/JobOrderHandler/ResqJobOrderHandler.php index 5f88b057..b1343f78 100644 --- a/src/Service/JobOrderHandler/ResqJobOrderHandler.php +++ b/src/Service/JobOrderHandler/ResqJobOrderHandler.php @@ -450,6 +450,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface $ownertype_id = $req->request->get('ownership_type', 0); $owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id); + // source of awareness is now required + if (empty($soa_type)) + $error_array['source_of_awareness'] = 'Source of awareness is required.'; + // TODO: check status before saving since JO might already // have a status that needs to be retained @@ -710,6 +714,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface $ownertype_id = $req->request->get('ownership_type', 0); $owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id); + // source of awareness is now required + if (empty($soa_type)) + $error_array['source_of_awareness'] = 'Source of awareness is required.'; + if (empty($error_array)) { // get current user @@ -916,6 +924,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface $ownertype_id = $req->request->get('ownership_type', 0); $owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id); + // source of awareness is now required + if (empty($soa_type)) + $error_array['source_of_awareness'] = 'Source of awareness is required.'; + if (empty($error_array)) { // coordinates @@ -1065,6 +1077,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface $ownertype_id = $req->request->get('ownership_type', 0); $owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id); + // source of awareness is now required + if (empty($soa_type)) + $error_array['source_of_awareness'] = 'Source of awareness is required.'; + // get current user $user = $this->security->getUser(); @@ -1205,6 +1221,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface $ownertype_id = $req->request->get('ownership_type', 0); $owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id); + // source of awareness is now required + if (empty($soa_type)) + $error_array['source_of_awareness'] = 'Source of awareness is required.'; + if (empty($error_array)) { // coordinates $point = new Point($req->request->get('coord_lng'), $req->request->get('coord_lat')); @@ -1459,6 +1479,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface $ownertype_id = $req->request->get('ownership_type', 0); $owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id); + // source of awareness is now required + if (empty($soa_type)) + $error_array['source_of_awareness'] = 'Source of awareness is required.'; + // get previously assigned hub, if any $old_hub = $obj->getHub(); @@ -1739,6 +1763,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface $ownertype_id = $req->request->get('ownership_type', 0); $owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id); + // source of awareness is now required + if (empty($soa_type)) + $error_array['source_of_awareness'] = 'Source of awareness is required.'; + if (empty($error_array)) { // rider mqtt event // NOTE: need to send this before saving because rider will be cleared diff --git a/templates/job-order/form.html.twig b/templates/job-order/form.html.twig index e57f8114..54ee4df1 100644 --- a/templates/job-order/form.html.twig +++ b/templates/job-order/form.html.twig @@ -510,7 +510,6 @@