Merge pull request #5057 from cividesk/CRM-15901-4.5
[civicrm-core.git] / CRM / Event / Form / Registration / AdditionalParticipant.php
index 0050b08cc8e9030bcaec3b921a34f334ec564358..1b34e1864887ad44737e39b1156a9a0124167c19 100644 (file)
@@ -160,7 +160,6 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
     if (array_key_exists('participant_campaign_id', $this->_fields)) {
       $defaults['participant_campaign_id'] = CRM_Utils_Array::value('campaign_id', $this->_values['event']);
     }
-    CRM_Core_BAO_Address::fixAllStateSelects($this, $this->_defaults);
 
     return $defaults;
   }
@@ -191,7 +190,7 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
       }
       foreach (array(
         'first_name', 'last_name') as $name) {
-        if (!empty($$keys[$name]) &&
+        if (array_key_exists($name, $$keys) &&
           CRM_Utils_Array::value('is_required', CRM_Utils_Array::value($name, $$keys))
         ) {
           $$name = 1;
@@ -367,9 +366,11 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
   /**
    * global form rule
    *
-   * @param array $fields  the input form values
-   * @param array $files   the uploaded files if any
-   * @param array $options additional user data
+   * @param array $fields the input form values
+   * @param array $files the uploaded files if any
+   * @param $self
+   *
+   * @internal param array $options additional user data
    *
    * @return true if no errors, else array of errors
    * @access public
@@ -511,6 +512,12 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
     return $errors;
   }
 
+  /**
+   * @param $self
+   * @param $fields
+   *
+   * @return bool
+   */
   function validatePaymentValues($self, $fields) {
 
     if (!empty($self->_params[0]['bypass_payment']) ||
@@ -723,6 +730,11 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
     }
   }
 
+  /**
+   * @param $additionalParticipant
+   *
+   * @return array
+   */
   public static function &getPages($additionalParticipant) {
     $details = array();
     for ($i = 1; $i <= $additionalParticipant; $i++) {
@@ -737,6 +749,8 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
   /**
    * check whether call current participant is last one
    *
+   * @param bool $isButtonJs
+   *
    * @return boolean ture on success.
    * @access public
    */
@@ -808,6 +822,10 @@ class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_R
     }
   }
 
+  /**
+   * @param $elementName
+   * @param array $optionIds
+   */
   function resetSubmittedValue($elementName, $optionIds = array(
     )) {
     if (empty($elementName) ||