Made the model year field a dropdown. #434
This commit is contained in:
parent
3fcb3d31b5
commit
a448177a1c
3 changed files with 29 additions and 6 deletions
|
|
@ -1455,7 +1455,6 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
$params['obj'] = $new_jo;
|
||||
$params['mode'] = 'onestep';
|
||||
$params['jo_service_charges'] = [];
|
||||
$params['discounts'] = $this->generateDiscountOptions();
|
||||
$params['current_date'] = new DateTime();
|
||||
|
||||
$this->fillDropdownParameters($params);
|
||||
|
|
@ -1477,7 +1476,6 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
$params['mode'] = 'onestep-edit';
|
||||
$params['cvid'] = $obj->getCustomerVehicle()->getID();
|
||||
$params['vid'] = $obj->getCustomerVehicle()->getVehicle()->getID();
|
||||
$params['discounts'] = $this->generateDiscountOptions();
|
||||
$params['current_date'] = new DateTime();
|
||||
|
||||
// get service charges
|
||||
|
|
@ -1597,7 +1595,6 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
$params['mode'] = 'open_edit';
|
||||
$params['cvid'] = $jo->getCustomerVehicle()->getID();
|
||||
$params['vid'] = $jo->getCustomerVehicle()->getVehicle()->getID();
|
||||
$params['discounts'] = $this->generateDiscountOptions();
|
||||
|
||||
$this->fillDropdownParameters($params);
|
||||
$this->fillFormTags($params);
|
||||
|
|
@ -2798,7 +2795,6 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
$params['mode'] = 'walk-in-edit';
|
||||
$params['cvid'] = $obj->getCustomerVehicle()->getID();
|
||||
$params['vid'] = $obj->getCustomerVehicle()->getVehicle()->getID();
|
||||
$params['discounts'] = $this->generateDiscountOptions();
|
||||
$params['current_date'] = new DateTime();
|
||||
|
||||
$this->fillDropdownParameters($params);
|
||||
|
|
@ -2838,6 +2834,9 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
$params['facilitated_types'] = FacilitatedType::getCollection();
|
||||
$params['facilitated_hubs'] = $fac_hubs;
|
||||
$params['sources'] = CMBTransactionOrigin::getCollection();
|
||||
|
||||
$params['model_years'] = $this->generateYearOptions();
|
||||
$params['discounts'] = $this->generateDiscountOptions();
|
||||
}
|
||||
|
||||
protected function initFormTags(&$params)
|
||||
|
|
@ -3134,4 +3133,10 @@ class CMBJobOrderHandler implements JobOrderHandlerInterface
|
|||
$discount_start = 0;
|
||||
return range($discount_start, 60);
|
||||
}
|
||||
|
||||
protected function generateYearOptions()
|
||||
{
|
||||
$start_year = 1950;
|
||||
return range($start_year, date("Y"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,7 +178,16 @@
|
|||
</div>
|
||||
<div class="col-lg-3">
|
||||
<label data-field="cv_year">Model Year</label>
|
||||
<input type="text" name="cv_year" id="cv-year" class="form-control m-input cv_field" value="{{ obj.getCustomerVehicle ? obj.getCustomerVehicle.getModelYear }}" data-vehicle-field="1" disabled>
|
||||
<select name="cv_year" class="form-control m-input cv_field" id="cv-year" data-required="0" disabled>
|
||||
<option value="">Select a year</option>
|
||||
{% for year in model_years %}
|
||||
{% if obj.getCustomerVehicle %}
|
||||
<option value="{{ year }}"{{ obj.getCustomerVehicle.getModelYear == year ? ' selected' }}>{{ year }}</option>
|
||||
{% else %}
|
||||
<option value="{{ year }}">{{ year }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="form-control-feedback hide" data-field="cv_year"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -178,7 +178,16 @@
|
|||
</div>
|
||||
<div class="col-lg-3">
|
||||
<label data-field="cv_year">Model Year</label>
|
||||
<input type="text" name="cv_year" id="cv-year" class="form-control m-input cv_field" value="{{ obj.getCustomerVehicle ? obj.getCustomerVehicle.getModelYear }}" data-vehicle-field="1" disabled>
|
||||
<select name="cv_year" class="form-control m-input cv_field" id="cv-year" data-required="0" disabled>
|
||||
<option value="">Select a year</option>
|
||||
{% for year in model_years %}
|
||||
{% if obj.getCustomerVehicle %}
|
||||
<option value="{{ year }}"{{ obj.getCustomerVehicle.getModelYear == year ? ' selected' }}>{{ year }}</option>
|
||||
{% else %}
|
||||
<option value="{{ year }}">{{ year }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="form-control-feedback hide" data-field="cv_year"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue