<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
* @public
*/
public $_premiumID = NULL;
+
+ /**
+ * @var CRM_Contribute_DAO_ContributionProduct
+ */
public $_productDAO = NULL;
/**
protected $_formType;
protected $_cdType;
+ /**
+ * @param $id
+ */
+ public function showRecordLinkMesssage($id) {
+ $statusId = CRM_Core_DAO::getFieldValue('CRM_Contribute_BAO_Contribution', $id, 'contribution_status_id');
+ if (CRM_Contribute_PseudoConstant::contributionStatus($statusId, 'name') == 'Partially paid') {
+ if ($pid = CRM_Core_DAO::getFieldValue('CRM_Event_BAO_ParticipantPayment', $id, 'participant_id', 'contribution_id')) {
+ $recordPaymentLink = CRM_Utils_System::url('civicrm/payment',
+ "reset=1&id={$pid}&cid={$this->_contactID}&action=add&component=event"
+ );
+ CRM_Core_Session::setStatus(ts('Please use the <a href="%1">Record Payment</a> form if you have received an additional payment for this Partially paid contribution record.', array(1 => $recordPaymentLink)), ts('Notice'), 'alert');
+ }
+ }
+ }
+
+ /**
+ * @param $id
+ * @param $values
+ */
public function buildValuesAndAssignOnline_Note_Type($id, &$values) {
$ids = array();
$params = array('id' => $id);
//Check if this is an online transaction (financial_trxn.payment_processor_id NOT NULL)
$this->_online = FALSE;
$fids = CRM_Core_BAO_FinancialTrxn::getFinancialTrxnId($id);
- if (CRM_Utils_Array::value('financialTrxnId', $fids)) {
+ if (!empty($fids['financialTrxnId'])) {
$this->_online = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialTrxn', $fids['financialTrxnId'], 'payment_processor_id');
}
$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', $values)) {
- unset($values['honor_type_id']);
- }
//to get note id
$daoNote = new CRM_Core_BAO_Note();
$daoNote->entity_table = 'civicrm_contribution';
CRM_Custom_Form_CustomData::setDefaultValues($this);
}
+ /**
+ * @param $id
+ * @todo - this function is a long way, non standard of saying $dao = new CRM_Contribute_DAO_ContributionProduct(); $dao->id = $id; $dao->find();
+ */
public function assignPremiumProduct($id) { //to get Premium id
$sql = "
SELECT *
elseif ($updatedStatusName == 'Expired') {
$statusMsg .= "<br />" . ts("Membership for %1 has been Expired.", array(1 => $userDisplayName));
}
- elseif ($endDate = CRM_Utils_Array::value('membership_end_date', $updateResult)) {
- $statusMsg .= "<br />" . ts("Membership for %1 has been updated. The membership End Date is %2.",
- array(
- 1 => $userDisplayName,
- 2 => $endDate
- )
- );
+ else {
+ $endDate = CRM_Utils_Array::value('membership_end_date', $updateResult);
+ if ($endDate) {
+ $statusMsg .= "<br />" . ts("Membership for %1 has been updated. The membership End Date is %2.",
+ array(
+ 1 => $userDisplayName,
+ 2 => $endDate
+ )
+ );
+ }
}
}
$this->assign('hidePayPalExpress', TRUE);
}
+ /**
+ * @param $submittedValues
+ *
+ * @return mixed
+ */
public function getCurrency($submittedValues) { // get current currency from DB or use default currency
$config = CRM_Core_Config::singleton();
return $result;
}
+ /**
+ * @param $financialTypeId
+ *
+ * @return array
+ */
public function getFinancialAccounts($financialTypeId) {
$financialAccounts = array();
CRM_Core_PseudoConstant::populate($financialAccounts,
return $financialAccounts;
}
+ /**
+ * @param $financialTypeId
+ * @param $relationTypeId
+ *
+ * @return mixed
+ */
public function getFinancialAccount($financialTypeId, $relationTypeId) {
$financialAccounts = $this->getFinancialAccounts($financialTypeId);
return CRM_Utils_Array::value($relationTypeId, $financialAccounts);
}
}
+ /**
+ * @param $submittedValues
+ *
+ * @return mixed
+ */
public function unsetCreditCardFields($submittedValues) {
//Offline Contribution.
$unsetParams = array(