Skip to content

Commit

Permalink
Fix a bug in Latest/Updated Date of Family and Person record
Browse files Browse the repository at this point in the history
  • Loading branch information
Daeho Baek committed Aug 21, 2024
1 parent 7797a8f commit 0380c2f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/FamilyEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@
$family = new \ChurchCRM\model\ChurchCRM\Family();
if ($iFamilyID >= 1) {
$family = FamilyQuery::create()->findPk($iFamilyID);
$family
->setDateLastEdited(date('YmdHis'))
->setEditedBy(AuthenticationManager::getCurrentUser()->getId());
} else {
$family
->setDateEntered(date('YmdHis'))
->setEnteredBy(AuthenticationManager::getCurrentUser()->getId());
}
$family
->setName($sName)
Expand All @@ -252,8 +259,6 @@
->setHomePhone($sHomePhone)
->setWorkPhone($sWorkPhone)
->setCellPhone($sCellPhone)
->setDateEntered(date('YmdHis'))
->setEnteredBy(AuthenticationManager::getCurrentUser()->getId())
->setSendNewsletter($bSendNewsLetterString)
->setEnvelope($nEnvelope);
if ($dWeddingDate) {
Expand Down
9 changes: 7 additions & 2 deletions src/PersonEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,13 @@
$personAlreadyExist = $iPersonID > 0;
if ($personAlreadyExist) {
$person = PersonQuery::create()->findOneById($iPersonID);
$person
->setDateLastEdited(date('YmdHis'))
->setEditedBy(AuthenticationManager::getCurrentUser()->getId());
} else {
$person
->setDateEntered(date('YmdHis'))
->setEnteredBy(AuthenticationManager::getCurrentUser()->getId());
}

$person
Expand All @@ -410,8 +417,6 @@
->setFamId($iFamily)
->setFmrId($iFamilyRole)
->setClsId($iClassification)
->setDateEntered(date('YmdHis'))
->setEnteredBy(AuthenticationManager::getCurrentUser()->getId())
->setFlags($per_Flags)
->setFacebook($sFacebook)
->setTwitter($sTwitter)
Expand Down

0 comments on commit 0380c2f

Please sign in to comment.