$locationId = $processor->getLocationTypeID($i);
$phoneType = $processor->getPhoneTypeID($i);
$imProvider = $processor->getIMProviderID($i);
- $typeId = $processor->getPhoneOrIMTypeID($i);
- if ($websiteTypeId) {
- $defaults["mapper[$i]"] = [$relation, $contactDetails, $websiteTypeId];
- }
- else {
-
- $defaults["mapper[$i]"] = [$relation, $contactDetails, $locationId, $typeId];
+ $defaults["mapper[$i]"] = $processor->getSavedQuickformDefaultsForColumn($i);
+ if (!$websiteTypeId) {
if (!$locationId) {
$js .= "{$formName}['mapper[$i][2]'].style.display = 'none';\n";
}
* @throws \CiviCRM_API3_Exception
*/
public function getSavedQuickformDefaultsForColumn($column) {
+ if ($this->getValidRelationshipKey($column)) {
+ if ($this->getWebsiteTypeID($column)) {
+ return [$this->getValidRelationshipKey($column), $this->getFieldName($column), $this->getWebsiteTypeID($column)];
+ }
+ return [$this->getValidRelationshipKey($column), $this->getFieldName($column), $this->getLocationTypeID($column), $this->getPhoneOrIMTypeID($column)];
+ }
if ($this->getWebsiteTypeID($column)) {
return [$this->getFieldName($column), $this->getWebsiteTypeID($column)];
}