Skip to content
Snippets Groups Projects
Commit ca7a7159 authored by Seamus Lee's avatar Seamus Lee
Browse files

dev/core1329 Reduce number of deceased contacts in the demo data from 31 to 12

Limit number of deceased contacts to 4 and add in age checks as per Justin
parent 00e7a58a
Branches
Tags
No related merge requests found
......@@ -270,6 +270,7 @@ class CRM_GCD {
private $groupMembershipStatus = array('Added', 'Removed', 'Pending');
private $subscriptionHistoryMethod = array('Admin', 'Email');
private $deceasedContactIds = array();
/*********************************
* private methods
......@@ -649,7 +650,13 @@ class CRM_GCD {
}
// Deceased probability based on age
if ($age > 40) {
if ($contact->gender_id && $contact->gender_id == 2) {
$checkAge = 64;
}
else {
$checkAge = 68;
}
if ($age > $checkAge && count($this->deceasedContactIds) < 4) {
$contact->is_deceased = $this->probability(($age - 30) / 100);
if ($contact->is_deceased && $this->probability(.7)) {
$contact->deceased_date = $this->randomDate();
......@@ -686,6 +693,9 @@ class CRM_GCD {
$contact->hash = crc32($contact->sort_name);
$contact->id = $cid;
$this->_update($contact);
if ($contact->is_deceased) {
$this->deceasedContactIds[] = $cid;
}
}
}
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment