Merge branch 'master' of gitlab.com:jankstudio/resq into 675-set-rider-s-current-jo-id-to-null-if-jo-s-hub-is-reassigned-and-jo-has-been-rider-assigned
This commit is contained in:
commit
e36523528d
4 changed files with 99 additions and 24 deletions
|
|
@ -402,6 +402,12 @@ class JobOrder
|
|||
*/
|
||||
protected $gender;
|
||||
|
||||
// caller classification of caller
|
||||
/**
|
||||
* @ORM\Column(type="string", length=80, nullable=true)
|
||||
*/
|
||||
protected $caller_classification;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->date_create = new DateTime();
|
||||
|
|
@ -1147,4 +1153,15 @@ class JobOrder
|
|||
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\InitialConcern;
|
||||
use App\Ramcar\Gender;
|
||||
use App\Ramcar\CallerClassification;
|
||||
|
||||
use App\Service\InvoiceGeneratorInterface;
|
||||
use App\Service\JobOrderHandlerInterface;
|
||||
|
|
@ -400,19 +401,22 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
}
|
||||
|
||||
// get source of awareness if any
|
||||
$soa_type = $req->request->get('source_of_awareness');
|
||||
$soa_type = $req->request->get('source_of_awareness', '');
|
||||
|
||||
// get remarks
|
||||
$remarks = $req->request->get('remarks', '');
|
||||
|
||||
// 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
|
||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||
|
||||
// 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
|
||||
// have a status that needs to be retained
|
||||
|
|
@ -450,6 +454,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setRemarks($remarks)
|
||||
->setInitialConcern($initial_concern)
|
||||
->setInitialConcernNotes($initial_concern_notes)
|
||||
->setCallerClassification($caller_class)
|
||||
->setGender($gender);
|
||||
|
||||
// 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
|
||||
$soa_type = $req->request->get('source_of_awareness');
|
||||
$soa_type = $req->request->get('source_of_awareness', '');
|
||||
|
||||
// get remarks
|
||||
$remarks = $req->request->get('remarks', '');
|
||||
|
||||
// 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
|
||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||
|
||||
// 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))
|
||||
{
|
||||
|
|
@ -691,6 +699,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setRemarks($remarks)
|
||||
->setInitialConcern($initial_concern)
|
||||
->setInitialConcernNotes($initial_concern_notes)
|
||||
->setCallerClassification($caller_class)
|
||||
->setGender($gender);
|
||||
|
||||
// did they change invoice?
|
||||
|
|
@ -838,19 +847,22 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
}
|
||||
|
||||
// get source of awareness if any
|
||||
$soa_type = $req->request->get('source_of_awareness');
|
||||
$soa_type = $req->request->get('source_of_awareness', '');
|
||||
|
||||
// get remarks
|
||||
$remarks = $req->request->get('remarks', '');
|
||||
|
||||
// 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
|
||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||
|
||||
// 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))
|
||||
{
|
||||
|
|
@ -880,7 +892,8 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setRemarks($remarks)
|
||||
->setInitialConcern($initial_concern)
|
||||
->setInitialConcernNotes($initial_concern_notes)
|
||||
->setGender($gender);
|
||||
->setGender($gender)
|
||||
->setCallerClassification($caller_class);
|
||||
|
||||
// validate
|
||||
$errors = $this->validator->validate($obj);
|
||||
|
|
@ -973,19 +986,22 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
}
|
||||
|
||||
// get source of awareness if any
|
||||
$soa_type = $req->request->get('source_of_awareness');
|
||||
$soa_type = $req->request->get('source_of_awareness', '');
|
||||
|
||||
// get remarks
|
||||
$remarks = $req->request->get('remarks', '');
|
||||
|
||||
// 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
|
||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||
|
||||
// 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
|
||||
$user = $this->security->getUser();
|
||||
|
|
@ -1017,6 +1033,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setRemarks($remarks)
|
||||
->setInitialConcern($initial_concern)
|
||||
->setInitialConcernNotes($initial_concern_notes)
|
||||
->setCallerClassification($caller_class)
|
||||
->setGender($gender);
|
||||
|
||||
if ($user != null)
|
||||
|
|
@ -1099,19 +1116,22 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
}
|
||||
|
||||
// get source of awareness if any
|
||||
$soa_type = $req->request->get('source_of_awareness');
|
||||
$soa_type = $req->request->get('source_of_awareness', '');
|
||||
|
||||
// get remarks
|
||||
$remarks = $req->request->get('remarks', '');
|
||||
|
||||
// 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
|
||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||
|
||||
// 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)) {
|
||||
// coordinates
|
||||
|
|
@ -1137,7 +1157,8 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setRemarks($remarks)
|
||||
->setInitialConcern($initial_concern)
|
||||
->setInitialConcernNotes($initial_concern_notes)
|
||||
->setGender($gender);
|
||||
->setGender($gender)
|
||||
->setCallerClassification($caller_class);
|
||||
|
||||
// validate
|
||||
$errors = $this->validator->validate($obj);
|
||||
|
|
@ -1339,19 +1360,22 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
}
|
||||
|
||||
// get source of awareness if any
|
||||
$soa_type = $req->request->get('source_of_awareness');
|
||||
$soa_type = $req->request->get('source_of_awareness', '');
|
||||
|
||||
// get remarks
|
||||
$remarks = $req->request->get('remarks', '');
|
||||
|
||||
// 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
|
||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||
|
||||
// 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
|
||||
$old_hub = $obj->getHub();
|
||||
|
|
@ -1404,6 +1428,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setInitialConcern($initial_concern)
|
||||
->setInitialConcernNotes($initial_concern_notes)
|
||||
->setGender($gender)
|
||||
->setCallerClassification($caller_class)
|
||||
->clearRider();
|
||||
|
||||
if ($user != null)
|
||||
|
|
@ -1601,19 +1626,22 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
}
|
||||
|
||||
// get source of awareness if any
|
||||
$soa_type = $req->request->get('source_of_awareness');
|
||||
$soa_type = $req->request->get('source_of_awareness', '');
|
||||
|
||||
// get remarks
|
||||
$remarks = $req->request->get('remarks', '');
|
||||
|
||||
// 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
|
||||
$initial_concern_notes = $req->request->get('initial_concern_notes', '');
|
||||
|
||||
// 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)) {
|
||||
// rider mqtt event
|
||||
|
|
@ -1660,7 +1688,8 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
->setDeliveryStatus(DeliveryStatus::RIDER_ASSIGN)
|
||||
->setInitialConcern($initial_concern)
|
||||
->setInitialConcernNotes($initial_concern_notes)
|
||||
->setGender($gender);
|
||||
->setGender($gender)
|
||||
->setCallerClassification($caller_class);
|
||||
|
||||
if ($user != null)
|
||||
{
|
||||
|
|
@ -3169,6 +3198,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
$params['soa_types'] = SourceOfAwareness::getCollection();
|
||||
$params['initial_concern'] = InitialConcern::getCollection();
|
||||
$params['genders'] = Gender::getCollection();
|
||||
$params['caller_classifications'] = CallerClassification::getCollection();
|
||||
}
|
||||
|
||||
protected function initFormTags(&$params)
|
||||
|
|
|
|||
|
|
@ -479,6 +479,16 @@
|
|||
</select>
|
||||
<div class="form-control-feedback hide" data-field="gender"></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 class="form-group m-form__group row">
|
||||
<div class="col-lg-6">
|
||||
|
|
|
|||
Loading…
Reference in a new issue