Add functionality to save facilitated by fields #181
This commit is contained in:
parent
7ae9fe4e2d
commit
e2ccf1bbc1
3 changed files with 46 additions and 2 deletions
|
|
@ -997,6 +997,27 @@ class JobOrderController extends BaseController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check facilitated type
|
||||||
|
$fac_type = $req->request->get('facilitated_type');
|
||||||
|
if (!empty($fac_type))
|
||||||
|
{
|
||||||
|
if (!FacilitatedType::validate($fac_type))
|
||||||
|
$fac_type = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$fac_type = null;
|
||||||
|
|
||||||
|
// check facilitated by
|
||||||
|
$fac_by_id = $req->request->get('facilitated_by');
|
||||||
|
$fac_by = null;
|
||||||
|
if (!empty($fac_by_id))
|
||||||
|
{
|
||||||
|
$fac_by = $em->getRepository(Hub::class)->find($fac_by_id);
|
||||||
|
if (empty($fac_by))
|
||||||
|
$fac_by = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (empty($error_array))
|
if (empty($error_array))
|
||||||
{
|
{
|
||||||
// coordinates
|
// coordinates
|
||||||
|
|
@ -1014,6 +1035,8 @@ class JobOrderController extends BaseController
|
||||||
->setTier1Notes($req->request->get('tier1_notes'))
|
->setTier1Notes($req->request->get('tier1_notes'))
|
||||||
->setTier2Notes($req->request->get('tier2_notes'))
|
->setTier2Notes($req->request->get('tier2_notes'))
|
||||||
->setDeliveryAddress($req->request->get('delivery_address'))
|
->setDeliveryAddress($req->request->get('delivery_address'))
|
||||||
|
->setFacilitatedType($fac_type)
|
||||||
|
->setFacilitatedBy($fac_by)
|
||||||
->setHub($hub);
|
->setHub($hub);
|
||||||
|
|
||||||
// validate
|
// validate
|
||||||
|
|
|
||||||
|
|
@ -755,4 +755,25 @@ class JobOrder
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setFacilitatedType($type = null)
|
||||||
|
{
|
||||||
|
$this->facilitated_type = $type;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFacilitatedType()
|
||||||
|
{
|
||||||
|
return $this->facilitated_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setFacilitatedBy(Hub $hub = null)
|
||||||
|
{
|
||||||
|
$this->facilitated_by = $hub;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFacilitatedBy()
|
||||||
|
{
|
||||||
|
return $this->facilitated_by;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -520,7 +520,7 @@
|
||||||
<div class="form-group m-form__group row">
|
<div class="form-group m-form__group row">
|
||||||
<div class="col-lg-2">
|
<div class="col-lg-2">
|
||||||
<label for="faciliateted-type">Facilitated By</label>
|
<label for="faciliateted-type">Facilitated By</label>
|
||||||
<select class="form-control m-input" id="facilitated-type">
|
<select name="facilitated_type" class="form-control m-input" id="facilitated-type">
|
||||||
<option value="">None</option>
|
<option value="">None</option>
|
||||||
{% for key, type in facilitated_types %}
|
{% for key, type in facilitated_types %}
|
||||||
<option value="{{ key }}">{{ type }}</option>
|
<option value="{{ key }}">{{ type }}</option>
|
||||||
|
|
@ -529,7 +529,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-8">
|
<div class="col-lg-8">
|
||||||
<label for="faciliateted-by"> </label>
|
<label for="faciliateted-by"> </label>
|
||||||
<select class="form-control m-input" id="facilitated-by">
|
<select name="facilitated_by" class="form-control m-input" id="facilitated-by">
|
||||||
<option value="">None</option>
|
<option value="">None</option>
|
||||||
{% for key, name in facilitated_hubs %}
|
{% for key, name in facilitated_hubs %}
|
||||||
<option value="{{ key }}">{{ name }}</option>
|
<option value="{{ key }}">{{ name }}</option>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue