Commit | Line | Data |
---|---|---|
5c3f5819 SL |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
fee14197 | 4 | | CiviCRM version 5 | |
5c3f5819 | 5 | +--------------------------------------------------------------------+ |
f299f7db | 6 | | Copyright CiviCRM LLC (c) 2004-2020 | |
5c3f5819 SL |
7 | +--------------------------------------------------------------------+ |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
10 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
11 | | under the terms of the GNU Affero General Public License | | |
12 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
13 | | | | |
14 | | CiviCRM is distributed in the hope that it will be useful, but | | |
15 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
17 | | See the GNU Affero General Public License for more details. | | |
18 | | | | |
19 | | You should have received a copy of the GNU Affero General Public | | |
20 | | License and the CiviCRM Licensing Exception along | | |
21 | | with this program; if not, contact CiviCRM LLC | | |
22 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
23 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
24 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
25 | +--------------------------------------------------------------------+ | |
26 | */ | |
27 | ||
28 | /** | |
29 | * | |
30 | * @package CRM | |
f299f7db | 31 | * @copyright CiviCRM LLC (c) 2004-2020 |
5c3f5819 SL |
32 | */ |
33 | class CRM_Utils_Check_Component_FinancialTypeAcls extends CRM_Utils_Check_Component { | |
34 | ||
35 | public static function checkFinancialAclReport() { | |
be2fb01f | 36 | $messages = []; |
5c3f5819 | 37 | $ftAclSetting = Civi::settings()->get('acl_financial_type'); |
bb17fb50 | 38 | $financialAclExtension = civicrm_api3('extension', 'get', ['key' => 'biz.jmaconsulting.financialaclreport', 'sequential' => 1]); |
7d3bbef2 | 39 | if ($ftAclSetting && (($financialAclExtension['count'] == 1 && $financialAclExtension['values'][0]['status'] != 'Installed') || $financialAclExtension['count'] !== 1)) { |
5c3f5819 SL |
40 | $messages[] = new CRM_Utils_Check_Message( |
41 | __FUNCTION__, | |
be2fb01f | 42 | ts('CiviCRM will in the future require the extension %1 for CiviCRM Reports to work correctly with the Financial Type ACLs. The extension can be downloaded <a href="%2">here</a>', [ |
5c3f5819 SL |
43 | 1 => 'biz.jmaconsulting.financialaclreport', |
44 | 2 => 'https://github.com/JMAConsulting/biz.jmaconsulting.financialaclreport', | |
be2fb01f | 45 | ]), |
5c3f5819 SL |
46 | ts('Extension Missing'), |
47 | \Psr\Log\LogLevel::WARNING, | |
48 | 'fa-server' | |
49 | ); | |
50 | } | |
51 | ||
52 | return $messages; | |
53 | } | |
54 | ||
55 | } |