Merge pull request #2264 from dlobo/CRM-13606
[civicrm-core.git] / CRM / Core / BAO / ActionSchedule.php
index 831f72d77756365ff8e6574b82ad3a93c380ecbf..decb24753ccc6b39de118bee79d6c4270db2dd4b 100755 (executable)
@@ -463,6 +463,8 @@ WHERE   cas.entity_value = $id AND
         'toName' => $contact['display_name'],
         'toEmail' => $email,
         'subject' => $messageSubject,
+        'entity' => 'action_schedule',
+        'entity_id' => $scheduleID,
       );
 
       if (!$html || $contact['preferred_mail_format'] == 'Text' ||
@@ -495,7 +497,7 @@ WHERE   cas.entity_value = $id AND
    * @static
    *
    */
-  static function add(&$params, &$ids = NULL) {
+  static function add(&$params, $ids = array()) {
     $actionSchedule = new CRM_Core_DAO_ActionSchedule();
     $actionSchedule->copyValues($params);
 
@@ -682,7 +684,7 @@ WHERE reminder.action_schedule_id = %1 AND reminder.action_date_time IS NULL
             $stateProvince = CRM_Core_PseudoConstant::stateProvince();
             $loc['street_address'] = $dao->street_address;
             $loc['city'] = $dao->city;
-            $loc['state_province'] = CRM_Utils_array::value($dao->state_province_id, $stateProvince);
+            $loc['state_province'] = CRM_Utils_Array::value($dao->state_province_id, $stateProvince);
             $loc['postal_code'] = $dao->postal_code;
             $entityTokenParams["{$tokenEntity}." . $field] = CRM_Utils_Address::format($loc);
           }
@@ -903,7 +905,7 @@ WHERE reminder.action_schedule_id = %1 AND reminder.action_date_time IS NULL
 
         // Need to check if its a smart group or not
         // Then decide which table to join onto the query
-        $group                 = CRM_Contact_DAO_Group::getTableName();
+        $group = CRM_Contact_DAO_Group::getTableName();
 
         // Get the group information
         $sql = "