From ef0e62b0e471e279efef9597ee466da73e9dd181 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Wed, 15 Mar 2017 12:03:34 +0530 Subject: [PATCH] CRM-19715, removed settings related to close accounting period and moved to an extension ---------------------------------------- * CRM-19715: Remove Close Accounting Period code https://issues.civicrm.org/jira/browse/CRM-19715 --- CRM/Admin/Form/Preferences/Contribute.php | 7 ----- api/v3/examples/Setting/GetFields.php | 30 ------------------- settings/Contribute.setting.php | 30 ------------------- .../CRM/Admin/Form/Preferences/Contribute.tpl | 13 -------- templates/CRM/Form/basicForm.tpl | 8 +---- 5 files changed, 1 insertion(+), 87 deletions(-) diff --git a/CRM/Admin/Form/Preferences/Contribute.php b/CRM/Admin/Form/Preferences/Contribute.php index 2027fdf1f1..e07b876a3f 100644 --- a/CRM/Admin/Form/Preferences/Contribute.php +++ b/CRM/Admin/Form/Preferences/Contribute.php @@ -41,9 +41,6 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences { 'always_post_to_accounts_receivable' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'deferred_revenue_enabled' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'default_invoice_page' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, - 'financial_account_bal_enable' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, - 'fiscalYearStart' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME, - 'prior_financial_period' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'invoicing' => CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, ); @@ -217,9 +214,6 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences { ) ); } - $defaults['fiscalYearStart'] = Civi::settings()->get('fiscalYearStart'); - $period = CRM_Contribute_BAO_Contribution::checkContributeSettings('prior_financial_period'); - $this->assign('priorFinancialPeriod', $period); return $defaults; } @@ -232,7 +226,6 @@ class CRM_Admin_Form_Preferences_Contribute extends CRM_Admin_Form_Preferences { unset($params['qfKey']); unset($params['entryURL']); Civi::settings()->set('contribution_invoice_settings', $params); - Civi::settings()->set('fiscalYearStart', $params['fiscalYearStart']); // to set default value for 'Invoices / Credit Notes' checkbox on display preferences $values = CRM_Core_BAO_Setting::getItem("CiviCRM Preferences"); diff --git a/api/v3/examples/Setting/GetFields.php b/api/v3/examples/Setting/GetFields.php index 9e6170e70d..90ca0004bc 100644 --- a/api/v3/examples/Setting/GetFields.php +++ b/api/v3/examples/Setting/GetFields.php @@ -225,36 +225,6 @@ function setting_getfields_expectedresult() { 'description' => '', 'help_text' => '', ), - 'financial_account_bal_enable' => array( - 'group_name' => 'Contribute Preferences', - 'group' => 'contribute', - 'name' => 'financial_account_bal_enable', - 'type' => 'Integer', - 'html_type' => 'checkbox', - 'quick_form_type' => 'Element', - 'default' => 0, - 'add' => '4.7', - 'title' => 'Enable Financial Account Balances', - 'is_domain' => 1, - 'is_contact' => 0, - 'description' => '', - 'help_text' => '', - ), - 'prior_financial_period' => array( - 'group_name' => 'Contribute Preferences', - 'group' => 'contribute', - 'name' => 'prior_financial_period', - 'type' => 'activityDate', - 'quick_form_type' => 'Date', - 'html_type' => 'Date', - 'default' => '', - 'add' => '4.7', - 'title' => 'Prior Financial Period', - 'is_domain' => 1, - 'is_contact' => 0, - 'description' => '', - 'help_text' => '', - ), 'always_post_to_accounts_receivable' => array( 'group_name' => 'Contribute Preferences', 'group' => 'contribute', diff --git a/settings/Contribute.setting.php b/settings/Contribute.setting.php index 54115ddf45..67313e3031 100644 --- a/settings/Contribute.setting.php +++ b/settings/Contribute.setting.php @@ -135,36 +135,6 @@ return array( 'description' => NULL, 'help_text' => NULL, ), - 'financial_account_bal_enable' => array( - 'group_name' => 'Contribute Preferences', - 'group' => 'contribute', - 'name' => 'financial_account_bal_enable', - 'type' => 'Integer', - 'html_type' => 'checkbox', - 'quick_form_type' => 'Element', - 'default' => 0, - 'add' => '4.7', - 'title' => 'Enable Financial Account Balances', - 'is_domain' => 1, - 'is_contact' => 0, - 'description' => NULL, - 'help_text' => NULL, - ), - 'prior_financial_period' => array( - 'group_name' => 'Contribute Preferences', - 'group' => 'contribute', - 'name' => 'prior_financial_period', - 'type' => 'activityDate', - 'quick_form_type' => 'Date', - 'html_type' => 'Date', - 'default' => NULL, - 'add' => '4.7', - 'title' => 'Prior Financial Period', - 'is_domain' => 1, - 'is_contact' => 0, - 'description' => NULL, - 'help_text' => NULL, - ), 'always_post_to_accounts_receivable' => array( 'group_name' => 'Contribute Preferences', 'group' => 'contribute', diff --git a/templates/CRM/Admin/Form/Preferences/Contribute.tpl b/templates/CRM/Admin/Form/Preferences/Contribute.tpl index bb98b83295..7daf986916 100644 --- a/templates/CRM/Admin/Form/Preferences/Contribute.tpl +++ b/templates/CRM/Admin/Form/Preferences/Contribute.tpl @@ -31,10 +31,6 @@ $("#deferred_revenue_enabled").click(function() { showHideElement('deferred_revenue_enabled', 'default_invoice_page'); }); - showHideElement('financial_account_bal_enable', 'fiscalYearStart'); - $("#financial_account_bal_enable").click(function() { - showHideElement('financial_account_bal_enable', 'fiscalYearStart'); - }); function showHideElement(checkEle, toHide) { if ($('#' + checkEle).prop('checked')) { $("tr.crm-preferences-form-block-" + toHide).show(); @@ -43,15 +39,6 @@ $("tr.crm-preferences-form-block-" + toHide).hide(); } } - $('input[name=_qf_Contribute_next]').on('click', checkPeriod); - function checkPeriod() { - var speriod = $('#prior_financial_period').val(); - var hperiod = '{/literal}{$priorFinancialPeriod}{literal}'; - if (((hperiod && speriod == '') || (hperiod && speriod != '')) && (speriod != hperiod)) { - var msg = '{/literal}{ts}Changing the Prior Financial Period may result in problems calculating closing account balances accurately and / or exporting of financial transactions. Do you want to proceed?{/ts}{literal}'; - return confirm(msg); - } - } }); {/literal} diff --git a/templates/CRM/Form/basicForm.tpl b/templates/CRM/Form/basicForm.tpl index cb30a35ba4..2b15663b41 100644 --- a/templates/CRM/Form/basicForm.tpl +++ b/templates/CRM/Form/basicForm.tpl @@ -42,11 +42,7 @@ {else} {$form.$htmlField.label} {if $htmlField eq 'acl_financial_type'}{help id="$htmlField"}{/if} - {if $htmlField eq 'prior_financial_period'} - {include file="CRM/common/jcalendar.tpl" elementName=$htmlField} - {else} - {$form.$htmlField.html} - {/if} + {$form.$htmlField.html} {if $desc}
{$desc} {/if} @@ -55,8 +51,6 @@ {/if} {/foreach} - {$form.prior_financial_period_M_hidden.html} - {$form.prior_financial_period_d_hidden.html} {/if} -- 2.25.1