style fixes based upon updated phpcs Drupal standard
[civicrm-core.git] / CRM / Activity / Form / Task / PickOption.php
index e524b566a9323f9cac57ce171b40e760fd8fffac..e81b27b8db6ded0e6c986097f9ddca3d96bda35e 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$
- *
  */
 
 /**
- * This class provides the functionality to email a group of contacts
+ * This class provides the functionality to email a group of contacts.
  */
 class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task {
 
@@ -62,14 +60,10 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task {
 
   /**
    * Build all the data structures needed to build the form.
-   *
-   * @return void
    */
   public function preProcess() {
-    /*
-     * initialize the task and row fields
-     */
 
+    // initialize the task and row fields.
     parent::preProcess();
     $session = CRM_Core_Session::singleton();
     $this->_userContext = $session->readUserContext();
@@ -80,9 +74,9 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task {
     //validations
     if (count($this->_activityHolderIds) > $this->_maxActivities) {
       CRM_Core_Session::setStatus(ts("The maximum number of Activities you can select to send an email is %1. You have selected %2. Please select fewer Activities from your search results and try again.", array(
-            1 => $this->_maxActivities,
-            2 => count($this->_activityHolderIds),
-          )), ts("Maximum Exceeded"), "error");
+        1 => $this->_maxActivities,
+        2 => count($this->_activityHolderIds),
+      )), ts("Maximum Exceeded"), "error");
       $validate = TRUE;
     }
     // then redirect
@@ -93,9 +87,6 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task {
 
   /**
    * Build the form object.
-   *
-   *
-   * @return void
    */
   public function buildQuickForm() {
     $this->addElement('checkbox', 'with_contact', ts('With Contact'));
@@ -107,9 +98,6 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task {
 
   /**
    * Add local and global form rules.
-   *
-   *
-   * @return void
    */
   public function addRules() {
     $this->addFormRule(array('CRM_Activity_Form_Task_PickOption', 'formRule'));
@@ -136,9 +124,6 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task {
 
   /**
    * Process the form after the input has been submitted and validated.
-   *
-   *
-   * @return void
    */
   public function postProcess() {
     // Clear any formRule errors from Email form in case they came back here via Cancel button
@@ -149,21 +134,21 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task {
     $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
     $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
     $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
-    //get assignee contacts
+    // Get assignee contacts.
     if (!empty($params['assigned_to'])) {
       foreach ($this->_activityHolderIds as $key => $id) {
         $ids = array_keys(CRM_Activity_BAO_ActivityContact::getNames($id, $assigneeID));
         $this->_contacts = array_merge($this->_contacts, $ids);
       }
     }
-    //get target contacts
+    // Get target contacts.
     if (!empty($params['with_contact'])) {
       foreach ($this->_activityHolderIds as $key => $id) {
         $ids = array_keys(CRM_Activity_BAO_ActivityContact::getNames($id, $targetID));
         $this->_contacts = array_merge($this->_contacts, $ids);
       }
     }
-    //get 'Added by' contacts
+    // Get 'Added by' contacts.
     if (!empty($params['created_by'])) {
       parent::setContactIDs();
       if (!empty($this->_contactIds)) {
@@ -172,12 +157,12 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task {
     }
     $this->_contacts = array_unique($this->_contacts);
 
-    //bounce to pick option if no contacts to send to
+    // Bounce to pick option if no contacts to send to.
     if (empty($this->_contacts)) {
       $urlParams = "_qf_PickOption_display=true&qfKey={$params['qfKey']}";
       $urlRedirect = CRM_Utils_System::url('civicrm/activity/search', $urlParams);
       CRM_Core_Error::statusBounce(
-        ts('It appears you have no contacts with emails from the selected recipients.'),
+        ts('It appears you have no contacts with email addresses from the selected recipients.'),
         $urlRedirect
       );
     }