}
$stateCountryMap = array();
- $location_type_id = null;
+ $locationTypeId = null;
foreach ($profileFields as $name => $field) {
if (in_array($field['field_type'], $fieldTypes)) {
list($prefixName, $index) = CRM_Utils_System::explode('-', $name, 2);
$stateCountryMap[$index][$prefixName] = 'onbehalf[' . $name . ']';
if (count($form->_submitValues)) {
- $location_type_id = $field['location_type_id'];
- if(!empty($form->_submitValues['onbehalf']["country-{$location_type_id}"]) &&
+ $locationTypeId = $field['location_type_id'];
+ if (!empty($form->_submitValues['onbehalf']["country-{$locationTypeId}"]) &&
$prefixName == "state_province") {
- $field['is_required'] = CRM_Core_Payment_Form::checkRequiredStateProvince($form, "country-{$location_type_id}", TRUE);
+ $field['is_required'] = CRM_Core_Payment_Form::checkRequiredStateProvince($form, "country-{$locationTypeId}", TRUE);
}
}
}
}
else {
if (count($this->_submitValues)) {
- $location_type_id = $field['location_type_id'];
- if (array_key_exists("country-{$location_type_id}", $fields) &&
- array_key_exists("state_province-{$location_type_id}", $fields) &&
- !empty($this->_submitValues["country-{$location_type_id}"])) {
+ $locationTypeId = $field['location_type_id'];
+ if (array_key_exists("country-{$locationTypeId}", $fields) &&
+ array_key_exists("state_province-{$locationTypeId}", $fields) &&
+ !empty($this->_submitValues["country-{$locationTypeId}"])) {
$field['is_required'] =
- CRM_Core_Payment_Form::checkRequiredStateProvince($this, "country-{$location_type_id}");
+ CRM_Core_Payment_Form::checkRequiredStateProvince($this, "country-{$locationTypeId}");
}
}
}
}
if (count($this->_submitValues)) {
- $location_type_id = null;
+ $locationTypeId = null;
foreach ($this->_fields as $field) {
if (!empty($field['location_type_id'])) {
- $location_type_id = $field['location_type_id'];
+ $locationTypeId = $field['location_type_id'];
}
- if (array_key_exists("country-{$location_type_id}", $this->_fields) &&
- array_key_exists("state_province-{$location_type_id}", $this->_fields) &&
- !empty($this->_submitValues["country-{$location_type_id}"])) {
- $this->_fields["state_province-{$location_type_id}"]['is_required'] =
- CRM_Core_Payment_Form::checkRequiredStateProvince($this, "country-{$location_type_id}");
+ if (array_key_exists("country-{$locationTypeId}", $this->_fields) &&
+ array_key_exists("state_province-{$locationTypeId}", $this->_fields) &&
+ !empty($this->_submitValues["country-{$locationTypeId}"])) {
+ $this->_fields["state_province-{$locationTypeId}"]['is_required'] =
+ CRM_Core_Payment_Form::checkRequiredStateProvince($this, "country-{$locationTypeId}");
}
}
}