本文整理汇总了PHP中CRM_PCP_BAO_PCP::getPcpPageTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_PCP_BAO_PCP::getPcpPageTitle方法的具体用法?PHP CRM_PCP_BAO_PCP::getPcpPageTitle怎么用?PHP CRM_PCP_BAO_PCP::getPcpPageTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_PCP_BAO_PCP
的用法示例。
在下文中一共展示了CRM_PCP_BAO_PCP::getPcpPageTitle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: allForContact
public static function allForContact($contactId)
{
$statusNames = CRM_Core_OptionGroup::values("pcp_status", FALSE, FALSE, FALSE, NULL, 'name');
$query = "SELECT\r\n pcp.id,\r\n pcp.title,\r\n pcp.status_id,\r\n pcp.page_id,\r\n count(cc.total_amount) as contribution_count,\r\n sum(cc.total_amount) as amount_raised,\r\n pcp.goal_amount,\r\n pcp.currency\r\n FROM civicrm_pcp pcp\r\n LEFT JOIN civicrm_contribution_soft cs ON ( pcp.id = cs.pcp_id )\r\n LEFT JOIN civicrm_contribution cc ON ( cs.contribution_id = cc.id)\r\n WHERE pcp.contact_id = %1\r\n GROUP BY pcp.id";
$cpages = CRM_Core_DAO::executeQuery($query, array(1 => array($contactId, 'Integer')));
$pages = array();
while ($cpages->fetch()) {
$pages[] = array('id' => $cpages->id, 'title' => $cpages->title, 'status' => $statusNames[$cpages->status_id], 'page' => CRM_PCP_BAO_PCP::getPcpPageTitle($cpages->page_id, 'contribute'), 'contribution_count' => $cpages->contribution_count, 'amount_raised' => $cpages->amount_raised, 'goal_amount' => $cpages->goal_amount, 'currency' => $cpages->currency);
}
return $pages;
}
示例2: setDefaultValues
/**
* Function used to set defaults for soft credit block.
*
* @param $defaults
* @param $form
*/
public static function setDefaultValues(&$defaults, &$form)
{
//Used to hide/unhide PCP and/or Soft-credit Panes
$noPCP = $noSoftCredit = TRUE;
if (!empty($form->_softCreditInfo['soft_credit'])) {
$noSoftCredit = FALSE;
foreach ($form->_softCreditInfo['soft_credit'] as $key => $value) {
$defaults["soft_credit_amount[{$key}]"] = CRM_Utils_Money::format($value['amount'], NULL, '%a');
$defaults["soft_credit_contact_id[{$key}]"] = $value['contact_id'];
$defaults["soft_credit_type[{$key}]"] = $value['soft_credit_type'];
}
}
if (!empty($form->_softCreditInfo['pcp_id'])) {
$noPCP = FALSE;
$pcpInfo = $form->_softCreditInfo;
$pcpId = CRM_Utils_Array::value('pcp_id', $pcpInfo);
$pcpTitle = CRM_Core_DAO::getFieldValue('CRM_PCP_DAO_PCP', $pcpId, 'title');
$contributionPageTitle = CRM_PCP_BAO_PCP::getPcpPageTitle($pcpId, 'contribute');
$defaults['pcp_made_through'] = CRM_Utils_Array::value('sort_name', $pcpInfo) . " :: " . $pcpTitle . " :: " . $contributionPageTitle;
$defaults['pcp_made_through_id'] = CRM_Utils_Array::value('pcp_id', $pcpInfo);
$defaults['pcp_display_in_roll'] = CRM_Utils_Array::value('pcp_display_in_roll', $pcpInfo);
$defaults['pcp_roll_nickname'] = CRM_Utils_Array::value('pcp_roll_nickname', $pcpInfo);
$defaults['pcp_personal_note'] = CRM_Utils_Array::value('pcp_personal_note', $pcpInfo);
}
$form->assign('noSoftCredit', $noSoftCredit);
$form->assign('noPCP', $noPCP);
}
示例3: setDefaultValues
/**
* Function used to set defaults for soft credit block
*/
static function setDefaultValues(&$defaults, &$form)
{
if (!empty($form->_softCreditInfo['soft_credit'])) {
foreach ($form->_softCreditInfo['soft_credit'] as $key => $value) {
$defaults["soft_credit_amount[{$key}]"] = CRM_Utils_Money::format($value['amount'], NULL, '%a');
$defaults["soft_credit_contact_select_id[{$key}]"] = $value['contact_id'];
$defaults["soft_credit_type[{$key}]"] = $value['soft_credit_type'];
}
} elseif (!empty($form->_softCreditInfo['pcp_id'])) {
$pcpInfo = $form->_softCreditInfo;
$pcpId = CRM_Utils_Array::value('pcp_id', $pcpInfo);
$pcpTitle = CRM_Core_DAO::getFieldValue('CRM_PCP_DAO_PCP', $pcpId, 'title');
$contributionPageTitle = CRM_PCP_BAO_PCP::getPcpPageTitle($pcpId, 'contribute');
$defaults['pcp_made_through'] = CRM_Utils_Array::value('sort_name', $pcpInfo) . " :: " . $pcpTitle . " :: " . $contributionPageTitle;
$defaults['pcp_made_through_id'] = CRM_Utils_Array::value('pcp_id', $pcpInfo);
$defaults['pcp_display_in_roll'] = CRM_Utils_Array::value('pcp_display_in_roll', $pcpInfo);
$defaults['pcp_roll_nickname'] = CRM_Utils_Array::value('pcp_roll_nickname', $pcpInfo);
$defaults['pcp_personal_note'] = CRM_Utils_Array::value('pcp_personal_note', $pcpInfo);
}
}
示例4: preProcess
//.........这里部分代码省略.........
} else {
$paymentsDue = $payments;
}
}
}
if ($multipleDue) {
// Show link to pledge tab since more than one pledge has a payment due
$pledgeTab = CRM_Utils_System::url('civicrm/contact/view', "reset=1&force=1&cid={$this->_contactID}&selectedChild=pledge");
CRM_Core_Session::setStatus(ts('This contact has pending or overdue pledge payments. <a href="%1">Click here to view their Pledges tab</a> and verify whether this contribution should be applied as a pledge payment.', array(1 => $pledgeTab)));
} elseif ($paymentsDue) {
// Show user link to oldest Pending or Overdue pledge payment
$ppAmountDue = CRM_Utils_Money::format($payments['amount'], $payments['currency']);
$ppSchedDate = CRM_Utils_Date::customFormat(CRM_Core_DAO::getFieldValue('CRM_Pledge_DAO_PledgePayment', $payments['id'], 'scheduled_date'));
if ($this->_mode) {
$ppUrl = CRM_Utils_System::url('civicrm/contact/view/contribution', "reset=1&action=add&cid={$this->_contactID}&ppid={$payments['id']}&context=pledge&mode=live");
} else {
$ppUrl = CRM_Utils_System::url('civicrm/contact/view/contribution', "reset=1&action=add&cid={$this->_contactID}&ppid={$payments['id']}&context=pledge");
}
CRM_Core_Session::setStatus(ts('This contact has a pending or overdue pledge payment of %2 which is scheduled for %3. <a href="%1">Click here to enter a pledge payment</a>.', array(1 => $ppUrl, 2 => $ppAmountDue, 3 => $ppSchedDate)));
}
}
}
}
}
$this->_values = array();
// current contribution id
if ($this->_id) {
//to get Premium id
$sql = "\nSELECT *\nFROM civicrm_contribution_product\nWHERE contribution_id = {$this->_id}\n";
$dao = CRM_Core_DAO::executeQuery($sql, CRM_Core_DAO::$_nullArray);
if ($dao->fetch()) {
$this->_premiumID = $dao->id;
$this->_productDAO = $dao;
}
$dao->free();
$ids = array();
$params = array('id' => $this->_id);
CRM_Contribute_BAO_Contribution::getValues($params, $this->_values, $ids);
//do check for online / recurring contributions
$fids = CRM_Core_BAO_FinancialTrxn::getFinancialTrxnIds($this->_id, 'civicrm_contribution');
$this->_online = CRM_Utils_Array::value('entityFinancialTrxnId', $fids);
//don't allow to update all fields for recuring contribution.
if (!$this->_online) {
$this->_online = CRM_Utils_Array::value('contribution_recur_id', $this->_values);
}
$this->assign('isOnline', $this->_online ? TRUE : FALSE);
//unset the honor type id:when delete the honor_contact_id
//and edit the contribution, honoree infomation pane open
//since honor_type_id is present
if (!CRM_Utils_Array::value('honor_contact_id', $this->_values)) {
unset($this->_values['honor_type_id']);
}
//to get note id
$daoNote = new CRM_Core_BAO_Note();
$daoNote->entity_table = 'civicrm_contribution';
$daoNote->entity_id = $this->_id;
if ($daoNote->find(TRUE)) {
$this->_noteID = $daoNote->id;
$this->_values['note'] = $daoNote->note;
}
$this->_contributionType = $this->_values['contribution_type_id'];
$csParams = array('contribution_id' => $this->_id);
$softCredit = CRM_Contribute_BAO_Contribution::getSoftContribution($csParams, TRUE);
if (CRM_Utils_Array::value('soft_credit_to', $softCredit)) {
$softCredit['sort_name'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $softCredit['soft_credit_to'], 'sort_name');
}
$this->_values['soft_credit_to'] = CRM_Utils_Array::value('sort_name', $softCredit);
$this->_values['softID'] = CRM_Utils_Array::value('soft_credit_id', $softCredit);
$this->_values['soft_contact_id'] = CRM_Utils_Array::value('soft_credit_to', $softCredit);
if (CRM_Utils_Array::value('pcp_id', $softCredit)) {
$pcpId = CRM_Utils_Array::value('pcp_id', $softCredit);
$pcpTitle = CRM_Core_DAO::getFieldValue('CRM_PCP_DAO_PCP', $pcpId, 'title');
$contributionPageTitle = CRM_PCP_BAO_PCP::getPcpPageTitle($pcpId, 'contribute');
$this->_values['pcp_made_through'] = CRM_Utils_Array::value('sort_name', $softCredit) . " :: " . $pcpTitle . " :: " . $contributionPageTitle;
$this->_values['pcp_made_through_id'] = CRM_Utils_Array::value('pcp_id', $softCredit);
$this->_values['pcp_display_in_roll'] = CRM_Utils_Array::value('pcp_display_in_roll', $softCredit);
$this->_values['pcp_roll_nickname'] = CRM_Utils_Array::value('pcp_roll_nickname', $softCredit);
$this->_values['pcp_personal_note'] = CRM_Utils_Array::value('pcp_personal_note', $softCredit);
}
//display check number field only if its having value or its offline mode.
if (CRM_Utils_Array::value('payment_instrument_id', $this->_values) == CRM_Core_OptionGroup::getValue('payment_instrument', 'Check', 'name') || CRM_Utils_Array::value('check_number', $this->_values)) {
$this->assign('showCheckNumber', TRUE);
}
}
// when custom data is included in this page
if (CRM_Utils_Array::value('hidden_custom', $_POST)) {
$this->set('type', 'Contribution');
$this->set('subType', CRM_Utils_Array::value('contribution_type_id', $_POST));
$this->set('entityId', $this->_id);
CRM_Custom_Form_CustomData::preProcess($this);
CRM_Custom_Form_CustomData::buildQuickForm($this);
CRM_Custom_Form_CustomData::setDefaultValues($this);
}
$this->_lineItems = array();
if ($this->_id) {
$lineItem = CRM_Price_BAO_LineItem::getLineItems($this->_id, 'contribution', 1);
empty($lineItem) ? null : ($this->_lineItems[] = $lineItem);
}
$this->assign('lineItem', empty($this->_lineItems) ? FALSE : $this->_lineItems);
}