Create a twig template for job order for resq, separate from cmb. #270

This commit is contained in:
Korina Cordero 2019-11-11 04:52:32 +00:00
parent a0ad1b0047
commit 341db63735
4 changed files with 3389 additions and 1713 deletions

View file

@ -17,6 +17,7 @@ use App\Ramcar\FuelType;
use App\Entity\Invoice;
use App\Entity\InvoiceItem;
use App\Entity\User;
use App\Entity\Battery;
use App\Service\InvoiceGeneratorInterface;

View file

@ -2030,15 +2030,15 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
$this->template_hash = [];
// add all twig templates for job order to hash
$this->template_hash['jo_incoming_form'] = 'job-order/form.html.twig';
$this->template_hash['jo_open_edit_form'] = 'job-order/form.html.twig';
$this->template_hash['jo_incoming_vehicle_form'] = 'job-order/form.html.twig';
$this->template_hash['jo_processing_form'] = 'job-order/form.html.twig';
$this->template_hash['jo_assigning_form'] = 'job-order/form.html.twig';
$this->template_hash['jo_fulfillment_form'] = 'job-order/form.html.twig';
$this->template_hash['jo_open_hub_form'] = 'job-order/form.html.twig';
$this->template_hash['jo_open_rider_form'] = 'job-order/form.html.twig';
$this->template_hash['jo_all_form'] = 'job-order/form.html.twig';
$this->template_hash['jo_incoming_form'] = 'job-order/cmb.form.html.twig';
$this->template_hash['jo_open_edit_form'] = 'job-order/cmb.form.html.twig';
$this->template_hash['jo_incoming_vehicle_form'] = 'job-order/cmb.form.html.twig';
$this->template_hash['jo_processing_form'] = 'job-order/cmb.form.html.twig';
$this->template_hash['jo_assigning_form'] = 'job-order/cmb.form.html.twig';
$this->template_hash['jo_fulfillment_form'] = 'job-order/cmb.form.html.twig';
$this->template_hash['jo_open_hub_form'] = 'job-order/cmb.form.html.twig';
$this->template_hash['jo_open_rider_form'] = 'job-order/cmb.form.html.twig';
$this->template_hash['jo_all_form'] = 'job-order/cmb.form.html.twig';
$this->template_hash['jo_list_processing'] = 'job-order/list.processing.html.twig';
$this->template_hash['jo_list_assigning'] = 'job-order/list.assigning.html.twig';
$this->template_hash['jo_list_fulfillment'] = 'job-order/list.fulfillment.html.twig';

File diff suppressed because it is too large Load diff

View file

@ -52,9 +52,7 @@
<div class="m-form__section m-form__section--first">
<div class="form-group m-form__group row">
<div class="col-lg-6">
<label data-field="customer_vehicle">Select a vehicle:
<span style="color:red"> *</span>
</label>
<label data-field="customer_vehicle">Select a vehicle:</label>
<select class="form-control m-select2" id="customer-vehicle" name="customer_vehicle"></select>
<div class="form-control-feedback hide" data-field="customer_vehicle"></div>
</div>
@ -112,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">{% trans %}country_code_prefix{% endtrans %}</span>
<span class="input-group-addon">+63</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>
@ -120,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">{% trans %}country_code_prefix{% endtrans %}</span>
<span class="input-group-addon">+63</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>
@ -130,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">{% trans %}country_code_prefix{% endtrans %}</span>
<span class="input-group-addon">+63</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>
@ -138,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">{% trans %}country_code_prefix{% endtrans %}</span>
<span class="input-group-addon">+63</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>
@ -310,7 +308,7 @@
</div>
<br>
<div class="col-lg-12 form-group-inner">
<label data-field="delivery_instructions">{% trans %}delivery_instructions_label{% endtrans %}</label>
<label data-field="delivery_instructions">Delivery Instructions</label>
<textarea name="delivery_instructions" class="form-control m-input" rows="4">{{ obj.getDeliveryInstructions }}</textarea>
</div>
</div>
@ -357,9 +355,7 @@
</div>
<div class="form-group m-form__group row">
<div class="col-lg-6">
<label data-field="delivery_address">Delivery Address
<span style="color:red"> *</span>
</label>
<label data-field="delivery_address">Delivery Address</label>
<textarea name="delivery_address" class="form-control m-input" rows="4">{{ obj.getDeliveryAddress }}</textarea>
<div class="form-control-feedback hide" data-field="delivery_address"></div>
</div>
@ -371,9 +367,7 @@
</div>
<div class="form-group m-form__group row">
<div class="col-lg-12">
<label name="coordinates" data-field="coordinates">Coordinates
<span style="color:red"> *</span>
</label>
<label name="coordinates" data-field="coordinates">Coordinates</label>
<div class="form-control-feedback hide" data-field="coordinates"></div>
<input type="hidden" id="map_lat" name="coord_lat" value="">
<input type="hidden" id="map_lng" name="coord_lng" value="">
@ -498,7 +492,7 @@
<div class="col-lg-2">
<label for="invoice-trade-in-type">Trade In</label>
<select class="form-control m-input" id="invoice-trade-in-type">
<option value="">No</option>
<option value="">None</option>
{% for key, type in trade_in_types %}
<option value="{{ key }}">{{ type }}</option>
{% endfor %}
@ -900,33 +894,10 @@
{% block scripts %}
<!-- <script src="//maps.google.com/maps/api/js?key={{ gmaps_api_key }}" type="text/javascript"></script> -->
<script src="//maps.googleapis.com/maps/api/js?key={{ gmaps_api_key }}&libraries=places" type="text/javascript"></script>
<script src="//maps.googleapis.com/maps/api/js?key={{ gmaps_api_key }}" type="text/javascript"></script>
<script src="/assets/vendors/custom/gmaps/gmaps.js" type="text/javascript"></script>
<script>
// location search autocomplete
var input = document.getElementById('m_gmap_address');
var autocomplete = new google.maps.places.Autocomplete(input);
autocomplete.setComponentRestrictions({'country': ['{% trans %}default_region{% endtrans %}']});
autocomplete.addListener('place_changed', function() {
var place = autocomplete.getPlace();
if (!place.geometry) {
return;
}
var message = {
'action': 'map.search',
'params': {
'lat': place.geometry.location.lat(),
'lng': place.geometry.location.lng()
}
};
console.log(message);
});
$(function() {
var form_in_process = false;
@ -951,16 +922,15 @@ $(function() {
var map = new GMaps({
div: '#m_gmap',
lat: {% trans %}default_lat{% endtrans %},
lng: {% trans %}default_long{% endtrans %},
lat: 14.6091,
lng: 121.0223,
click: function(e) {
// handle click in map
selectPoint(map, e.latLng);
e.stop();
}
});
var handleAction = function() {
var handleAction = function() {
var text = $.trim($('#m_gmap_address').val());
GMaps.geocode({
address: text,
@ -1702,3 +1672,4 @@ $(function() {
});
</script>
{% endblock %}