本文整理汇总了PHP中CRM_Member_BAO_Membership::getContributionPageId方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Member_BAO_Membership::getContributionPageId方法的具体用法?PHP CRM_Member_BAO_Membership::getContributionPageId怎么用?PHP CRM_Member_BAO_Membership::getContributionPageId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Member_BAO_Membership
的用法示例。
在下文中一共展示了CRM_Member_BAO_Membership::getContributionPageId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listMemberships
/**
* Function to list memberships for the UF user
*
* return null
* @access public
*/
function listMemberships()
{
$idList = array('membership_type' => 'MembershipType', 'status' => 'MembershipStatus');
$membership = array();
require_once "CRM/Member/BAO/Membership.php";
$dao =& new CRM_Member_DAO_Membership();
$dao->contact_id = $this->_contactId;
$dao->is_test = 0;
$dao->find();
while ($dao->fetch()) {
$membership[$dao->id] = array();
CRM_Core_DAO::storeValues($dao, $membership[$dao->id]);
foreach ($idList as $name => $file) {
if ($membership[$dao->id][$name . '_id']) {
$membership[$dao->id][$name] = CRM_Core_DAO::getFieldValue("CRM_Member_DAO_{$file}", $membership[$dao->id][$name . '_id']);
}
}
if ($dao->status_id) {
$active = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipStatus', $dao->status_id, 'is_current_member');
if ($active) {
$membership[$dao->id]['active'] = $active;
}
}
$membership[$dao->id]['renewPageId'] = CRM_Member_BAO_Membership::getContributionPageId($dao->id);
}
$activeMembers = CRM_Member_BAO_Membership::activeMembers($membership);
$inActiveMembers = CRM_Member_BAO_Membership::activeMembers($membership, 'inactive');
$this->assign('activeMembers', $activeMembers);
$this->assign('inActiveMembers', $inActiveMembers);
}
示例2: listMemberships
/**
* Function to list memberships for the UF user
*
* return null
* @access public
*/
function listMemberships()
{
$membership = array();
$dao = new CRM_Member_DAO_Membership();
$dao->contact_id = $this->_contactId;
$dao->is_test = 0;
$dao->find();
while ($dao->fetch()) {
$membership[$dao->id] = array();
CRM_Core_DAO::storeValues($dao, $membership[$dao->id]);
//get the membership status and type values.
$statusANDType = CRM_Member_BAO_Membership::getStatusANDTypeValues($dao->id);
foreach (array('status', 'membership_type') as $fld) {
$membership[$dao->id][$fld] = CRM_Utils_Array::value($fld, $statusANDType[$dao->id]);
}
if (!empty($statusANDType[$dao->id]['is_current_member'])) {
$membership[$dao->id]['active'] = TRUE;
}
$membership[$dao->id]['renewPageId'] = CRM_Member_BAO_Membership::getContributionPageId($dao->id);
if (!$membership[$dao->id]['renewPageId']) {
// Membership payment was not done via online contribution page or free membership. Check for default membership renewal page from CiviMember Settings
$defaultRenewPageId = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MEMBER_PREFERENCES_NAME, 'default_renewal_contribution_page');
if ($defaultRenewPageId) {
$membership[$dao->id]['renewPageId'] = $defaultRenewPageId;
}
}
}
$activeMembers = CRM_Member_BAO_Membership::activeMembers($membership);
$inActiveMembers = CRM_Member_BAO_Membership::activeMembers($membership, 'inactive');
$this->assign('activeMembers', $activeMembers);
$this->assign('inActiveMembers', $inActiveMembers);
}
示例3: listMemberships
/**
* Function to list memberships for the UF user
*
* return null
* @access public
*/
function listMemberships()
{
$membership = array();
require_once "CRM/Member/BAO/Membership.php";
$dao = new CRM_Member_DAO_Membership();
$dao->contact_id = $this->_contactId;
$dao->is_test = 0;
$dao->find();
while ($dao->fetch()) {
$membership[$dao->id] = array();
CRM_Core_DAO::storeValues($dao, $membership[$dao->id]);
//get the membership status and type values.
$statusANDType = CRM_Member_BAO_Membership::getStatusANDTypeVaues($dao->id);
foreach (array('status', 'membership_type') as $fld) {
$membership[$dao->id][$fld] = CRM_Utils_Array::value($fld, $statusANDType[$dao->id]);
}
if (CRM_Utils_Array::value('is_current_member', $statusANDType[$dao->id])) {
$membership[$dao->id]['active'] = true;
}
$membership[$dao->id]['renewPageId'] = CRM_Member_BAO_Membership::getContributionPageId($dao->id);
}
$activeMembers = CRM_Member_BAO_Membership::activeMembers($membership);
$inActiveMembers = CRM_Member_BAO_Membership::activeMembers($membership, 'inactive');
$this->assign('activeMembers', $activeMembers);
$this->assign('inActiveMembers', $inActiveMembers);
}
示例4: listMemberships
/**
* List memberships for the UF user.
*
*/
public function listMemberships()
{
$membership = array();
$dao = new CRM_Member_DAO_Membership();
$dao->contact_id = $this->_contactId;
$dao->is_test = 0;
$dao->find();
while ($dao->fetch()) {
$membership[$dao->id] = array();
CRM_Core_DAO::storeValues($dao, $membership[$dao->id]);
//get the membership status and type values.
$statusANDType = CRM_Member_BAO_Membership::getStatusANDTypeValues($dao->id);
foreach (array('status', 'membership_type') as $fld) {
$membership[$dao->id][$fld] = CRM_Utils_Array::value($fld, $statusANDType[$dao->id]);
}
if (!empty($statusANDType[$dao->id]['is_current_member'])) {
$membership[$dao->id]['active'] = TRUE;
}
$membership[$dao->id]['renewPageId'] = CRM_Member_BAO_Membership::getContributionPageId($dao->id);
if (!$membership[$dao->id]['renewPageId']) {
// Membership payment was not done via online contribution page or free membership. Check for default membership renewal page from CiviMember Settings
$defaultRenewPageId = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MEMBER_PREFERENCES_NAME, 'default_renewal_contribution_page');
if ($defaultRenewPageId) {
//CRM-14831 - check if membership type is present in contrib page
$memBlock = CRM_Member_BAO_Membership::getMembershipBlock($defaultRenewPageId);
if (!empty($memBlock['membership_types'])) {
$memTypes = explode(',', $memBlock['membership_types']);
if (in_array($dao->membership_type_id, $memTypes)) {
$membership[$dao->id]['renewPageId'] = $defaultRenewPageId;
}
}
} else {
switch ($membership[$dao->id]['membership_type_id']) {
case "1":
default:
$membership[$dao->id]['renewPageId'] = 2;
break;
case "10":
$membership[$dao->id]['renewPageId'] = 19;
break;
case "11":
$membership[$dao->id]['renewPageId'] = 23;
break;
case "5":
case "9":
$membership[$dao->id]['renewPageId'] = 22;
break;
}
}
}
}
$activeMembers = CRM_Member_BAO_Membership::activeMembers($membership);
$inActiveMembers = CRM_Member_BAO_Membership::activeMembers($membership, 'inactive');
$this->assign('activeMembers', $activeMembers);
$this->assign('inActiveMembers', $inActiveMembers);
}
示例5: testgetContributionPageId
/**
* Get the contribution.
* page id from the membership record
*/
public function testgetContributionPageId()
{
$contactId = Contact::createIndividual();
$params = array('contact_id' => $contactId, 'membership_type_id' => $this->_membershipTypeID, 'join_date' => date('Ymd', strtotime('2006-01-21')), 'start_date' => date('Ymd', strtotime('2006-01-21')), 'end_date' => date('Ymd', strtotime('2006-12-21')), 'source' => 'Payment', 'is_override' => 1, 'status_id' => $this->_membershipStatusID);
$ids = array();
CRM_Member_BAO_Membership::create($params, $ids);
$membershipId = $this->assertDBNotNull('CRM_Member_BAO_Membership', $contactId, 'id', 'contact_id', 'Database check for created membership.');
$membership[$membershipId]['renewPageId'] = CRM_Member_BAO_Membership::getContributionPageId($membershipId);
$this->membershipDelete($membershipId);
Contact::delete($contactId);
}