summaryrefslogtreecommitdiff
path: root/app/Controller/LifespanController.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2015-03-08 17:09:41 +0000
committerGreg Roach <fisharebest@gmail.com>2015-03-09 00:08:53 +0000
commit24ec66ce7e77188cd2495b0f8d4dd0ae6e8c9c52 (patch)
tree0059c30afd4b78da23f28067165a7b17415924d8 /app/Controller/LifespanController.php
parent3763c3f2dff6a4360b7b8810b6250e372dded805 (diff)
downloadwebtrees-24ec66ce7e77188cd2495b0f8d4dd0ae6e8c9c52.tar.gz
webtrees-24ec66ce7e77188cd2495b0f8d4dd0ae6e8c9c52.tar.bz2
webtrees-24ec66ce7e77188cd2495b0f8d4dd0ae6e8c9c52.zip
Use Tree object instead of ID/name
Diffstat (limited to 'app/Controller/LifespanController.php')
-rw-r--r--app/Controller/LifespanController.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/Controller/LifespanController.php b/app/Controller/LifespanController.php
index 8528825a4c..e3d30f55d6 100644
--- a/app/Controller/LifespanController.php
+++ b/app/Controller/LifespanController.php
@@ -88,7 +88,7 @@ class LifespanController extends PageController {
$beginYear = Filter::getInteger('beginYear', 0, $this->currentYear + 100, 0);
$endYear = Filter::getInteger('endYear', 0, $this->currentYear + 100, 0);
- $new_person = Individual::getInstance($newpid);
+ $new_person = Individual::getInstance($newpid, $WT_TREE);
if ($clear) {
// Empty list
@@ -101,7 +101,7 @@ class LifespanController extends PageController {
$wt_place = new Place($place, $WT_TREE);
$this->pids = Database::prepare(
"SELECT DISTINCT pl_gid FROM `##placelinks` WHERE pl_p_id = ? AND pl_file = ?"
- )->execute(array($wt_place->getPlaceId(), WT_GED_ID))->fetchOneColumn();
+ )->execute(array($wt_place->getPlaceId(), $WT_TREE->getTreeId()))->fetchOneColumn();
$this->place = $place;
} else {
// Modify an existing list of records
@@ -132,7 +132,7 @@ class LifespanController extends PageController {
foreach ($this->pids as $key => $value) {
if ($value != $remove) {
$this->pids[$key] = $value;
- $person = Individual::getInstance($value);
+ $person = Individual::getInstance($value, $WT_TREE);
// list of linked records includes families as well as individuals.
if ($person) {
$bdate = $person->getEstimatedBirthDate();
@@ -562,6 +562,8 @@ class LifespanController extends PageController {
* @return Individual[]
*/
private static function searchIndividualsInYearRange($startyear, $endyear) {
+ global $WT_TREE;
+
// At present, the lifespan chart is driven by Gregorian years.
// We ought to allow it to work with other calendars...
$gregorian_calendar = new GregorianCalendar;
@@ -574,11 +576,11 @@ class LifespanController extends PageController {
" FROM `##individuals`" .
" JOIN `##dates` ON i_id=d_gid AND i_file=d_file" .
" WHERE i_file=? AND d_julianday1 BETWEEN ? AND ?"
- )->execute(array(WT_GED_ID, $startjd, $endjd))->fetchAll();
+ )->execute(array($WT_TREE->getTreeId(), $startjd, $endjd))->fetchAll();
$list = array();
foreach ($rows as $row) {
- $list[] = Individual::getInstance($row->xref, $row->gedcom_id, $row->gedcom);
+ $list[] = Individual::getInstance($row->xref, $WT_TREE, $row->gedcom);
}
return $list;