<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
class CRM_Pledge_Page_AJAX {
/**
- * Function for building Pledge Name combo box
+ * Building Pledge Name combo box
*/
- static function pledgeName() {
+ public static function pledgeName() {
$getRecords = FALSE;
if (isset($_GET['name']) && $_GET['name']) {
echo CRM_Utils_JSON::encode($elements, 'value');
CRM_Utils_System::civiExit();
}
+ /**
+ * Function to setDefaults according to Pledge Id
+ * for batch entry pledges
+ */
+ public function getPledgeDefaults() {
+ $details = array();
+ if (!empty($_POST['pid'])) {
+ $pledgeID = CRM_Utils_Type::escape($_POST['pid'], 'Integer');
+ $details = CRM_Pledge_BAO_PledgePayment::getOldestPledgePayment($pledgeID);
+ }
+ echo json_encode($details);
+ CRM_Utils_System::civiExit();
+ }
}
-