Update copyright date for 2020
[civicrm-core.git] / CRM / Contact / Form / Task / PickProfile.php
index 46a5d67a6c99092765246ee00eb391e56d6393f0..5f0af37bcb302c8a66501fca591731124b62ca49 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.7                                                |
+ | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017                                |
+ | Copyright CiviCRM LLC (c) 2004-2020                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2017
+ * @copyright CiviCRM LLC (c) 2004-2020
  */
 
 /**
@@ -45,16 +45,19 @@ class CRM_Contact_Form_Task_PickProfile extends CRM_Contact_Form_Task {
 
   /**
    * Maximum contacts that should be allowed to update
+   * @var int
    */
   protected $_maxContacts = 100;
 
   /**
    * Maximum profile fields that will be displayed
+   * @var int
    */
   protected $_maxFields = 9;
 
   /**
    * Variable to store redirect path
+   * @var string
    */
   protected $_userContext;
 
@@ -71,10 +74,10 @@ class CRM_Contact_Form_Task_PickProfile extends CRM_Contact_Form_Task {
     $validate = FALSE;
     //validations
     if (count($this->_contactIds) > $this->_maxContacts) {
-      CRM_Core_Session::setStatus(ts("The maximum number of contacts you can select for Update multiple contacts is %1. You have selected %2. Please select fewer contacts from your search results and try again.", array(
-            1 => $this->_maxContacts,
-            2 => count($this->_contactIds),
-          )), ts('Maximum Exceeded'), 'error');
+      CRM_Core_Session::setStatus(ts("The maximum number of contacts you can select for Update multiple contacts is %1. You have selected %2. Please select fewer contacts from your search results and try again.", [
+        1 => $this->_maxContacts,
+        2 => count($this->_contactIds),
+      ]), ts('Maximum Exceeded'), 'error');
       $validate = TRUE;
     }
 
@@ -106,10 +109,10 @@ class CRM_Contact_Form_Task_PickProfile extends CRM_Contact_Form_Task {
 
     if (empty($profiles)) {
       $types = implode(' ' . ts('or') . ' ', $this->_contactTypes);
-      CRM_Core_Session::setStatus(ts("The contact type selected for Update multiple contacts does not have a corresponding profile. Please set up a profile for %1s and try again.", array(1 => $types)), ts('No Profile Available'), 'error');
+      CRM_Core_Session::setStatus(ts("The contact type selected for Update multiple contacts does not have a corresponding profile. Please set up a profile for %1s and try again.", [1 => $types]), ts('No Profile Available'), 'error');
       CRM_Utils_System::redirect($this->_userContext);
     }
-    $ufGroupElement = $this->add('select', 'uf_group_id', ts('Select Profile'), array('' => ts('- select profile -')) + $profiles, TRUE, array('class' => 'crm-select2 huge'));
+    $ufGroupElement = $this->add('select', 'uf_group_id', ts('Select Profile'), ['' => ts('- select profile -')] + $profiles, TRUE, ['class' => 'crm-select2 huge']);
 
     $this->addDefaultButtons(ts('Continue'));
   }
@@ -118,7 +121,7 @@ class CRM_Contact_Form_Task_PickProfile extends CRM_Contact_Form_Task {
    * Add local and global form rules.
    */
   public function addRules() {
-    $this->addFormRule(array('CRM_Contact_Form_Task_PickProfile', 'formRule'));
+    $this->addFormRule(['CRM_Contact_Form_Task_PickProfile', 'formRule']);
   }
 
   /**