(NFC) Update CRM/Friend CRM/Grant CRM/Group CRM/Mailing to be up to date to a future...
authorSeamus Lee <seamuslee001@gmail.com>
Wed, 10 Apr 2019 00:25:23 +0000 (10:25 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Wed, 10 Apr 2019 19:59:38 +0000 (05:59 +1000)
46 files changed:
CRM/Friend/Form.php
CRM/Grant/BAO/Query.php
CRM/Grant/Form/Grant.php
CRM/Grant/Form/GrantView.php
CRM/Grant/Form/Search.php
CRM/Grant/Form/Task.php
CRM/Grant/Form/Task/Print.php
CRM/Grant/Form/Task/Result.php
CRM/Grant/Form/Task/SearchTaskHookSample.php
CRM/Grant/Info.php
CRM/Grant/Page/Tab.php
CRM/Grant/Selector/Search.php
CRM/Grant/Task.php
CRM/Group/Form/Edit.php
CRM/Group/Page/AJAX.php
CRM/Mailing/BAO/BouncePattern.php
CRM/Mailing/BAO/Mailing.php
CRM/Mailing/BAO/MailingAB.php
CRM/Mailing/BAO/MailingJob.php
CRM/Mailing/BAO/Query.php
CRM/Mailing/BAO/Spool.php
CRM/Mailing/Config.php
CRM/Mailing/Event/BAO/Subscribe.php
CRM/Mailing/Form/Browse.php
CRM/Mailing/Form/Component.php
CRM/Mailing/Form/ForwardMailing.php
CRM/Mailing/Form/Search.php
CRM/Mailing/Form/Subscribe.php
CRM/Mailing/Form/Task.php
CRM/Mailing/Form/Task/Print.php
CRM/Mailing/Info.php
CRM/Mailing/MailStore.php
CRM/Mailing/MailStore/Localdir.php
CRM/Mailing/MailStore/Maildir.php
CRM/Mailing/MailStore/Mbox.php
CRM/Mailing/MailStore/Pop3.php
CRM/Mailing/Page/Component.php
CRM/Mailing/Page/Confirm.php
CRM/Mailing/Page/Optout.php
CRM/Mailing/Page/Resubscribe.php
CRM/Mailing/Page/Tab.php
CRM/Mailing/PseudoConstant.php
CRM/Mailing/Selector/Browse.php
CRM/Mailing/Selector/Event.php
CRM/Mailing/Selector/Search.php
CRM/Mailing/Task.php

index d8d7263b61263a40598e1c8598506c8b3262690f..70cd21086dc5109a098aaee6f2fedca8f44f01ff 100644 (file)
@@ -219,18 +219,17 @@ class CRM_Friend_Form extends CRM_Core_Form {
     }
 
     $this->addButtons([
-        [
-          'type' => 'submit',
-          'name' => ts('Send Your Message'),
-          'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => 'submit',
+        'name' => ts('Send Your Message'),
+        'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ],
+    ]);
 
     $this->addFormRule(['CRM_Friend_Form', 'formRule']);
   }
index eae47c5b47ed5aed8d1c2991e2cb13e68e65e9d2..7e2f9d48fa05f88f41d1574300c1e45e5b7c190b 100644 (file)
@@ -33,6 +33,7 @@
  *
  */
 class CRM_Grant_BAO_Query extends CRM_Core_BAO_Query {
+
   /**
    * @return array
    */
index 980366983746c7b9b411c5760d8ecab055910c30..36d7afa24fe8cc6b5e3cee3106d823a7fddad431 100644 (file)
@@ -155,18 +155,17 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form {
 
     if ($this->_action & CRM_Core_Action::DELETE) {
       $this->addButtons([
-          [
-            'type' => 'next',
-            'name' => ts('Delete'),
-            'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-            'isDefault' => TRUE,
-          ],
-          [
-            'type' => 'cancel',
-            'name' => ts('Cancel'),
-          ],
-        ]
-      );
+        [
+          'type' => 'next',
+          'name' => ts('Delete'),
+          'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+          'isDefault' => TRUE,
+        ],
+        [
+          'type' => 'cancel',
+          'name' => ts('Cancel'),
+        ],
+      ]);
       return;
     }
 
@@ -208,23 +207,22 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form {
     // make this form an upload since we dont know if the custom data injected dynamically
     // is of type file etc $uploadNames = $this->get( 'uploadNames' );
     $this->addButtons([
-        [
-          'type' => 'upload',
-          'name' => ts('Save'),
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'upload',
-          'name' => ts('Save and New'),
-          'js' => ['onclick' => "return verify( );"],
-          'subName' => 'new',
-        ],
-        [
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => 'upload',
+        'name' => ts('Save'),
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'upload',
+        'name' => ts('Save and New'),
+        'js' => ['onclick' => "return verify( );"],
+        'subName' => 'new',
+      ],
+      [
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ],
+    ]);
 
     if ($this->_context == 'standalone') {
       $this->addEntityRef('contact_id', ts('Applicant'), ['create' => TRUE], TRUE);
index 8dbd187efba1e0c63e8d5fa2b32b56d23c9daadd..1f55a08c89e04a4b47f917d276c93db2c5e56e62 100644 (file)
@@ -132,14 +132,13 @@ class CRM_Grant_Form_GrantView extends CRM_Core_Form {
    */
   public function buildQuickForm() {
     $this->addButtons([
-        [
-          'type' => 'cancel',
-          'name' => ts('Done'),
-          'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
-          'isDefault' => TRUE,
-        ],
-      ]
-    );
+      [
+        'type' => 'cancel',
+        'name' => ts('Done'),
+        'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
+        'isDefault' => TRUE,
+      ],
+    ]);
   }
 
 }
index 5981f0d2134f380c3db1d8b7593117d5be5815be..9cb7c8e397cc9cc5a375a0714c28aef3dc23f2c4 100644 (file)
@@ -59,6 +59,7 @@ class CRM_Grant_Form_Search extends CRM_Core_Form_Search {
 
   /**
    * Prefix for the controller.
+   * @var string
    */
   protected $_prefix = "grant_";
 
index da5458e849186b54ce859e5cad3d86eb99d5bb1e..e868f4d646651dc8e518d7952860b60010c73deb 100644 (file)
@@ -138,17 +138,16 @@ class CRM_Grant_Form_Task extends CRM_Core_Form_Task {
    */
   public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) {
     $this->addButtons([
-        [
-          'type' => $nextType,
-          'name' => $title,
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => $backType,
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => $nextType,
+        'name' => $title,
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => $backType,
+        'name' => ts('Cancel'),
+      ],
+    ]);
   }
 
 }
index 34d3f2b2413a41a36c10082545194b2aab7de754..9f962f1294895bb63c669800279680ea5a93f73f 100644 (file)
@@ -78,18 +78,17 @@ class CRM_Grant_Form_Task_Print extends CRM_Grant_Form_Task {
     // just need to add a javacript to popup the window for printing
     //
     $this->addButtons([
-        [
-          'type' => 'next',
-          'name' => ts('Print Grant List'),
-          'js' => ['onclick' => 'window.print()'],
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'back',
-          'name' => ts('Done'),
-        ],
-      ]
-    );
+      [
+        'type' => 'next',
+        'name' => ts('Print Grant List'),
+        'js' => ['onclick' => 'window.print()'],
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'back',
+        'name' => ts('Done'),
+      ],
+    ]);
   }
 
   /**
index 5c9f719c100d63492c6a385fa2cb809b0c69bbeb..eb6086e47b00e4666d159e9d79d2e5bd23c042e1 100644 (file)
@@ -71,13 +71,12 @@ class CRM_Grant_Form_Task_Result extends CRM_Grant_Form_Task {
    */
   public function buildQuickForm() {
     $this->addButtons([
-        [
-          'type' => 'done',
-          'name' => ts('Done'),
-          'isDefault' => TRUE,
-        ],
-      ]
-    );
+      [
+        'type' => 'done',
+        'name' => ts('Done'),
+        'isDefault' => TRUE,
+      ],
+    ]);
   }
 
 }
