first go at action menu changes
[civicrm-core.git] / CRM / Activity / Form / Task / PickProfile.php
index 7988fd673064eedd5465a72ba68e74bd44be80d4..b6d875af6ca2bc64330cd487f8d07bb5a6a9ffd1 100755 (executable)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | 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_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task {
 
   /**
-   * The title of the group
+   * The title of the group.
    *
    * @var string
    */
   protected $_title;
 
   /**
-   * Maximum Activities that should be allowed to update
-   *
+   * Maximum Activities that should be allowed to update.
    */
   protected $_maxActivities = 100;
 
   /**
-   * Variable to store redirect path
-   *
+   * Variable to store redirect path.
    */
   protected $_userContext;
 
   /**
-   * Build all the data structures needed to build the form
+   * Build all the data structures needed to build the form.
    *
    * @return void
    */
@@ -76,7 +74,10 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task {
     $validate = FALSE;
     //validations
     if (count($this->_activityHolderIds) > $this->_maxActivities) {
-      CRM_Core_Session::setStatus(ts("The maximum number of Activities you can select for Batch Update 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');
+      CRM_Core_Session::setStatus(ts("The maximum number of Activities you can select for Batch update 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');
       $validate = TRUE;
     }
 
@@ -87,7 +88,7 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task {
   }
 
   /**
-   * Build the form object
+   * Build the form object.
    *
    *
    * @return void
@@ -118,7 +119,7 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task {
     }
 
     if (empty($profiles)) {
-      CRM_Core_Session::setStatus(ts("You will need to create a Profile containing the %1 fields you want to edit before you can use Batch Update via Profile. Navigate to Administer > Customize Data and Screens > Profiles to configure a Profile. Consult the online Administrator documentation for more information.", array(1 => $types[0])), ts("No Profile Configured"), "alert");
+      CRM_Core_Session::setStatus(ts("You will need to create a Profile containing the %1 fields you want to edit before you can use Batch update activities via profile. Navigate to Administer > Customize Data and Screens > Profiles to configure a Profile. Consult the online Administrator documentation for more information.", array(1 => $types[0])), ts("No Profile Configured"), "alert");
       CRM_Utils_System::redirect($this->_userContext);
     }
     elseif ($notEditable) {
@@ -128,13 +129,14 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task {
 
     $ufGroupElement = $this->add('select', 'uf_group_id', ts('Select Profile'),
       array(
-        '' => ts('- select profile -')) + $profiles, TRUE
+        '' => ts('- select profile -'),
+      ) + $profiles, TRUE
     );
-    $this->addDefaultButtons(ts('Continue >>'));
+    $this->addDefaultButtons(ts('Continue'));
   }
 
   /**
-   * Add local and global form rules
+   * Add local and global form rules.
    *
    *
    * @return void
@@ -144,19 +146,20 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task {
   }
 
   /**
-   * Global validation rules for the form
+   * Global validation rules for the form.
    *
-   * @param array $fields posted values of the form
+   * @param array $fields
+   *   Posted values of the form.
    *
-   * @return array list of errors to be posted back to the form
-   * @static
+   * @return array
+   *   list of errors to be posted back to the form
    */
   public static function formRule($fields) {
     return TRUE;
   }
 
   /**
-   * Process the form after the input has been submitted and validated
+   * Process the form after the input has been submitted and validated.
    *
    *
    * @return void
@@ -169,4 +172,5 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task {
     // also reset the batch page so it gets new values from the db
     $this->controller->resetPage('Batch');
   }
+
 }