From: Pradeep Nayak Date: Sat, 3 May 2014 10:50:11 +0000 (+0530) Subject: -- added code to set default website type during add new contact mode, CRM-9288 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1d4777567a332b5fed94a42b1137044a2b925b57;p=civicrm-core.git -- 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 --- 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) {