Merge pull request #14252 from jitendrapurohit/core-961
[civicrm-core.git] / CRM / Event / Form / SelfSvcTransfer.php
index 57821565f1a0bea0e8be854b0bee5c99e228c321..a0e629e0aaf6e82ae09a15e128aa27debe96d811 100644 (file)
@@ -113,32 +113,32 @@ class CRM_Event_Form_SelfSvcTransfer extends CRM_Core_Form {
   /**
    * particpant values
    *
-   * @array string
+   * @var string
    */
   protected $_part_values;
   /**
    * details
    *
-   * @array string
+   * @var array
    */
   protected $_details = [];
   /**
    * line items
    *
-   * @array string
+   * @var array
    */
   protected $_line_items = [];
   /**
    * contact_id
    *
-   * @array string
+   * @var int
    */
   protected $contact_id;
 
   /**
    * Is backoffice form?
    *
-   * @array bool
+   * @var bool
    */
   protected $isBackoffice = FALSE;
 
@@ -315,7 +315,7 @@ class CRM_Event_Form_SelfSvcTransfer extends CRM_Core_Form {
     $query = "select event_id from civicrm_participant where contact_id = " . $contact_id;
     $dao = CRM_Core_DAO::executeQuery($query);
     while ($dao->fetch()) {
-      $to_event_id[]  = $dao->event_id;
+      $to_event_id[] = $dao->event_id;
     }
     if (!empty($to_event_id)) {
       foreach ($to_event_id as $id) {
@@ -365,7 +365,11 @@ class CRM_Event_Form_SelfSvcTransfer extends CRM_Core_Form {
     }
     $value_to['contact_id'] = $contact_id;
     $value_to['event_id'] = $this->_event_id;
-    $value_to['status_id'] = 1;
+    $value_to['status_id'] = CRM_Core_PseudoConstant::getKey(
+      'CRM_Event_BAO_Participant',
+      'status_id',
+      'Registered'
+    );
     $value_to['register_date'] = date("Y-m-d");
     //first create the new participant row -don't set registered_by yet or email won't be sent
     $participant = CRM_Event_BAO_Participant::create($value_to);