Merge branch '738-filter-sms-hub-rejection' into 'master'
Resolve "Filter SMS Hub Rejection" Closes #738 See merge request jankstudio/resq!853
This commit is contained in:
commit
f6a858cc28
1 changed files with 15 additions and 6 deletions
|
|
@ -1661,10 +1661,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
$em->persist($obj);
|
||||
$em->flush();
|
||||
|
||||
// check if hub has valid mobile number
|
||||
$phone_number = $this->country_code . $hub->getNotifNumber();
|
||||
if (!empty($phone_number))
|
||||
$this->sendSMSHubRejection($phone_number, $obj, $jo);
|
||||
$this->sendSMSHubRejection($obj, $jo);
|
||||
}
|
||||
|
||||
return $error_array;
|
||||
|
|
@ -4013,8 +4010,21 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
$this->rt->sendSMS($phone_number, $this->translator->trans('message.battery_brand_allcaps'), $message);
|
||||
}
|
||||
|
||||
protected function sendSMSHubRejection($phone_number, $rejection, $jo)
|
||||
protected function sendSMSHubRejection($rejection, $jo)
|
||||
{
|
||||
$hub = $rejection->getHub();
|
||||
|
||||
// check if hub has a notification number
|
||||
$notif_number = $hub->getNotifNumber();
|
||||
if (empty($notif_number))
|
||||
return null;
|
||||
|
||||
$phone_number = $this->country_code . $notif_number;
|
||||
|
||||
// check if reason is administrative
|
||||
if ($rejection->getReason() == JORejectionReason::ADMINISTRATIVE)
|
||||
return null;
|
||||
|
||||
// sms content
|
||||
// Job Order # - can get from jo
|
||||
// Order Date and Time - get from jo
|
||||
|
|
@ -4024,7 +4034,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
// Remarks - get from rejection
|
||||
// Type of Service - get from jo
|
||||
|
||||
$hub = $rejection->getHub();
|
||||
$jo_id = $jo->getID();
|
||||
|
||||
// convert to string format the date fields (order date and time and date and time rejected)
|
||||
|
|
|
|||
Loading…
Reference in a new issue