Merge pull request #6538 from systopia/CRM-17047
[civicrm-core.git] / CRM / Contact / Form / Inline / IM.php
index 7bdc2790259ffc8b8f5a4acda9c54fe0f06399b1..db17a2876bc4dfb821b116b67737df929b49cd91 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.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
 class CRM_Contact_Form_Inline_IM extends CRM_Contact_Form_Inline {
 
   /**
-   * Ims of the contact that is been viewed
+   * Ims of the contact that is been viewed.
    */
   private $_ims = array();
 
   /**
-   * No of im blocks for inline edit
+   * No of im blocks for inline edit.
    */
   private $_blockCount = 6;
 
   /**
-   * Call preprocess
+   * Call preprocess.
    */
   public function preProcess() {
     parent::preProcess();
@@ -62,7 +62,7 @@ class CRM_Contact_Form_Inline_IM extends CRM_Contact_Form_Inline {
   }
 
   /**
-   * Build the form object elements for im object
+   * Build the form object elements for im object.
    *
    * @return void
    */
@@ -96,12 +96,14 @@ class CRM_Contact_Form_Inline_IM extends CRM_Contact_Form_Inline {
   }
 
   /**
-   * Global validation rules for the form
+   * Global validation rules for the form.
    *
-   * @param array $fields posted values of the form
-   * @param array $errors list of errors to be posted back to the form
+   * @param array $fields
+   *   Posted values of the form.
+   * @param array $errors
+   *   List of errors to be posted back to the form.
    *
-   * @return array $errors@static
+   * @return array
    */
   public static function formRule($fields, $errors) {
     $hasData = $hasPrimary = $errors = array();
@@ -114,7 +116,7 @@ class CRM_Contact_Form_Inline_IM extends CRM_Contact_Form_Inline {
           if (!empty($blockValues['is_primary'])) {
             $hasPrimary[] = $instance;
             if (!$primaryID && !empty($blockValues['im'])) {
-                $primaryID = $blockValues['im'];
+              $primaryID = $blockValues['im'];
             }
           }
         }
@@ -125,14 +127,14 @@ class CRM_Contact_Form_Inline_IM extends CRM_Contact_Form_Inline {
       }
 
       if (count($hasPrimary) > 1) {
-        $errors["im[".array_pop($hasPrimary)."][is_primary]"] = ts('Only one IM can be marked as primary.');
+        $errors["im[" . array_pop($hasPrimary) . "][is_primary]"] = ts('Only one IM can be marked as primary.');
       }
     }
     return $errors;
   }
 
   /**
-   * Set defaults for the form
+   * Set defaults for the form.
    *
    * @return array
    */
@@ -152,7 +154,7 @@ class CRM_Contact_Form_Inline_IM extends CRM_Contact_Form_Inline {
   }
 
   /**
-   * Process the form
+   * Process the form.
    *
    * @return void
    */
@@ -167,4 +169,5 @@ class CRM_Contact_Form_Inline_IM extends CRM_Contact_Form_Inline {
     $this->log();
     $this->response();
   }
+
 }