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


PHP CRM_PCP_BAO_PCP::buildPcp方法代碼示例

本文整理匯總了PHP中CRM_PCP_BAO_PCP::buildPcp方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_PCP_BAO_PCP::buildPcp方法的具體用法?PHP CRM_PCP_BAO_PCP::buildPcp怎麽用?PHP CRM_PCP_BAO_PCP::buildPcp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_PCP_BAO_PCP的用法示例。


在下文中一共展示了CRM_PCP_BAO_PCP::buildPcp方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: buildQuickForm


//.........這裏部分代碼省略.........
     //lets display status to primary page only.
     $this->assign('waitlistMsg', $this->_waitlistMsg);
     $this->assign('requireApprovalMsg', $this->_requireApprovalMsg);
     $this->assign('allowGroupOnWaitlist', $allowGroupOnWaitlist);
     $this->assign('isAdditionalParticipants', $isAdditionalParticipants);
     //lets get js on two different qf elements.
     $showHidePayfieldName = NULL;
     $showHidePaymentInformation = FALSE;
     if ($this->_values['event']['is_monetary']) {
         self::buildAmount($this);
     }
     $pps = array();
     //@todo this processor adding fn is another one duplicated on contribute - a shared
     // common class would make this sort of thing extractable
     $onlinePaymentProcessorEnabled = FALSE;
     if (!empty($this->_paymentProcessors)) {
         foreach ($this->_paymentProcessors as $key => $name) {
             if ($name['billing_mode'] == 1) {
                 $onlinePaymentProcessorEnabled = TRUE;
             }
             $pps[$key] = $name['name'];
         }
     }
     if ($this->getContactID() === '0' && !$this->_values['event']['is_multiple_registrations']) {
         //@todo we are blocking for multiple registrations because we haven't tested
         $this->addCidZeroOptions($onlinePaymentProcessorEnabled);
     }
     if (CRM_Utils_Array::value('is_pay_later', $this->_values['event']) && ($this->_allowConfirmation || !$this->_requireApproval && !$this->_allowWaitlist)) {
         $pps[0] = $this->_values['event']['pay_later_text'];
     }
     if ($this->_values['event']['is_monetary']) {
         if (count($pps) > 1) {
             $this->addRadio('payment_processor', ts('Payment Method'), $pps, NULL, " ");
         } elseif (!empty($pps)) {
             $ppKeys = array_keys($pps);
             $currentPP = array_pop($ppKeys);
             $this->addElement('hidden', 'payment_processor', $currentPP);
         }
     }
     //lets add some qf element to bypass payment validations, CRM-4320
     if ($bypassPayment) {
         $this->addElement('hidden', 'bypass_payment', NULL, array('id' => 'bypass_payment'));
     }
     $this->assign('bypassPayment', $bypassPayment);
     $this->assign('showHidePaymentInformation', $showHidePaymentInformation);
     $userID = $this->getContactID();
     if (!$userID) {
         $createCMSUser = FALSE;
         if ($this->_values['custom_pre_id']) {
             $profileID = $this->_values['custom_pre_id'];
             $createCMSUser = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $profileID, 'is_cms_user');
         }
         if (!$createCMSUser && $this->_values['custom_post_id']) {
             if (!is_array($this->_values['custom_post_id'])) {
                 $profileIDs = array($this->_values['custom_post_id']);
             } else {
                 $profileIDs = $this->_values['custom_post_id'];
             }
             foreach ($profileIDs as $pid) {
                 if (CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $pid, 'is_cms_user')) {
                     $profileID = $pid;
                     $createCMSUser = TRUE;
                     break;
                 }
             }
         }
         if ($createCMSUser) {
             CRM_Core_BAO_CMSUser::buildForm($this, $profileID, TRUE);
         }
     }
     //we have to load confirm contribution button in template
     //when multiple payment processor as the user
     //can toggle with payment processor selection
     $billingModePaymentProcessors = 0;
     if (!CRM_Utils_System::isNull($this->_paymentProcessors)) {
         foreach ($this->_paymentProcessors as $key => $values) {
             if ($values['billing_mode'] == CRM_Core_Payment::BILLING_MODE_BUTTON) {
                 $billingModePaymentProcessors++;
             }
         }
     }
     if ($billingModePaymentProcessors && count($this->_paymentProcessors) == $billingModePaymentProcessors) {
         $allAreBillingModeProcessors = TRUE;
     } else {
         $allAreBillingModeProcessors = FALSE;
     }
     if (!$allAreBillingModeProcessors || CRM_Utils_Array::value('is_pay_later', $this->_values['event']) || $bypassPayment) {
         //freeze button to avoid multiple calls.
         $js = NULL;
         if (!CRM_Utils_Array::value('is_monetary', $this->_values['event'])) {
             $js = array('onclick' => "return submitOnce(this,'" . $this->_name . "','" . ts('Processing') . "');");
         }
         $this->addButtons(array(array('type' => 'upload', 'name' => ts('Continue >>'), 'spacing' => '         ', 'isDefault' => TRUE, 'js' => $js)));
     }
     $this->addFormRule(array('CRM_Event_Form_Registration_Register', 'formRule'), $this);
     // add pcp fields
     if ($this->_pcpId) {
         CRM_PCP_BAO_PCP::buildPcp($this->_pcpId, $this);
     }
 }
開發者ID:TheCraftyCanvas,項目名稱:aegir-platforms,代碼行數:101,代碼來源:Register.php


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