Add country code prefix to messages. Made the country code a constant. #270
This commit is contained in:
parent
f6df19a58f
commit
eb0e19d27f
13 changed files with 41 additions and 30 deletions
|
|
@ -27,6 +27,8 @@ use DateTime;
|
|||
|
||||
class CustomerController extends Controller
|
||||
{
|
||||
const COUNTRY_CODE_PREFIX = '+60';
|
||||
|
||||
/**
|
||||
* @Menu(selected="customer_list")
|
||||
*/
|
||||
|
|
@ -588,7 +590,7 @@ class CustomerController extends Controller
|
|||
$cust = $cv->getCustomer();
|
||||
$vehicles[] = [
|
||||
'id' => $cv->getID(),
|
||||
'text' => $cv->getPlateNumber() . ' ' . $cust->getFirstName() . ' ' . $cust->getLastName() . ' (+63' . $cust->getPhoneMobile() . ')',
|
||||
'text' => $cv->getPlateNumber() . ' ' . $cust->getFirstName() . ' ' . $cust->getLastName() . ' ('. self::COUNTRY_CODE_PREFIX . $cust->getPhoneMobile() . ')',
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ use App\Ramcar\CustomerClassification;
|
|||
*/
|
||||
class Customer
|
||||
{
|
||||
const COUNTRY_CODE_PREFIX = '+60';
|
||||
|
||||
// unique id
|
||||
/**
|
||||
* @ORM\Id
|
||||
|
|
@ -258,16 +260,16 @@ class Customer
|
|||
$phones = [];
|
||||
|
||||
if (!empty($this->phone_mobile))
|
||||
$phones[] = '+63' . $this->phone_mobile;
|
||||
$phones[] = self::COUNTRY_CODE_PREFIX . $this->phone_mobile;
|
||||
|
||||
if (!empty($this->phone_landline))
|
||||
$phones[] = '+63' . $this->phone_landline;
|
||||
$phones[] = self::COUNTRY_CODE_PREFIX . $this->phone_landline;
|
||||
|
||||
if (!empty($this->phone_office))
|
||||
$phones[] = '+63' . $this->phone_office;
|
||||
$phones[] = self::COUNTRY_CODE_PREFIX . $this->phone_office;
|
||||
|
||||
if (!empty($this->phone_fax))
|
||||
$phones[] = '+63' . $this->phone_fax;
|
||||
$phones[] = self::COUNTRY_CODE_PREFIX . $this->phone_fax;
|
||||
|
||||
return $phones;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ use FPDF;
|
|||
|
||||
class CMBJobOrderHandler implements JobOrderHandlerInterface
|
||||
{
|
||||
const COUNTRY_CODE_PREFIX = '+60';
|
||||
|
||||
protected $em;
|
||||
protected $ic;
|
||||
protected $security;
|
||||
|
|
@ -1616,7 +1618,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
|
||||
$pdf->SetXY($col2_x, $y);
|
||||
$pdf->Cell($label_width, $line_height, 'Mobile Phone:');
|
||||
$pdf->MultiCell(0, $line_height, $customer && $customer->getPhoneMobile() ? '+63' . $customer->getPhoneMobile() : '', 0, 'L');
|
||||
$pdf->MultiCell(0, $line_height, $customer && $customer->getPhoneMobile() ? self::COUNTRY_CODE_PREFIX . $customer->getPhoneMobile() : '', 0, 'L');
|
||||
|
||||
// get Y after right cell
|
||||
$y2 = $pdf->GetY();
|
||||
|
|
@ -1633,7 +1635,7 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
|
||||
$pdf->SetXY($col2_x, $y);
|
||||
$pdf->Cell($label_width, $line_height, 'Landline:');
|
||||
$pdf->MultiCell(0, $line_height, $customer && $customer->getPhoneLandline() ? '+63' . $customer->getPhoneLandline() : '', 0, 'L');
|
||||
$pdf->MultiCell(0, $line_height, $customer && $customer->getPhoneLandline() ? self::COUNTRY_CODE_PREFIX . $customer->getPhoneLandline() : '', 0, 'L');
|
||||
|
||||
// get Y after right cell
|
||||
$y2 = $pdf->GetY();
|
||||
|
|
@ -1643,11 +1645,11 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
|
||||
$pdf->SetXY($col2_x, $y);
|
||||
$pdf->Cell($label_width, $line_height, 'Office Phone:');
|
||||
$pdf->MultiCell(0, $line_height, $customer && $customer->getPhoneOffice() ? '+63' . $customer->getPhoneOffice() : '', 0, 'L');
|
||||
$pdf->MultiCell(0, $line_height, $customer && $customer->getPhoneOffice() ? self::COUNTRY_CODE_PREFIX . $customer->getPhoneOffice() : '', 0, 'L');
|
||||
|
||||
$pdf->SetX($col2_x);
|
||||
$pdf->Cell($label_width, $line_height, 'Fax:');
|
||||
$pdf->MultiCell($val_width, $line_height, $customer && $customer->getPhoneFax() ? '+63' . $customer->getPhoneFax() : '', 0, 'L');
|
||||
$pdf->MultiCell($val_width, $line_height, $customer && $customer->getPhoneFax() ? self::COUNTRY_CODE_PREFIX . $customer->getPhoneFax() : '', 0, 'L');
|
||||
|
||||
// insert vehicle info
|
||||
$cv = $obj->getCustomerVehicle();
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ use FPDF;
|
|||
|
||||
class ResqJobOrderHandler implements JobOrderHandlerInterface
|
||||
{
|
||||
const COUNTRY_CODE_PREFIX = '+63';
|
||||
|
||||
protected $em;
|
||||
protected $ic;
|
||||
protected $security;
|
||||
|
|
@ -1616,7 +1618,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
|
||||
$pdf->SetXY($col2_x, $y);
|
||||
$pdf->Cell($label_width, $line_height, 'Mobile Phone:');
|
||||
$pdf->MultiCell(0, $line_height, $customer && $customer->getPhoneMobile() ? '+63' . $customer->getPhoneMobile() : '', 0, 'L');
|
||||
$pdf->MultiCell(0, $line_height, $customer && $customer->getPhoneMobile() ? self::COUNTRY_CODE_PREFIX . $customer->getPhoneMobile() : '', 0, 'L');
|
||||
|
||||
// get Y after right cell
|
||||
$y2 = $pdf->GetY();
|
||||
|
|
@ -1633,7 +1635,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
|
||||
$pdf->SetXY($col2_x, $y);
|
||||
$pdf->Cell($label_width, $line_height, 'Landline:');
|
||||
$pdf->MultiCell(0, $line_height, $customer && $customer->getPhoneLandline() ? '+63' . $customer->getPhoneLandline() : '', 0, 'L');
|
||||
$pdf->MultiCell(0, $line_height, $customer && $customer->getPhoneLandline() ? self::COUNTRY_CODE_PREFIX . $customer->getPhoneLandline() : '', 0, 'L');
|
||||
|
||||
// get Y after right cell
|
||||
$y2 = $pdf->GetY();
|
||||
|
|
@ -1643,11 +1645,11 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
|
||||
$pdf->SetXY($col2_x, $y);
|
||||
$pdf->Cell($label_width, $line_height, 'Office Phone:');
|
||||
$pdf->MultiCell(0, $line_height, $customer && $customer->getPhoneOffice() ? '+63' . $customer->getPhoneOffice() : '', 0, 'L');
|
||||
$pdf->MultiCell(0, $line_height, $customer && $customer->getPhoneOffice() ? self::COUNTRY_CODE_PREFIX . $customer->getPhoneOffice() : '', 0, 'L');
|
||||
|
||||
$pdf->SetX($col2_x);
|
||||
$pdf->Cell($label_width, $line_height, 'Fax:');
|
||||
$pdf->MultiCell($val_width, $line_height, $customer && $customer->getPhoneFax() ? '+63' . $customer->getPhoneFax() : '', 0, 'L');
|
||||
$pdf->MultiCell($val_width, $line_height, $customer && $customer->getPhoneFax() ? self::COUNTRY_CODE_PREFIX . $customer->getPhoneFax() : '', 0, 'L');
|
||||
|
||||
// insert vehicle info
|
||||
$cv = $obj->getCustomerVehicle();
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@
|
|||
Mobile Phone
|
||||
</label>
|
||||
<div class="input-group m-input-group">
|
||||
<span class="input-group-addon">+63</span>
|
||||
<span class="input-group-addon">{% trans %}country_code_prefix{% endtrans %}</span>
|
||||
<input type="text" name="phone_mobile" class="form-control m-input" value="{{ obj.getPhoneMobile|default('') }}" data-name="phone_mobile">
|
||||
<div class="form-control-feedback hide" data-field="phone_mobile"></div>
|
||||
</div>
|
||||
|
|
@ -141,7 +141,7 @@
|
|||
Landline
|
||||
</label>
|
||||
<div class="input-group m-input-group">
|
||||
<span class="input-group-addon">+63</span>
|
||||
<span class="input-group-addon">{% trans %}country_code_prefix{% endtrans %}</span>
|
||||
<input type="text" name="phone_landline" class="form-control m-input" value="{{ obj.getPhoneLandline|default('') }}" data-name="phone_landline">
|
||||
<div class="form-control-feedback hide" data-field="phone_landline"></div>
|
||||
</div>
|
||||
|
|
@ -153,7 +153,7 @@
|
|||
Office Phone
|
||||
</label>
|
||||
<div class="input-group m-input-group">
|
||||
<span class="input-group-addon">+63</span>
|
||||
<span class="input-group-addon">{% trans %}country_code_prefix{% endtrans %}</span>
|
||||
<input type="text" name="phone_office" class="form-control m-input" value="{{ obj.getPhoneOffice|default('') }}" data-name="phone_office">
|
||||
<div class="form-control-feedback hide" data-field="phone_office"></div>
|
||||
</div>
|
||||
|
|
@ -163,7 +163,7 @@
|
|||
Fax
|
||||
</label>
|
||||
<div class="input-group m-input-group">
|
||||
<span class="input-group-addon">+63</span>
|
||||
<span class="input-group-addon">{% trans %}country_code_prefix{% endtrans %}</span>
|
||||
<input type="text" name="phone_fax" class="form-control m-input" value="{{ obj.getPhoneFax|default('') }}" data-name="phone_fax">
|
||||
<div class="form-control-feedback hide" data-field="phone_fax"></div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@
|
|||
<div class="col-lg-6">
|
||||
<label data-field="customer_phone_mobile">Mobile Phone</label>
|
||||
<div class="input-group m-input-group">
|
||||
<span class="input-group-addon">+63</span>
|
||||
<span class="input-group-addon">{% trans %}country_code_prefix{% endtrans %}</span>
|
||||
<input type="text" name="customer_phone_mobile" id="customer-phone-mobile" class="form-control m-input" value="{{ obj.getCustomer.getPhoneMobile|default('') }}" data-vehicle-field="1" disabled>
|
||||
<div class="form-control-feedback hide" data-field="customer_phone_mobile"></div>
|
||||
</div>
|
||||
|
|
@ -118,7 +118,7 @@
|
|||
<div class="col-lg-6">
|
||||
<label data-field="customer_phone_landline">Landline</label>
|
||||
<div class="input-group m-input-group">
|
||||
<span class="input-group-addon">+63</span>
|
||||
<span class="input-group-addon">{% trans %}country_code_prefix{% endtrans %}</span>
|
||||
<input type="text" name="customer_phone_landline" id="customer-phone-landline" class="form-control m-input" value="{{ obj.getCustomer.getPhoneLandline|default('') }}" data-vehicle-field="1" disabled>
|
||||
<div class="form-control-feedback hide" data-field="customer_phone_landline"></div>
|
||||
</div>
|
||||
|
|
@ -128,7 +128,7 @@
|
|||
<div class="col-lg-6">
|
||||
<label data-field="customer_phone_office">Office Phone</label>
|
||||
<div class="input-group m-input-group">
|
||||
<span class="input-group-addon">+63</span>
|
||||
<span class="input-group-addon">{% trans %}country_code_prefix{% endtrans %}</span>
|
||||
<input type="text" name="customer_phone_office" id="customer-phone-office" class="form-control m-input" value="{{ obj.getCustomer.getPhoneOffice|default('') }}" data-vehicle-field="1" disabled>
|
||||
<div class="form-control-feedback hide" data-field="customer_phone_office"></div>
|
||||
</div>
|
||||
|
|
@ -136,7 +136,7 @@
|
|||
<div class="col-lg-6">
|
||||
<label data-field="customer_phone_fax">Fax</label>
|
||||
<div class="input-group m-input-group">
|
||||
<span class="input-group-addon">+63</span>
|
||||
<span class="input-group-addon">{% trans %}country_code_prefix{% endtrans %}</span>
|
||||
<input type="text" name="customer_phone_fax" id="customer-phone-fax" class="form-control m-input" value="{{ obj.getCustomer.getPhoneFax|default('') }}" data-vehicle-field="1" disabled>
|
||||
<div class="form-control-feedback hide" data-field="customer_phone_fax"></div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@
|
|||
<div class="col-lg-6">
|
||||
<label data-field="customer_phone_mobile">Mobile Phone</label>
|
||||
<div class="input-group m-input-group">
|
||||
<span class="input-group-addon">+63</span>
|
||||
<span class="input-group-addon">{% trans %}country_code_prefix{% endtrans %}</span>
|
||||
<input type="text" name="customer_phone_mobile" id="customer-phone-mobile" class="form-control m-input" value="{{ obj.getCustomer.getPhoneMobile|default('') }}" data-vehicle-field="1" disabled>
|
||||
<div class="form-control-feedback hide" data-field="customer_phone_mobile"></div>
|
||||
</div>
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
<div class="col-lg-6">
|
||||
<label data-field="customer_phone_landline">Landline</label>
|
||||
<div class="input-group m-input-group">
|
||||
<span class="input-group-addon">+63</span>
|
||||
<span class="input-group-addon">{% trans %}country_code_prefix{% endtrans %}</span>
|
||||
<input type="text" name="customer_phone_landline" id="customer-phone-landline" class="form-control m-input" value="{{ obj.getCustomer.getPhoneLandline|default('') }}" data-vehicle-field="1" disabled>
|
||||
<div class="form-control-feedback hide" data-field="customer_phone_landline"></div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
<div class="col-lg-6">
|
||||
<label data-field="customer_phone_mobile">Mobile Phone</label>
|
||||
<div class="input-group m-input-group">
|
||||
<span class="input-group-addon">+63</span>
|
||||
<span class="input-group-addon">{% trans %}country_code_prefix{% endtrans %}</span>
|
||||
<input type="text" name="customer_phone_mobile" id="customer-phone-mobile" class="form-control m-input" value="{{ data.getCustMobile|default('') }}" data-vehicle-field="1" disabled>
|
||||
<div class="form-control-feedback hide" data-field="customer_phone_mobile"></div>
|
||||
</div>
|
||||
|
|
@ -61,7 +61,7 @@
|
|||
<div class="col-lg-6">
|
||||
<label data-field="customer_phone_landline">Landline</label>
|
||||
<div class="input-group m-input-group">
|
||||
<span class="input-group-addon">+63</span>
|
||||
<span class="input-group-addon">{% trans %}country_code_prefix{% endtrans %}</span>
|
||||
<input type="text" name="customer_phone_landline" id="customer-phone-landline" class="form-control m-input" value="{{ data.getCustLandline|default('') }}" data-vehicle-field="1" disabled>
|
||||
<div class="form-control-feedback hide" data-field="customer_phone_landline"></div>
|
||||
</div>
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
<div class="col-lg-6">
|
||||
<label data-field="customer_contact">Contact</label>
|
||||
<div class="input-group m-input-group">
|
||||
<span class="input-group-addon">+63</span>
|
||||
<span class="input-group-addon">{% trans %}country_code_prefix{% endtrans %}</span>
|
||||
<input type="text" name="customer_contact" id="customer-contact" class="form-control m-input" value="{{ data.getCustContact|default('') }}" data-vehicle-field="1" disabled>
|
||||
<div class="form-control-feedback hide" data-field="customer_contact"></div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
<div class="col-lg-4">
|
||||
<label data-field="contact_num">Contact Number</label>
|
||||
<div class="input-group m-input-group">
|
||||
<span class="input-group-addon">+63</span>
|
||||
<span class="input-group-addon">{% trans %}country_code_prefix{% endtrans %}</span>
|
||||
<input type="text" name="contact_num" class="form-control m-input" value="{{ customer and mode == 'create' and customer.getPhoneMobile is not empty ? customer.getPhoneMobile : obj.getContactNumber }}"{{ customer ? ' disabled' }}>
|
||||
<div class="form-control-feedback hide" data-field="contact_num"></div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@
|
|||
Mobile Phone
|
||||
</label>
|
||||
<div class="input-group m-input-group">
|
||||
<span class="input-group-addon">+63</span>
|
||||
<span class="input-group-addon">{% trans %}country_code_prefix{% endtrans %}</span>
|
||||
<input type="text" name="mobile_number" class="form-control m-input" value="{{ obj.getMobileNumber|default('') }}" data-name="mobile_number">
|
||||
<div class="form-control-feedback hide" data-field="mobile_number"></div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,11 +10,12 @@ battery_size_tradein_premium: Trade-in Premium
|
|||
battery_size_tradein_other: Trade-in Other
|
||||
add_cust_vehicle_battery_info: This vehicle is using a Motolite battery
|
||||
jo_title_pdf: Res-Q for CMB Job Order
|
||||
country_code_prefix: '+60'
|
||||
|
||||
# images
|
||||
image_logo_login: /assets/images/black-text-logo-01.png
|
||||
icon_login: /assets/images/battery-assist-bm-logo-32x32.png
|
||||
icon_base_32x32: /assets/images/black-text-logo-01-32x32.png
|
||||
icon_base_16x16: /assets/images/black-text-logo-01-16x16.png
|
||||
image_dashboard: /assets/images/battery-assist-bm-logo-50x50.png
|
||||
image_dashboard: /assets/images/black-text-logo-01-115x115.png
|
||||
image_jo_pdf: /public/assets/images/black-text-logo-01-115x115.png
|
||||
|
|
|
|||
|
|
@ -10,11 +10,12 @@ battery_size_tradein_premium: Trade-in Premium
|
|||
battery_size_tradein_other: Trade-in Other
|
||||
add_cust_vehicle_battery_info: This vehicle is using a Motolite battery
|
||||
jo_title_pdf: Res-Q for CMB Job Order
|
||||
country_code_prefix: '+60'
|
||||
|
||||
# images
|
||||
image_logo_login: /assets/images/black-text-logo-01.png
|
||||
icon_login: /assets/images/battery-assist-bm-logo-32x32.png
|
||||
icon_base_32x32: /assets/images/black-text-logo-01-32x32.png
|
||||
icon_base_16x16: /assets/images/black-text-logo-01-16x16.png
|
||||
image_dashboard: /assets/images/battery-assist-bm-logo-50x50.png
|
||||
image_dashboard: /assets/images/black-text-logo-01-115x115.png
|
||||
image_jo_pdf: /public/assets/images/black-text-logo-01-115x115.png
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ battery_size_tradein_premium: Trade-in Premium
|
|||
battery_size_tradein_other: Trade-in Other
|
||||
add_cust_vehicle_battery_info: This vehicle is using a Motolite battery
|
||||
jo_title_pdf: Motolite Res-Q Job Order
|
||||
country_code_prefix: '+63'
|
||||
|
||||
# images
|
||||
image_logo_login: /assets/images/logo-resq.png
|
||||
|
|
|
|||
Loading…
Reference in a new issue