本文整理汇总了PHP中CRM_Event_BAO_Participant::pendingToConfirmSpaces方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Event_BAO_Participant::pendingToConfirmSpaces方法的具体用法?PHP CRM_Event_BAO_Participant::pendingToConfirmSpaces怎么用?PHP CRM_Event_BAO_Participant::pendingToConfirmSpaces使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Event_BAO_Participant
的用法示例。
在下文中一共展示了CRM_Event_BAO_Participant::pendingToConfirmSpaces方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
/**
* Function to build the form
*
* @return void
* @access public
*/
public function buildQuickForm()
{
$params = array('id' => $this->_eventId);
$values = array();
CRM_Core_DAO::commonRetrieve('CRM_Event_DAO_Event', $params, $values, array('title'));
$buttons = array();
// only pending status class family able to confirm.
$statusMsg = NULL;
if (array_key_exists($this->_participantStatusId, CRM_Event_PseudoConstant::participantStatus(NULL, "class = 'Pending'"))) {
//need to confirm that though participant confirming
//registration - but is there enough space to confirm.
$emptySeats = CRM_Event_BAO_Participant::pendingToConfirmSpaces($this->_eventId);
$additonalIds = CRM_Event_BAO_Participant::getAdditionalParticipantIds($this->_participantId);
$requireSpace = 1 + count($additonalIds);
if ($emptySeats !== NULL && $requireSpace > $emptySeats) {
$statusMsg = ts("Oops, it looks like there are currently no available spaces for the %1 event.", array(1 => $values['title']));
} else {
if ($this->_cc == 'fail') {
$statusMsg = '<div class="bold">' . ts('Your Credit Card transaction was not successful. No money has yet been charged to your card.') . '</div><div><br />' . ts('Click the "Confirm Registration" button to complete your registration in %1, or click "Cancel Registration" if you are no longer interested in attending this event.', array(1 => $values['title'])) . '</div>';
} else {
$statusMsg = '<div class="bold">' . ts('Confirm your registration for %1.', array(1 => $values['title'])) . '</div><div><br />' . ts('Click the "Confirm Registration" button to begin, or click "Cancel Registration" if you are no longer interested in attending this event.') . '</div>';
}
$buttons = array_merge($buttons, array(array('type' => 'next', 'name' => ts('Confirm Registration'), 'spacing' => ' ', 'isDefault' => TRUE)));
}
}
// status class other than Negative should be able to cancel registration.
if (array_key_exists($this->_participantStatusId, CRM_Event_PseudoConstant::participantStatus(NULL, "class != 'Negative'"))) {
$cancelConfirm = ts('Are you sure you want to cancel your registration for this event?');
$buttons = array_merge($buttons, array(array('type' => 'submit', 'name' => ts('Cancel Registration'), 'spacing' => ' ', 'js' => array('onclick' => 'return confirm(\'' . $cancelConfirm . '\');'))));
if (!$statusMsg) {
$statusMsg = ts('You can cancel your registration for %1 by clicking "Cancel Registration".', array(1 => $values['title']));
}
}
if (!$statusMsg) {
$statusMsg = ts("Oops, it looks like your registration for %1 has already been cancelled.", array(1 => $values['title']));
}
$this->assign('statusMsg', $statusMsg);
$this->addButtons($buttons);
}