| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
class CRM_Event_Form_Registration_AdditionalParticipant extends CRM_Event_Form_Registration {
/**
- * The defaults involved in this page
+ * The defaults involved in this page.
*/
public $_defaults = array();
public $additionalParticipantId = NULL;
/**
- * Set variables up before form is built
+ * Set variables up before form is built.
*
* @return void
*/
}
/**
- * Build the form object
+ * Build the form object.
*
* @return void
*/
$pre = $post = array();
foreach (array(
'pre',
- 'post'
+ 'post',
) as $keys) {
if (isset($this->_values['additional_custom_' . $keys . '_id'])) {
$this->buildCustom($this->_values['additional_custom_' . $keys . '_id'], 'additionalCustom' . ucfirst($keys), TRUE);
}
foreach (array(
'first_name',
- 'last_name'
+ 'last_name',
) as $name) {
if (array_key_exists($name, $$keys) &&
CRM_Utils_Array::value('is_required', CRM_Utils_Array::value($name, $$keys))
if ($this->_requireApproval) {
$statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed). Registration for this event requires approval. You will receive an email once your registration has been reviewed.", array(
1 => ++$processedCnt,
- 2 => $spaces
+ 2 => $spaces,
));
}
else {
$statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed).", array(
1 => ++$processedCnt,
- 2 => $spaces
+ 2 => $spaces,
));
}
}
else {
$statusMessage = ts("It looks like you are now registering a group of %1 participants. The event has %2 available spaces (you will not be wait listed). Please go back to the main registration page and reduce the number of additional people. You will also need to complete payment information.", array(
1 => ++$processedCnt,
- 2 => $spaces
+ 2 => $spaces,
));
$allowToProceed = FALSE;
}
'name' => ts('Skip Participant'),
'subName' => 'skip',
'icon' => 'seek-next',
- )
+ ),
)
);
}
}
/**
- * Global form rule
+ * Global form rule.
*
* @param array $fields
* The input form values.
* @param $self
*
*
- * @return true if no errors, else array of errors
- * @static
+ * @return bool|array
+ * true if no errors, else array of errors
*/
public static function formRule($fields, $files, $self) {
$errors = array();
) {
$errors['_qf_default'] = ts('It looks like event has only %2 seats available and you are trying to register %1 participants, so could you please select price options accordingly.', array(
1 => $totalParticipants,
- 2 => $self->_availableRegistrations
+ 2 => $self->_availableRegistrations,
));
}
}
}
/**
- * Process the form submission
+ * Process the form submission.
*
*
* @return void
}
/**
- * Check whether call current participant is last one
+ * Check whether call current participant is last one.
*
* @param bool $isButtonJs
*
- * @return boolean
+ * @return bool
* ture on success.
*/
public function isLastParticipant($isButtonJs = FALSE) {
/**
* Reset values for all options those are full.
*
- **/
+ */
public function resetElementValue($optionFullIds = array()) {
if (!is_array($optionFullIds) ||
empty($optionFullIds) ||
foreach (array(
'constantValues',
'submitValues',
- 'defaultValues'
+ 'defaultValues',
) as $val) {
$values = &$this->{"_$val"};
if (!is_array($values) || empty($values)) {
}
}
}
+
}