当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Event_BAO_Event::displayProfile方法代码示例

本文整理汇总了PHP中CRM_Event_BAO_Event::displayProfile方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Event_BAO_Event::displayProfile方法的具体用法?PHP CRM_Event_BAO_Event::displayProfile怎么用?PHP CRM_Event_BAO_Event::displayProfile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Event_BAO_Event的用法示例。


在下文中一共展示了CRM_Event_BAO_Event::displayProfile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: buildQuickForm

 /** 
  * Function to build the form 
  * 
  * @return None 
  * @access public 
  */
 public function buildQuickForm()
 {
     $this->assignToTemplate();
     if ($this->_params[0]['amount'] || $this->_params[0]['amount'] == 0) {
         $this->_amount = array();
         foreach ($this->_params as $k => $v) {
             if (is_array($v)) {
                 if (CRM_Utils_Array::value("email-{$this->_bltID}", $v)) {
                     $append = $v["email-{$this->_bltID}"];
                 } else {
                     $append = $v['first_name'] . ' ' . $v['last_name'];
                 }
                 $this->_amount[$k]['amount'] = $v['amount'];
                 if (CRM_Utils_Array::value('discountAmount', $v)) {
                     $this->_amount[$k]['amount'] -= $v['discountAmount'];
                 }
                 $this->_amount[$k]['label'] = $v['amount_level'] . '  -  ' . $append;
                 $this->_totalAmount = $this->_totalAmount + $this->_amount[$k]['amount'];
                 if (CRM_Utils_Array::value('is_primary', $v)) {
                     $this->set('primaryParticipantAmount', $this->_amount[$k]['amount']);
                 }
             }
         }
         $this->assign('amount', $this->_amount);
         $this->assign('totalAmount', $this->_totalAmount);
         $this->set('totalAmount', $this->_totalAmount);
     }
     $config =& CRM_Core_Config::singleton();
     $this->buildCustom($this->_values['custom_pre_id'], 'customPre', true);
     $this->buildCustom($this->_values['custom_post_id'], 'customPost', true);
     $this->assign('lineItem', $this->_lineItem);
     //display additional participants profile.
     require_once 'CRM/Event/BAO/Event.php';
     $participantParams = $this->_params;
     $formattedValues = array();
     $count = 1;
     foreach ($participantParams as $participantNum => $participantValue) {
         if ($participantNum && $participantValue != 'skip') {
             //get the customPre profile info
             if (CRM_Utils_Array::value('additional_custom_pre_id', $this->_values)) {
                 $values = array();
                 $groupName = array();
                 CRM_Event_BAO_Event::displayProfile($participantValue, $this->_values['additional_custom_pre_id'], $groupName, $values);
                 if (count($values)) {
                     $formattedValues[$count]['additionalCustomPre'] = $values;
                 }
                 $formattedValues[$count]['additionalCustomPreGroupTitle'] = CRM_Utils_Array::value('groupTitle', $groupName);
             }
             //get the customPost profile info
             if (CRM_Utils_Array::value('additional_custom_post_id', $this->_values)) {
                 $values = array();
                 $groupName = array();
                 CRM_Event_BAO_Event::displayProfile($participantValue, $this->_values['additional_custom_post_id'], $groupName, $values);
                 if (count($values)) {
                     $formattedValues[$count]['additionalCustomPost'] = $values;
                 }
                 $formattedValues[$count]['additionalCustomPostGroupTitle'] = CRM_Utils_Array::value('groupTitle', $groupName);
             }
             $count++;
         }
     }
     if (!empty($formattedValues) && $count > 1) {
         $this->assign('addParticipantProfile', $formattedValues);
     }
     if ($this->_params[0]['amount'] == 0) {
         $this->assign('isAmountzero', 1);
     }
     if ($this->_paymentProcessor['payment_processor_type'] == 'Google_Checkout' && !CRM_Utils_Array::value('is_pay_later', $this->_params[0]) && !($this->_params[0]['amount'] == 0) && !$this->_allowWaitlist && !$this->_requireApproval) {
         $this->_checkoutButtonName = $this->getButtonName('next', 'checkout');
         $this->add('image', $this->_checkoutButtonName, $this->_paymentProcessor['url_button'], array('class' => 'form-submit'));
         $this->addButtons(array(array('type' => 'back', 'name' => ts('<< Go Back'))));
     } else {
         $contribButton = ts('Continue >>');
         $this->addButtons(array(array('type' => 'back', 'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', 'name' => ts('<< Go Back')), array('type' => 'next', 'name' => $contribButton, 'isDefault' => true, 'js' => array('onclick' => "return submitOnce(this,'" . $this->_name . "','" . ts('Processing') . "');"))));
     }
     $defaults = array();
     $fields = array();
     if (!empty($this->_fields)) {
         foreach ($this->_fields as $name => $dontCare) {
             $fields[$name] = 1;
         }
     }
     $fields["billing_state_province-{$this->_bltID}"] = $fields["billing_country-{$this->_bltID}"] = $fields["email-{$this->_bltID}"] = 1;
     foreach ($fields as $name => $dontCare) {
         if (isset($this->_params[0][$name])) {
             $defaults[$name] = $this->_params[0][$name];
             if (substr($name, 0, 7) == 'custom_') {
                 $timeField = "{$name}_time";
                 if (isset($this->_params[0][$timeField])) {
                     $defaults[$timeField] = $this->_params[0][$timeField];
                 }
             } else {
                 if (in_array($name, array('addressee', 'email_greeting', 'postal_greeting')) && CRM_Utils_Array::value($name . '_custom', $this->_params[0])) {
                     $defaults[$name . '_custom'] = $this->_params[0][$name . '_custom'];
//.........这里部分代码省略.........
开发者ID:bhirsch,项目名称:voipdev,代码行数:101,代码来源:Confirm.php

示例2: assignProfiles

 /**
  * Assign Profiles.
  *
  * @param CRM_Core_Form $form
  */
 public static function assignProfiles(&$form)
 {
     $participantParams = $form->_params;
     $formattedValues = $profileFields = array();
     $count = 1;
     foreach ($participantParams as $participantNum => $participantValue) {
         if ($participantNum) {
             $prefix1 = 'additional';
             $prefix2 = 'additional_';
         } else {
             $prefix1 = '';
             $prefix2 = '';
         }
         if ($participantValue != 'skip') {
             //get the customPre profile info
             if (!empty($form->_values[$prefix2 . 'custom_pre_id'])) {
                 $values = $groupName = array();
                 CRM_Event_BAO_Event::displayProfile($participantValue, $form->_values[$prefix2 . 'custom_pre_id'], $groupName, $values, $profileFields);
                 if (count($values)) {
                     $formattedValues[$count][$prefix1 . 'CustomPre'] = $values;
                 }
                 $formattedValues[$count][$prefix1 . 'CustomPreGroupTitle'] = CRM_Utils_Array::value('groupTitle', $groupName);
             }
             //get the customPost profile info
             if (!empty($form->_values[$prefix2 . 'custom_post_id'])) {
                 $values = $groupName = array();
                 foreach ($form->_values[$prefix2 . 'custom_post_id'] as $gids) {
                     $val = array();
                     CRM_Event_BAO_Event::displayProfile($participantValue, $gids, $group, $val, $profileFields);
                     $values[$gids] = $val;
                     $groupName[$gids] = $group;
                 }
                 if (count($values)) {
                     $formattedValues[$count][$prefix1 . 'CustomPost'] = $values;
                 }
                 if (isset($formattedValues[$count][$prefix1 . 'CustomPre'])) {
                     $formattedValues[$count][$prefix1 . 'CustomPost'] = array_diff_assoc($formattedValues[$count][$prefix1 . 'CustomPost'], $formattedValues[$count][$prefix1 . 'CustomPre']);
                 }
                 $formattedValues[$count][$prefix1 . 'CustomPostGroupTitle'] = $groupName;
             }
             $count++;
         }
         $form->_fields = $profileFields;
     }
     if (!empty($formattedValues)) {
         $form->assign('primaryParticipantProfile', $formattedValues[1]);
         $form->set('primaryParticipantProfile', $formattedValues[1]);
         if ($count > 2) {
             unset($formattedValues[1]);
             $form->assign('addParticipantProfile', $formattedValues);
             $form->set('addParticipantProfile', $formattedValues);
         }
     }
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:59,代码来源:Confirm.php

示例3: buildQuickForm

 /**
  * Function to build the form
  *
  * @return None
  * @access public
  */
 public function buildQuickForm()
 {
     $this->assignToTemplate();
     if ($this->_params[0]['amount'] || $this->_params[0]['amount'] == 0) {
         $this->_amount = array();
         foreach ($this->_params as $k => $v) {
             if (is_array($v)) {
                 foreach (array('first_name', 'last_name') as $name) {
                     if (isset($v['billing_' . $name]) && !isset($v[$name])) {
                         $v[$name] = $v['billing_' . $name];
                     }
                 }
                 if (CRM_Utils_Array::value('first_name', $v) && CRM_Utils_Array::value('last_name', $v)) {
                     $append = $v['first_name'] . ' ' . $v['last_name'];
                 } else {
                     //use an email if we have one
                     foreach ($v as $v_key => $v_val) {
                         if (substr($v_key, 0, 6) == 'email-') {
                             $append = $v[$v_key];
                         }
                     }
                 }
                 $this->_amount[$k]['amount'] = $v['amount'];
                 if (CRM_Utils_Array::value('discountAmount', $v)) {
                     $this->_amount[$k]['amount'] -= $v['discountAmount'];
                 }
                 $this->_amount[$k]['label'] = preg_replace('//', '', $v['amount_level']) . '  -  ' . $append;
                 $this->_part[$k]['info'] = CRM_Utils_Array::value('first_name', $v) . ' ' . CRM_Utils_Array::value('last_name', $v);
                 if (!CRM_Utils_Array::value('first_name', $v)) {
                     $this->_part[$k]['info'] = $append;
                 }
                 $this->_totalAmount = $this->_totalAmount + $this->_amount[$k]['amount'];
                 if (CRM_Utils_Array::value('is_primary', $v)) {
                     $this->set('primaryParticipantAmount', $this->_amount[$k]['amount']);
                 }
             }
         }
         $this->assign('part', $this->_part);
         $this->set('part', $this->_part);
         $this->assign('amounts', $this->_amount);
         $this->assign('totalAmount', $this->_totalAmount);
         $this->set('totalAmount', $this->_totalAmount);
     }
     $config = CRM_Core_Config::singleton();
     $this->buildCustom($this->_values['custom_pre_id'], 'customPre', TRUE);
     $this->buildCustom($this->_values['custom_post_id'], 'customPost', TRUE);
     if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_priceSetId, 'is_quick_config')) {
         $this->assign('lineItem', $this->_lineItem);
     }
     //display additional participants profile.
     $participantParams = $this->_params;
     $formattedValues = array();
     $count = 1;
     foreach ($participantParams as $participantNum => $participantValue) {
         if ($participantNum && $participantValue != 'skip') {
             //get the customPre profile info
             if (CRM_Utils_Array::value('additional_custom_pre_id', $this->_values)) {
                 $values = $groupName = array();
                 CRM_Event_BAO_Event::displayProfile($participantValue, $this->_values['additional_custom_pre_id'], $groupName, $values);
                 if (count($values)) {
                     $formattedValues[$count]['additionalCustomPre'] = $values;
                 }
                 $formattedValues[$count]['additionalCustomPreGroupTitle'] = CRM_Utils_Array::value('groupTitle', $groupName);
             }
             //get the customPost profile info
             if (CRM_Utils_Array::value('additional_custom_post_id', $this->_values)) {
                 $values = $groupName = array();
                 foreach ($this->_values['additional_custom_post_id'] as $gids) {
                     $val = array();
                     CRM_Event_BAO_Event::displayProfile($participantValue, $gids, $group, $val);
                     $values[$gids] = $val;
                     $groupName[$gids] = $group;
                 }
                 if (count($values)) {
                     $formattedValues[$count]['additionalCustomPost'] = $values;
                 }
                 if (isset($formattedValues[$count]['additionalCustomPre'])) {
                     $formattedValues[$count]['additionalCustomPost'] = array_diff_assoc($formattedValues[$count]['additionalCustomPost'], $formattedValues[$count]['additionalCustomPre']);
                 }
                 $formattedValues[$count]['additionalCustomPostGroupTitle'] = $groupName;
             }
             $count++;
         }
     }
     if (!empty($formattedValues) && $count > 1) {
         $this->assign('addParticipantProfile', $formattedValues);
         $this->set('addParticipantProfile', $formattedValues);
     }
     //cosider total amount.
     $this->assign('isAmountzero', $this->_totalAmount <= 0 ? TRUE : FALSE);
     if ($this->_paymentProcessor['payment_processor_type'] == 'Google_Checkout' && !CRM_Utils_Array::value('is_pay_later', $this->_params[0]) && !($this->_params[0]['amount'] == 0) && !$this->_allowWaitlist && !$this->_requireApproval) {
         $this->_checkoutButtonName = $this->getButtonName('next', 'checkout');
         $this->add('image', $this->_checkoutButtonName, $this->_paymentProcessor['url_button'], array('class' => 'form-submit'));
         $this->addButtons(array(array('type' => 'back', 'name' => ts('<< Go Back'))));
//.........这里部分代码省略.........
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:101,代码来源:Confirm.php


注:本文中的CRM_Event_BAO_Event::displayProfile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。