Add checking for source of awareness for job order. #698
This commit is contained in:
parent
772c472595
commit
65cba1842a
2 changed files with 28 additions and 1 deletions
|
|
@ -450,6 +450,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
$ownertype_id = $req->request->get('ownership_type', 0);
|
$ownertype_id = $req->request->get('ownership_type', 0);
|
||||||
$owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id);
|
$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
|
// TODO: check status before saving since JO might already
|
||||||
// have a status that needs to be retained
|
// have a status that needs to be retained
|
||||||
|
|
||||||
|
|
@ -710,6 +714,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
$ownertype_id = $req->request->get('ownership_type', 0);
|
$ownertype_id = $req->request->get('ownership_type', 0);
|
||||||
$owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id);
|
$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))
|
if (empty($error_array))
|
||||||
{
|
{
|
||||||
// get current user
|
// get current user
|
||||||
|
|
@ -916,6 +924,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
$ownertype_id = $req->request->get('ownership_type', 0);
|
$ownertype_id = $req->request->get('ownership_type', 0);
|
||||||
$owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id);
|
$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))
|
if (empty($error_array))
|
||||||
{
|
{
|
||||||
// coordinates
|
// coordinates
|
||||||
|
|
@ -1065,6 +1077,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
$ownertype_id = $req->request->get('ownership_type', 0);
|
$ownertype_id = $req->request->get('ownership_type', 0);
|
||||||
$owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id);
|
$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
|
// get current user
|
||||||
$user = $this->security->getUser();
|
$user = $this->security->getUser();
|
||||||
|
|
||||||
|
|
@ -1205,6 +1221,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
$ownertype_id = $req->request->get('ownership_type', 0);
|
$ownertype_id = $req->request->get('ownership_type', 0);
|
||||||
$owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id);
|
$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)) {
|
if (empty($error_array)) {
|
||||||
// coordinates
|
// coordinates
|
||||||
$point = new Point($req->request->get('coord_lng'), $req->request->get('coord_lat'));
|
$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);
|
$ownertype_id = $req->request->get('ownership_type', 0);
|
||||||
$owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id);
|
$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
|
// get previously assigned hub, if any
|
||||||
$old_hub = $obj->getHub();
|
$old_hub = $obj->getHub();
|
||||||
|
|
||||||
|
|
@ -1739,6 +1763,10 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
$ownertype_id = $req->request->get('ownership_type', 0);
|
$ownertype_id = $req->request->get('ownership_type', 0);
|
||||||
$owner_type = $em->getRepository(OwnershipType::class)->find($ownertype_id);
|
$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)) {
|
if (empty($error_array)) {
|
||||||
// rider mqtt event
|
// rider mqtt event
|
||||||
// NOTE: need to send this before saving because rider will be cleared
|
// NOTE: need to send this before saving because rider will be cleared
|
||||||
|
|
|
||||||
|
|
@ -510,7 +510,6 @@
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<label data-field="status">Source of Awareness</label>
|
<label data-field="status">Source of Awareness</label>
|
||||||
<select class="form-control m-input" id="source-of-awareness" name="source_of_awareness">
|
<select class="form-control m-input" id="source-of-awareness" name="source_of_awareness">
|
||||||
<option value=""></option>
|
|
||||||
{% for key, soa in soa_types %}
|
{% for key, soa in soa_types %}
|
||||||
<option value="{{ key }}"{{ key == obj.getSourceOfAwareness ? ' selected' }}>{{ soa }}</option>
|
<option value="{{ key }}"{{ key == obj.getSourceOfAwareness ? ' selected' }}>{{ soa }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue