本文整理汇总了PHP中CRM_Contribute_Form_ContributionPage类的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contribute_Form_ContributionPage类的具体用法?PHP CRM_Contribute_Form_ContributionPage怎么用?PHP CRM_Contribute_Form_ContributionPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CRM_Contribute_Form_ContributionPage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
/**
* Function to actually build the form
*
* @return void
* @access public
*/
public function buildQuickForm()
{
$this->registerRule('emailList', 'callback', 'emailList', 'CRM_Utils_Rule');
// thank you title and text (html allowed in text)
$this->add('text', 'thankyou_title', ts('Thank-you Page Title'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'thankyou_title'), true);
$this->addWysiwyg('thankyou_text', ts('Thank-you Message'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'thankyou_text'));
$this->addWysiwyg('thankyou_footer', ts('Thank-you Page Footer'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'thankyou_footer'));
$this->addElement('checkbox', 'is_email_receipt', ts('Email Receipt to Contributor?'), null, array('onclick' => "showReceipt()"));
$this->add('text', 'receipt_from_name', ts('Receipt From Name'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'receipt_from_name'));
$this->add('text', 'receipt_from_email', ts('Receipt From Email'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'receipt_from_email'));
$this->add('textarea', 'receipt_text', ts('Receipt Message'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'receipt_text'));
$this->add('text', 'cc_receipt', ts('CC Receipt To'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'cc_receipt'));
$this->addRule('cc_receipt', ts('Please enter a valid list of comma delimited email addresses'), 'emailList');
$this->add('text', 'bcc_receipt', ts('BCC Receipt To'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'bcc_receipt'));
$this->addRule('bcc_receipt', ts('Please enter a valid list of comma delimited email addresses'), 'emailList');
$this->addFormRule(array('CRM_Contribute_Form_ContributionPage_ThankYou', 'formRule'));
parent::buildQuickForm();
}
开发者ID:bhirsch,项目名称:voipdev,代码行数:24,代码来源:ThankYou.php
示例2: buildQuickForm
function buildQuickForm()
{
$attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Widget');
$this->addElement('checkbox', 'is_active', ts('Enable Widget?'), null, array('onclick' => "widgetBlock(this)"));
$this->addWysiwyg('about', ts('About'), $attributes['about']);
foreach ($this->_fields as $name => $val) {
$this->add($val[1], $name, $val[0], $attributes[$name], $val[2]);
}
foreach ($this->_colorFields as $name => $val) {
$this->add($val[1], $name, $val[0], $attributes[$name], $val[2]);
}
$this->assign_by_ref('fields', $this->_fields);
$this->assign_by_ref('colorFields', $this->_colorFields);
$this->_refreshButtonName = $this->getButtonName('refresh');
$this->addElement('submit', $this->_refreshButtonName, ts('Save and Preview'));
parent::buildQuickForm();
$this->addFormRule(array('CRM_Contribute_Form_ContributionPage_Widget', 'formRule'), $this);
}
开发者ID:bhirsch,项目名称:voipdev,代码行数:18,代码来源:Widget.php
示例3: buildQuickForm
/**
* Function to actually build the form
*
* @return void
* @access public
*/
public function buildQuickForm()
{
require_once 'CRM/Utils/Money.php';
$this->_first = true;
$attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage');
// name
$this->add('text', 'title', ts('Title'), $attributes['title'], true);
$this->add('select', 'contribution_type_id', ts('Contribution Type'), CRM_Contribute_PseudoConstant::contributionType(), true);
$this->addWysiwyg('intro_text', ts('Introductory Message'), $attributes['intro_text']);
$this->addWysiwyg('footer_text', ts('Footer Message'), $attributes['footer_text']);
// is on behalf of an organization ?
$this->addElement('checkbox', 'is_organization', ts('Allow individuals to contribute and / or signup for membership on behalf of an organization?'), null, array('onclick' => "showHideByValue('is_organization',true,'for_org_text','table-row','radio',false);showHideByValue('is_organization',true,'for_org_option','table-row','radio',false);"));
$options = array();
$options[] = HTML_QuickForm::createElement('radio', null, null, ts('Optional'), 1);
$options[] = HTML_QuickForm::createElement('radio', null, null, ts('Required'), 2);
$this->addGroup($options, 'is_for_organization', ts(''));
$this->add('textarea', 'for_organization', ts('On behalf of Label'), $attributes['for_organization']);
// collect goal amount
$this->add('text', 'goal_amount', ts('Goal Amount'), array('size' => 8, 'maxlength' => 12));
$this->addRule('goal_amount', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
// is this page active ?
$this->addElement('checkbox', 'is_active', ts('Is this Online Contribution Page Active?'));
// should the honor be enabled
$this->addElement('checkbox', 'honor_block_is_active', ts('Honoree Section Enabled'), null, array('onclick' => "showHonor()"));
$this->add('text', 'honor_block_title', ts('Honoree Section Title'), $attributes['honor_block_title']);
$this->add('textarea', 'honor_block_text', ts('Honoree Introductory Message'), $attributes['honor_block_text']);
// add optional start and end dates
$this->addDateTime('start_date', ts('Start Date'));
$this->addDateTime('end_date', ts('End Date'));
$this->addFormRule(array('CRM_Contribute_Form_ContributionPage_Settings', 'formRule'));
parent::buildQuickForm();
}
开发者ID:bhirsch,项目名称:voipdev,代码行数:38,代码来源:Settings.php
示例4: buildQuickForm
/**
* Function to actually build the form
*
* @return void
* @access public
*/
function buildQuickForm()
{
$this->addElement('checkbox', 'is_active', ts('Enable Personal Campaign Pages (for this contribution page)?'), null, array('onclick' => "return showHideByValue('is_active',true,'pcpFields','table-row','radio',false);"));
$this->addElement('checkbox', 'is_approval_needed', ts('Approval required'));
$profile = array();
$isUserRequired = null;
$config =& CRM_Core_Config::singleton();
if ($config->userFramework != 'Standalone') {
$isUserRequired = 2;
}
CRM_Core_DAO::commonRetrieveAll('CRM_Core_DAO_UFGroup', 'is_cms_user', $isUserRequired, $profiles, array('title', 'is_active'));
if (!empty($profiles)) {
foreach ($profiles as $key => $value) {
if ($value['is_active']) {
$profile[$key] = $value['title'];
}
}
$this->assign('profile', $profile);
}
$this->add('select', 'supporter_profile_id', ts('Supporter profile'), array('' => ts('- select -')) + $profile);
$this->addElement('checkbox', 'is_tellfriend_enabled', ts("Allow 'Tell a friend' functionality"), null, array('onclick' => "return showHideByValue('is_tellfriend_enabled',true,'tflimit','table-row','radio',false);"));
$this->add('text', 'tellfriend_limit', ts("'Tell a friend' maximum recipients limit"), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'pcp_tellfriend_limit'));
$this->addRule('tellfriend_limit', ts('Please enter a valid limit.'), 'integer');
$this->add('text', 'link_text', ts("'Create Personal Campaign Page' link text"), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_PCPBlock', 'pcp_link_text'));
$this->add('text', 'notify_email', ts('Notify Email'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_PCPBlock', 'notify_email'));
parent::buildQuickForm();
$this->addFormRule(array('CRM_Contribute_Form_ContributionPage_PCP', 'formRule'), $this);
}
开发者ID:ksecor,项目名称:civicrm,代码行数:34,代码来源:PCP.php
示例5: setDefaultValues
/**
* This function sets the default values for the form. Note that in edit/view mode
* the default values are retrieved from the database
*
* @access public
* @return void
*/
function setDefaultValues()
{
$defaults = parent::setDefaultValues();
require_once 'CRM/Core/BAO/UFJoin.php';
$ufJoinParams = array('entity_table' => 'civicrm_contribution_page', 'entity_id' => $this->_id, 'weight' => 1);
$defaults['custom_pre_id'] = CRM_Core_BAO_UFJoin::findUFGroupId($ufJoinParams);
$ufJoinParams['weight'] = 2;
$defaults['custom_post_id'] = CRM_Core_BAO_UFJoin::findUFGroupId($ufJoinParams);
return $defaults;
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:17,代码来源:Custom.php
示例6: setDefaultValues
/**
* This function sets the default values for the form. Note that in edit/view mode
* the default values are retrieved from the database
*
* @access public
* @return void
*/
function setDefaultValues()
{
$defaults = parent::setDefaultValues();
if ($this->_id) {
$title = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $this->_id, 'title');
CRM_Utils_System::setTitle(ts('Include Profiles (%1)', array(1 => $title)));
}
require_once 'CRM/Core/BAO/UFJoin.php';
$ufJoinParams = array('entity_table' => 'civicrm_contribution_page', 'entity_id' => $this->_id);
list($defaults['custom_pre_id'], $defaults['custom_post_id']) = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
return $defaults;
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:19,代码来源:Custom.php
示例7: buildQuickForm
/**
* Function to actually build the form
*
* @return void
* @access public
*/
function buildQuickForm()
{
$this->_first = true;
// name
$this->add('text', 'title', ts('Title'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'title'), true);
$this->add('select', 'contribution_type_id', ts('Contribution Type'), CRM_Contribute_PseudoConstant::contributionType());
// intro_text and footer_text
$this->add('textarea', 'intro_text', ts('Introductory Message'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'intro_text'), true);
$this->add('textarea', 'footer_text', ts('Footer Message'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'footer_text'), false);
// is this group active ?
$this->addElement('checkbox', 'is_active', ts('Is this Online Contribution Page Active?'));
parent::buildQuickForm();
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:19,代码来源:Settings.php
示例8: preProcess
/**
* Function to set variables up before form is built
*
* @return void
* @access public
*/
public function preProcess()
{
//Check if there are contributions related to Contribution Page
parent::preProcess();
//check for delete
if (!CRM_Core_Permission::checkActionPermission('CiviContribute', $this->_action)) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page'));
}
$dao = new CRM_Contribute_DAO_Contribution();
$dao->contribution_page_id = $this->_id;
if ($dao->find(TRUE)) {
$this->_relatedContributions = TRUE;
$this->assign('relatedContributions', TRUE);
}
}
开发者ID:archcidburnziso,项目名称:civicrm-core,代码行数:21,代码来源:Delete.php
示例9: setDefaultValues
/**
* This function sets the default values for the form. Note that in edit/view mode
* the default values are retrieved from the database
*
* @access public
* @return void
*/
function setDefaultValues()
{
$defaults = parent::setDefaultValues();
require_once 'CRM/Core/BAO/CustomOption.php';
CRM_Core_BAO_CustomOption::getAssoc('civicrm_contribution_page', $this->_id, $defaults);
if (CRM_Utils_Array::value('value', $defaults)) {
foreach ($defaults['value'] as $i => $v) {
if ($v == $defaults['default_amount']) {
$defaults['default'] = $i;
break;
}
}
}
return $defaults;
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:22,代码来源:Amount.php
示例10: postProcess
/**
* Process the form submission.
*
*
* @return void
*/
public function postProcess()
{
// get the submitted form values.
$formValues = $this->controller->exportValues($this->_name);
$formValues['entity_table'] = 'civicrm_contribution_page';
$formValues['entity_id'] = $this->_id;
$formValues['title'] = $formValues['tf_title'];
$formValues['is_active'] = CRM_Utils_Array::value('tf_is_active', $formValues, FALSE);
$formValues['thankyou_title'] = CRM_Utils_Array::value('tf_thankyou_title', $formValues);
$formValues['thankyou_text'] = CRM_Utils_Array::value('tf_thankyou_text', $formValues);
if ($this->_action & CRM_Core_Action::UPDATE && $this->_friendId) {
$formValues['id'] = $this->_friendId;
}
CRM_Friend_BAO_Friend::addTellAFriend($formValues);
parent::endPostProcess();
}
开发者ID:utkarshsharma,项目名称:civicrm-core,代码行数:22,代码来源:Contribute.php
示例11: postProcess
/**
* Process the form.
*
* @return void
*/
public function postProcess()
{
// get the submitted form values.
$params = $this->controller->exportValues($this->_name);
if ($this->_action & CRM_Core_Action::UPDATE) {
$params['id'] = $this->_id;
}
$transaction = new CRM_Core_Transaction();
// also update uf join table
$ufJoinParams = array('is_active' => 1, 'module' => 'CiviContribute', 'entity_table' => 'civicrm_contribution_page', 'entity_id' => $this->_id);
// first delete all past entries
CRM_Core_BAO_UFJoin::deleteAll($ufJoinParams);
if (!empty($params['custom_pre_id'])) {
$ufJoinParams['weight'] = 1;
$ufJoinParams['uf_group_id'] = $params['custom_pre_id'];
CRM_Core_BAO_UFJoin::create($ufJoinParams);
}
unset($ufJoinParams['id']);
if (!empty($params['custom_post_id'])) {
$ufJoinParams['weight'] = 2;
$ufJoinParams['uf_group_id'] = $params['custom_post_id'];
CRM_Core_BAO_UFJoin::create($ufJoinParams);
}
$transaction->commit();
parent::endPostProcess();
}
开发者ID:vakeesan26,项目名称:civicrm-core,代码行数:31,代码来源:Custom.php
示例12: buildQuickForm
/**
* Function to actually build the form
*
* @return void
* @access public
*/
public function buildQuickForm()
{
require_once 'CRM/Member/BAO/MembershipType.php';
$membershipTypes = CRM_Member_BAO_MembershipType::getMembershipTypes();
if (!empty($membershipTypes)) {
$this->addElement('checkbox', 'is_active', ts('Membership Section Enabled?'), null, array('onclick' => "memberBlock(this);"));
$this->addElement('text', 'new_title', ts('Title - New Membership'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipBlock', 'new_title'));
$this->addWysiwyg('new_text', ts('Introductory Message - New Memberships'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipBlock', 'new_text'));
$this->addElement('text', 'renewal_title', ts('Title - Renewals'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipBlock', 'renewal_title'));
$this->addWysiwyg('renewal_text', ts('Introductory Message - Renewals'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipBlock', 'renewal_text'));
$this->addElement('checkbox', 'is_required', ts('Require Membership Signup'));
$this->addElement('checkbox', 'display_min_fee', ts('Display Membership Fee'));
$this->addElement('checkbox', 'is_separate_payment', ts('Separate Membership Payment'));
$membership = array();
$membershipDefault = array();
foreach ($membershipTypes as $k => $v) {
$membership[] = HTML_QuickForm::createElement('advcheckbox', $k, null, $v);
$membershipDefault[] = HTML_QuickForm::createElement('radio', null, null, null, $k);
}
$this->addGroup($membership, 'membership_type', ts('Membership Types'));
$this->addGroup($membershipDefault, 'membership_type_default', ts('Membership Types Default'));
$this->addFormRule(array('CRM_Member_Form_MembershipBlock', 'formRule'), $this->_id);
}
$session =& CRM_Core_Session::singleton();
$single = $session->get('singleForm');
if ($single) {
$this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'spacing' => ' ', 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
} else {
parent::buildQuickForm();
}
//$session->set('single', false );
}
开发者ID:ksecor,项目名称:civicrm,代码行数:38,代码来源:MembershipBlock.php
示例13: postProcess
/**
* Process the form
*
* @return void
* @access public
*/
public function postProcess()
{
// get the submitted form values.
$params = $this->controller->exportValues($this->_name);
// we do this in case the user has hit the forward/back button
$dao = new CRM_Contribute_DAO_Premium();
$dao->entity_table = 'civicrm_contribution_page';
$dao->entity_id = $this->_id;
$dao->find(TRUE);
$premiumID = $dao->id;
if ($premiumID) {
$params['id'] = $premiumID;
}
$params['premiums_active'] = CRM_Utils_Array::value('premiums_active', $params, FALSE);
$params['premiums_display_min_contribution'] = CRM_Utils_Array::value('premiums_display_min_contribution', $params, FALSE);
$params['entity_table'] = 'civicrm_contribution_page';
$params['entity_id'] = $this->_id;
$dao = new CRM_Contribute_DAO_Premium();
$dao->copyValues($params);
$dao->save();
parent::endPostProcess();
}
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:28,代码来源:Premium.php
示例14: postProcess
/**
* Process the form.
*
* @return void
*/
public function postProcess()
{
// get the submitted form values.
$params = $this->controller->exportValues($this->_name);
$deletePriceSet = 0;
if ($params['membership_type']) {
// we do this in case the user has hit the forward/back button
$dao = new CRM_Member_DAO_MembershipBlock();
$dao->entity_table = 'civicrm_contribution_page';
$dao->entity_id = $this->_id;
$dao->find(TRUE);
$membershipID = $dao->id;
if ($membershipID) {
$params['id'] = $membershipID;
}
$membershipTypes = array();
if (is_array($params['membership_type'])) {
foreach ($params['membership_type'] as $k => $v) {
if ($v) {
$membershipTypes[$k] = CRM_Utils_Array::value("auto_renew_{$k}", $params);
}
}
}
if ($this->_id && !empty($params['member_price_set_id'])) {
CRM_Core_DAO::setFieldValue('CRM_Contribute_DAO_ContributionPage', $this->_id, 'amount_block_is_active', 0);
}
// check for price set.
$priceSetID = CRM_Utils_Array::value('member_price_set_id', $params);
if (!empty($params['member_is_active']) && is_array($membershipTypes) && !$priceSetID) {
$usedPriceSetId = CRM_Price_BAO_PriceSet::getFor('civicrm_contribution_page', $this->_id, 2);
if (empty($params['mem_price_field_id']) && !$usedPriceSetId) {
$pageTitle = strtolower(CRM_Utils_String::munge($this->_values['title'], '_', 245));
$setParams['title'] = $this->_values['title'];
if (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_PriceSet', $pageTitle, 'id', 'name')) {
$setParams['name'] = $pageTitle;
} elseif (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_PriceSet', $pageTitle . '_' . $this->_id, 'id', 'name')) {
$setParams['name'] = $pageTitle . '_' . $this->_id;
} else {
$timeSec = explode(".", microtime(TRUE));
$setParams['name'] = $pageTitle . '_' . date('is', $timeSec[0]) . $timeSec[1];
}
$setParams['is_quick_config'] = 1;
$setParams['extends'] = CRM_Core_Component::getComponentID('CiviMember');
$setParams['financial_type_id'] = CRM_Utils_Array::value('financial_type_id', $this->_values);
$priceSet = CRM_Price_BAO_PriceSet::create($setParams);
$priceSetID = $priceSet->id;
$fieldParams['price_set_id'] = $priceSet->id;
} elseif ($usedPriceSetId) {
$setParams['extends'] = CRM_Core_Component::getComponentID('CiviMember');
$setParams['financial_type_id'] = CRM_Utils_Array::value('financial_type_id', $this->_values);
$setParams['id'] = $usedPriceSetId;
$priceSet = CRM_Price_BAO_PriceSet::create($setParams);
$priceSetID = $priceSet->id;
$fieldParams['price_set_id'] = $priceSet->id;
} else {
$fieldParams['id'] = CRM_Utils_Array::value('mem_price_field_id', $params);
$priceSetID = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceField', CRM_Utils_Array::value('mem_price_field_id', $params), 'price_set_id');
}
$editedFieldParams = array('price_set_id' => $priceSetID, 'name' => 'membership_amount');
$editedResults = array();
CRM_Price_BAO_PriceField::retrieve($editedFieldParams, $editedResults);
if (empty($editedResults['id'])) {
$fieldParams['name'] = strtolower(CRM_Utils_String::munge('Membership Amount', '_', 245));
if (empty($params['mem_price_field_id'])) {
CRM_Utils_Weight::updateOtherWeights('CRM_Price_DAO_PriceField', 0, 1, array('price_set_id' => $priceSetID));
}
$fieldParams['weight'] = 1;
} else {
$fieldParams['id'] = CRM_Utils_Array::value('id', $editedResults);
}
$fieldParams['label'] = !empty($params['membership_type_label']) ? $params['membership_type_label'] : ts('Membership');
$fieldParams['is_active'] = 1;
$fieldParams['html_type'] = 'Radio';
$fieldParams['is_required'] = !empty($params['is_required']) ? 1 : 0;
$fieldParams['is_display_amounts'] = !empty($params['display_min_fee']) ? 1 : 0;
$rowCount = 1;
$options = array();
if (!empty($fieldParams['id'])) {
CRM_Core_PseudoConstant::populate($options, 'CRM_Price_DAO_PriceFieldValue', TRUE, 'membership_type_id', NULL, " price_field_id = {$fieldParams['id']} ");
}
foreach ($membershipTypes as $memType => $memAutoRenew) {
if ($priceFieldID = CRM_Utils_Array::key($memType, $options)) {
$fieldParams['option_id'][$rowCount] = $priceFieldID;
unset($options[$priceFieldID]);
}
$membetype = CRM_Member_BAO_MembershipType::getMembershipTypeDetails($memType);
$fieldParams['option_label'][$rowCount] = CRM_Utils_Array::value('name', $membetype);
$fieldParams['option_amount'][$rowCount] = CRM_Utils_Array::value('minimum_fee', $membetype, 0);
$fieldParams['option_weight'][$rowCount] = CRM_Utils_Array::value('weight', $membetype);
$fieldParams['option_description'][$rowCount] = CRM_Utils_Array::value('description', $membetype);
$fieldParams['default_option'] = CRM_Utils_Array::value('membership_type_default', $params);
$fieldParams['option_financial_type_id'][$rowCount] = CRM_Utils_Array::value('financial_type_id', $membetype);
$fieldParams['membership_type_id'][$rowCount] = $memType;
// [$rowCount] = $membetype[''];
$rowCount++;
//.........这里部分代码省略.........
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:101,代码来源:MembershipBlock.php
示例15: buildQuickForm
/**
* Function to actually build the form
*
* @return void
* @access public
*/
public function buildQuickForm()
{
require_once 'CRM/Member/BAO/MembershipType.php';
$membershipTypes = CRM_Member_BAO_MembershipType::getMembershipTypes();
if (!empty($membershipTypes)) {
$this->addElement('checkbox', 'is_active', ts('Membership Section Enabled?'), null, array('onclick' => "memberBlock(this);"));
$this->addElement('text', 'new_title', ts('Title - New Membership'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipBlock', 'new_title'));
$this->addWysiwyg('new_text', ts('Introductory Message - New Memberships'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipBlock', 'new_text'));
$this->addElement('text', 'renewal_title', ts('Title - Renewals'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipBlock', 'renewal_title'));
$this->addWysiwyg('renewal_text', ts('Introductory Message - Renewals'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipBlock', 'renewal_text'));
$this->addElement('checkbox', 'is_required', ts('Require Membership Signup'));
$this->addElement('checkbox', 'display_min_fee', ts('Display Membership Fee'));
$this->addElement('checkbox', 'is_separate_payment', ts('Separate Membership Payment'));
$paymentProcessor = CRM_Core_PseudoConstant::paymentProcessor(false, false, 'is_recur = 1');
$paymentProcessorId = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $this->_id, 'payment_processor_id');
$isRecur = false;
$membership = array();
$membershipDefault = array();
foreach ($membershipTypes as $k => $v) {
$membership[] = HTML_QuickForm::createElement('advcheckbox', $k, null, $v);
$membershipDefault[] = HTML_QuickForm::createElement('radio', null, null, null, $k);
if (is_array($paymentProcessor) && CRM_Utils_Array::value($paymentProcessorId, $paymentProcessor)) {
$isRecur = true;
$autoRenew = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $k, 'auto_renew');
$autoRenewOptions = array();
if ($autoRenew) {
$autoRenewOptions = array(ts('Not offered'), ts('Give option'), ts('Required'));
$this->addElement('select', "auto_renew_{$k}", ts('Auto-renew'), $autoRenewOptions);
$this->_renewOption[$k] = $autoRenew;
}
} else {
$isRecur = false;
}
}
$this->assign('is_recur', $isRecur);
$this->assign('auto_renew', $this->_renewOption);
$this->addGroup($membership, 'membership_type', ts('Membership Types'));
$this->addGroup($membershipDefault, 'membership_type_default', ts('Membership Types Default'));
$this->addFormRule(array('CRM_Member_Form_MembershipBlock', 'formRule'), $this->_id);
}
$session = CRM_Core_Session::singleton();
$single = $session->get('singleForm');
if ($single) {
$this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'spacing' => ' ', 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
} else {
parent::buildQuickForm();
}
//$session->set('single', false );
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:55,代码来源:MembershipBlock.php
示例16: buildQuickForm
/**
* Function to actually build the form
*
* @return void
* @access public
*/
function buildQuickForm()
{
if ($this->_action & CRM_CORE_ACTION_DELETE) {
$session =& CRM_Core_Session::singleton();
$url = CRM_Utils_System::url('/civicrm/admin/contribute', 'reset=1&action=update&id=' . $this->_id . '&subPage=Premium');
$session->pushUserContext($url);
if (CRM_Utils_Request::retrieve('confirmed', $form, '', '', 'GET')) {
require_once 'CRM/Contribute/DAO/PremiumsProduct.php';
$dao =& new CRM_Contribute_DAO_PremiumsProduct();
$dao->id = $this->_pid;
$dao->delete();
CRM_Core_Session::setStatus(ts('Selected Premium Product has been removed from this Contribution Page.'));
CRM_Utils_System::redirect($url);
}
$this->addButtons(array(array('type' => 'next', 'name' => ts('Delete'), 'spacing' => ' ', 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
return;
}
if ($this->_action & CRM_CORE_ACTION_PREVIEW) {
require_once 'CRM/Contribute/BAO/Premium.php';
CRM_Contribute_BAO_Premium::buildPremiumPreviewBlock($this, null, $this->_pid);
$this->addButtons(array(array('type' => 'next', 'name' => ts('Done With Preview'), 'isDefault' => true)));
return;
}
$session =& CRM_Core_Session::singleton();
$url = CRM_Utils_System::url('/civicrm/admin/contribute', 'reset=1&action=update&id=' . $this->_id . '&subPage=Premium');
$session->pushUserContext($url);
$this->addElement('select', 'product_id', ts('Select the Product') . ' ', $this->_products);
$this->addRule('product_id', ts('Select the Product') . ' ', 'required');
$this->addElement('text', 'sort_position', ts('Weight'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_PremiumsProduct', 'sort_position'));
$this->addRule('sort_position', ts('Please enter integer value for weight'), 'integer');
$session =& CRM_Core_Session::singleton();
$single = $session->get('singleForm');
$session->pushUserContext(CRM_Utils_System::url('civicrm/admin/contribute', 'action=update&reset=1&id=' . $this->_id . '&subPage=Premium'));
if ($single) {
$this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'spacing' => ' ', 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
} else {
parent::buildQuickForm();
}
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:45,代码来源:AddProduct.php
示例17: postProcess
function postProcess()
{
//to reset quickform elements of next (pcp) page.
if ($this->controller->getNextName('Widget') == 'PCP') {
$this->controller->resetPage('PCP');
}
// get the submitted form values.
$params = $this->controller->exportValues($this->_name);
if ($this->_widget) {
$params['id'] = $this->_widget->id;
}
$params['contribution_page_id'] = $this->_id;
$params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
$params['url_homepage'] = 'null';
$widget = new CRM_Contribute_DAO_Widget();
$widget->copyValues($params);
$widget->save();
$buttonName = $this->controller->getButtonName();
if ($buttonName == $this->_refreshButtonName) {
return;
}
parent::endPostProcess();
}
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:23,代码来源:Widget.php
示例18: postProcess
/**
* Process the form
*
* @return void
* @access public
*/
public function postProcess()
{
// get the submitted form values.
$params = $this->controller->exportValues($this->_name);
// we do this in case the user has hit the forward/back button
if ($this->_id) {
$params['id'] = $this->_id;
} else {
$session = CRM_Core_Session::singleton();
$params['created_id'] = $session->get('userID');
$params['created_date'] = date('YmdHis');
$config = CRM_Core_Config::singleton();
$params['currency'] = $config->defaultCurrency;
}
$params['is_confirm_enabled'] = CRM_Utils_Array::value('is_confirm_enabled', $params, FALSE);
$params['is_share'] = CRM_Utils_Array::value('is_share', $params, FALSE);
$params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
$params['is_credit_card_only'] = CRM_Utils_Array::value('is_credit_card_only', $params, FALSE);
$params['honor_block_is_active'] = CRM_Utils_Array::value('honor_block_is_active', $params, FALSE);
$params['is_for_organization'] = CRM_Utils_Array::value('is_organization', $params) ? CRM_Utils_Array::value('is_for_organization', $params, FALSE) : 0;
$params['start_date'] = CRM_Utils_Date::processDate($params['start_date'], $params['start_date_time'], TRUE);
$params['end_date'] = CRM_Utils_Date::processDate($params['end_date'], $params['end_date_time'], TRUE);
$params['goal_amount'] = CRM_Utils_Rule::cleanMoney($params['goal_amount']);
if (!$params['honor_block_is_active']) {
$params['honor_block_title'] = NULL;
$params['honor_block_text'] = NULL;
}
$dao = CRM_Contribute_BAO_ContributionPage::create($params);
// make entry in UF join table for onbehalf of org profile
$ufJoinParams = array('is_active' => 1, 'module' => 'OnBehalf', 'entity_table' => 'civicrm_contribution_page', 'entity_id' => $dao->id);
// first delete all past entries
CRM_Core_BAO_UFJoin::deleteAll($ufJoinParams);
if (CRM_Utils_Array::value('onbehalf_profile_id', $params)) {
$ufJoinParams['weight'] = 1;
$ufJoinParams['uf_group_id'] = $params['onbehalf_profile_id'];
CRM_Core_BAO_UFJoin::create($ufJoinParams);
}
$this->set('id', $dao->id);
if ($this->_action & CRM_Core_Action::ADD) {
$url = 'civicrm/admin/contribute/amount';
$urlParams = "action=update&reset=1&id={$dao->id}";
// special case for 'Save and Done' consistency.
if ($this->controller->getButtonName('submit') == '_qf_Amount_upload_done') {
$url = 'civicrm/admin/contribute';
$urlParams = 'reset=1';
CRM_Core_Session::setStatus(ts("'%1' information has been saved.", array(1 => $this->getTitle())));
}
CRM_Utils_System::redirect(CRM_Utils_System::url($url, $urlParams));
}
parent::endPostProcess();
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:57,代码来源:Settings.php
示例19: buildQuickForm
/**
* Function to actually build the form
*
* @return void
* @access public
*/
function buildQuickForm()
{
$this->assign('showForm', false);
$this->addElement('checkbox', 'premiums_active', ts('Premiums Section Enabled?'));
$this->addElement('text', 'premiums_intro_title', ts('Title'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Premium', 'premiums_intro_title'));
//$this->addRule('premiums_intro_title',ts('Plese Eneter the Title'),'required');
// intro_text
$this->add('textarea', 'premiums_intro_text', ts('Introductory Message'), 'rows=5, cols=50');
$this->add('text', 'premiums_contact_email', ts('Contact Email') . ' ', CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Premium', 'premiums_contact_email'));
$this->addRule('premiums_contact_email', ts('Please enter valid email address for Contact Email') . ' ', 'email');
$this->add('text', 'premiums_contact_phone', ts('Contact Phone'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Premium', 'premiums_contact_phone'));
$this->addRule('premiums_contact_phone', ts('Please enter valid phone'), 'phone');
$this->addElement('checkbox', 'premiums_display_min_contribution', ts('Display Minimum Contribution Amount?'));
$session =& CRM_Core_Session::singleton();
$single = $session->get('singleForm');
if ($single) {
$this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'spacing' => ' ', 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
} else {
$this->assign('showForm', true);
parent::buildQuickForm();
}
//$session->set('single', false );
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:29,代码来源:Premium.php
示例20: postProcess
/**
* Process the form.
*/
public function postProcess()
{
// get the submitted form values.
$params = $this->controller->exportValues($this->_name);
// we do this in case the user has hit the forward/back button
if ($this->_id) {
$params['id'] = $this->_id;
} else {
$session = CRM_Core_Session::singleton();
$params['created_id'] = $session->get('userID');
$params['created_date'] = date('YmdHis');
$config = CRM_Core_Config::singleton();
$params['currency'] = $config->defaultCurrency;
}
$params['is_confirm_enabled'] = CRM_Utils_Array::value('is_confirm_enabled', $params, FALSE);
$params['is_share'] = CRM_Utils_Array::value('is_share', $params, FALSE);
$params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
$params['is_credit_card_only'] = CRM_Utils_Array::value('is_credit_card_only', $params, FALSE);
$params['honor_block_is_active'] = CRM_Utils_Array::value('honor_block_is_active', $params, FALSE);
$params['is_fo
|
请发表评论