index 8d448b841234283d9c7bea5be5a404c29cae430d..a09dfa62132af68db4b0a2a00827ed5e85987305 100644 (file)
@@ -79,13 +79,12 @@ INNER JOIN civicrm_contact ct ON ( grt.contact_id = ct.id )
    */
   public function buildQuickForm() {
     $this->addButtons([
-        [
-          'type' => 'done',
-          'name' => ts('Done'),
-          'isDefault' => TRUE,
-        ],
-      ]
-    );
+      [
+        'type' => 'done',
+        'name' => ts('Done'),
+        'isDefault' => TRUE,
+      ],
+    ]);
   }
 
 }
index b947cbd5c7b8eef34ca80b3a81b8243765a6739a..7ae2788d91073c265a50346d4f64b7ae59510649 100644 (file)
@@ -38,6 +38,7 @@
 class CRM_Grant_Info extends CRM_Core_Component_Info {
 
   /**
+   * @var string
    * @inheritDoc
    */
   protected $keyword = 'grant';
@@ -57,7 +58,6 @@ class CRM_Grant_Info extends CRM_Core_Component_Info {
     ];
   }
 
-
   /**
    * @inheritDoc
    * @param bool $getAllUnconditionally
index 7e86083c377904516d3771ddf49b8ad35dfb8a53..914879716cd62a8b9a3b6a35940663d573e96d19 100644 (file)
@@ -44,7 +44,7 @@ class CRM_Grant_Page_Tab extends CRM_Contact_Page_View {
    *
    * @var array
    */
-  static $_links = NULL;
+  public static $_links = NULL;
   public $_permission = NULL;
   public $_contactId = NULL;
 
index 561261cd0959cd69b265ea0fb77dcd3c33257989..19ff51cd4fa6bcbc4c22495b8206079ded7ddca9 100644 (file)
@@ -46,20 +46,20 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co
    *
    * @var array
    */
-  static $_links = NULL;
+  public static $_links = NULL;
 
   /**
    * We use desc to remind us what that column is, name is used in the tpl
    *
    * @var array
    */
-  static $_columnHeaders;
+  public static $_columnHeaders;
 
   /**
    * Properties of contact we're interested in displaying
    * @var array
    */
