Skip to content

Commit

Permalink
Resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
tbar0970 committed Jul 23, 2018
1 parent c5a0b30 commit 93f64be
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions db_objects/person.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -967,61 +967,6 @@ public function populate($id, $values)
}
}

<<<<<<< HEAD

/*
* <li>Change their name to "Removed"</li>
<li>Change their status to "archived"</li>
<li>Blank out all their fields except congregation</li>
<li>Clear their history and notes</li>
<li>Preserve their (anonymous) roster assignments, group memberships and attendance records</li>
*/
public function archiveAndClean()
{
if (!$this->acquireLock()) return FALSE;
$GLOBALS['system']->doTransaction('BEGIN');
foreach ($this->fields as $fieldname => $params) {
switch ($fieldname) {
case 'first_name':
case 'last_name':
$this->setValue($fieldname, '(Removed)');
break;
case 'congregationid':
case 'familyid':
case 'status_last_changed':
case 'creator':
case 'created':
// leave these intact
break;
case 'status':
$this->setValue($fieldname, 'archived');
break;
default:
$this->setValue($fieldname, '');
}
}
// todo: clear the history ??
$this->save();
$family = $GLOBALS['system']->getDBObject('family', $this->getValue('familyid'));
$members = $family->getMemberData();
$found_live = FALSE;
foreach ($members as $id => $detail) {
if (($detail['status'] != 'archived') && ($id != $this->id)) $found_live = TRUE;
}
if (!$found_live) {
if (!$family->acquireLock()) {
add_message("This person could not be archived and cleaned because their family record is locked by another user. Try again later.");
$GLOBALS['system']->doTransaction('ROLLBACK');
$this->releaseLock();
return FALSE;
}
$family->archiveAndClean();
add_message("Since the ".$family->getValue('family_name').' family had no remaining members, it has been archived and cleaned also');
}
$GLOBALS['system']->doTransaction('COMMIT');
$this->releaseLock();
return TRUE;
=======
/**
* Archive and clean this record:
* Change their name to "Removed"
Expand Down Expand Up @@ -1084,7 +1029,6 @@ public function delete()
}
Abstract_Note::cleanupInstances();
$GLOBALS['system']->doTransaction('COMMIT');
>>>>>>> 6622ab7ffc27fa88e336672820b7059284f0e340
}

}
Expand Down

0 comments on commit 93f64be

Please sign in to comment.