protected $_currentUserID = NULL;
protected $_session = NULL;
- public $_stateCountryMap = array();
/**
* pre processing work done here.
*
} elseif (!empty($this->_multiRecordFields)
&& (!$this->_multiRecord || !in_array($this->_multiRecord, array(CRM_Core_Action::DELETE, CRM_Core_Action::UPDATE)) )) {
- CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js');
+ CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'js/crm.livePage.js', 1, 'html-header');
//multirecord listing page
$multiRecordFieldListing = TRUE;
$page = new CRM_Profile_Page_MultipleRecordFieldsListing();
return FALSE;
}
- if (count($this->_submitValues)) {
- $locationTypeId = null;
- foreach ($this->_fields as $field) {
- if (!empty($field['location_type_id'])) {
- $locationTypeId = $field['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}");
- }
- }
- }
-
$this->assign('id', $this->_id);
$this->assign('mode', $this->_mode);
$this->assign('action', $this->_action);
$addCaptcha = array();
$emailPresent = FALSE;
- // cache the state country fields. based on the results, we could use our javascript solution
- // in create or register mode
- $stateCountryMap = array();
-
// add the form elements
foreach ($this->_fields as $name => $field) {
// make sure that there is enough permission to expose this field
}
list($prefixName, $index) = CRM_Utils_System::explode('-', $name, 2);
- if ($prefixName == 'state_province' || $prefixName == 'country' || $prefixName == 'county') {
- if (!array_key_exists($index, $stateCountryMap)) {
- $stateCountryMap[$index] = array();
- }
- $stateCountryMap[$index][$prefixName] = $name;
- }
CRM_Core_BAO_UFGroup::buildProfile($this, $field, $this->_mode);
}
}
- // lets do the defaults, so we can use it for the below state country routines
+ //let's do set defaults for the profile
$this->setDefaultsValues();
- // also do state country js
- CRM_Core_BAO_Address::addStateCountryMap($stateCountryMap, $this->_defaults);
-
$action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, NULL);
if ($this->_mode == self::MODE_CREATE) {
CRM_Core_BAO_CMSUser::buildForm($this, $this->_gid, $emailPresent, $action);
$this->assign('groupId', $this->_gid);
- // now fix all state country selectors
- CRM_Core_BAO_Address::fixAllStateSelects($this, $this->_defaults);
-
// if view mode pls freeze it with the done button.
if ($this->_action & CRM_Core_Action::VIEW) {
$this->freeze();