-  static $_properties = [
+  public static $_properties = [
     'contact_id',
     'contact_type',
     'sort_name',
index e9a14e59c8323911782556384c73353c88b7f793..467853f627a62aa5b72203a7c2b922f4ab3cad2f 100644 (file)
  */
 class CRM_Grant_Task extends CRM_Core_Task {
 
-  const
-    // Grant Tasks
-    UPDATE_GRANTS = 701;
+  /**
+   * Grant Tasks
+   */
+  const UPDATE_GRANTS = 701;
 
-  static $objectType = 'grant';
+  /**
+   * @var string
+   */
+  public static $objectType = 'grant';
 
   /**
    * These tasks are the core set of tasks that the user can perform
index a745b401e16edffc93a2ed21d726ca808fa88afd..789689886fd8d2543d080254f98fede1429f88a0 100644 (file)
@@ -215,17 +215,16 @@ class CRM_Group_Form_Edit extends CRM_Core_Form {
   public function buildQuickForm() {
     if ($this->_action == CRM_Core_Action::DELETE) {
       $this->addButtons(array(
-          array(
-            'type' => 'next',
-            'name' => ts('Delete Group'),
-            'isDefault' => TRUE,
-          ),
-          array(
-            'type' => 'cancel',
-            'name' => ts('Cancel'),
-          ),
-        )
-      );
+        array(
+          'type' => 'next',
+          'name' => ts('Delete Group'),
+          'isDefault' => TRUE,
+        ),
+        array(
+          'type' => 'cancel',
+          'name' => ts('Cancel'),
+        ),
+      ));
       return;
     }
 
@@ -274,17 +273,16 @@ class CRM_Group_Form_Edit extends CRM_Core_Form {
     CRM_Custom_Form_CustomData::buildQuickForm($this);
 
     $this->addButtons(array(
-        array(
-          'type' => 'upload',
-          'name' => ($this->_action == CRM_Core_Action::ADD) ? ts('Continue') : ts('Save'),
-          'isDefault' => TRUE,
-        ),
-        array(
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ),
-      )
-    );
+      array(
+        'type' => 'upload',
+        'name' => ($this->_action == CRM_Core_Action::ADD) ? ts('Continue') : ts('Save'),
+        'isDefault' => TRUE,
+      ),
+      array(
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ),
+    ));
 
     $doParentCheck = FALSE;
     if (CRM_Core_Permission::isMultisiteEnabled()) {
index f1bf656f619d670786c7a127162b9cb985e7435f..5ccad88a887fbaa5d51ac28c6ed363e51133278e 100644 (file)
@@ -36,6 +36,7 @@
  * This class contains the functions that are called using AJAX (jQuery)
  */
 class CRM_Group_Page_AJAX {
+
   /**
    * Get list of groups.
    */
index 5a255b5c11f248f9744bbccf03f923959bc0d397..d3bc49fd6facf11eab2ba7ef6f5de886bb1d6b54 100644 (file)
@@ -34,8 +34,9 @@ class CRM_Mailing_BAO_BouncePattern extends CRM_Mailing_DAO_BouncePattern {
 
   /**
    * Pseudo-constant pattern array.
+   * @var array
    */
-  static $_patterns = NULL;
+  public static $_patterns = NULL;
 
   /**
    * Class constructor.
index a6e37494c442785611d3d54b703ff801b645a70b..7177149ea478aafe5808f15722bd8646ae3e7bb9 100644 (file)
@@ -41,6 +41,7 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing {
    * An array that holds the complete templates
    * including any headers or footers that need to be prepended
    * or appended to the body.
+   * @var array
    */
   private $preparedTemplates = NULL;
 
@@ -48,41 +49,49 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing {
    * An array that holds the complete templates
    * including any headers or footers that need to be prepended
    * or appended to the body.
+   * @var array
    */
   private $templates = NULL;
 
   /**
    * An array that holds the tokens that are specifically found in our text and html bodies.
+   * @var array
    */
   private $tokens = NULL;
 
   /**
    * An array that holds the tokens that are specifically found in our text and html bodies.
+   * @var array
    */
   private $flattenedTokens = NULL;
 
   /**
    * The header associated with this mailing.
+   * @var string
    */
   private $header = NULL;
 
   /**
    * The footer associated with this mailing.
+   * @var string
    */
   private $footer = NULL;
 
   /**
    * The HTML content of the message.
+   * @var string
    */
   private $html = NULL;
 
   /**
    * The text content of the message.
+   * @var string
    */
   private $text = NULL;
 
   /**
    * Cached BAO for the domain.
+   * @var int
    */
   private $_domain = NULL;
 
@@ -607,10 +616,10 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing {
       $this->preparedTemplates = [];
 
       foreach ([
-                 'html',
-                 'text',
-                 'subject',
-               ] as $key) {
+        'html',
+        'text',
+        'subject',
+      ] as $key) {
         if (!isset($templates[$key])) {
           continue;
         }
@@ -809,14 +818,13 @@ class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing {
   public function getTestRecipients($testParams) {
     if (!empty($testParams['test_group']) && array_key_exists($testParams['test_group'], CRM_Core_PseudoConstant::group())) {
       $contacts = civicrm_api('contact', 'get', [
-          'version' => 3,
-          'group' => $testParams['test_group'],
-          'return' => 'id',
-          'options' => [
-            'limit' => 100000000000,
-          ],
-        ]
-      );
+        'version' => 3,
+        'group' => $testParams['test_group'],
+        'return' => 'id',
+        'options' => [
+          'limit' => 100000000000,
+        ],
+      ]);
 
       foreach (array_keys($contacts['values']) as $groupContact) {
         $query = "
@@ -1742,7 +1750,7 @@ ORDER BY   civicrm_email.is_bulkmail DESC
    *   'include' or 'exclude'.
    * @param string $entity
    *   'groups' or 'mailings'.
-   * @param array <int> $entityIds
+   * @param array $entityIds
    * @throws CiviCRM_API3_Exception
    */
   public static function replaceGroups($mailingId, $type, $entity, $entityIds) {
@@ -2176,7 +2184,8 @@ ORDER BY   civicrm_email.is_bulkmail DESC
           break;
 
         case 'opened':
-          $reportFilter .= "&distinct=0"; // do not use group by clause in report, because same report used for total and unique open
+          // do not use group by clause in report, because same report used for total and unique open
+          $reportFilter .= "&distinct=0";
         case 'opened_unique':
           $url = "mailing/opened";
           $searchFilter .= "&mailing_open_status=Y";
@@ -2957,7 +2966,7 @@ ORDER BY civicrm_mailing.name";
    *   Array of mailings for a contact
    *
    */
-  static public function getContactMailings(&$params) {
+  public static function getContactMailings(&$params) {
     $params['version'] = 3;
     $params['offset'] = ($params['page'] - 1) * $params['rp'];
     $params['limit'] = $params['rp'];
@@ -2976,7 +2985,7 @@ ORDER BY civicrm_mailing.name";
    *   count of mailings for a contact
    *
    */
-  static public function getContactMailingsCount(&$params) {
+  public static function getContactMailingsCount(&$params) {
     $params['version'] = 3;
     return civicrm_api('MailingContact', 'getcount', $params);
   }
@@ -2994,17 +3003,18 @@ ORDER BY civicrm_mailing.name";
     foreach ($fieldNames as $fieldName) {
       if ($fieldName == 'id') {
         $fieldPerms[$fieldName] = [
+          // OR
           [
             'access CiviMail',
             'schedule mailings',
             'approve mailings',
-            'create mailings',
-          ], // OR
+          ],
         ];
       }
       elseif (in_array($fieldName, ['scheduled_date', 'scheduled_id'])) {
         $fieldPerms[$fieldName] = [
-          ['access CiviMail', 'schedule mailings'], // OR
+          // OR
+          ['access CiviMail', 'schedule mailings'],
         ];
       }
       elseif (in_array($fieldName, [
@@ -3014,12 +3024,14 @@ ORDER BY civicrm_mailing.name";
         'approval_note',
       ])) {
         $fieldPerms[$fieldName] = [
-          ['access CiviMail', 'approve mailings'], // OR
+          // OR
+          ['access CiviMail', 'approve mailings'],
         ];
       }
       else {
         $fieldPerms[$fieldName] = [
-          ['access CiviMail', 'create mailings'], // OR
+          // OR
+          ['access CiviMail', 'create mailings'],
         ];
       }
     }
@@ -3048,9 +3060,9 @@ ORDER BY civicrm_mailing.name";
    */
   public static function getPublicViewUrl($id, $absolute = TRUE) {
     if ((civicrm_api3('Mailing', 'getvalue', [
-        'id' => $id,
-        'return' => 'visibility',
-      ])) === 'Public Pages') {
+      'id' => $id,
+      'return' => 'visibility',
+    ])) === 'Public Pages') {
       return CRM_Utils_System::url('civicrm/mailing/view', ['id' => $id], $absolute, NULL, TRUE, TRUE);
     }
   }
index e2ff2fbdbbc58d3e2c0b0de3a1f8543fb544e489..2ff81ed5e92cdb480702d02d32d0caad3441cde2 100644 (file)
@@ -109,7 +109,6 @@ class CRM_Mailing_BAO_MailingAB extends CRM_Mailing_DAO_MailingAB {
     return $result;
   }
 
-
   /**
    * Delete MailingAB and all its associated records.
    *
index c74785568e567a8e37d0741e0e477fcfb20594e9..8f3dff95e2d4caaea06459272b753192ef046f65 100644 (file)
@@ -45,7 +45,7 @@ class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob {
    *
    * @var int
    */
-  static $mailsProcessed = 0;
+  public static $mailsProcessed = 0;
 
   /**
    * Class constructor.
@@ -62,7 +62,7 @@ class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob {
    * @return \CRM_Mailing_BAO_MailingJob
    * @throws \CRM_Core_Exception
    */
-  static public function create($params) {
+  public static function create($params) {
     if (empty($params['id']) && empty($params['mailing_id'])) {
       throw new CRM_Core_Exception("Failed to create job: Unknown mailing ID");
     }
@@ -301,7 +301,6 @@ class CRM_Mailing_BAO_MailingJob extends CRM_Mailing_DAO_MailingJob {
     }
   }
 
-
   /**
    * before we run jobs, we need to split the jobs
    * @param int $offset
@@ -602,9 +601,11 @@ VALUES (%1, %2, %3, %4, %5, %6, %7)
 
     // CRM-15702: Sending bulk sms to contacts without e-mail address fails.
     // Solution is to skip checking for on hold
-    $skipOnHold = TRUE;    //do include a statement to check wether e-mail address is on hold
+    //do include a statement to check wether e-mail address is on hold
+    $skipOnHold = TRUE;
     if ($mailing->sms_provider_id) {
-      $skipOnHold = FALSE; //do not include a statement to check wether e-mail address is on hold
+      //do not include a statement to check wether e-mail address is on hold
+      $skipOnHold = FALSE;
     }
 
     foreach ($fields as $key => $field) {
index 329d9b79326d4fec929af0f3f7836c0ec9232d3c..ff1e5a8dd07848454e3c6f3635dbd0b908a89071 100644 (file)
@@ -32,7 +32,7 @@
  */
 class CRM_Mailing_BAO_Query {
 
-  static $_mailingFields = NULL;
+  public static $_mailingFields = NULL;
 
   /**
    * @return array|null
@@ -313,9 +313,9 @@ class CRM_Mailing_BAO_Query {
           'bounce_type_id',
           ts('Bounce type(s)'),
           CRM_Core_PseudoConstant::get('CRM_Mailing_Event_DAO_Bounce', 'bounce_type_id', [
-              'keyColumn' => 'id',
-              'labelColumn' => 'name',
-            ])
+            'keyColumn' => 'id',
+            'labelColumn' => 'name',
+          ])
         );
         return;
 
index 26eb8d3ea3a99a118d0034fa989ae2a068c47f90..ffb5e51c06f06c275df047d7cba12eb66e52f2db 100644 (file)
@@ -88,14 +88,16 @@ class CRM_Mailing_BAO_Spool extends CRM_Mailing_DAO_Spool {
       }
 
       $job = new CRM_Mailing_BAO_MailingJob();
-      $job->is_test = 0;  // if set to 1 it doesn't show in the UI
+      // if set to 1 it doesn't show in the UI
+      $job->is_test = 0;
       $job->status = 'Complete';
       $job->scheduled_date = CRM_Utils_Date::processDate(date('Y-m-d'), date('H:i:s'));
       $job->start_date = $job->scheduled_date;
       $job->end_date = $job->scheduled_date;
       $job->mailing_id = $mailing->id;
       $job->save();
-      $job_id = $job->id; // need this for parent_id below
+      // need this for parent_id below
+      $job_id = $job->id;
 
       $job = new CRM_Mailing_BAO_MailingJob();
       $job->is_test = 0;
@@ -107,7 +109,8 @@ class CRM_Mailing_BAO_Spool extends CRM_Mailing_DAO_Spool {
       $job->parent_id = $job_id;
       $job->job_type = 'child';
       $job->save();
-      $job_id = $job->id; // this is the one we want for the spool
+      // this is the one we want for the spool
+      $job_id = $job->id;
 
       if (is_array($recipient)) {
         $recipient = implode(';', $recipient);
index 94064c2bb03955599bc94cf8a3401ebde543ebf8..79fdb2028ecd940f29fb4cd9d5c2f46e80a21aef 100644 (file)
@@ -36,7 +36,8 @@ class CRM_Mailing_Config {
   const OUTBOUND_OPTION_SENDMAIL = 1;
   const OUTBOUND_OPTION_DISABLED = 2;
   const OUTBOUND_OPTION_MAIL = 3;
-  const OUTBOUND_OPTION_MOCK = 4; // seems to be the same as 2, but also calls Mail's pre/post hooks? - see packages/Mail
+  // seems to be the same as 2, but also calls Mail's pre/post hooks? - see packages/Mail
+  const OUTBOUND_OPTION_MOCK = 4;
   const OUTBOUND_OPTION_REDIRECT_TO_DB = 5;
 
   // special value for mail bulk inserts to avoid
index 2df4893a8f570549c765b24e96418979159cec00..b020f76ad7c44192ba4fadd89dacb54f60bbe994 100644 (file)
@@ -371,9 +371,9 @@ SELECT     civicrm_email.id as email_id
 
         $group[$groupID]['status'] = $contactGroups[$groupID]['status'];
         $status = ts('You are already subscribed in %1, your subscription is %2.', [
-            1 => $group[$groupID]['title'],
-            2 => ts($group[$groupID]['status']),
-          ]);
+          1 => $group[$groupID]['title'],
+          2 => ts($group[$groupID]['status']),
+        ]);
         CRM_Utils_System::setUFMessage($status);
         continue;
       }
index d0c1f8d9c88fdb0c8675a38f018e83f7c4ccd427..bb52d77a1fbf756036ebb2d5cef091b4b03977cb 100644 (file)
@@ -63,17 +63,16 @@ class CRM_Mailing_Form_Browse extends CRM_Core_Form {
    */
   public function buildQuickForm() {
     $this->addButtons([
-        [
-          'type' => 'next',
-          'name' => ts('Confirm'),
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => 'next',
+        'name' => ts('Confirm'),
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ],
+    ]);
   }
 
   public function postProcess() {
index beb2efee21427efd083c8462d2c9cd71a5306d7c..2200d9a5a3a91a43b845f7cd65ff7e465dc531a6 100644 (file)
@@ -65,9 +65,9 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form {
       CRM_Core_DAO::getAttribute('CRM_Mailing_BAO_MailingComponent', 'name'), TRUE
     );
     $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', [
-        'CRM_Mailing_BAO_MailingComponent',
-        $this->_id,
-      ]);
+      'CRM_Mailing_BAO_MailingComponent',
+      $this->_id,
+    ]);
 
     $this->add('select', 'component_type', ts('Component Type'), CRM_Core_SelectValues::mailingComponents());
 
@@ -89,17 +89,16 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form {
     $this->addFormRule(['CRM_Mailing_Form_Component', 'dataRule']);
 
     $this->addButtons([
-        [
-          'type' => 'next',
-          'name' => ts('Save'),
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => 'next',
+        'name' => ts('Save'),
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ],
+    ]);
   }
 
   /**
@@ -134,9 +133,8 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form {
 
     $component = CRM_Mailing_BAO_MailingComponent::add($params);
     CRM_Core_Session::setStatus(ts('The mailing component \'%1\' has been saved.', [
-        1 => $component->name,
-      ]
-    ), ts('Saved'), 'success');
+      1 => $component->name,
+    ]), ts('Saved'), 'success');
 
   }
 
@@ -161,24 +159,24 @@ class CRM_Mailing_Form_Component extends CRM_Core_Form {
     }
     $errors = [];
     foreach ([
-               'text',
-               'html',
-             ] as $type) {
+      'text',
+      'html',
+    ] as $type) {
       $dataErrors = [];
       foreach ($InvalidTokens as $token => $desc) {
         if ($params['body_' . $type]) {
           if (preg_match('/' . preg_quote('{' . $token . '}') . '/', $params['body_' . $type])) {
             $dataErrors[] = '<li>' . ts('This message is having a invalid token - %1: %2', [
-                1 => $token,
-                2 => $desc,
-              ]) . '</li>';
+              1 => $token,
+              2 => $desc,
+            ]) . '</li>';
           }
         }
       }
       if (!empty($dataErrors)) {
         $errors['body_' . $type] = ts('The following errors were detected in %1 message:', [
-            1 => $type,
-          ]) . '<ul>' . implode('', $dataErrors) . '</ul><br /><a href="' . CRM_Utils_System::docURL2('Tokens', TRUE, NULL, NULL, NULL, "wiki") . '">' . ts('More information on tokens...') . '</a>';
+          1 => $type,
+        ]) . '<ul>' . implode('', $dataErrors) . '</ul><br /><a href="' . CRM_Utils_System::docURL2('Tokens', TRUE, NULL, NULL, NULL, "wiki") . '">' . ts('More information on tokens...') . '</a>';
       }
     }
     return empty($errors) ? TRUE : $errors;
index 0fa6966707a5942280b6a80b49c82143353fc5aa..3d7a04cf2c4861210090f9713b85726b3ff7e135 100644 (file)
@@ -31,6 +31,7 @@
  * @copyright CiviCRM LLC (c) 2004-2019
  */
 class CRM_Mailing_Form_ForwardMailing extends CRM_Core_Form {
+
   public function preProcess() {
     $job_id = CRM_Utils_Request::retrieve('jid', 'Positive',
       $this, NULL
@@ -139,14 +140,14 @@ class CRM_Mailing_Form_ForwardMailing extends CRM_Core_Form {
     }
 
     $status = ts('Mailing is not forwarded to the given email address.', [
-        'count' => count($emails),
-        'plural' => 'Mailing is not forwarded to the given email addresses.',
-      ]);
+      'count' => count($emails),
+      'plural' => 'Mailing is not forwarded to the given email addresses.',
+    ]);
     if ($forwarded) {
       $status = ts('Mailing is forwarded successfully to %count email address.', [
-          'count' => $forwarded,
-          'plural' => 'Mailing is forwarded successfully to %count email addresses.',
-        ]);
+        'count' => $forwarded,
+        'plural' => 'Mailing is forwarded successfully to %count email addresses.',
+      ]);
     }
 
     CRM_Utils_System::setUFMessage($status);
index c7c3d42eaefc9ed445ad96441161b89695ee56c8..d2d6af941ea9a9480943a371ef514369c4ed67b0 100644 (file)
@@ -133,10 +133,9 @@ class CRM_Mailing_Form_Search extends CRM_Core_Form {
           !CRM_Utils_System::isNull($params[$field])
         ) {
           if (in_array($field, [
-              'mailing_from',
-              'mailing_to',
-            ]) && !$params["mailing_relative"]
-          ) {
+            'mailing_from',
+            'mailing_to',
+          ]) && !$params["mailing_relative"]) {
             $time = ($field == 'mailing_to') ? '235959' : NULL;
             $parent->set($field, CRM_Utils_Date::processDate($params[$field], $time));
           }
index 91b79e81a39b0f0907c347a96579f5a41ec0cd07..6a8feae66b2e2668470f562bea6a334f63d9d881 100644 (file)
@@ -154,17 +154,16 @@ ORDER BY title";
     }
 
     $this->addButtons([
-        [
-          'type' => 'next',
-          'name' => ts('Subscribe'),
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'cancel',
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => 'next',
+        'name' => ts('Subscribe'),
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'cancel',
+        'name' => ts('Cancel'),
+      ],
+    ]);
   }
 
   /**
index e06b8cc1a1973c410fd87072e62a585461459163..edd13fb523c2b1949efdc7685066fdfa5bf24a08 100644 (file)
@@ -116,17 +116,16 @@ class CRM_Mailing_Form_Task extends CRM_Core_Form_Task {
    */
   public function addDefaultButtons($title, $nextType = 'next', $backType = 'back', $submitOnce = FALSE) {
     $this->addButtons([
-        [
-          'type' => $nextType,
-          'name' => $title,
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => $backType,
-          'name' => ts('Cancel'),
-        ],
-      ]
-    );
+      [
+        'type' => $nextType,
+        'name' => $title,
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => $backType,
+        'name' => ts('Cancel'),
+      ],
+    ]);
   }
 
 }
index a57f21a40af0fbab9b5adfbccfda7ae4d2b2dde8..0d1322edd4f64e2824984ef3c85e182c4961b409 100644 (file)
@@ -71,18 +71,17 @@ class CRM_Mailing_Form_Task_Print extends CRM_Mailing_Form_Task {
     // just need to add a javacript to popup the window for printing
     //
     $this->addButtons([
-        [
-          'type' => 'next',
-          'name' => ts('Print Mailing Recipients'),
-          'js' => ['onclick' => 'window.print()'],
-          'isDefault' => TRUE,
-        ],
-        [
-          'type' => 'back',
-          'name' => ts('Done'),
-        ],
-      ]
-    );
+      [
+        'type' => 'next',
+        'name' => ts('Print Mailing Recipients'),
+        'js' => ['onclick' => 'window.print()'],
+        'isDefault' => TRUE,
+      ],
+      [
+        'type' => 'back',
+        'name' => ts('Done'),
+      ],
+    ]);
   }
 
   /**
index 7ed725507dda2fc6dda5b8bfce0eed8d4ba81960..a674129e54aad866526608d69cb02ebf9afccf6c 100644 (file)
 class CRM_Mailing_Info extends CRM_Core_Component_Info {
 
   /**
+   * @var string
    * @inheritDoc
    */
   protected $keyword = 'mailing';
 
