Merge branch '673-add-classification-of-caller-to-job-order' into 'master'
Resolve "Add classification of caller to job order" Closes #673 See merge request jankstudio/resq!787
This commit is contained in:
commit
744e80a9e5
4 changed files with 99 additions and 24 deletions
|
|
@ -402,6 +402,12 @@ class JobOrder
|
||||||
*/
|
*/
|
||||||
protected $gender;
|
protected $gender;
|
||||||
|
|
||||||
|
// caller classification of caller
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string", length=80, nullable=true)
|
||||||
|
*/
|
||||||
|
protected $caller_classification;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->date_create = new DateTime();
|
$this->date_create = new DateTime();
|
||||||
|
|
@ -1147,4 +1153,15 @@ class JobOrder
|
||||||
return $this->gender;
|
return $this->gender;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setCallerClassification($caller_classification)
|
||||||
|
{
|
||||||
|
$this->caller_classification = $caller_classification;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCallerClassification()
|
||||||
|
{
|
||||||
|
return $this->caller_classification;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18
src/Ramcar/CallerClassification.php
Normal file
18
src/Ramcar/CallerClassification.php
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Ramcar;
|
||||||
|
|
||||||
|
class CallerClassification extends NameValue
|
||||||
|
{
|
||||||
|
const OWNER = 'owner';
|
||||||
|
const DRIVER = 'driver';
|
||||||
|
const FAMILY = 'family';
|
||||||
|
const FRIENDS = 'friends';
|
||||||
|
|
||||||
|
const COLLECTION = [
|
||||||
|
'owner' => 'Owner',
|
||||||
|
'driver' => 'Driver',
|
||||||
|
'family' => 'Family',
|
||||||
|
'friends' => 'Friends',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -47,6 +47,7 @@ use App\Ramcar\DeliveryStatus;
|
||||||
use App\Ramcar\SourceOfAwareness;
|
use App\Ramcar\SourceOfAwareness;
|
||||||
use App\Ramcar\InitialConcern;
|
use App\Ramcar\InitialConcern;
|
||||||
use App\Ramcar\Gender;
|
use App\Ramcar\Gender;
|
||||||
|
use App\Ramcar\CallerClassification;
|
||||||
|
|
||||||
use App\Service\InvoiceGeneratorInterface;
|
use App\Service\InvoiceGeneratorInterface;
|
||||||
use App\Service\JobOrderHandlerInterface;
|
use App\Service\JobOrderHandlerInterface;
|
||||||
|
|
@ -400,19 +401,22 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
// get source of awareness if any
|
// get source of awareness if any
|
||||||
$soa_type = $req->request->get('source_of_awareness');
|
$soa_type = $req->request->get('source_of_awareness', '');
|
||||||
|
|
||||||
// get remarks
|
// get remarks
|
||||||
$remarks = $req->request->get('remarks', '');
|
$remarks = $req->request->get('remarks', '');
|
||||||
|
|
||||||
// get initial concern if any
|
// get initial concern if any
|
||||||
$initial_concern = $req->request->get('initial_concern');
|
$initial_concern = $req->request->get('initial_concern', '');
|
||||||
|
|
||||||
// get initial concern notes if any
|
// get initial concern notes if any
|
||||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||||
|
|
||||||
// get gender if any
|
// get gender if any
|
||||||
$gender = $req->request->get('gender');
|
$gender = $req->request->get('gender', '');
|
||||||
|
|
||||||
|
// get caller classification if any
|
||||||
|
$caller_class = $req->request->get('caller_class','');
|
||||||
|
|
||||||
// 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
|
||||||
|
|
@ -450,6 +454,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
->setRemarks($remarks)
|
->setRemarks($remarks)
|
||||||
->setInitialConcern($initial_concern)
|
->setInitialConcern($initial_concern)
|
||||||
->setInitialConcernNotes($initial_concern_notes)
|
->setInitialConcernNotes($initial_concern_notes)
|
||||||
|
->setCallerClassification($caller_class)
|
||||||
->setGender($gender);
|
->setGender($gender);
|
||||||
|
|
||||||
// check if user is null, meaning call to create came from API
|
// check if user is null, meaning call to create came from API
|
||||||
|
|
@ -646,19 +651,22 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
// get source of awareness if any
|
// get source of awareness if any
|
||||||
$soa_type = $req->request->get('source_of_awareness');
|
$soa_type = $req->request->get('source_of_awareness', '');
|
||||||
|
|
||||||
// get remarks
|
// get remarks
|
||||||
$remarks = $req->request->get('remarks', '');
|
$remarks = $req->request->get('remarks', '');
|
||||||
|
|
||||||
// get initial concern if any
|
// get initial concern if any
|
||||||
$initial_concern = $req->request->get('initial_concern');
|
$initial_concern = $req->request->get('initial_concern', '');
|
||||||
|
|
||||||
// get initial concern notes if any
|
// get initial concern notes if any
|
||||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||||
|
|
||||||
// get gender if any
|
// get gender if any
|
||||||
$gender = $req->request->get('gender');
|
$gender = $req->request->get('gender', '');
|
||||||
|
|
||||||
|
// get caller classification if any
|
||||||
|
$caller_class = $req->request->get('caller_class', '');
|
||||||
|
|
||||||
if (empty($error_array))
|
if (empty($error_array))
|
||||||
{
|
{
|
||||||
|
|
@ -691,6 +699,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
->setRemarks($remarks)
|
->setRemarks($remarks)
|
||||||
->setInitialConcern($initial_concern)
|
->setInitialConcern($initial_concern)
|
||||||
->setInitialConcernNotes($initial_concern_notes)
|
->setInitialConcernNotes($initial_concern_notes)
|
||||||
|
->setCallerClassification($caller_class)
|
||||||
->setGender($gender);
|
->setGender($gender);
|
||||||
|
|
||||||
// did they change invoice?
|
// did they change invoice?
|
||||||
|
|
@ -838,19 +847,22 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
// get source of awareness if any
|
// get source of awareness if any
|
||||||
$soa_type = $req->request->get('source_of_awareness');
|
$soa_type = $req->request->get('source_of_awareness', '');
|
||||||
|
|
||||||
// get remarks
|
// get remarks
|
||||||
$remarks = $req->request->get('remarks', '');
|
$remarks = $req->request->get('remarks', '');
|
||||||
|
|
||||||
// get initial concern if any
|
// get initial concern if any
|
||||||
$initial_concern = $req->request->get('initial_concern');
|
$initial_concern = $req->request->get('initial_concern', '');
|
||||||
|
|
||||||
// get initial concern notes if any
|
// get initial concern notes if any
|
||||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||||
|
|
||||||
// get gender if any
|
// get gender if any
|
||||||
$gender = $req->request->get('gender');
|
$gender = $req->request->get('gender', '');
|
||||||
|
|
||||||
|
// get caller classification if any
|
||||||
|
$caller_class = $req->request->get('caller_class', '');
|
||||||
|
|
||||||
if (empty($error_array))
|
if (empty($error_array))
|
||||||
{
|
{
|
||||||
|
|
@ -880,7 +892,8 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
->setRemarks($remarks)
|
->setRemarks($remarks)
|
||||||
->setInitialConcern($initial_concern)
|
->setInitialConcern($initial_concern)
|
||||||
->setInitialConcernNotes($initial_concern_notes)
|
->setInitialConcernNotes($initial_concern_notes)
|
||||||
->setGender($gender);
|
->setGender($gender)
|
||||||
|
->setCallerClassification($caller_class);
|
||||||
|
|
||||||
// validate
|
// validate
|
||||||
$errors = $this->validator->validate($obj);
|
$errors = $this->validator->validate($obj);
|
||||||
|
|
@ -973,19 +986,22 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
// get source of awareness if any
|
// get source of awareness if any
|
||||||
$soa_type = $req->request->get('source_of_awareness');
|
$soa_type = $req->request->get('source_of_awareness', '');
|
||||||
|
|
||||||
// get remarks
|
// get remarks
|
||||||
$remarks = $req->request->get('remarks', '');
|
$remarks = $req->request->get('remarks', '');
|
||||||
|
|
||||||
// get initial concern if any
|
// get initial concern if any
|
||||||
$initial_concern = $req->request->get('initial_concern');
|
$initial_concern = $req->request->get('initial_concern', '');
|
||||||
|
|
||||||
// get initial concern notes if any
|
// get initial concern notes if any
|
||||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||||
|
|
||||||
// get gender if any
|
// get gender if any
|
||||||
$gender = $req->request->get('gender');
|
$gender = $req->request->get('gender', '');
|
||||||
|
|
||||||
|
// get caller classification if any
|
||||||
|
$caller_class = $req->request->get('caller_class', '');
|
||||||
|
|
||||||
// get current user
|
// get current user
|
||||||
$user = $this->security->getUser();
|
$user = $this->security->getUser();
|
||||||
|
|
@ -1017,6 +1033,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
->setRemarks($remarks)
|
->setRemarks($remarks)
|
||||||
->setInitialConcern($initial_concern)
|
->setInitialConcern($initial_concern)
|
||||||
->setInitialConcernNotes($initial_concern_notes)
|
->setInitialConcernNotes($initial_concern_notes)
|
||||||
|
->setCallerClassification($caller_class)
|
||||||
->setGender($gender);
|
->setGender($gender);
|
||||||
|
|
||||||
if ($user != null)
|
if ($user != null)
|
||||||
|
|
@ -1099,19 +1116,22 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
// get source of awareness if any
|
// get source of awareness if any
|
||||||
$soa_type = $req->request->get('source_of_awareness');
|
$soa_type = $req->request->get('source_of_awareness', '');
|
||||||
|
|
||||||
// get remarks
|
// get remarks
|
||||||
$remarks = $req->request->get('remarks', '');
|
$remarks = $req->request->get('remarks', '');
|
||||||
|
|
||||||
// get initial concern if any
|
// get initial concern if any
|
||||||
$initial_concern = $req->request->get('initial_concern');
|
$initial_concern = $req->request->get('initial_concern', '');
|
||||||
|
|
||||||
// get initial concern notes if any
|
// get initial concern notes if any
|
||||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||||
|
|
||||||
// get gender if any
|
// get gender if any
|
||||||
$gender = $req->request->get('gender');
|
$gender = $req->request->get('gender', '');
|
||||||
|
|
||||||
|
// get caller classification if any
|
||||||
|
$caller_class = $req->request->get('caller_class', '');
|
||||||
|
|
||||||
if (empty($error_array)) {
|
if (empty($error_array)) {
|
||||||
// coordinates
|
// coordinates
|
||||||
|
|
@ -1137,7 +1157,8 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
->setRemarks($remarks)
|
->setRemarks($remarks)
|
||||||
->setInitialConcern($initial_concern)
|
->setInitialConcern($initial_concern)
|
||||||
->setInitialConcernNotes($initial_concern_notes)
|
->setInitialConcernNotes($initial_concern_notes)
|
||||||
->setGender($gender);
|
->setGender($gender)
|
||||||
|
->setCallerClassification($caller_class);
|
||||||
|
|
||||||
// validate
|
// validate
|
||||||
$errors = $this->validator->validate($obj);
|
$errors = $this->validator->validate($obj);
|
||||||
|
|
@ -1339,19 +1360,22 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
// get source of awareness if any
|
// get source of awareness if any
|
||||||
$soa_type = $req->request->get('source_of_awareness');
|
$soa_type = $req->request->get('source_of_awareness', '');
|
||||||
|
|
||||||
// get remarks
|
// get remarks
|
||||||
$remarks = $req->request->get('remarks', '');
|
$remarks = $req->request->get('remarks', '');
|
||||||
|
|
||||||
// get initial concern if any
|
// get initial concern if any
|
||||||
$initial_concern = $req->request->get('initial_concern');
|
$initial_concern = $req->request->get('initial_concern', '');
|
||||||
|
|
||||||
// get initial concern notes if any
|
// get initial concern notes if any
|
||||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||||
|
|
||||||
// get gender if any
|
// get gender if any
|
||||||
$gender = $req->request->get('gender');
|
$gender = $req->request->get('gender', '');
|
||||||
|
|
||||||
|
// get caller classification if any
|
||||||
|
$caller_class = $req->request->get('caller_class', '');
|
||||||
|
|
||||||
// get previously assigned hub, if any
|
// get previously assigned hub, if any
|
||||||
$old_hub = $obj->getHub();
|
$old_hub = $obj->getHub();
|
||||||
|
|
@ -1392,6 +1416,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
->setInitialConcern($initial_concern)
|
->setInitialConcern($initial_concern)
|
||||||
->setInitialConcernNotes($initial_concern_notes)
|
->setInitialConcernNotes($initial_concern_notes)
|
||||||
->setGender($gender)
|
->setGender($gender)
|
||||||
|
->setCallerClassification($caller_class)
|
||||||
->clearRider();
|
->clearRider();
|
||||||
|
|
||||||
if ($user != null)
|
if ($user != null)
|
||||||
|
|
@ -1589,19 +1614,22 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
// get source of awareness if any
|
// get source of awareness if any
|
||||||
$soa_type = $req->request->get('source_of_awareness');
|
$soa_type = $req->request->get('source_of_awareness', '');
|
||||||
|
|
||||||
// get remarks
|
// get remarks
|
||||||
$remarks = $req->request->get('remarks', '');
|
$remarks = $req->request->get('remarks', '');
|
||||||
|
|
||||||
// get initial concern if any
|
// get initial concern if any
|
||||||
$initial_concern = $req->request->get('initial_concern');
|
$initial_concern = $req->request->get('initial_concern', '');
|
||||||
|
|
||||||
// get initial concern notes if any
|
// get initial concern notes if any
|
||||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||||
|
|
||||||
// get gender if any
|
// get gender if any
|
||||||
$gender = $req->request->get('gender');
|
$gender = $req->request->get('gender', '');
|
||||||
|
|
||||||
|
// get caller classification if any
|
||||||
|
$caller_class = $req->request->get('caller_class', '');
|
||||||
|
|
||||||
if (empty($error_array)) {
|
if (empty($error_array)) {
|
||||||
// rider mqtt event
|
// rider mqtt event
|
||||||
|
|
@ -1648,7 +1676,8 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
->setDeliveryStatus(DeliveryStatus::RIDER_ASSIGN)
|
->setDeliveryStatus(DeliveryStatus::RIDER_ASSIGN)
|
||||||
->setInitialConcern($initial_concern)
|
->setInitialConcern($initial_concern)
|
||||||
->setInitialConcernNotes($initial_concern_notes)
|
->setInitialConcernNotes($initial_concern_notes)
|
||||||
->setGender($gender);
|
->setGender($gender)
|
||||||
|
->setCallerClassification($caller_class);
|
||||||
|
|
||||||
if ($user != null)
|
if ($user != null)
|
||||||
{
|
{
|
||||||
|
|
@ -3157,6 +3186,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||||
$params['soa_types'] = SourceOfAwareness::getCollection();
|
$params['soa_types'] = SourceOfAwareness::getCollection();
|
||||||
$params['initial_concern'] = InitialConcern::getCollection();
|
$params['initial_concern'] = InitialConcern::getCollection();
|
||||||
$params['genders'] = Gender::getCollection();
|
$params['genders'] = Gender::getCollection();
|
||||||
|
$params['caller_classifications'] = CallerClassification::getCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function initFormTags(&$params)
|
protected function initFormTags(&$params)
|
||||||
|
|
|
||||||
|
|
@ -479,6 +479,16 @@
|
||||||
</select>
|
</select>
|
||||||
<div class="form-control-feedback hide" data-field="gender"></div>
|
<div class="form-control-feedback hide" data-field="gender"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<label data-field="status">Caller Classification</label>
|
||||||
|
<select class="form-control m-input" id="caller-class" name="caller_class">
|
||||||
|
<option value=""></option>
|
||||||
|
{% for key, caller_class in caller_classifications %}
|
||||||
|
<option value="{{ key }}"{{ key == obj.getCallerClassification ? ' selected' }}>{{ caller_class }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="form-control-feedback hide" data-field="caller_class"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group m-form__group row">
|
<div class="form-group m-form__group row">
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue