<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
/**
/**
* Build all the data structures needed to build the form.
- *
- * @return void
*/
public function preProcess() {
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add');
}
/**
- * Set default values for the form. Note that in edit/view mode
- * the default values are retrieved from the database
- *
+ * Set default values for the form.
*
- * @return void
+ * Note that in edit/view mode the default values are retrieved from the database
*/
public function setDefaultValues() {
$defaults = $this->_values;
- $params = array();
if ($this->_action & CRM_Core_Action::ADD) {
if (array_key_exists('TagsAndGroups', $this->_editOptions)) {
}
/**
- * Do the set default related to location type id,
- * primary location, default country
+ * Do the set default related to location type id, primary location, default country.
+ *
+ * @param array $defaults
*/
public function blockSetDefaults(&$defaults) {
$locationTypeKeys = array_filter(array_keys(CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id')), 'is_int');
* add the rules (mainly global rules) for form.
* All local rules are added near the element
*
- * @return void
* @see valid_date
*/
public function addRules() {
/**
* Build the form object.
- *
- * @return void
*/
public function buildQuickForm() {
//load form for child blocks
/**
* Form submission of new/edit contact is processed.
- *
- *
- * @return void
*/
public function postProcess() {
// check if dedupe button, if so return.
$parseStatusMsg = self::parseAddressStatusMsg($parseResult);
}
+ $blocks = array('email', 'phone', 'im', 'openid', 'address', 'website');
+ foreach ($blocks as $block) {
+ if (!empty($this->_preEditValues[$block]) && is_array($this->_preEditValues[$block])) {
+ foreach ($this->_preEditValues[$block] as $count => $value) {
+ if (!empty($value['id'])) {
+ $params[$block][$count]['id'] = $value['id'];
+ $params[$block]['isIdSet'] = TRUE;
+ }
+ }
+ }
+ }
+
// Allow un-setting of location info, CRM-5969
$params['updateBlankLocInfo'] = TRUE;