Ian province abbreviation patch - issue 724
[civicrm-core.git] / CRM / Contact / Form / Inline / Website.php
index 72cf288ac80aee5cdfc9d927df194a70f23ba5a8..3f34c369e2eb48895d79d4faf42e88272459e80c 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  *
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
  */
 
 /**
- * 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);