本文整理汇总了PHP中CRM_Financial_BAO_FinancialAccount::getARAccounts方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Financial_BAO_FinancialAccount::getARAccounts方法的具体用法?PHP CRM_Financial_BAO_FinancialAccount::getARAccounts怎么用?PHP CRM_Financial_BAO_FinancialAccount::getARAccounts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Financial_BAO_FinancialAccount
的用法示例。
在下文中一共展示了CRM_Financial_BAO_FinancialAccount::getARAccounts方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
/**
* Set variables up before form is built.
*
* @return void
*/
public function preProcess()
{
parent::preProcess();
if ($this->_id) {
$params = array('id' => $this->_id);
$financialAccount = CRM_Financial_BAO_FinancialAccount::retrieve($params, CRM_Core_DAO::$_nullArray);
$financialAccountType = CRM_Core_PseudoConstant::accountOptionValues('financial_account_type');
if ($financialAccount->financial_account_type_id == array_search('Asset', $financialAccountType) && strtolower($financialAccount->account_type_code) == 'ar' && !CRM_Financial_BAO_FinancialAccount::getARAccounts($this->_id, array_search('Asset', $financialAccountType))) {
$this->_isARFlag = TRUE;
if ($this->_action & CRM_Core_Action::DELETE) {
$msg = ts("The selected financial account cannot be deleted because at least one Accounts Receivable type account is required (to ensure that accounting transactions are in balance).");
CRM_Core_Error::statusBounce($msg);
}
}
}
}
示例2: preProcess
/**
* Function to set variables up before form is built
*
* @return void
* @access public
*/
public function preProcess()
{
parent::preProcess();
if ($this->_id) {
$params = array('id' => $this->_id);
$financialAccount = CRM_Financial_BAO_FinancialAccount::retrieve($params, CRM_Core_DAO::$_nullArray);
$financialAccountType = CRM_Core_PseudoConstant::accountOptionValues('financial_account_type');
if ($financialAccount->financial_account_type_id == array_search('Asset', $financialAccountType) && strtolower($financialAccount->account_type_code) == 'ar' && !CRM_Financial_BAO_FinancialAccount::getARAccounts($this->_id, array_search('Asset', $financialAccountType))) {
$this->_isARFlag = TRUE;
if ($this->_action & CRM_Core_Action::DELETE) {
CRM_Core_Session::setStatus(ts("The selected financial account cannot be deleted because at least one Accounts Receivable type account is required (to ensure that accounting transactions are in balance)."), '', 'error');
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/financial/financialAccount', "reset=1&action=browse"));
}
}
}
}
示例3: getStatusMsg
/**
* Function to build status message while
* enabling/ disabling various objects
*/
static function getStatusMsg()
{
$recordID = CRM_Utils_Type::escape($_POST['recordID'], 'Integer');
$recordBAO = CRM_Utils_Type::escape($_POST['recordBAO'], 'String');
$op = CRM_Utils_Type::escape($_POST['op'], 'String');
$show = NULL;
if ($op == 'disable-enable') {
$status = ts('Are you sure you want to enable this record?');
} else {
switch ($recordBAO) {
case 'CRM_Core_BAO_UFGroup':
require_once str_replace('_', DIRECTORY_SEPARATOR, $recordBAO) . '.php';
$method = 'getUFJoinRecord';
$result = array($recordBAO, $method);
$ufJoin = call_user_func_array($result, array($recordID, TRUE));
if (!empty($ufJoin)) {
$status = ts('This profile is currently used for %1.', array(1 => implode(', ', $ufJoin))) . ' <br/><br/>' . ts('If you disable the profile - it will be removed from these forms and/or modules. Do you want to continue?');
} else {
$status = ts('Are you sure you want to disable this profile?');
}
break;
case 'CRM_Price_BAO_PriceSet':
require_once str_replace('_', DIRECTORY_SEPARATOR, $recordBAO) . '.php';
$usedBy = CRM_Price_BAO_PriceSet::getUsedBy($recordID);
$priceSet = CRM_Price_BAO_PriceSet::getTitle($recordID);
if (!CRM_Utils_System::isNull($usedBy)) {
$template = CRM_Core_Smarty::singleton();
$template->assign('usedBy', $usedBy);
$comps = array('Event' => 'civicrm_event', 'Contribution' => 'civicrm_contribution_page', 'EventTemplate' => 'civicrm_event_template');
$contexts = array();
foreach ($comps as $name => $table) {
if (array_key_exists($table, $usedBy)) {
$contexts[] = $name;
}
}
$template->assign('contexts', $contexts);
$show = 'noButton';
$table = $template->fetch('CRM/Price/Page/table.tpl');
$status = ts('Unable to disable the \'%1\' price set - it is currently in use by one or more active events, contribution pages or contributions.', array(1 => $priceSet)) . "<br/> {$table}";
} else {
$status = ts('Are you sure you want to disable \'%1\' Price Set?', array(1 => $priceSet));
}
break;
case 'CRM_Event_BAO_Event':
$status = ts('Are you sure you want to disable this Event?');
break;
case 'CRM_Core_BAO_UFField':
$status = ts('Are you sure you want to disable this CiviCRM Profile field?');
break;
case 'CRM_Contribute_BAO_ManagePremiums':
$status = ts('Are you sure you want to disable this premium? This action will remove the premium from any contribution pages that currently offer it. However it will not delete the premium record - so you can re-enable it and add it back to your contribution page(s) at a later time.');
break;
case 'CRM_Contact_BAO_RelationshipType':
$status = ts('Are you sure you want to disable this relationship type?') . '<br/><br/>' . ts('Users will no longer be able to select this value when adding or editing relationships between contacts.');
break;
case 'CRM_Financial_BAO_FinancialType':
$status = ts('Are you sure you want to disable this financial type?');
break;
case 'CRM_Financial_BAO_FinancialAccount':
if (!CRM_Financial_BAO_FinancialAccount::getARAccounts($recordID)) {
$show = 'noButton';
$status = ts('The selected financial account cannot be disabled because at least one Accounts Receivable type account is required (to ensure that accounting transactions are in balance).');
} else {
$status = ts('Are you sure you want to disable this financial account?');
}
break;
case 'CRM_Financial_BAO_PaymentProcessor':
$status = ts('Are you sure you want to disable this payment processor?') . ' <br/><br/>' . ts('Users will no longer be able to select this value when adding or editing transaction pages.');
break;
case 'CRM_Financial_BAO_PaymentProcessorType':
$status = ts('Are you sure you want to disable this payment processor type?');
break;
case 'CRM_Core_BAO_LocationType':
$status = ts('Are you sure you want to disable this location type?') . ' <br/><br/>' . ts('Users will no longer be able to select this value when adding or editing contact locations.');
break;
case 'CRM_Event_BAO_ParticipantStatusType':
$status = ts('Are you sure you want to disable this Participant Status?') . '<br/><br/> ' . ts('Users will no longer be able to select this value when adding or editing Participant Status.');
break;
case 'CRM_Mailing_BAO_Component':
$status = ts('Are you sure you want to disable this component?');
break;
case 'CRM_Core_BAO_CustomField':
$status = ts('Are you sure you want to disable this custom data field?');
break;
case 'CRM_Core_BAO_CustomGroup':
$status = ts('Are you sure you want to disable this custom data group? Any profile fields that are linked to custom fields of this group will be disabled.');
break;
case 'CRM_Core_BAO_MessageTemplate':
$status = ts('Are you sure you want to disable this message tempate?');
break;
case 'CRM_ACL_BAO_ACL':
$status = ts('Are you sure you want to disable this ACL?');
break;
case 'CRM_ACL_BAO_EntityRole':
$status = ts('Are you sure you want to disable this ACL Role Assignment?');
break;
//.........这里部分代码省略.........