From 1d4777567a332b5fed94a42b1137044a2b925b57 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Sat, 3 May 2014 16:20:11 +0530 Subject: [PATCH] -- added code to set default website type during add new contact mode, CRM-9288 ---------------------------------------- * CRM-9288: Website type improvements: allow multiple websites in Profiles, respect default type and update type options https://issues.civicrm.org/jira/browse/CRM-9288 --- CRM/Contact/Form/Contact.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 11fa202aca..2445ba7299 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -476,6 +476,9 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { $defIMProviderId = key(CRM_Core_OptionGroup::values('instant_messenger_service', FALSE, FALSE, FALSE, ' AND is_default = 1' )); + $defWebsiteTypeId = key(CRM_Core_OptionGroup::values('website_type', + FALSE, FALSE, FALSE, ' AND is_default = 1' + )); $allBlocks = $this->_blocks; if (array_key_exists('Address', $this->_editOptions)) { @@ -532,6 +535,10 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { if ($name == 'phone' && $defPhoneTypeId) { $defaults[$name][$instance]['phone_type_id'] = $defPhoneTypeId; } + //set default website type. + if ($name == 'website' && $defWebsiteTypeId) { + $defaults[$name][$instance]['website_type_id'] = $defWebsiteTypeId; + } //set default im provider. if ($name == 'im' && $defIMProviderId) { -- 2.25.1