本文整理汇总了PHP中CRM_Event_BAO_Participant::updateStatusMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Event_BAO_Participant::updateStatusMessage方法的具体用法?PHP CRM_Event_BAO_Participant::updateStatusMessage怎么用?PHP CRM_Event_BAO_Participant::updateStatusMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Event_BAO_Participant
的用法示例。
在下文中一共展示了CRM_Event_BAO_Participant::updateStatusMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postProcess
//.........这里部分代码省略.........
$transaction = new CRM_Core_Transaction();
// CRM-11124
if ($this->_params['discount_id']) {
CRM_Event_BAO_Participant::createDiscountTrxn($this->_eventId, $contributionParams, NULL, CRM_Price_BAO_PriceSet::parseFirstPriceSetValueIDFromParams($this->_params));
}
$transaction->commit();
}
}
// also store lineitem stuff here
if ($this->_lineItem & $this->_action & CRM_Core_Action::ADD || $this->_lineItem && CRM_Core_Action::UPDATE && !$this->_paymentId) {
foreach ($this->_contactIds as $num => $contactID) {
foreach ($this->_lineItem as $key => $value) {
if (is_array($value) && $value != 'skip') {
foreach ($value as $lineKey => $line) {
//10117 update the line items for participants if contribution amount is recorded
if ($this->_quickConfig && !empty($params['total_amount']) && $params['status_id'] != array_search('Partially paid', $participantStatus)) {
$line['unit_price'] = $line['line_total'] = $params['total_amount'];
if (!empty($params['tax_amount'])) {
$line['unit_price'] = $line['unit_price'] - $params['tax_amount'];
$line['line_total'] = $line['line_total'] - $params['tax_amount'];
}
}
$lineItem[$this->_priceSetId][$lineKey] = $line;
}
CRM_Price_BAO_LineItem::processPriceSet($participants[$num]->id, $lineItem, CRM_Utils_Array::value($num, $contributions, NULL), 'civicrm_participant');
CRM_Contribute_BAO_Contribution::addPayments($value, $contributions);
}
}
}
}
$updateStatusMsg = NULL;
//send mail when participant status changed, CRM-4326
if ($this->_id && $this->_statusId && $this->_statusId != CRM_Utils_Array::value('status_id', $params) && !empty($params['is_notify'])) {
$updateStatusMsg = CRM_Event_BAO_Participant::updateStatusMessage($this->_id, $params['status_id'], $this->_statusId);
}
$sent = array();
$notSent = array();
if (!empty($params['send_receipt'])) {
if (array_key_exists($params['from_email_address'], $this->_fromEmails['from_email_id'])) {
$receiptFrom = $params['from_email_address'];
}
$this->assign('module', 'Event Registration');
//use of the message template below requires variables in different format
$event = $events = array();
$returnProperties = array('fee_label', 'start_date', 'end_date', 'is_show_location', 'title');
//get all event details.
CRM_Core_DAO::commonRetrieveAll('CRM_Event_DAO_Event', 'id', $params['event_id'], $events, $returnProperties);
$event = $events[$params['event_id']];
unset($event['start_date']);
unset($event['end_date']);
$role = CRM_Event_PseudoConstant::participantRole();
$participantRoles = CRM_Utils_Array::value('role_id', $params);
if (is_array($participantRoles)) {
$selectedRoles = array();
foreach ($participantRoles as $roleId) {
$selectedRoles[] = $role[$roleId];
}
$event['participant_role'] = implode(', ', $selectedRoles);
} else {
$event['participant_role'] = CRM_Utils_Array::value($participantRoles, $role);
}
$event['is_monetary'] = $this->_isPaidEvent;
if ($params['receipt_text']) {
$event['confirm_email_text'] = $params['receipt_text'];
}
$this->assign('isAmountzero', 1);
示例2: postProcess
//.........这里部分代码省略.........
}
}
//insert payment record for this participation
if (!$ids['contribution']) {
require_once 'CRM/Event/DAO/ParticipantPayment.php';
foreach ($this->_contactIds as $num => $contactID) {
$ppDAO =& new CRM_Event_DAO_ParticipantPayment();
$ppDAO->participant_id = $participants[$num]->id;
$ppDAO->contribution_id = $contributions[$num]->id;
$ppDAO->save();
}
}
}
}
// also store lineitem stuff here
if ($this->_lineItem) {
require_once 'CRM/Price/BAO/LineItem.php';
foreach ($this->_contactIds as $num => $contactID) {
foreach ($this->_lineItem as $key => $value) {
if (is_array($value) && $value != 'skip') {
foreach ($value as $line) {
$line['entity_table'] = 'civicrm_participant';
$line['entity_id'] = $participants[$num]->id;
CRM_Price_BAO_LineItem::create($line);
}
}
}
}
}
$updateStatusMsg = null;
//send mail when participant status changed, CRM-4326
if ($this->_participantId && $this->_statusId && $this->_statusId != CRM_Utils_Array::value('status_id', $params) && CRM_Utils_Array::value('is_notify', $params)) {
require_once "CRM/Event/BAO/Participant.php";
$updateStatusMsg = CRM_Event_BAO_Participant::updateStatusMessage($this->_participantId, $params['status_id'], $this->_statusId);
}
if (CRM_Utils_Array::value('send_receipt', $params)) {
$receiptFrom = "{$userName} <{$userEmail}>";
$this->assign('module', 'Event Registration');
//use of the message template below requires variables in different format
$event = $events = array();
$returnProperties = array('fee_label', 'start_date', 'end_date', 'is_show_location', 'title');
//get all event details.
CRM_Core_DAO::commonRetrieveAll('CRM_Event_DAO_Event', 'id', $params['event_id'], $events, $returnProperties);
$event = $events[$params['event_id']];
unset($event['start_date']);
unset($event['end_date']);
$role = CRM_Event_PseudoConstant::participantRole();
$event['participant_role'] = $role[$params['role_id']];
$event['is_monetary'] = $this->_isPaidEvent;
if ($params['receipt_text']) {
$event['confirm_email_text'] = $params['receipt_text'];
}
$this->assign('isAmountzero', 1);
$this->assign('event', $event);
$this->assign('isShowLocation', $event['is_show_location']);
if (CRM_Utils_Array::value('is_show_location', $event) == 1) {
$locationParams = array('entity_id' => $params['event_id'], 'entity_table' => 'civicrm_event');
require_once 'CRM/Core/BAO/Location.php';
$location = CRM_Core_BAO_Location::getValues($locationParams, true);
$this->assign('location', $location);
}
$status = CRM_Event_PseudoConstant::participantStatus();
if ($this->_isPaidEvent) {
$paymentInstrument = CRM_Contribute_PseudoConstant::paymentInstrument();
if (!$this->_mode) {
$this->assign('paidBy', CRM_Utils_Array::value($params['payment_instrument_id'], $paymentInstrument));