Commit | Line | Data |
---|---|---|
dfe9afbf | 1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
bc77d7c0 | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
dfe9afbf | 5 | | | |
bc77d7c0 TO |
6 | | This work is published under the GNU AGPLv3 license with some | |
7 | | permitted exceptions and without any warranty. For full license | | |
8 | | and copyright information, see https://civicrm.org/licensing | | |
dfe9afbf | 9 | +--------------------------------------------------------------------+ |
10 | */ | |
11 | ||
12 | /** | |
13 | * | |
14 | * @package CRM | |
ca5cec67 | 15 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
dfe9afbf | 16 | * |
17 | */ | |
18 | ||
19 | /** | |
20 | * This class contains all the function that are called using AJAX (jQuery) | |
21 | */ | |
22 | class CRM_Contribute_Page_AJAX { | |
1330f57a | 23 | |
dfe9afbf | 24 | /** |
25 | * Get Soft credit to list in DT | |
26 | */ | |
27 | public static function getSoftContributionRows() { | |
be2fb01f | 28 | $requiredParameters = [ |
dfe9afbf | 29 | 'cid' => 'Integer', |
30 | 'context' => 'String', | |
be2fb01f CW |
31 | ]; |
32 | $optionalParameters = [ | |
dfe9afbf | 33 | 'entityID' => 'Integer', |
34 | 'isTest' => 'Integer', | |
be2fb01f | 35 | ]; |
dfe9afbf | 36 | |
37 | $params = CRM_Core_Page_AJAX::defaultSortAndPagerParams(); | |
38 | $params += CRM_Core_Page_AJAX::validateParams($requiredParameters, $optionalParameters); | |
39 | ||
40 | $softCreditList = CRM_Contribute_BAO_ContributionSoft::getSoftContributionSelector($params); | |
41 | ||
42 | if (!empty($_GET['is_unit_test'])) { | |
43 | return $softCreditList; | |
44 | } | |
45 | ||
46 | CRM_Utils_JSON::output($softCreditList); | |
47 | } | |
48 | ||
49 | } |