-
   /**
    * @inheritDoc
    * @return array
@@ -78,7 +78,8 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info {
     foreach ($reportTypes as $report) {
       $result = civicrm_api3('ReportInstance', 'get', [
         'sequential' => 1,
-        'report_id' => 'mailing/' . $report]);
+        'report_id' => 'mailing/' . $report,
+      ]);
       if (!empty($result['values'])) {
         $reportIds[$report] = $result['values'][0]['id'];
       }
@@ -150,9 +151,9 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info {
           'disableMandatoryTokensCheck' => (int) Civi::settings()->get('disable_mandatory_tokens_check'),
           'fromAddress' => $fromAddress['values'],
           'defaultTestEmail' => civicrm_api3('Contact', 'getvalue', [
-              'id' => 'user_contact_id',
-              'return' => 'email',
-            ]),
+            'id' => 'user_contact_id',
+            'return' => 'email',
+          ]),
           'visibility' => CRM_Utils_Array::makeNonAssociative(CRM_Core_SelectValues::groupVisibility()),
           'workflowEnabled' => CRM_Mailing_Info::workflowEnabled(),
           'reportIds' => $reportIds,
@@ -245,7 +246,6 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info {
     return $permissions;
   }
 
-
   /**
    * @inheritDoc
    * @return null
index bb94c529a161ee4e3e79a2a4bbe12778e1c279cb..86b79c38b3f891100937983e87fc13727ea2168a 100644 (file)
  * @copyright CiviCRM LLC (c) 2004-2019
  */
 class CRM_Mailing_MailStore {
-  // flag to decide whether to print debug messages
-  var $_debug = FALSE;
+  /**
+   * flag to decide whether to print debug messages
+   * @var bool
+   */
+  public $_debug = FALSE;
 
   /**
    * Return the proper mail store implementation, based on config settings.
@@ -153,10 +156,10 @@ class CRM_Mailing_MailStore {
     $config = CRM_Core_Config::singleton();
     $dir = $config->customFileUploadDir . DIRECTORY_SEPARATOR . $name;
     foreach ([
-               'cur',
-               'new',
-               'tmp',
-             ] as $sub) {
+      'cur',
+      'new',
+      'tmp',
+    ] as $sub) {
       if (!file_exists($dir . DIRECTORY_SEPARATOR . $sub)) {
         if ($this->_debug) {
           print "creating $dir/$sub\n";
index 87a0a4f1856a90e0e93bcff4afd30b2ea8cd2b45..8e9c66f1c813082832c069729a6ecbccdbad1375 100644 (file)
@@ -48,17 +48,17 @@ class CRM_Mailing_MailStore_Localdir extends CRM_Mailing_MailStore {
     $this->_dir = $dir;
 
     $this->_ignored = $this->maildir(implode(DIRECTORY_SEPARATOR, [
-          'CiviMail.ignored',
-          date('Y'),
-          date('m'),
-          date('d'),
-        ]));
+      'CiviMail.ignored',
+      date('Y'),
+      date('m'),
+      date('d'),
+    ]));
     $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, [
-          'CiviMail.processed',
-          date('Y'),
-          date('m'),
-          date('d'),
-        ]));
+      'CiviMail.processed',
+      date('Y'),
+      date('m'),
+      date('d'),
+    ]));
   }
 
   /**
index c0b58553956627259057d7b60a39633680a4c338..90b371026ed4e6812cf90bd363638afd5247bdf8 100644 (file)
@@ -48,17 +48,17 @@ class CRM_Mailing_MailStore_Maildir extends CRM_Mailing_MailStore {
     $this->_dir = $dir;
 
     $this->_ignored = $this->maildir(implode(DIRECTORY_SEPARATOR, [
-          'CiviMail.ignored',
-          date('Y'),
-          date('m'),
-          date('d'),
-        ]));
+      'CiviMail.ignored',
+      date('Y'),
+      date('m'),
+      date('d'),
+    ]));
     $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, [
-          'CiviMail.processed',
-          date('Y'),
-          date('m'),
-          date('d'),
-        ]));
+      'CiviMail.processed',
+      date('Y'),
+      date('m'),
+      date('d'),
+    ]));
   }
 
   /**
@@ -78,9 +78,9 @@ class CRM_Mailing_MailStore_Maildir extends CRM_Mailing_MailStore {
     $parser->options->parseTextAttachmentsAsFiles = TRUE;
 
     foreach ([
-               'cur',
-               'new',
-             ] as $subdir) {
+      'cur',
+      'new',
+    ] as $subdir) {
       $dir = $this->_dir . DIRECTORY_SEPARATOR . $subdir;
       foreach (scandir($dir) as $file) {
         if ($file == '.' or $file == '..') {
index c1679a4aaf5585c648c63cbf796fde415f99560d..6ffadf4166e89c260d18306f7fdd331e7779969b 100644 (file)
@@ -51,17 +51,17 @@ class CRM_Mailing_MailStore_Mbox extends CRM_Mailing_MailStore {
     $this->_leftToProcess = count($this->_transport->listMessages());
 
     $this->_ignored = $this->maildir(implode(DIRECTORY_SEPARATOR, [
-          'CiviMail.ignored',
-          date('Y'),
-          date('m'),
-          date('d'),
-        ]));
+      'CiviMail.ignored',
+      date('Y'),
+      date('m'),
+      date('d'),
+    ]));
     $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, [
-          'CiviMail.processed',
-          date('Y'),
-          date('m'),
-          date('d'),
-        ]));
+      'CiviMail.processed',
+      date('Y'),
+      date('m'),
+      date('d'),
+    ]));
   }
 
   /**
index f30f741a986691041f14e8484dfba5727e285835..c552c3e18c7bb5871ae6ac7560b645141ba01f95 100644 (file)
@@ -60,17 +60,17 @@ class CRM_Mailing_MailStore_Pop3 extends CRM_Mailing_MailStore {
     $this->_transport->authenticate($username, $password);
 
     $this->_ignored = $this->maildir(implode(DIRECTORY_SEPARATOR, [
-          'CiviMail.ignored',
-          date('Y'),
-          date('m'),
-          date('d'),
-        ]));
+      'CiviMail.ignored',
+      date('Y'),
+      date('m'),
+      date('d'),
+    ]));
     $this->_processed = $this->maildir(implode(DIRECTORY_SEPARATOR, [
-          'CiviMail.processed',
-          date('Y'),
-          date('m'),
-          date('d'),
-        ]));
+      'CiviMail.processed',
+      date('Y'),
+      date('m'),
+      date('d'),
+    ]));
   }
 
   /**
index 24d90b33868974d08919a522788434904f8e625c..055f42d8eed727f1945cb2a5a9165ee6e5823ef1 100644 (file)
@@ -42,7 +42,7 @@ class CRM_Mailing_Page_Component extends CRM_Core_Page_Basic {
    *
    * @var array
    */
-  static $_links = NULL;
+  public static $_links = NULL;
 
   /**
    * Get BAO Name.
index fc159675c69d1640db49eee63756a93468e57ddb..b126dac4281f721274fd500a358044694bee23ce 100644 (file)
@@ -31,6 +31,7 @@
  * @copyright CiviCRM LLC (c) 2004-2019
  */
 class CRM_Mailing_Page_Confirm extends CRM_Core_Page {
+
   /**
    * @return string
    * @throws Exception
index 402d047c724f1874001abf974ab98f86313f96e9..c03a8076f2a4ca29738a2192b02e84f6b2b0dcb6 100644 (file)
@@ -31,6 +31,7 @@
  * @copyright CiviCRM LLC (c) 2004-2019
  */
 class CRM_Mailing_Page_Optout extends CRM_Mailing_Page_Common {
+
   /**
    * Run page.
    *
index 6ce256123bb0a118809054128801f2e3b14aded9..8df64a00b9a6600981be979314a0520f6eb827fb 100644 (file)
@@ -31,6 +31,7 @@
  * @copyright CiviCRM LLC (c) 2004-2019
  */
 class CRM_Mailing_Page_Resubscribe extends CRM_Mailing_Page_Common {
+
   /**
    * @return string
    */
index 66a7200f1c3b87e8e5384bfee7f06f88f82b76e1..5af444db8f2dd5609ad611871d72d6c5c568434e 100644 (file)
@@ -40,7 +40,7 @@ class CRM_Mailing_Page_Tab extends CRM_Contact_Page_View {
    *
    * @var array
    */
-  static $_links = NULL;
+  public static $_links = NULL;
   public $_permission = NULL;
   public $_contactId = NULL;
 
index d6186b9d342a6417f9bb77c8b8ccd903ff07801f..c2e43ff7a920a207657b058671d995311cff09a6 100644 (file)
@@ -75,6 +75,7 @@ class CRM_Mailing_PseudoConstant extends CRM_Core_PseudoConstant {
 
   /**
    * Default component id's, indexed by component type
+   * @var array
    */
   private static $defaultComponent;
 
@@ -117,7 +118,7 @@ class CRM_Mailing_PseudoConstant extends CRM_Core_PseudoConstant {
    */
   public static function abWinnerCriteria() {
     if (!is_array(self::$abWinnerCriteria)) {
-      self::$abWinnerCriteria  = [
+      self::$abWinnerCriteria = [
         'open' => ts('Open'),
         'unique_click' => ts('Total Unique Clicks'),
         'link_click' => ts('Total Clicks on a particular link'),
@@ -131,7 +132,7 @@ class CRM_Mailing_PseudoConstant extends CRM_Core_PseudoConstant {
    */
   public static function mailingTypes() {
     if (!is_array(self::$mailingTypes)) {
-      self::$mailingTypes  = [
+      self::$mailingTypes = [
         'standalone' => ts('Standalone'),
         'experiment' => ts('Experimental'),
         'winner' => ts('Winner'),
index 84014a0b1b300b2ef227d76fdd0ee01d0454b330..1f4aa41c55cb6826ef8e402527df6bac861bb5db 100644 (file)
@@ -41,14 +41,14 @@ class CRM_Mailing_Selector_Browse extends CRM_Core_Selector_Base implements CRM_
    *
    * @var array
    */
-  static $_links = NULL;
+  public static $_links = NULL;
 
   /**
    * We use desc to remind us what that column is, name is used in the tpl
    *
    * @var array
    */
-  static $_columnHeaders;
+  public static $_columnHeaders;
 
   protected $_parent;
 
index 0354321a92c69c6587d1e534abf9d8249f758ac2..618cbc3e4f19110a3b4ecfba0b4e78c877b1a642 100644 (file)
@@ -43,30 +43,35 @@ class CRM_Mailing_Selector_Event extends CRM_Core_Selector_Base implements CRM_C
    *
    * @var array
    */
-  static $_links = NULL;
+  public static $_links = NULL;
 
   /**
    * What event type are we browsing?
+   * @var sting
    */
   private $_event;
 
   /**
    * Should we only count distinct contacts?
+   * @var bool
    */
   private $_is_distinct;
 
   /**
    * Which mailing are we browsing events from?
+   * @var int
    */
   private $_mailing_id;
 
   /**
    * Do we want events tied to a specific job?
+   * @var int
    */
   private $_job_id;
 
   /**
    * For click-through events, do we only want those from a specific url?
+   * @var int
    */
   private $_url_id;
 
index 2417a7ed2a9a7cd05a4dbdf93a2f164e71cb3219..e50406bd8359b9560cfefa4d5dbf3d78aaedcede 100644 (file)
@@ -43,20 +43,20 @@ class CRM_Mailing_Selector_Search extends CRM_Core_Selector_Base implements CRM_
    *
    * @var array
    */
-  static $_links = NULL;
+  public static $_links = NULL;
 
   /**
    * We use desc to remind us what that column is, name is used in the tpl
    *
    * @var array
    */
-  static $_columnHeaders;
+  public static $_columnHeaders;
 
   /**
    * Properties of contact we're interested in displaying
    * @var array
    */
-  static $_properties = [
+  public static $_properties = [
     'contact_id',
     'mailing_id',
     'mailing_name',
index 65664796e6a3d53db5eb593f15582f45252f5459..32a4b0ff74ed48a188a995a5e822fd9d17362fca 100644 (file)
@@ -38,7 +38,7 @@
  */
 class CRM_Mailing_Task extends CRM_Core_Task {
 
-  static $objectType = 'mailing';
+  public static $objectType = 'mailing';
 
   /**
    * These tasks are the core set of tasks that the user can perform