Merge pull request #18479 from eileenmcnaughton/just_pay
[civicrm-core.git] / CRM / Pledge / Page / AJAX.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
bc77d7c0 4 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 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 |
6a488035 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
6a488035
TO
11
12/**
13 *
14 * @package CRM
ca5cec67 15 * @copyright CiviCRM LLC https://civicrm.org/licensing
6a488035
TO
16 */
17
18/**
19 * This class contains all the function that are called using AJAX
20 */
21class CRM_Pledge_Page_AJAX {
22
098201d8
TO
23 /**
24 * Function to setDefaults according to Pledge Id
25 * for batch entry pledges
26 */
00be9182 27 public function getPledgeDefaults() {
be2fb01f 28 $details = [];
d78a705e 29 if (!empty($_POST['pid'])) {
30 $pledgeID = CRM_Utils_Type::escape($_POST['pid'], 'Integer');
31 $details = CRM_Pledge_BAO_PledgePayment::getOldestPledgePayment($pledgeID);
32 }
42e397d3 33 CRM_Utils_JSON::output($details);
04e6444d 34 }
96025800 35
6a488035 36}