<?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();
}
/**
- * Build the form object elements for im object
+ * Build the form object elements for im object.
*
* @return void
- * @access public
*/
public function buildQuickForm() {
parent::buildQuickForm();
}
/**
- * 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
- * @access public
+ * @return array
*/
- static function formRule($fields, $errors) {
+ public static function formRule($fields, $errors) {
$hasData = $hasPrimary = $errors = array();
if (!empty($fields['im']) && is_array($fields['im'])) {
foreach ($fields['im'] as $instance => $blockValues) {
if (!empty($blockValues['is_primary'])) {
$hasPrimary[] = $instance;
if (!$primaryID && !empty($blockValues['im'])) {
- $primaryID = $blockValues['im'];
+ $primaryID = $blockValues['im'];
}
}
}
}
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
- * @access public
*/
public function setDefaultValues() {
$defaults = array();
}
/**
- * Process the form
+ * Process the form.
*
* @return void
- * @access public
*/
public function postProcess() {
$params = $this->exportValues();
$this->log();
$this->response();
}
+
}