當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Event_BAO_Participant::pendingToConfirmSpaces方法代碼示例

本文整理匯總了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' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', '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' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', '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);
 }
開發者ID:prashantgajare,項目名稱:civicrm-core,代碼行數:45,代碼來源:ParticipantConfirm.php


注:本文中的CRM_Event_BAO_Participant::pendingToConfirmSpaces方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。