* +--------------------------------------------------------------------+
* | CiviCRM version 4.7 |
* +--------------------------------------------------------------------+
- * | Copyright CiviCRM LLC (c) 2004-2016 |
+ * | Copyright CiviCRM LLC (c) 2004-2017 |
* +--------------------------------------------------------------------+
* | This file is a part of CiviCRM. |
* | |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
* $Id$
*
*/
// number of seconds per year
$numSecond = 31536000;
- $dateFormat = "Ymdhis";
+ $dateFormat = "YmdHis";
$today = time();
// both are defined
private function _insert(&$dao) {
if (self::ADD_TO_DB) {
if (!$dao->insert()) {
- echo "ERROR INSERT: " . mysql_error() . "\n";
+ echo "ERROR INSERT: " . mysqli_error($dao->getConnection()->connection) . "\n";
print_r($dao);
exit(1);
}
private function _update(&$dao) {
if (self::ADD_TO_DB) {
if (!$dao->update()) {
- echo "ERROR UPDATE: " . mysql_error() . "\n";
+ echo "ERROR UPDATE: " . mysqli_error($dao->getConnection()->connection) . "\n";
print_r($dao);
exit(1);
}
$contactDAO->find();
$count = 0;
- $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
+ $activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate');
while ($contactDAO->fetch()) {
if ($count++ > 2) {
break;
private function addMembership() {
$contact = new CRM_Contact_DAO_Contact();
$contact->query("SELECT id FROM civicrm_contact where contact_type = 'Individual'");
- $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
+ $activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate');
while ($contact->fetch()) {
$contacts[] = $contact->id;
}
(contact_id, activity_id, record_type_id)
VALUES
";
- $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
+ $activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate');
$currentActivityID = CRM_Core_DAO::singleValueQuery("SELECT MAX(id) FROM civicrm_activity");
$currentActivityID -= 50;
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$select = 'SELECT contribution.id contribution_id, cli.id as line_item_id, contribution.contact_id, contribution.receive_date, contribution.total_amount, contribution.currency, cli.label,
cli.financial_type_id, cefa.financial_account_id, contribution.payment_instrument_id, contribution.check_number, contribution.trxn_id';
$where = 'WHERE cefa.account_relationship = 1';
- $financialAccountId = CRM_Financial_BAO_FinancialTypeAccount::getInstrumentFinancialAccount();
+ $financialAccountId = CRM_Financial_BAO_FinancialTypeAccount::getInstrumentFinancialAccount(4);
foreach ($components as $component) {
if ($component == 'contribution') {
$from = 'FROM `civicrm_contribution` contribution';
}
-/**
- * @param null $str
- *
- * @return bool
- */
-function user_access($str = NULL) {
- return TRUE;
-}
-
-/**
- * @return array
- */
-function module_list() {
- return array();
-}
-
echo ("Starting data generation on " . date("F dS h:i:s A") . "\n");
$gcd = new CRM_GCD();
$gcd->initID();