Ian province abbreviation patch - issue 724
[civicrm-core.git] / CRM / Contact / Form / Inline / Website.php
index 554ba66f2c1da124305a0dd3b4599474cbacbd5d..3f34c369e2eb48895d79d4faf42e88272459e80c 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
- * $Id$
- *
+ * @copyright CiviCRM LLC (c) 2004-2015
  */
 
 /**
- * form helper class for an Website object
+ * Form helper class for an Website object,
  */
 class CRM_Contact_Form_Inline_Website extends CRM_Contact_Form_Inline {
 
@@ -62,8 +60,6 @@ class CRM_Contact_Form_Inline_Website extends CRM_Contact_Form_Inline {
 
   /**
    * Build the form object elements for website object.
-   *
-   * @return void
    */
   public function buildQuickForm() {
     parent::buildQuickForm();
@@ -116,12 +112,15 @@ class CRM_Contact_Form_Inline_Website extends CRM_Contact_Form_Inline {
 
   /**
    * Process the form.
-   *
-   * @return void
    */
   public function postProcess() {
     $params = $this->exportValues();
 
+    foreach ($this->_websites as $count => $value) {
+      if (!empty($value['id']) && isset($params['website'][$count])) {
+        $params['website'][$count]['id'] = $value['id'];
+      }
+    }
     // Process / save websites
     CRM_Core_BAO_Website::create($params['website'], $this->_contactId, TRUE);