*/
public function buildQuickForm() {
$ufGroupId = $this->get('ufGroupId');
-
if (!$ufGroupId) {
CRM_Core_Error::fatal('ufGroupId is missing');
}
$this->addDefaultButtons(ts('Save'));
$this->_fields = array();
$this->_fields = CRM_Core_BAO_UFGroup::getFields($ufGroupId, FALSE, CRM_Core_Action::VIEW);
+ if (array_key_exists('participant_status', $this->_fields)) {
+ CRM_Event_Form_Task_ParticipantStatus::assignToTemplate('statusChangeBatch');
+ }
// remove file type field and then limit fields
$suppressFields = FALSE;
) + $statuses
);
- $this->assign('context', 'statusChange');
-
# CRM-4321: display info on users being notified if any of the below statuses is enabled
- $notifyingStatuses = array('Pending from waitlist', 'Pending from approval', 'Expired', 'Cancelled');
- $notifyingStatuses = array_intersect($notifyingStatuses, CRM_Event_PseudoConstant::participantStatus());
- $this->assign('notifyingStatuses', implode(', ', $notifyingStatuses));
+ self::assignToTemplate('statusChange');
parent::buildQuickForm();
}
+ public function assignToTemplate($context) {
+ $notifyingStatuses = array('Pending from waitlist', 'Pending from approval', 'Expired', 'Cancelled');
+ $notifyingStatuses = array_intersect($notifyingStatuses, CRM_Event_PseudoConstant::participantStatus());
+ $statuses = implode(', ', $notifyingStatuses);
+ $status = ts('Participants whose status is changed FROM Pending Pay Later TO Registered or Attended will receive a confirmation email and their payment status will be set to completed. If this is not you want to do, you can change their participant status by editing their event registration record directly.');
+ if (!empty($notifyingStatuses)) {
+ $status .= '<br />' .ts("Participants whose status is changed TO any of the following will be automatically notified via email: %1", array(1 => $statuses));
+ }
+ $this->assign('status', $status);
+ $this->assign('context', $context);
+ }
}
*}
<div class="batch-update crm-block crm-form-block crm-event-batch-form-block">
<fieldset>
-<div class="help">
+ <div class="help">
{if $context EQ 'statusChange'} {* Update Participant Status task *}
- {ts}Update the status for each participant individually, OR change all statuses to:{/ts}
- {$form.status_change.html} {help id="id-status_change"}
- <div class="status">
- {ts}Participants whose status is changed FROM Pending Pay Later TO Registered or Attended will receive a confirmation email and their payment status will be set to completed. If this is not what you want to do, you can change their participant status by editing their event registration record directly.{/ts}
- </div>
- {if $notifyingStatuses}
- <div class="status">
- {ts 1=$notifyingStatuses}Participants whose status is changed TO any of the following will be automatically notified via email: %1.{/ts}
- </div>
- {/if}
+ {ts}Update the status for each participant individually, OR change all statuses to:{/ts}
+ {$form.status_change.html} {help id="id-status_change"}
+ <div class="status">{$status}</div>
{else}
- {ts}Update field values for each participant as needed. To set a field to the same value for ALL rows, enter that value for the first participation and then click the <strong>Copy icon</strong> (next to the column title).{/ts}
+ {if $context EQ 'statusChangeBatch'} {* Update Participant Status in batch task *}
+ <div class="status">{$status}</div>
+ {/if}
+ {ts}Update field values for each participant as needed. To set a field to the same value for ALL rows, enter that value for the first participation and then click the
+ <strong>Copy icon</strong>
+ (next to the column title).{/ts}
{/if}
- <p>{ts}Click <strong>Update Participant(s)</strong> below to save all your changes.{/ts}</p>
-</div>
+ <p>{ts}Click<strong>Update Participant(s)</strong>below to save all your changes.{/ts}</p>
+ </div>
<table class="crm-copy-fields">
<thead class="sticky">
<tr class="columnheader">