summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--admin.php52
-rw-r--r--admin_module_blocks.php8
-rw-r--r--admin_module_menus.php8
-rw-r--r--admin_module_reports.php8
-rw-r--r--admin_module_sidebar.php8
-rw-r--r--admin_module_tabs.php8
-rw-r--r--admin_site_merge.php2
-rw-r--r--admin_site_upgrade.php2
-rw-r--r--admin_trees_export.php2
-rw-r--r--admin_trees_manage.php106
-rw-r--r--admin_trees_merge.php8
-rw-r--r--admin_trees_places.php2
-rw-r--r--admin_trees_renumber.php2
-rw-r--r--admin_users.php32
-rw-r--r--app/Controller/SearchController.php39
-rw-r--r--app/GedcomRecord.php53
-rw-r--r--app/Log.php2
-rw-r--r--app/Media.php8
-rw-r--r--app/Module.php2
-rw-r--r--app/Note.php4
-rw-r--r--app/Stats.php216
-rw-r--r--app/Theme/BaseTheme.php14
-rw-r--r--app/Tree.php12
-rw-r--r--app/User.php2
-rw-r--r--includes/functions/functions_db.php2
-rw-r--r--includes/session.php10
-rw-r--r--login.php6
-rw-r--r--modules_v3/faq/module.php2
-rw-r--r--modules_v3/googlemap/module.php2
-rw-r--r--modules_v3/html/module.php6
-rw-r--r--modules_v3/sitemap/module.php28
-rw-r--r--search.php4
32 files changed, 347 insertions, 313 deletions
diff --git a/admin.php b/admin.php
index d27a3f2cf3..cb0ecddac1 100644
--- a/admin.php
+++ b/admin.php
@@ -636,67 +636,67 @@ $changes = Database::prepare(
</thead>
<tbody>
<?php foreach (Tree::getAll() as $tree): ?>
- <tr class="<?php echo $changes[$tree->id()] ? 'danger' : ''; ?>">
+ <tr class="<?php echo $changes[$tree->getId()] ? 'danger' : ''; ?>">
<td>
- <a href="index.php?ctype=gedcom&amp;ged=<?php echo $tree->nameUrl(); ?>">
- <?php echo $tree->titleHtml(); ?>
+ <a href="index.php?ctype=gedcom&amp;ged=<?php echo $tree->getNameUrl(); ?>">
+ <?php echo $tree->getTitleHtml(); ?>
</a>
</td>
<td class="text-right flip">
- <?php if ($changes[$tree->id()]): ?>
+ <?php if ($changes[$tree->getId()]): ?>
<a onclick="window.open('edit_changes.php', '_blank', chan_window_specs); return false;" href="#">
- <?php echo I18N::number($changes[$tree->id()]); ?>
- <span class="sr-only"><?php echo I18N::translate('Pending changes'); ?> <?php echo $tree->titleHtml(); ?></span>
+ <?php echo I18N::number($changes[$tree->getId()]); ?>
+ <span class="sr-only"><?php echo I18N::translate('Pending changes'); ?> <?php echo $tree->getTitleHtml(); ?></span>
</a>
<?php else: ?>
-
<?php endif; ?>
</td>
<td class="text-right flip">
- <?php if ($individuals[$tree->id()]): ?>
- <a href="indilist.php?ged=<?php echo $tree->nameUrl(); ?>">
- <?php echo I18N::number($individuals[$tree->id()]); ?>
- <span class="sr-only"><?php echo I18N::translate('Individuals'); ?> <?php echo $tree->titleHtml(); ?></span>
+ <?php if ($individuals[$tree->getId()]): ?>
+ <a href="indilist.php?ged=<?php echo $tree->getNameUrl(); ?>">
+ <?php echo I18N::number($individuals[$tree->getId()]); ?>
+ <span class="sr-only"><?php echo I18N::translate('Individuals'); ?> <?php echo $tree->getTitleHtml(); ?></span>
</a>
<?php else: ?>
-
<?php endif; ?>
</td>
<td class="text-right flip">
- <?php if ($families[$tree->id()]): ?>
- <a href="famlist.php?ged=<?php echo $tree->nameUrl(); ?>">
- <?php echo I18N::number($families[$tree->id()]); ?>
- <span class="sr-only"><?php echo I18N::translate('Families'); ?> <?php echo $tree->titleHtml(); ?></span>
+ <?php if ($families[$tree->getId()]): ?>
+ <a href="famlist.php?ged=<?php echo $tree->getNameUrl(); ?>">
+ <?php echo I18N::number($families[$tree->getId()]); ?>
+ <span class="sr-only"><?php echo I18N::translate('Families'); ?> <?php echo $tree->getTitleHtml(); ?></span>
</a>
<?php else: ?>
-
<?php endif; ?>
</td>
<td class="text-right flip">
- <?php if ($sources[$tree->id()]): ?>
- <a href="sourlist.php?ged=<?php echo $tree->nameUrl(); ?>">
- <?php echo I18N::number($sources[$tree->id()]); ?>
- <span class="sr-only"><?php echo I18N::translate('Sources'); ?> <?php echo $tree->titleHtml(); ?></span>
+ <?php if ($sources[$tree->getId()]): ?>
+ <a href="sourlist.php?ged=<?php echo $tree->getNameUrl(); ?>">
+ <?php echo I18N::number($sources[$tree->getId()]); ?>
+ <span class="sr-only"><?php echo I18N::translate('Sources'); ?> <?php echo $tree->getTitleHtml(); ?></span>
</a>
<?php else: ?>
-
<?php endif; ?>
</td>
<td class="text-right flip">
- <?php if ($repositories[$tree->id()]): ?>
- <a href="repolist.php?ged=<?php echo $tree->nameUrl(); ?>">
- <?php echo I18N::number($repositories[$tree->id()]); ?>
- <span class="sr-only"><?php echo I18N::translate('Repositories'); ?> <?php echo $tree->titleHtml(); ?></span>
+ <?php if ($repositories[$tree->getId()]): ?>
+ <a href="repolist.php?ged=<?php echo $tree->getNameUrl(); ?>">
+ <?php echo I18N::number($repositories[$tree->getId()]); ?>
+ <span class="sr-only"><?php echo I18N::translate('Repositories'); ?> <?php echo $tree->getTitleHtml(); ?></span>
</a>
<?php else: ?>
-
<?php endif; ?>
</td>
<td class="text-right flip">
- <?php if ($media[$tree->id()]): ?>
- <a href="medialist.php?ged=<?php echo $tree->nameUrl(); ?>">
- <?php echo I18N::number($media[$tree->id()]); ?>
- <span class="sr-only"><?php echo I18N::translate('Media objects'); ?> <?php echo $tree->titleHtml(); ?></span>
+ <?php if ($media[$tree->getId()]): ?>
+ <a href="medialist.php?ged=<?php echo $tree->getNameUrl(); ?>">
+ <?php echo I18N::number($media[$tree->getId()]); ?>
+ <span class="sr-only"><?php echo I18N::translate('Media objects'); ?> <?php echo $tree->getTitleHtml(); ?></span>
</a>
<?php else: ?>
-
diff --git a/admin_module_blocks.php b/admin_module_blocks.php
index 82a2019ecb..fef4a75b2e 100644
--- a/admin_module_blocks.php
+++ b/admin_module_blocks.php
@@ -30,10 +30,10 @@ $action = Filter::post('action');
if ($action === 'update_mods' && Filter::checkCsrf()) {
foreach ($modules as $module) {
foreach (Tree::getAll() as $tree) {
- $access_level = Filter::post('access-' . $module->getName() . '-' . $tree->id(), WT_REGEX_INTEGER, $module->defaultAccessLevel());
+ $access_level = Filter::post('access-' . $module->getName() . '-' . $tree->getId(), WT_REGEX_INTEGER, $module->defaultAccessLevel());
Database::prepare(
"REPLACE INTO `##module_privacy` (module_name, gedcom_id, component, access_level) VALUES (?, ?, 'block', ?)"
- )->execute(array($module->getName(), $tree->id(), $access_level));
+ )->execute(array($module->getName(), $tree->getId(), $access_level));
}
}
@@ -82,10 +82,10 @@ $controller
<?php foreach (Tree::getAll() as $tree): ?>
<tr>
<td>
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</td>
<td>
- <?php echo edit_field_access_level('access-' . $module->getName() . '-' . $tree->id(), $module->getAccessLevel($tree, 'block')); ?>
+ <?php echo edit_field_access_level('access-' . $module->getName() . '-' . $tree->getId(), $module->getAccessLevel($tree, 'block')); ?>
</td>
</tr>
<?php endforeach; ?>
diff --git a/admin_module_menus.php b/admin_module_menus.php
index 3a8df67975..75eaba3315 100644
--- a/admin_module_menus.php
+++ b/admin_module_menus.php
@@ -30,10 +30,10 @@ $action = Filter::post('action');
if ($action === 'update_mods' && Filter::checkCsrf()) {
foreach ($modules as $module) {
foreach (Tree::getAll() as $tree) {
- $access_level = Filter::post('access-' . $module->getName() . '-' . $tree->id(), WT_REGEX_INTEGER, $module->defaultAccessLevel());
+ $access_level = Filter::post('access-' . $module->getName() . '-' . $tree->getId(), WT_REGEX_INTEGER, $module->defaultAccessLevel());
Database::prepare(
"REPLACE INTO `##module_privacy` (module_name, gedcom_id, component, access_level) VALUES (?, ?, 'menu', ?)"
- )->execute(array($module->getName(), $tree->id(), $access_level));
+ )->execute(array($module->getName(), $tree->getId(), $access_level));
}
$order = Filter::post('order-' . $module->getName());
Database::prepare(
@@ -107,10 +107,10 @@ $controller
<?php foreach (Tree::getAll() as $tree): ?>
<tr>
<td>
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</td>
<td>
- <?php echo edit_field_access_level('access-' . $module->getName() . '-' . $tree->id(), $module->getAccessLevel($tree, 'menu')); ?>
+ <?php echo edit_field_access_level('access-' . $module->getName() . '-' . $tree->getId(), $module->getAccessLevel($tree, 'menu')); ?>
</td>
</tr>
<?php endforeach; ?>
diff --git a/admin_module_reports.php b/admin_module_reports.php
index 697de2654d..e98c14b918 100644
--- a/admin_module_reports.php
+++ b/admin_module_reports.php
@@ -30,10 +30,10 @@ $action = Filter::post('action');
if ($action === 'update_mods' && Filter::checkCsrf()) {
foreach ($modules as $module) {
foreach (Tree::getAll() as $tree) {
- $access_level = Filter::post('access-' . $module->getName() . '-' . $tree->id(), WT_REGEX_INTEGER, $module->defaultAccessLevel());
+ $access_level = Filter::post('access-' . $module->getName() . '-' . $tree->getId(), WT_REGEX_INTEGER, $module->defaultAccessLevel());
Database::prepare(
"REPLACE INTO `##module_privacy` (module_name, gedcom_id, component, access_level) VALUES (?, ?, 'report', ?)"
- )->execute(array($module->getName(), $tree->id(), $access_level));
+ )->execute(array($module->getName(), $tree->getId(), $access_level));
}
}
@@ -82,10 +82,10 @@ $controller
<?php foreach (Tree::getAll() as $tree): ?>
<tr>
<td>
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</td>
<td>
- <?php echo edit_field_access_level('access-' . $module->getName() . '-' . $tree->id(), $module->getAccessLevel($tree, 'report')); ?>
+ <?php echo edit_field_access_level('access-' . $module->getName() . '-' . $tree->getId(), $module->getAccessLevel($tree, 'report')); ?>
</td>
</tr>
<?php endforeach; ?>
diff --git a/admin_module_sidebar.php b/admin_module_sidebar.php
index e50893925b..eaf1460f36 100644
--- a/admin_module_sidebar.php
+++ b/admin_module_sidebar.php
@@ -30,10 +30,10 @@ $action = Filter::post('action');
if ($action === 'update_mods' && Filter::checkCsrf()) {
foreach ($modules as $module) {
foreach (Tree::getAll() as $tree) {
- $access_level = Filter::post('access-' . $module->getName() . '-' . $tree->id(), WT_REGEX_INTEGER, $module->defaultAccessLevel());
+ $access_level = Filter::post('access-' . $module->getName() . '-' . $tree->getId(), WT_REGEX_INTEGER, $module->defaultAccessLevel());
Database::prepare(
"REPLACE INTO `##module_privacy` (module_name, gedcom_id, component, access_level) VALUES (?, ?, 'sidebar', ?)"
- )->execute(array($module->getName(), $tree->id(), $access_level));
+ )->execute(array($module->getName(), $tree->getId(), $access_level));
}
$order = Filter::post('order-' . $module->getName());
Database::prepare(
@@ -107,10 +107,10 @@ $controller
<?php foreach (Tree::getAll() as $tree): ?>
<tr>
<td>
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</td>
<td>
- <?php echo edit_field_access_level('access-' . $module->getName() . '-' . $tree->id(), $module->getAccessLevel($tree, 'sidebar')); ?>
+ <?php echo edit_field_access_level('access-' . $module->getName() . '-' . $tree->getId(), $module->getAccessLevel($tree, 'sidebar')); ?>
</td>
</tr>
<?php endforeach; ?>
diff --git a/admin_module_tabs.php b/admin_module_tabs.php
index be2a48583e..6134f22e02 100644
--- a/admin_module_tabs.php
+++ b/admin_module_tabs.php
@@ -30,10 +30,10 @@ $action = Filter::post('action');
if ($action === 'update_mods' && Filter::checkCsrf()) {
foreach ($modules as $module) {
foreach (Tree::getAll() as $tree) {
- $access_level = Filter::post('access-' . $module->getName() . '-' . $tree->id(), WT_REGEX_INTEGER, $module->defaultAccessLevel());
+ $access_level = Filter::post('access-' . $module->getName() . '-' . $tree->getId(), WT_REGEX_INTEGER, $module->defaultAccessLevel());
Database::prepare(
"REPLACE INTO `##module_privacy` (module_name, gedcom_id, component, access_level) VALUES (?, ?, 'tab', ?)"
- )->execute(array($module->getName(), $tree->id(), $access_level));
+ )->execute(array($module->getName(), $tree->getId(), $access_level));
}
$order = Filter::post('order-' . $module->getName());
Database::prepare(
@@ -107,10 +107,10 @@ $controller
<?php foreach (Tree::getAll() as $tree): ?>
<tr>
<td>
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</td>
<td>
- <?php echo edit_field_access_level('access-' . $module->getName() . '-' . $tree->id(), $module->getAccessLevel($tree, 'tab')); ?>
+ <?php echo edit_field_access_level('access-' . $module->getName() . '-' . $tree->getId(), $module->getAccessLevel($tree, 'tab')); ?>
</td>
</tr>
<?php endforeach; ?>
diff --git a/admin_site_merge.php b/admin_site_merge.php
index 95f74f05e3..e6f7907b84 100644
--- a/admin_site_merge.php
+++ b/admin_site_merge.php
@@ -28,7 +28,7 @@ require './includes/session.php';
$controller = new PageController;
$controller
->restrictAccess(Auth::isManager())
- ->setPageTitle(I18N::translate('Merge records') . ' — ' . $WT_TREE->titleHtml())
+ ->setPageTitle(I18N::translate('Merge records') . ' — ' . $WT_TREE->getTitleHtml())
->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)
->addInlineJavascript('autocomplete();');
diff --git a/admin_site_upgrade.php b/admin_site_upgrade.php
index 4faad95f8a..5e8326f1f2 100644
--- a/admin_site_upgrade.php
+++ b/admin_site_upgrade.php
@@ -281,7 +281,7 @@ echo '<li>', /* I18N: The system is about to [...] */ I18N::translate('Export al
foreach (Tree::getAll() as $tree) {
reset_timeout();
- $filename = WT_DATA_DIR . $tree->name() . date('-Y-m-d') . '.ged';
+ $filename = WT_DATA_DIR . $tree->getName() . date('-Y-m-d') . '.ged';
if ($tree->exportGedcom($filename)) {
echo '<br>', I18N::translate('Family tree exported to %s.', '<span dir="ltr">' . $filename . '</span>'), $icon_success;
} else {
diff --git a/admin_trees_export.php b/admin_trees_export.php
index 9b6a8d8a06..1d5755528e 100644
--- a/admin_trees_export.php
+++ b/admin_trees_export.php
@@ -26,7 +26,7 @@ define('WT_SCRIPT_NAME', 'admin_trees_export.php');
require './includes/session.php';
if (Auth::isManager($WT_TREE) && Filter::checkCsrf()) {
- $filename = WT_DATA_DIR . $WT_TREE->name();
+ $filename = WT_DATA_DIR . $WT_TREE->getName();
// Force a ".ged" suffix
if (strtolower(substr($filename, -4)) != '.ged') {
$filename .= '.ged';
diff --git a/admin_trees_manage.php b/admin_trees_manage.php
index 5606da9dc3..a9324de732 100644
--- a/admin_trees_manage.php
+++ b/admin_trees_manage.php
@@ -38,7 +38,7 @@ case 'delete':
$gedcom_id = Filter::postInteger('gedcom_id');
if (Filter::checkCsrf() && $gedcom_id) {
$tree = Tree::get($gedcom_id);
- FlashMessages::addMessage(/* I18N: %s is the name of a family tree */ I18N::translate('The family tree “%s” has been deleted.', $tree->titleHtml()), 'success');
+ FlashMessages::addMessage(/* I18N: %s is the name of a family tree */ I18N::translate('The family tree “%s” has been deleted.', $tree->getTitleHtml()), 'success');
$tree->delete();
}
header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
@@ -47,7 +47,7 @@ case 'delete':
case 'setdefault':
if (Filter::checkCsrf()) {
Site::setPreference('DEFAULT_GEDCOM', Filter::post('ged'));
- FlashMessages::addMessage(/* I18N: %s is the name of a family tree */ I18N::translate('The family tree “%s” will be shown to visitors when they first arrive at this website.', $WT_TREE->titleHtml()), 'success');
+ FlashMessages::addMessage(/* I18N: %s is the name of a family tree */ I18N::translate('The family tree “%s” will be shown to visitors when they first arrive at this website.', $WT_TREE->getTitleHtml()), 'success');
}
header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
@@ -114,8 +114,8 @@ case 'bulk-import':
}
foreach (Tree::getAll() as $tree) {
- if (!in_array($tree->name(), $basenames)) {
- FlashMessages::addMessage(I18N::translate('The family tree “%s” has been deleted.', $tree->titleHtml()), 'success');
+ if (!in_array($tree->getName(), $basenames)) {
+ FlashMessages::addMessage(I18N::translate('The family tree “%s” has been deleted.', $tree->getTitleHtml()), 'success');
$tree->delete();
}
}
@@ -162,11 +162,11 @@ case 'importform':
if (!$tree) {
break;
}
- echo '<p>', /* I18N: %s is the name of a family tree */ I18N::translate('This will delete all the genealogical data from “%s” and replace it with data from another GEDCOM file.', $tree->titleHtml()), '</p>';
+ echo '<p>', /* I18N: %s is the name of a family tree */ I18N::translate('This will delete all the genealogical data from “%s” and replace it with data from another GEDCOM file.', $tree->getTitleHtml()), '</p>';
// the javascript in the next line strips any path associated with the file before comparing it to the current GEDCOM name (both Chrome and IE8 include c:\fakepath\ in the filename).
$previous_gedcom_filename = $tree->getPreference('gedcom_filename');
echo '<form name="replaceform" method="post" enctype="multipart/form-data" onsubmit="var newfile = document.replaceform.ged_name.value; newfile = newfile.substr(newfile.lastIndexOf(\'\\\\\')+1); if (newfile!=\'', Filter::escapeHtml($previous_gedcom_filename), '\' && \'\' != \'', Filter::escapeHtml($previous_gedcom_filename), '\') return confirm(\'', Filter::escapeHtml(I18N::translate('You have selected a GEDCOM file with a different name. Is this correct?')), '\'); else return true;">';
- echo '<input type="hidden" name="gedcom_id" value="', $tree->id(), '">';
+ echo '<input type="hidden" name="gedcom_id" value="', $tree->getId(), '">';
echo Filter::getCsrf();
if (Filter::get('action') == 'uploadform') {
echo '<input type="hidden" name="action" value="replace_upload">';
@@ -230,39 +230,39 @@ $controller->pageHeader();
<?php foreach (Tree::GetAll() as $tree): ?>
<?php if (Auth::isManager($tree)): ?>
<div class="panel panel-default">
- <div class="panel-heading" role="tab" id="panel-tree-<?php echo $tree->id(); ?>">
+ <div class="panel-heading" role="tab" id="panel-tree-<?php echo $tree->getId(); ?>">
<h2 class="panel-title">
<i class="fa fa-fw fa-tree"></i>
- <a data-toggle="collapse" data-parent="#accordion" href="#tree-<?php echo $tree->id(); ?>" aria-expanded="true" aria-controls="tree-<?php echo $tree->id(); ?>">
- <?php echo $tree->nameHtml(); ?> — <?php echo $tree->titleHtml(); ?>
+ <a data-toggle="collapse" data-parent="#accordion" href="#tree-<?php echo $tree->getId(); ?>" aria-expanded="true" aria-controls="tree-<?php echo $tree->getId(); ?>">
+ <?php echo $tree->getNameHtml(); ?> — <?php echo $tree->getTitleHtml(); ?>
</a>
</h2>
</div>
- <div id="tree-<?php echo $tree->id(); ?>" class="panel-collapse collapse<?php echo $tree->id() === WT_GED_ID || $tree->getPreference('imported') === '0' ? ' in' : ''; ?>" role="tabpanel" aria-labelledby="panel-tree-<?php echo $tree->id(); ?>">
+ <div id="tree-<?php echo $tree->getId(); ?>" class="panel-collapse collapse<?php echo $tree->getId() === WT_GED_ID || $tree->getPreference('imported') === '0' ? ' in' : ''; ?>" role="tabpanel" aria-labelledby="panel-tree-<?php echo $tree->getId(); ?>">
<div class="panel-body">
<?php
// The third row shows an optional progress bar and a list of maintenance options
$importing = Database::prepare(
"SELECT 1 FROM `##gedcom_chunk` WHERE gedcom_id = ? AND imported = '0' LIMIT 1"
- )->execute(array($tree->id()))->fetchOne();
+ )->execute(array($tree->getId()))->fetchOne();
if ($importing) {
?>
- <div id="import<?php echo $tree->id(); ?>" class="col-xs-12">
+ <div id="import<?php echo $tree->getId(); ?>" class="col-xs-12">
<div class="progress">
<?php echo I18N::translate('Calculating…'); ?>
</div>
</div>
<?php
$controller->addInlineJavascript(
- 'jQuery("#import' . $tree->id() . '").load("import.php?gedcom_id=' . $tree->id() . '");'
+ 'jQuery("#import' . $tree->getId() . '").load("import.php?gedcom_id=' . $tree->getId() . '");'
);
}
?>
- <div class="row<?php echo $importing ? ' hidden' : ''; ?>" id="actions<?php echo $tree->id(); ?>">
+ <div class="row<?php echo $importing ? ' hidden' : ''; ?>" id="actions<?php echo $tree->getId(); ?>">
<div class="col-sm-6 col-md-3">
<h3>
- <a href="index.php?ctype=gedcom&ged=<?php echo $tree->nameUrl(); ?>">
+ <a href="index.php?ctype=gedcom&ged=<?php echo $tree->getNameUrl(); ?>">
<?php echo I18N::translate('Family tree'); ?>
</a>
</h3>
@@ -270,48 +270,48 @@ $controller->pageHeader();
<!-- PREFERENCES -->
<li>
<i class="fa fa-li fa-cogs"></i>
- <a href="admin_trees_config.php?action=general&amp;ged=<?php echo $tree->nameUrl(); ?>">
+ <a href="admin_trees_config.php?action=general&amp;ged=<?php echo $tree->getNameUrl(); ?>">
<?php echo I18N::translate('Preferences'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
</li>
<!-- PRIVACY -->
<li>
<i class="fa fa-li fa-lock"></i>
- <a href="admin_trees_config.php?action=privacy&amp;ged=<?php echo $tree->nameUrl(); ?>">
+ <a href="admin_trees_config.php?action=privacy&amp;ged=<?php echo $tree->getNameUrl(); ?>">
<?php echo I18N::translate('Privacy'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
</li>
<!-- HOME PAGE BLOCKS-->
<li>
<i class="fa fa-li fa-th-large"></i>
- <a href="index_edit.php?gedcom_id=<?php echo $tree->id(); ?>">
+ <a href="index_edit.php?gedcom_id=<?php echo $tree->getId(); ?>">
<?php echo I18N::translate('Change the “Home page” blocks'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
</li>
<!-- DELETE -->
<li>
<i class="fa fa-li fa-trash-o"></i>
- <a href="#" onclick="if (confirm('<?php echo Filter::escapeJs(I18N::translate('Are you sure you want to delete “%s”?', $tree->nameHtml())); ?>')) { document.delete_form<?php echo $tree->id(); ?>.submit(); } return false;">
+ <a href="#" onclick="if (confirm('<?php echo Filter::escapeJs(I18N::translate('Are you sure you want to delete “%s”?', $tree->getNameHtml())); ?>')) { document.delete_form<?php echo $tree->getId(); ?>.submit(); } return false;">
<?php echo I18N::translate('Delete'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
- <form name="delete_form<?php echo $tree->id(); ?>" method="post">
+ <form name="delete_form<?php echo $tree->getId(); ?>" method="post">
<input type="hidden" name="action" value="delete">
- <input type="hidden" name="gedcom_id" value="<?php echo $tree->id(); ?>">
+ <input type="hidden" name="gedcom_id" value="<?php echo $tree->getId(); ?>">
<?php echo Filter::getCsrf(); ?>
<!-- A11Y - forms need submit buttons, but they look ugly here -->
- <button class="sr-only" onclick="return confirm('<?php echo Filter::escapeJs(I18N::translate('Are you sure you want to delete “%s”?', $tree->titleHtml())); ?>')" type="submit">
+ <button class="sr-only" onclick="return confirm('<?php echo Filter::escapeJs(I18N::translate('Are you sure you want to delete “%s”?', $tree->getTitleHtml())); ?>')" type="submit">
<?php echo I18N::translate('Delete'); ?>
</button>
</form>
@@ -320,18 +320,18 @@ $controller->pageHeader();
<?php if (count(Tree::getAll()) > 1): ?>
<li>
<i class="fa fa-li fa-star"></i>
- <?php if ($tree->name() == Site::getPreference('DEFAULT_GEDCOM')): ?>
+ <?php if ($tree->getName() == Site::getPreference('DEFAULT_GEDCOM')): ?>
<?php echo I18N::translate('Default family tree'); ?>
<?php else: ?>
- <a href="#" onclick="document.defaultform<?php echo $tree->id(); ?>.submit();">
+ <a href="#" onclick="document.defaultform<?php echo $tree->getId(); ?>.submit();">
<?php echo I18N::translate('Set as default'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
- <form name="defaultform<?php echo $tree->id(); ?>" method="post">
+ <form name="defaultform<?php echo $tree->getId(); ?>" method="post">
<input type="hidden" name="action" value="setdefault">
- <input type="hidden" name="ged" value="<?php echo $tree->nameHtml(); ?>">
+ <input type="hidden" name="ged" value="<?php echo $tree->getNameHtml(); ?>">
<?php echo Filter::getCsrf(); ?>
<!-- A11Y - forms need submit buttons, but they look ugly here -->
<button class="sr-only" type="submit">
@@ -351,50 +351,50 @@ $controller->pageHeader();
<!-- MERGE -->
<li>
<i class="fa fa-li fa-code-fork"></i>
- <a href="admin_site_merge.php?ged=<?php echo $tree->nameUrl(); ?>">
+ <a href="admin_site_merge.php?ged=<?php echo $tree->getNameUrl(); ?>">
<?php echo I18N::translate('Merge records'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
</li>
<!-- UPDATE PLACE NAMES -->
<li>
<i class="fa fa-li fa-map-marker"></i>
- <a href="admin_trees_places.php?ged=<?php echo $tree->nameUrl(); ?>">
+ <a href="admin_trees_places.php?ged=<?php echo $tree->getNameUrl(); ?>">
<?php echo I18N::translate('Update place names'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
</li>
<!-- CHECK FOR ERRORS -->
<li>
<i class="fa fa-li fa-check"></i>
- <a href="admin_trees_check.php?ged=<?php echo $tree->nameUrl(); ?>">
+ <a href="admin_trees_check.php?ged=<?php echo $tree->getNameUrl(); ?>">
<?php echo I18N::translate('Check for errors'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
</li>
<!-- RENUMBER -->
<li>
<i class="fa fa-li fa-sort-numeric-asc"></i>
- <a href="admin_trees_renumber.php?ged=<?php echo $tree->nameUrl(); ?>">
+ <a href="admin_trees_renumber.php?ged=<?php echo $tree->getNameUrl(); ?>">
<?php echo I18N::translate('Renumber'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
</li>
<!-- CHANGES -->
<li>
<i class="fa fa-li fa-th-list"></i>
- <a href="admin_site_change.php?gedc=<?php echo $tree->nameUrl(); ?>">
+ <a href="admin_site_change.php?gedc=<?php echo $tree->getNameUrl(); ?>">
<?php echo I18N::translate('Changes log'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
</li>
@@ -412,7 +412,7 @@ $controller->pageHeader();
<a href="#" onclick="add_unlinked_indi(); return false;">
<?php echo I18N::translate('Individual'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
</li>
@@ -422,7 +422,7 @@ $controller->pageHeader();
<a href="#" onclick="addnewsource(''); return false;">
<?php echo I18N::translate('Source'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
</li>
@@ -432,7 +432,7 @@ $controller->pageHeader();
<a href="#" onclick="addnewrepository(''); return false;">
<?php echo I18N::translate('Repository'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
</li>
@@ -442,7 +442,7 @@ $controller->pageHeader();
<a href="#" onclick="window.open('addmedia.php?action=showmediaform', '_blank', edit_window_specs); return false;">
<?php echo I18N::translate('Media object'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
</li>
@@ -451,7 +451,7 @@ $controller->pageHeader();
<i class="fa fa-li fa-paragraph"></i>
<a href="#" onclick="addnewnote(''); return false;">
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
<?php echo I18N::translate('Shared note'); ?>
</a>
@@ -466,20 +466,20 @@ $controller->pageHeader();
<!-- DOWNLOAD -->
<li>
<i class="fa fa-li fa-download"></i>
- <a href="admin_trees_download.php?ged=<?php echo $tree->nameUrl(); ?>">
+ <a href="admin_trees_download.php?ged=<?php echo $tree->getNameUrl(); ?>">
<?php echo I18N::translate('Download'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
</li>
<!-- UPLOAD -->
<li>
<i class="fa fa-li fa-upload"></i>
- <a href="?action=uploadform&amp;gedcom_id=<?php echo $tree->id(); ?>">
+ <a href="?action=uploadform&amp;gedcom_id=<?php echo $tree->getId(); ?>">
<?php echo I18N::translate('Upload'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
</li>
@@ -487,7 +487,7 @@ $controller->pageHeader();
<li>
<form action="admin_trees_export.php" method="post">
<?php echo Filter::getCsrf(); ?>
- <input type="hidden" name="ged" value="<?php echo $tree->nameHtml(); ?>">
+ <input type="hidden" name="ged" value="<?php echo $tree->getNameHtml(); ?>">
<i class="fa fa-li fa-file-text"></i>
<input type="submit" class="hide"><!-- for WCAG2 -->
<a href="#" onclick="jQuery(this).closest('form').submit();">
@@ -498,10 +498,10 @@ $controller->pageHeader();
<!-- IMPORT -->
<li>
<i class="fa fa-li fa-file-text-o"></i>
- <a href="?action=importform&amp;gedcom_id=<?php echo $tree->id(); ?>">
+ <a href="?action=importform&amp;gedcom_id=<?php echo $tree->getId(); ?>">
<?php echo I18N::translate('Import'); ?>
<span class="sr-only">
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</span>
</a>
</li>
diff --git a/admin_trees_merge.php b/admin_trees_merge.php
index 3e3864de5b..5b5c2a15eb 100644
--- a/admin_trees_merge.php
+++ b/admin_trees_merge.php
@@ -87,13 +87,13 @@ if ($tree1_id && $tree2_id != $tree1_id) {
I18N::translate('You must renumber the records in one of the trees before you can merge them.'),
'</p>',
'<p>',
- '<a class="current" href="admin_trees_renumber.php?ged=', $tree1->nameUrl(), '">',
- I18N::translate('Renumber family tree'), ' — ', $tree1->titleHtml(),
+ '<a class="current" href="admin_trees_renumber.php?ged=', $tree1->getNameUrl(), '">',
+ I18N::translate('Renumber family tree'), ' — ', $tree1->getTitleHtml(),
'</a>',
'</p>',
'<p>',
- '<a class="current" href="admin_trees_renumber.php?ged=', $tree2->nameUrl(), '">',
- I18N::translate('Renumber family tree'), ' — ', $tree2->titleHtml(),
+ '<a class="current" href="admin_trees_renumber.php?ged=', $tree2->getNameUrl(), '">',
+ I18N::translate('Renumber family tree'), ' — ', $tree2->getTitleHtml(),
'</a>',
'</p>';
} else {
diff --git a/admin_trees_places.php b/admin_trees_places.php
index 73e6a4600a..db0ed111bd 100644
--- a/admin_trees_places.php
+++ b/admin_trees_places.php
@@ -78,7 +78,7 @@ if ($search && $replace) {
$controller = new PageController;
$controller
->restrictAccess(Auth::isManager())
- ->setPageTitle(I18N::translate('Update all the place names in a family tree') . ' — ' . $WT_TREE->titleHtml())
+ ->setPageTitle(I18N::translate('Update all the place names in a family tree') . ' — ' . $WT_TREE->getTitleHtml())
->pageHeader();
?>
diff --git a/admin_trees_renumber.php b/admin_trees_renumber.php
index 85170732d8..0872ac3e98 100644
--- a/admin_trees_renumber.php
+++ b/admin_trees_renumber.php
@@ -28,7 +28,7 @@ require './includes/session.php';
$controller = new PageController;
$controller
->restrictAccess(Auth::isManager())
- ->setPageTitle(I18N::translate(/* I18N: Renumber the records in a family tree */ 'Renumber family tree') . ' — ' . $WT_TREE->titleHtml())
+ ->setPageTitle(I18N::translate(/* I18N: Renumber the records in a family tree */ 'Renumber family tree') . ' — ' . $WT_TREE->getTitleHtml())
->pageHeader();
// Every XREF used by this tree and also used by some other tree
diff --git a/admin_users.php b/admin_users.php
index 5fafdd0084..fc2c99c814 100644
--- a/admin_users.php
+++ b/admin_users.php
@@ -114,11 +114,11 @@ case 'save':
}
foreach (Tree::getAll() as $tree) {
- $tree->setUserPreference($user, 'gedcomid', Filter::post('gedcomid' . $tree->id(), WT_REGEX_XREF));
- $tree->setUserPreference($user, 'rootid', Filter::post('rootid' . $tree->id(), WT_REGEX_XREF));
- $tree->setUserPreference($user, 'canedit', Filter::post('canedit' . $tree->id(), implode('|', array_keys($ALL_EDIT_OPTIONS))));
- if (Filter::post('gedcomid' . $tree->id(), WT_REGEX_XREF)) {
- $tree->setUserPreference($user, 'RELATIONSHIP_PATH_LENGTH', Filter::postInteger('RELATIONSHIP_PATH_LENGTH' . $tree->id(), 0, 10, 0));
+ $tree->setUserPreference($user, 'gedcomid', Filter::post('gedcomid' . $tree->getId(), WT_REGEX_XREF));
+ $tree->setUserPreference($user, 'rootid', Filter::post('rootid' . $tree->getId(), WT_REGEX_XREF));
+ $tree->setUserPreference($user, 'canedit', Filter::post('canedit' . $tree->getId(), implode('|', array_keys($ALL_EDIT_OPTIONS))));
+ if (Filter::post('gedcomid' . $tree->getId(), WT_REGEX_XREF)) {
+ $tree->setUserPreference($user, 'RELATIONSHIP_PATH_LENGTH', Filter::postInteger('RELATIONSHIP_PATH_LENGTH' . $tree->getId(), 0, 10, 0));
} else {
// Do not allow a path length to be set if the individual ID is not
$tree->setUserPreference($user, 'RELATIONSHIP_PATH_LENGTH', null);
@@ -585,10 +585,10 @@ case 'edit':
<?php foreach (Tree::getAll() as $tree): ?>
<tr>
<td>
- <?php echo $tree->titleHtml(); ?>
+ <?php echo $tree->getTitleHtml(); ?>
</td>
<td>
- <select name="canedit<?php echo $tree->id(); ?>">
+ <select name="canedit<?php echo $tree->getId(); ?>">
<?php foreach ($ALL_EDIT_OPTIONS as $EDIT_OPTION => $desc): ?>
<option value="<?php echo $EDIT_OPTION; ?>"
<?php echo $EDIT_OPTION === $tree->getUserPreference($user, 'canedit') ? 'selected' : ''; ?>
@@ -601,29 +601,29 @@ case 'edit':
<td>
<input
data-autocomplete-type="INDI"
- data-autocomplete-ged="<?php echo Filter::escapeHtml($tree->name()); ?>"
+ data-autocomplete-ged="<?php echo Filter::escapeHtml($tree->getName()); ?>"
type="text"
size="12"
- name="rootid<?php echo $tree->id(); ?>"
- id="rootid<?php echo $tree->id(); ?>"
+ name="rootid<?php echo $tree->getId(); ?>"
+ id="rootid<?php echo $tree->getId(); ?>"
value="<?php echo Filter::escapeHtml($tree->getUserPreference($user, 'rootid')); ?>"
>
- <?php echo print_findindi_link('rootid' . $tree->id()), '', $tree->name(); ?>
+ <?php echo print_findindi_link('rootid' . $tree->getId()), '', $tree->getName(); ?>
</td>
<td>
<input
data-autocomplete-type="INDI"
- data-autocomplete-ged="<?php echo Filter::escapeHtml($tree->name()); ?>"
+ data-autocomplete-ged="<?php echo Filter::escapeHtml($tree->getName()); ?>"
type="text"
size="12"
- name="gedcomid<?php echo $tree->id(); ?>"
- id="gedcomid<?php echo $tree->id(); ?>"
+ name="gedcomid<?php echo $tree->getId(); ?>"
+ id="gedcomid<?php echo $tree->getId(); ?>"
value="<?php echo Filter::escapeHtml($tree->getUserPreference($user, 'gedcomid')); ?>"
>
- <?php echo print_findindi_link('gedcomid' . $tree->id(), '', $tree->name()); ?>
+ <?php echo print_findindi_link('gedcomid' . $tree->getId(), '', $tree->getName()); ?>
</td>
<td>
- <select name="RELATIONSHIP_PATH_LENGTH<?php echo $tree->id(); ?>" id="RELATIONSHIP_PATH_LENGTH<?php echo $tree->id(); ?>" class="relpath">
+ <select name="RELATIONSHIP_PATH_LENGTH<?php echo $tree->getId(); ?>" id="RELATIONSHIP_PATH_LENGTH<?php echo $tree->getId(); ?>" class="relpath">
<?php for ($n = 0; $n <= 10; ++$n): ?>
<option value="<?php echo $n; ?>" <?php echo $tree->getUserPreference($user, 'RELATIONSHIP_PATH_LENGTH') === $n ? 'checked' : ''; ?>>
<?php echo $n ? $n : I18N::translate('No'); ?>
diff --git a/app/Controller/SearchController.php b/app/Controller/SearchController.php
index 0a1a7d2f23..549750758a 100644
--- a/app/Controller/SearchController.php
+++ b/app/Controller/SearchController.php
@@ -130,9 +130,9 @@ class SearchController extends PageController {
// Retrieve the gedcoms to search in
if (count(Tree::getAll()) > 1 && Site::getPreference('ALLOW_CHANGE_GEDCOM')) {
foreach (Tree::getAll() as $search_tree) {
- $str = str_replace(array(".", "-", " "), array("_", "_", "_"), $search_tree->name());
+ $str = str_replace(array(".", "-", " "), array("_", "_", "_"), $search_tree->getName());
if (isset ($_REQUEST["$str"]) || $topsearch) {
- $this->search_trees[$search_tree->id()] = $search_tree;
+ $this->search_trees[$search_tree->getId()] = $search_tree;
$_REQUEST["$str"] = 'yes';
}
}
@@ -602,15 +602,15 @@ class SearchController extends PageController {
foreach ($this->search_trees as $search_tree) {
$datalist = array();
foreach ($this->myindilist as $individual) {
- if ($individual->getGedcomId() === $search_tree->id()) {
+ if ($individual->getGedcomId() === $search_tree->getId()) {
$datalist[] = $individual;
}
}
if ($datalist) {
usort($datalist, __NAMESPACE__ . '\GedcomRecord::compare');
- $GEDCOM = $search_tree->name();
- load_gedcom_settings($search_tree->id());
- echo '<h3 class="indi-acc-header"><a href="#"><span class="search_item" dir="auto">', $this->myquery, '</span> @ <span>', $search_tree->titleHtml(), '</span></a></h3>
+ $GEDCOM = $search_tree->getName();
+ load_gedcom_settings($search_tree->getId());
+ echo '<h3 class="indi-acc-header"><a href="#"><span class="search_item" dir="auto">', $this->myquery, '</span> @ <span>', $search_tree->getTitleHtml(), '</span></a></h3>
<div class="indi-acc_content">',
format_indi_table($datalist);
echo '</div>'; //indi-acc_content
@@ -625,15 +625,22 @@ class SearchController extends PageController {
foreach ($this->search_trees as $search_tree) {
$datalist = array();
foreach ($this->myfamlist as $family) {
- if ($family->getGedcomId() === $search_tree->id()) {
+ if ($family->getGedcomId() === $search_tree->getId()) {
$datalist[] = $family;
}
}
if ($datalist) {
+<<<<<<< Updated upstream
usort($datalist, __NAMESPACE__ . '\GedcomRecord::compare');
$GEDCOM = $search_tree->name();
load_gedcom_settings($search_tree->id());
echo '<h3 class="fam-acc-header"><a href="#"><span class="search_item" dir="auto">', $this->myquery, '</span> @ <span>', $search_tree->titleHtml(), '</span></a></h3>
+=======
+ usort($datalist, 'Webtrees\GedcomRecord::compare');
+ $GEDCOM = $search_tree->getName();
+ load_gedcom_settings($search_tree->getId());
+ echo '<h3 class="fam-acc-header"><a href="#"><span class="search_item" dir="auto">', $this->myquery, '</span> @ <span>', $search_tree->getTitleHtml(), '</span></a></h3>
+>>>>>>> Stashed changes
<div class="fam-acc_content">',
format_fam_table($datalist);
echo '</div>'; //fam-acc_content
@@ -648,15 +655,22 @@ class SearchController extends PageController {
foreach ($this->search_trees as $search_tree) {
$datalist = array();
foreach ($this->mysourcelist as $source) {
- if ($source->getGedcomId() === $search_tree->id()) {
+ if ($source->getGedcomId() === $search_tree->getId()) {
$datalist[] = $source;
}
}
if ($datalist) {
+<<<<<<< Updated upstream
usort($datalist, __NAMESPACE__ . '\GedcomRecord::compare');
$GEDCOM = $search_tree->name();
load_gedcom_settings($search_tree->id());
echo '<h3 class="source-acc-header"><a href="#"><span class="search_item" dir="auto">', $this->myquery, '</span> @ <span>', $search_tree->titleHtml(), '</span></a></h3>
+=======
+ usort($datalist, 'Webtrees\GedcomRecord::compare');
+ $GEDCOM = $search_tree->getName();
+ load_gedcom_settings($search_tree->getId());
+ echo '<h3 class="source-acc-header"><a href="#"><span class="search_item" dir="auto">', $this->myquery, '</span> @ <span>', $search_tree->getTitleHtml(), '</span></a></h3>
+>>>>>>> Stashed changes
<div class="source-acc_content">',
format_sour_table($datalist);
echo '</div>'; //fam-acc_content
@@ -671,15 +685,22 @@ class SearchController extends PageController {
foreach ($this->search_trees as $search_tree) {
$datalist = array();
foreach ($this->mynotelist as $note) {
- if ($note->getGedcomId() === $search_tree->id()) {
+ if ($note->getGedcomId() === $search_tree->getId()) {
$datalist[] = $note;
}
}
if ($datalist) {
+<<<<<<< Updated upstream
usort($datalist, __NAMESPACE__ . '\GedcomRecord::compare');
$GEDCOM = $search_tree->name();
load_gedcom_settings($search_tree->id());
echo '<h3 class="note-acc-header"><a href="#"><span class="search_item" dir="auto">', $this->myquery, '</span> @ <span>', $search_tree->titleHtml(), '</span></a></h3>
+=======
+ usort($datalist, 'Webtrees\GedcomRecord::compare');
+ $GEDCOM = $search_tree->getName();
+ load_gedcom_settings($search_tree->getId());
+ echo '<h3 class="note-acc-header"><a href="#"><span class="search_item" dir="auto">', $this->myquery, '</span> @ <span>', $search_tree->getTitleHtml(), '</span></a></h3>
+>>>>>>> Stashed changes
<div class="note-acc_content">',
format_note_table($datalist);
echo '</div>'; //note-acc_content
diff --git a/app/GedcomRecord.php b/app/GedcomRecord.php
index aeef9b09da..b797f12dc4 100644
--- a/app/GedcomRecord.php
+++ b/app/GedcomRecord.php
@@ -26,8 +26,8 @@ class GedcomRecord {
/** @var string The record identifier */
protected $xref;
- /** @var int The gedcom file */
- protected $gedcom_id;
+ /** @var Tree The family tree to which this record belongs */
+ protected $tree;
/** @var string GEDCOM data (before any pending edits) */
protected $gedcom;
@@ -68,13 +68,13 @@ class GedcomRecord {
* @param string $gedcom an empty string for new/pending records
* @param string|null $pending null for a record with no pending edits,
* empty string for records with pending deletions
- * @param integer $gedcom_id
+ * @param integer $tree_id
*/
- public function __construct($xref, $gedcom, $pending, $gedcom_id) {
+ public function __construct($xref, $gedcom, $pending, $tree_id) {
$this->xref = $xref;
$this->gedcom = $gedcom;
$this->pending = $pending;
- $this->gedcom_id = $gedcom_id;
+ $this->tree = Tree::get($tree_id);
$this->parseFacts();
}
@@ -265,12 +265,21 @@ class GedcomRecord {
}
/**
+ * Get the tree to which this record belongs
+ *
+ * @return Tree
+ */
+ public function getTree() {
+ return $this->xref;
+ }
+
+ /**
* Get the tree ID for this record
*
* @return integer
*/
public function getGedcomId() {
- return $this->gedcom_id;
+ return $this->tree->getId();
}
/**
@@ -341,12 +350,12 @@ class GedcomRecord {
* @return string
*/
private function getLinkUrl($link, $separator) {
- if ($this->gedcom_id == WT_GED_ID) {
+ if ($this->tree->getId() == WT_GED_ID) {
return $link . $this->getXref() . $separator . 'ged=' . WT_GEDURL;
- } elseif ($this->gedcom_id == 0) {
+ } elseif ($this->tree->getId() == 0) {
return '#';
} else {
- return $link . $this->getXref() . $separator . 'ged=' . rawurlencode(get_gedcom_from_id($this->gedcom_id));
+ return $link . $this->getXref() . $separator . 'ged=' . rawurlencode(get_gedcom_from_id($this->tree->getId()));
}
}
@@ -670,7 +679,7 @@ class GedcomRecord {
* @return string
*/
public function __toString() {
- return $this->xref . '@' . $this->gedcom_id;
+ return $this->xref . '@' . $this->tree->getId();
}
/**
@@ -810,7 +819,7 @@ class GedcomRecord {
" LEFT JOIN `##name` ON (i_file=n_file AND i_id=n_id AND n_num=0)" .
" WHERE i_file=? AND l_type=? AND l_to=?" .
" ORDER BY n_sort COLLATE '" . I18N::$collation . "'"
- )->execute(array($this->gedcom_id, $link, $this->xref))->fetchAll();
+ )->execute(array($this->tree->getId(), $link, $this->xref))->fetchAll();
$list = array();
foreach ($rows as $row) {
@@ -836,7 +845,7 @@ class GedcomRecord {
" JOIN `##link` ON (f_file=l_file AND f_id=l_from)" .
" LEFT JOIN `##name` ON (f_file=n_file AND f_id=n_id AND n_num=0)" .
" WHERE f_file=? AND l_type=? AND l_to=?"
- )->execute(array($this->gedcom_id, $link, $this->xref))->fetchAll();
+ )->execute(array($this->tree->getId(), $link, $this->xref))->fetchAll();
$list = array();
foreach ($rows as $row) {
@@ -862,7 +871,7 @@ class GedcomRecord {
" JOIN `##link` ON (s_file=l_file AND s_id=l_from)" .
" WHERE s_file=? AND l_type=? AND l_to=?" .
" ORDER BY s_name COLLATE '" . I18N::$collation . "'"
- )->execute(array($this->gedcom_id, $link, $this->xref))->fetchAll();
+ )->execute(array($this->tree->getId(), $link, $this->xref))->fetchAll();
$list = array();
foreach ($rows as $row) {
@@ -888,7 +897,7 @@ class GedcomRecord {
" JOIN `##link` ON (m_file=l_file AND m_id=l_from)" .
" WHERE m_file=? AND l_type=? AND l_to=?" .
" ORDER BY m_titl COLLATE '" . I18N::$collation . "'"
- )->execute(array($this->gedcom_id, $link, $this->xref))->fetchAll();
+ )->execute(array($this->tree->getId(), $link, $this->xref))->fetchAll();
$list = array();
foreach ($rows as $row) {
@@ -915,7 +924,7 @@ class GedcomRecord {
" LEFT JOIN `##name` ON (o_file=n_file AND o_id=n_id AND n_num=0)" .
" WHERE o_file=? AND o_type='NOTE' AND l_type=? AND l_to=?" .
" ORDER BY n_sort COLLATE '" . I18N::$collation . "'"
- )->execute(array($this->gedcom_id, $link, $this->xref))->fetchAll();
+ )->execute(array($this->tree->getId(), $link, $this->xref))->fetchAll();
$list = array();
foreach ($rows as $row) {
@@ -942,7 +951,7 @@ class GedcomRecord {
" LEFT JOIN `##name` ON (o_file=n_file AND o_id=n_id AND n_num=0)" .
" WHERE o_file=? AND o_type='REPO' AND l_type=? AND l_to=?" .
" ORDER BY n_sort COLLATE '" . I18N::$collation . "'"
- )->execute(array($this->gedcom_id, $link, $this->xref))->fetchAll();
+ )->execute(array($this->tree->getId(), $link, $this->xref))->fetchAll();
$list = array();
foreach ($rows as $row) {
@@ -1171,7 +1180,7 @@ class GedcomRecord {
Database::prepare(
"INSERT INTO `##change` (gedcom_id, xref, old_gedcom, new_gedcom, user_id) VALUES (?, ?, ?, ?, ?)"
)->execute(array(
- $this->gedcom_id,
+ $this->tree->getId(),
$this->xref,
$old_gedcom,
$new_gedcom,
@@ -1181,7 +1190,7 @@ class GedcomRecord {
$this->pending = $new_gedcom;
if (Auth::user()->getPreference('auto_accept')) {
- accept_all_changes($this->xref, $this->gedcom_id);
+ accept_all_changes($this->xref, $this->tree->getId());
$this->gedcom = $new_gedcom;
$this->pending = null;
}
@@ -1266,7 +1275,7 @@ class GedcomRecord {
Database::prepare(
"INSERT INTO `##change` (gedcom_id, xref, old_gedcom, new_gedcom, user_id) VALUES (?, ?, ?, ?, ?)"
)->execute(array(
- $this->gedcom_id,
+ $this->tree->getId(),
$this->xref,
$this->getGedcom(),
$gedcom,
@@ -1278,7 +1287,7 @@ class GedcomRecord {
// Accept this pending change
if (Auth::user()->getPreference('auto_accept')) {
- accept_all_changes($this->xref, $this->gedcom_id);
+ accept_all_changes($this->xref, $this->tree->getId());
$this->gedcom = $gedcom;
$this->pending = null;
}
@@ -1296,7 +1305,7 @@ class GedcomRecord {
Database::prepare(
"INSERT INTO `##change` (gedcom_id, xref, old_gedcom, new_gedcom, user_id) VALUES (?, ?, ?, '', ?)"
)->execute(array(
- $this->gedcom_id,
+ $this->tree->getId(),
$this->xref,
$this->getGedcom(),
Auth::id(),
@@ -1304,7 +1313,7 @@ class GedcomRecord {
// Accept this pending change
if (Auth::user()->getPreference('auto_accept')) {
- accept_all_changes($this->xref, $this->gedcom_id);
+ accept_all_changes($this->xref, $this->tree->getId());
}
// Clear the cache
diff --git a/app/Log.php b/app/Log.php
index 262f407499..d9aacc250e 100644
--- a/app/Log.php
+++ b/app/Log.php
@@ -51,7 +51,7 @@ class Log {
$message,
$WT_REQUEST->getClientIp(),
Auth::id(),
- $tree ? $tree->id() : null
+ $tree ? $tree->getId() : null
));
}
diff --git a/app/Media.php b/app/Media.php
index ddf0218d8d..32b7f2189e 100644
--- a/app/Media.php
+++ b/app/Media.php
@@ -72,8 +72,10 @@ class Media extends GedcomRecord {
protected function canShowByType($access_level) {
// Hide media objects if they are attached to private records
$linked_ids = Database::prepare(
- "SELECT l_from FROM `##link` WHERE l_to=? AND l_file=?"
- )->execute(array($this->xref, $this->gedcom_id))->fetchOneColumn();
+ "SELECT l_from FROM `##link` WHERE l_to = ? AND l_file = ?"
+ )->execute(array(
+ $this->xref, $this->tree->getId()
+ ))->fetchOneColumn();
foreach ($linked_ids as $linked_id) {
$linked_record = GedcomRecord::getInstance($linked_id);
if ($linked_record && !$linked_record->canShow($access_level)) {
@@ -444,7 +446,7 @@ class Media extends GedcomRecord {
return
'mediafirewall.php?mid=' . $this->getXref() . $thumbstr . $downloadstr .
- '&amp;ged=' . rawurlencode(get_gedcom_from_id($this->gedcom_id)) .
+ '&amp;ged=' . rawurlencode(get_gedcom_from_id($this->tree->getId())) .
'&amp;cb=' . $this->getEtag($which);
}
diff --git a/app/Module.php b/app/Module.php
index 756da3fa02..93f79358f0 100644
--- a/app/Module.php
+++ b/app/Module.php
@@ -169,7 +169,7 @@ abstract class Module {
$access_level = Database::prepare(
"SELECT access_level FROM `##module_privacy` WHERE gedcom_id = :gedcom_id AND module_name = :module_name AND component = :component"
)->execute(array(
- 'gedcom_id' => $tree->id(),
+ 'gedcom_id' => $tree->getId(),
'module_name' => $this->getName(),
'component' => $component,
))->fetchOne();
diff --git a/app/Note.php b/app/Note.php
index effbb8c0d3..8363e9f7d6 100644
--- a/app/Note.php
+++ b/app/Note.php
@@ -62,7 +62,9 @@ class Note extends GedcomRecord {
// Hide notes if they are attached to private records
$linked_ids = Database::prepare(
"SELECT l_from FROM `##link` WHERE l_to=? AND l_file=?"
- )->execute(array($this->xref, $this->gedcom_id))->fetchOneColumn();
+ )->execute(array(
+ $this->xref, $this->tree->getId()
+ ))->fetchOneColumn();
foreach ($linked_ids as $linked_id) {
$linked_record = GedcomRecord::getInstance($linked_id);
if ($linked_record && !$linked_record->canShow($access_level)) {
diff --git a/app/Stats.php b/app/Stats.php
index be06cc047b..f19f6d94fd 100644
--- a/app/Stats.php
+++ b/app/Stats.php
@@ -170,21 +170,21 @@ class Stats {
* @return string
*/
public function gedcomFilename() {
- return $this->tree->name();
+ return $this->tree->getName();
}
/**
* @return integer
*/
public function gedcomID() {
- return $this->tree->id();
+ return $this->tree->getId();
}
/**
* @return string
*/
public function gedcomTitle() {
- return $this->tree->titleHtml();
+ return $this->tree->getTitleHtml();
}
/**
@@ -255,7 +255,7 @@ class Stats {
public function gedcomUpdated() {
$row = Database::prepare(
"SELECT SQL_CACHE d_year, d_month, d_day FROM `##dates` WHERE d_julianday1 = (SELECT MAX(d_julianday1) FROM `##dates` WHERE d_file =? AND d_fact='CHAN') LIMIT 1"
- )->execute(array($this->tree->id()))->fetchOneRow();
+ )->execute(array($this->tree->getId()))->fetchOneRow();
if ($row) {
$date = new Date("{$row->d_day} {$row->d_month} {$row->d_year}");
@@ -317,7 +317,7 @@ class Stats {
private function totalIndividualsQuery() {
return
(int) Database::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file = ?")
- ->execute(array($this->tree->id()))
+ ->execute(array($this->tree->getId()))
->fetchOne();
}
@@ -332,7 +332,7 @@ class Stats {
* @return integer
*/
private function totalIndisWithSourcesQuery() {
- $rows = $this->runSql("SELECT SQL_CACHE COUNT(DISTINCT i_id) AS tot FROM `##link`, `##individuals` WHERE i_id=l_from AND i_file=l_file AND l_file=" . $this->tree->id() . " AND l_type='SOUR'");
+ $rows = $this->runSql("SELECT SQL_CACHE COUNT(DISTINCT i_id) AS tot FROM `##link`, `##individuals` WHERE i_id=l_from AND i_file=l_file AND l_file=" . $this->tree->getId() . " AND l_type='SOUR'");
return (int) $rows[0]['tot'];
}
@@ -397,7 +397,7 @@ class Stats {
private function totalFamiliesQuery() {
return
(int) Database::prepare("SELECT SQL_CACHE COUNT(*) FROM `##families` WHERE f_file=?")
- ->execute(array($this->tree->id()))
+ ->execute(array($this->tree->getId()))
->fetchOne();
}
@@ -412,7 +412,7 @@ class Stats {
* @return integer
*/
private function totalFamsWithSourcesQuery() {
- $rows = $this->runSql("SELECT SQL_CACHE COUNT(DISTINCT f_id) AS tot FROM `##link`, `##families` WHERE f_id=l_from AND f_file=l_file AND l_file=" . $this->tree->id() . " AND l_type='SOUR'");
+ $rows = $this->runSql("SELECT SQL_CACHE COUNT(DISTINCT f_id) AS tot FROM `##link`, `##families` WHERE f_id=l_from AND f_file=l_file AND l_file=" . $this->tree->getId() . " AND l_type='SOUR'");
return (int) $rows[0]['tot'];
}
@@ -478,7 +478,7 @@ class Stats {
private function totalSourcesQuery() {
return
(int) Database::prepare("SELECT SQL_CACHE COUNT(*) FROM `##sources` WHERE s_file=?")
- ->execute(array($this->tree->id()))
+ ->execute(array($this->tree->getId()))
->fetchOne();
}
@@ -502,7 +502,7 @@ class Stats {
private function totalNotesQuery() {
return
(int) Database::prepare("SELECT SQL_CACHE COUNT(*) FROM `##other` WHERE o_type='NOTE' AND o_file=?")
- ->execute(array($this->tree->id()))
+ ->execute(array($this->tree->getId()))
->fetchOne();
}
@@ -526,7 +526,7 @@ class Stats {
private function totalRepositoriesQuery() {
return
(Int) Database::prepare("SELECT SQL_CACHE COUNT(*) FROM `##other` WHERE o_type='REPO' AND o_file=?")
- ->execute(array($this->tree->id()))
+ ->execute(array($this->tree->getId()))
->fetchOne();
}
@@ -560,7 +560,7 @@ class Stats {
$vars = '';
$distinct = 'DISTINCT';
}
- $vars[] = $this->tree->id();
+ $vars[] = $this->tree->getId();
$total =
Database::prepare(
"SELECT SQL_CACHE COUNT({$distinct} n_surn COLLATE '" . I18N::$collation . "')" .
@@ -583,7 +583,7 @@ class Stats {
public function totalGivennames($params = array()) {
if ($params) {
$qs = implode(',', array_fill(0, count($params), '?'));
- $params[] = $this->tree->id();
+ $params[] = $this->tree->getId();
$total =
Database::prepare("SELECT SQL_CACHE COUNT( n_givn) FROM `##name` WHERE n_givn IN ({$qs}) AND n_file=?")
->execute($params)
@@ -591,7 +591,7 @@ class Stats {
} else {
$total =
Database::prepare("SELECT SQL_CACHE COUNT(DISTINCT n_givn) FROM `##name` WHERE n_givn IS NOT NULL AND n_file=?")
- ->execute(array($this->tree->id()))
+ ->execute(array($this->tree->getId()))
->fetchOne();
}
@@ -605,7 +605,7 @@ class Stats {
*/
public function totalEvents($params = array()) {
$sql = "SELECT SQL_CACHE COUNT(*) AS tot FROM `##dates` WHERE d_file=?";
- $vars = array($this->tree->id());
+ $vars = array($this->tree->getId());
$no_types = array('HEAD', 'CHAN');
if ($params) {
@@ -704,7 +704,7 @@ class Stats {
private function totalSexMalesQuery() {
return
(int) Database::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file=? AND i_sex=?")
- ->execute(array($this->tree->id(), 'M'))
+ ->execute(array($this->tree->getId(), 'M'))
->fetchOne();
}
@@ -728,7 +728,7 @@ class Stats {
private function totalSexFemalesQuery() {
return
(int) Database::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file=? AND i_sex=?")
- ->execute(array($this->tree->id(), 'F'))
+ ->execute(array($this->tree->getId(), 'F'))
->fetchOne();
}
@@ -752,7 +752,7 @@ class Stats {
private function totalSexUnknownQuery() {
return
(int) Database::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file=? AND i_sex=?")
- ->execute(array($this->tree->id(), 'U'))
+ ->execute(array($this->tree->getId(), 'U'))
->fetchOne();
}
@@ -845,7 +845,7 @@ class Stats {
private function totalLivingQuery() {
return
(int) Database::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file=? AND i_gedcom NOT REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'")
- ->execute(array($this->tree->id()))
+ ->execute(array($this->tree->getId()))
->fetchOne();
}
@@ -869,7 +869,7 @@ class Stats {
private function totalDeceasedQuery() {
return
(int) Database::prepare("SELECT SQL_CACHE COUNT(*) FROM `##individuals` WHERE i_file=? AND i_gedcom REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")'")
- ->execute(array($this->tree->id()))
+ ->execute(array($this->tree->getId()))
->fetchOne();
}
@@ -972,7 +972,7 @@ class Stats {
return 0;
}
$sql = "SELECT SQL_CACHE COUNT(*) AS tot FROM `##media` WHERE m_file=?";
- $vars = array($this->tree->id());
+ $vars = array($this->tree->getId());
if ($type != 'all') {
if ($type == 'unknown') {
@@ -1241,10 +1241,10 @@ class Stats {
$rows = $this->runSql(
"SELECT SQL_CACHE d_year, d_type, d_fact, d_gid" .
" FROM `##dates`" .
- " WHERE d_file={$this->tree->id()} AND d_fact IN ({$query_field}) AND d_julianday1=(" .
+ " WHERE d_file={$this->tree->getId()} AND d_fact IN ({$query_field}) AND d_julianday1=(" .
" SELECT {$dmod}( d_julianday1 )" .
" FROM `##dates`" .
- " WHERE d_file={$this->tree->id()} AND d_fact IN ({$query_field}) AND d_julianday1<>0 )" .
+ " WHERE d_file={$this->tree->getId()} AND d_fact IN ({$query_field}) AND d_julianday1<>0 )" .
" LIMIT 1"
);
if (!isset($rows[0])) {
@@ -1294,12 +1294,12 @@ class Stats {
if ($what == 'INDI') {
$rows =
Database::prepare("SELECT i_gedcom AS ged FROM `##individuals` WHERE i_file=?")
- ->execute(array($this->tree->id()))
+ ->execute(array($this->tree->getId()))
->fetchAll();
} elseif ($what == 'FAM') {
$rows =
Database::prepare("SELECT f_gedcom AS ged FROM `##families` WHERE f_file=?")
- ->execute(array($this->tree->id()))
+ ->execute(array($this->tree->getId()))
->fetchAll();
}
$placelist = array();
@@ -1339,7 +1339,7 @@ class Stats {
$join .
" WHERE" .
" p_id={$parent} AND" .
- " p_file={$this->tree->id()}" .
+ " p_file={$this->tree->getId()}" .
" GROUP BY place"
);
@@ -1361,7 +1361,7 @@ class Stats {
" JOIN `##placelinks` ON pl_file=p_file AND p_id=pl_p_id" .
$join .
" WHERE" .
- " p_file={$this->tree->id()}" .
+ " p_file={$this->tree->getId()}" .
" AND p_parent_id='0'" .
" GROUP BY country ORDER BY tot DESC, country ASC"
);
@@ -1376,7 +1376,7 @@ class Stats {
private function totalPlacesQuery() {
return
(int) Database::prepare("SELECT SQL_CACHE COUNT(*) FROM `##places` WHERE p_file=?")
- ->execute(array($this->tree->id()))
+ ->execute(array($this->tree->getId()))
->fetchOne();
}
@@ -1577,7 +1577,7 @@ class Stats {
foreach ($all_db_countries as $country_code => $country) {
$top10[] = '<li>';
foreach ($country as $country_name => $tot) {
- $tmp = new Place($country_name, $this->tree->id());
+ $tmp = new Place($country_name, $this->tree->getId());
$place = '<a href="' . $tmp->getURL() . '" class="list_item">' . $all_countries[$country_code] . '</a>';
$top10[] .= $place . ' - ' . I18N::number($tot);
}
@@ -1599,7 +1599,7 @@ class Stats {
$i = 1;
arsort($places);
foreach ($places as $place => $count) {
- $tmp = new Place($place, $this->tree->id());
+ $tmp = new Place($place, $this->tree->getId());
$place = '<a href="' . $tmp->getURL() . '" class="list_item">' . $tmp->getFullName() . '</a>';
$top10[] = '<li>' . $place . ' - ' . I18N::number($count) . '</li>';
if ($i++ == 10) {
@@ -1620,7 +1620,7 @@ class Stats {
$i = 1;
arsort($places);
foreach ($places as $place => $count) {
- $tmp = new Place($place, $this->tree->id());
+ $tmp = new Place($place, $this->tree->getId());
$place = '<a href="' . $tmp->getURL() . '" class="list_item">' . $tmp->getFullName() . '</a>';
$top10[] = '<li>' . $place . ' - ' . I18N::number($count) . '</li>';
if ($i++ == 10) {
@@ -1641,7 +1641,7 @@ class Stats {
$i = 1;
arsort($places);
foreach ($places as $place => $count) {
- $tmp = new Place($place, $this->tree->id());
+ $tmp = new Place($place, $this->tree->getId());
$place = '<a href="' . $tmp->getURL() . '" class="list_item">' . $tmp->getFullName() . '</a>';
$top10[] = '<li>' . $place . ' - ' . I18N::number($count) . '</li>';
if ($i++ == 10) {
@@ -1673,7 +1673,7 @@ class Stats {
$sql =
"SELECT SQL_CACHE FLOOR(d_year/100+1) AS century, COUNT(*) AS total FROM `##dates` " .
"WHERE " .
- "d_file={$this->tree->id()} AND " .
+ "d_file={$this->tree->getId()} AND " .
"d_year<>0 AND " .
"d_fact='BIRT' AND " .
"d_type IN ('@#DGREGORIAN@', '@#DJULIAN@')";
@@ -1682,14 +1682,14 @@ class Stats {
"SELECT SQL_CACHE d_month, i_sex, COUNT(*) AS total FROM `##dates` " .
"JOIN `##individuals` ON d_file = i_file AND d_gid = i_id " .
"WHERE " .
- "d_file={$this->tree->id()} AND " .
+ "d_file={$this->tree->getId()} AND " .
"d_fact='BIRT' AND " .
"d_type IN ('@#DGREGORIAN@', '@#DJULIAN@')";
} else {
$sql =
"SELECT SQL_CACHE d_month, COUNT(*) AS total FROM `##dates` " .
"WHERE " .
- "d_file={$this->tree->id()} AND " .
+ "d_file={$this->tree->getId()} AND " .
"d_fact='BIRT' AND " .
"d_type IN ('@#DGREGORIAN@', '@#DJULIAN@')";
}
@@ -1764,7 +1764,7 @@ class Stats {
$sql =
"SELECT SQL_CACHE FLOOR(d_year/100+1) AS century, COUNT(*) AS total FROM `##dates` " .
"WHERE " .
- "d_file={$this->tree->id()} AND " .
+ "d_file={$this->tree->getId()} AND " .
'd_year<>0 AND ' .
"d_fact='DEAT' AND " .
"d_type IN ('@#DGREGORIAN@', '@#DJULIAN@')";
@@ -1773,14 +1773,14 @@ class Stats {
"SELECT SQL_CACHE d_month, i_sex, COUNT(*) AS total FROM `##dates` " .
"JOIN `##individuals` ON d_file = i_file AND d_gid = i_id " .
"WHERE " .
- "d_file={$this->tree->id()} AND " .
+ "d_file={$this->tree->getId()} AND " .
"d_fact='DEAT' AND " .
"d_type IN ('@#DGREGORIAN@', '@#DJULIAN@')";
} else {
$sql =
"SELECT SQL_CACHE d_month, COUNT(*) AS total FROM `##dates` " .
"WHERE " .
- "d_file={$this->tree->id()} AND " .
+ "d_file={$this->tree->getId()} AND " .
"d_fact='DEAT' AND " .
"d_type IN ('@#DGREGORIAN@', '@#DJULIAN@')";
}
@@ -1992,7 +1992,7 @@ class Stats {
" WHERE" .
" indi.i_id=birth.d_gid AND" .
" birth.d_gid=death.d_gid AND" .
- " death.d_file={$this->tree->id()} AND" .
+ " death.d_file={$this->tree->getId()} AND" .
" birth.d_file=death.d_file AND" .
" birth.d_file=indi.i_file AND" .
" birth.d_fact='BIRT' AND" .
@@ -2060,7 +2060,7 @@ class Stats {
"WHERE " .
" indi.i_id=birth.d_gid AND " .
" birth.d_gid=death.d_gid AND " .
- " death.d_file={$this->tree->id()} AND " .
+ " death.d_file={$this->tree->getId()} AND " .
" birth.d_file=death.d_file AND " .
" birth.d_file=indi.i_file AND " .
" birth.d_fact='BIRT' AND " .
@@ -2144,7 +2144,7 @@ class Stats {
" WHERE" .
" indi.i_id=birth.d_gid AND" .
" indi.i_gedcom NOT REGEXP '\\n1 (" . WT_EVENTS_DEAT . ")' AND" .
- " birth.d_file={$this->tree->id()} AND" .
+ " birth.d_file={$this->tree->getId()} AND" .
" birth.d_fact='BIRT' AND" .
" birth.d_file=indi.i_file AND" .
" birth.d_julianday1<>0" .
@@ -2209,7 +2209,7 @@ class Stats {
"WHERE " .
" indi.i_id=birth.d_gid AND " .
" birth.d_gid=death.d_gid AND " .
- " death.d_file=" . $this->tree->id() . " AND " .
+ " death.d_file=" . $this->tree->getId() . " AND " .
" birth.d_file=death.d_file AND " .
" birth.d_file=indi.i_file AND " .
" birth.d_fact='BIRT' AND " .
@@ -2267,7 +2267,7 @@ class Stats {
" WHERE" .
" indi.i_id=birth.d_gid AND" .
" birth.d_gid=death.d_gid AND" .
- " death.d_file={$this->tree->id()} AND" .
+ " death.d_file={$this->tree->getId()} AND" .
" birth.d_file=death.d_file AND" .
" birth.d_file=indi.i_file AND" .
" birth.d_fact='BIRT' AND" .
@@ -2363,7 +2363,7 @@ class Stats {
" WHERE" .
" indi.i_id=birth.d_gid AND" .
" birth.d_gid=death.d_gid AND" .
- " death.d_file={$this->tree->id()} AND" .
+ " death.d_file={$this->tree->getId()} AND" .
" birth.d_file=death.d_file AND" .
" birth.d_file=indi.i_file AND" .
" birth.d_fact='BIRT' AND" .
@@ -2620,7 +2620,7 @@ class Stats {
. ' FROM'
. " `##dates`"
. ' WHERE'
- . " d_file={$this->tree->id()} AND"
+ . " d_file={$this->tree->getId()} AND"
. " d_gid<>'HEAD' AND"
. " d_fact {$fact_query} AND"
. ' d_julianday1<>0'
@@ -2759,14 +2759,14 @@ class Stats {
$rows = $this->runSql(
" SELECT SQL_CACHE fam.f_id AS famid, fam.{$sex_field}, married.d_julianday2-birth.d_julianday1 AS age, indi.i_id AS i_id" .
" FROM `##families` AS fam" .
- " LEFT JOIN `##dates` AS birth ON birth.d_file = {$this->tree->id()}" .
- " LEFT JOIN `##dates` AS married ON married.d_file = {$this->tree->id()}" .
- " LEFT JOIN `##individuals` AS indi ON indi.i_file = {$this->tree->id()}" .
+ " LEFT JOIN `##dates` AS birth ON birth.d_file = {$this->tree->getId()}" .
+ " LEFT JOIN `##dates` AS married ON married.d_file = {$this->tree->getId()}" .
+ " LEFT JOIN `##individuals` AS indi ON indi.i_file = {$this->tree->getId()}" .
" WHERE" .
" birth.d_gid = indi.i_id AND" .
" married.d_gid = fam.f_id AND" .
" indi.i_id = fam.{$sex_field} AND" .
- " fam.f_file = {$this->tree->id()} AND" .
+ " fam.f_file = {$this->tree->getId()} AND" .
" birth.d_fact = 'BIRT' AND" .
" married.d_fact = 'MARR' AND" .
" birth.d_julianday1 <> 0 AND" .
@@ -2837,10 +2837,10 @@ class Stats {
$hrows = $this->runSql(
" SELECT SQL_CACHE DISTINCT fam.f_id AS family, MIN(husbdeath.d_julianday2-married.d_julianday1) AS age" .
" FROM `##families` AS fam" .
- " LEFT JOIN `##dates` AS married ON married.d_file = {$this->tree->id()}" .
- " LEFT JOIN `##dates` AS husbdeath ON husbdeath.d_file = {$this->tree->id()}" .
+ " LEFT JOIN `##dates` AS married ON married.d_file = {$this->tree->getId()}" .
+ " LEFT JOIN `##dates` AS husbdeath ON husbdeath.d_file = {$this->tree->getId()}" .
" WHERE" .
- " fam.f_file = {$this->tree->id()} AND" .
+ " fam.f_file = {$this->tree->getId()} AND" .
" husbdeath.d_gid = fam.f_husb AND" .
" husbdeath.d_fact = 'DEAT' AND" .
" married.d_gid = fam.f_id AND" .
@@ -2852,10 +2852,10 @@ class Stats {
$wrows = $this->runSql(
" SELECT SQL_CACHE DISTINCT fam.f_id AS family, MIN(wifedeath.d_julianday2-married.d_julianday1) AS age" .
" FROM `##families` AS fam" .
- " LEFT JOIN `##dates` AS married ON married.d_file = {$this->tree->id()}" .
- " LEFT JOIN `##dates` AS wifedeath ON wifedeath.d_file = {$this->tree->id()}" .
+ " LEFT JOIN `##dates` AS married ON married.d_file = {$this->tree->getId()}" .
+ " LEFT JOIN `##dates` AS wifedeath ON wifedeath.d_file = {$this->tree->getId()}" .
" WHERE" .
- " fam.f_file = {$this->tree->id()} AND" .
+ " fam.f_file = {$this->tree->getId()} AND" .
" wifedeath.d_gid = fam.f_wife AND" .
" wifedeath.d_fact = 'DEAT' AND" .
" married.d_gid = fam.f_id AND" .
@@ -2867,10 +2867,10 @@ class Stats {
$drows = $this->runSql(
" SELECT SQL_CACHE DISTINCT fam.f_id AS family, MIN(divorced.d_julianday2-married.d_julianday1) AS age" .
" FROM `##families` AS fam" .
- " LEFT JOIN `##dates` AS married ON married.d_file = {$this->tree->id()}" .
- " LEFT JOIN `##dates` AS divorced ON divorced.d_file = {$this->tree->id()}" .
+ " LEFT JOIN `##dates` AS married ON married.d_file = {$this->tree->getId()}" .
+ " LEFT JOIN `##dates` AS divorced ON divorced.d_file = {$this->tree->getId()}" .
" WHERE" .
- " fam.f_file = {$this->tree->id()} AND" .
+ " fam.f_file = {$this->tree->getId()} AND" .
" married.d_gid = fam.f_id AND" .
" married.d_fact = 'MARR' AND" .
" divorced.d_gid = fam.f_id AND" .
@@ -2975,10 +2975,10 @@ class Stats {
$rows = $this->runSql(
" SELECT SQL_CACHE fam.f_id AS family," . $query1 .
" FROM `##families` AS fam" .
- " LEFT JOIN `##dates` AS wifebirth ON wifebirth.d_file = {$this->tree->id()}" .
- " LEFT JOIN `##dates` AS husbbirth ON husbbirth.d_file = {$this->tree->id()}" .
+ " LEFT JOIN `##dates` AS wifebirth ON wifebirth.d_file = {$this->tree->getId()}" .
+ " LEFT JOIN `##dates` AS husbbirth ON husbbirth.d_file = {$this->tree->getId()}" .
" WHERE" .
- " fam.f_file = {$this->tree->id()} AND" .
+ " fam.f_file = {$this->tree->getId()} AND" .
" husbbirth.d_gid = fam.f_husb AND" .
" husbbirth.d_fact = 'BIRT' AND" .
" wifebirth.d_gid = fam.f_wife AND" .
@@ -3049,16 +3049,16 @@ class Stats {
" parentfamily.l_to AS id," .
" childbirth.d_julianday2-birth.d_julianday1 AS age" .
" FROM `##link` AS parentfamily" .
- " JOIN `##link` AS childfamily ON childfamily.l_file = {$this->tree->id()}" .
- " JOIN `##dates` AS birth ON birth.d_file = {$this->tree->id()}" .
- " JOIN `##dates` AS childbirth ON childbirth.d_file = {$this->tree->id()}" .
+ " JOIN `##link` AS childfamily ON childfamily.l_file = {$this->tree->getId()}" .
+ " JOIN `##dates` AS birth ON birth.d_file = {$this->tree->getId()}" .
+ " JOIN `##dates` AS childbirth ON childbirth.d_file = {$this->tree->getId()}" .
" WHERE" .
" birth.d_gid = parentfamily.l_to AND" .
" childfamily.l_to = childbirth.d_gid AND" .
" childfamily.l_type = 'CHIL' AND" .
" parentfamily.l_type = '{$sex_field}' AND" .
" childfamily.l_from = parentfamily.l_from AND" .
- " parentfamily.l_file = {$this->tree->id()} AND" .
+ " parentfamily.l_file = {$this->tree->getId()} AND" .
" birth.d_fact = 'BIRT' AND" .
" childbirth.d_fact = 'BIRT' AND" .
" birth.d_julianday1 <> 0 AND" .
@@ -3123,7 +3123,7 @@ class Stats {
$sql =
"SELECT SQL_CACHE FLOOR(d_year/100+1) AS century, COUNT(*) AS total" .
" FROM `##dates`" .
- " WHERE d_file={$this->tree->id()} AND d_year<>0 AND d_fact='MARR' AND d_type IN ('@#DGREGORIAN@', '@#DJULIAN@')";
+ " WHERE d_file={$this->tree->getId()} AND d_year<>0 AND d_fact='MARR' AND d_type IN ('@#DGREGORIAN@', '@#DJULIAN@')";
if ($year1 >= 0 && $year2 >= 0) {
$sql .= " AND d_year BETWEEN '{$year1}' AND '{$year2}'";
}
@@ -3136,11 +3136,11 @@ class Stats {
$sql =
" SELECT SQL_CACHE fam.f_id AS fams, fam.f_husb, fam.f_wife, married.d_julianday2 AS age, married.d_month AS month, indi.i_id AS indi" .
" FROM `##families` AS fam" .
- " LEFT JOIN `##dates` AS married ON married.d_file = {$this->tree->id()}" .
- " LEFT JOIN `##individuals` AS indi ON indi.i_file = {$this->tree->id()}" .
+ " LEFT JOIN `##dates` AS married ON married.d_file = {$this->tree->getId()}" .
+ " LEFT JOIN `##individuals` AS indi ON indi.i_file = {$this->tree->getId()}" .
" WHERE" .
" married.d_gid = fam.f_id AND" .
- " fam.f_file = {$this->tree->id()} AND" .
+ " fam.f_file = {$this->tree->getId()} AND" .
" married.d_fact = 'MARR' AND" .
" married.d_julianday2 <> 0 AND" .
$years .
@@ -3150,7 +3150,7 @@ class Stats {
$sql =
"SELECT SQL_CACHE d_month, COUNT(*) AS total" .
" FROM `##dates`" .
- " WHERE d_file={$this->tree->id()} AND d_fact='MARR'";
+ " WHERE d_file={$this->tree->getId()} AND d_fact='MARR'";
if ($year1 >= 0 && $year2 >= 0) {
$sql .= " AND d_year BETWEEN '{$year1}' AND '{$year2}'";
}
@@ -3218,7 +3218,7 @@ class Stats {
$sql =
"SELECT SQL_CACHE FLOOR(d_year/100+1) AS century, COUNT(*) AS total" .
" FROM `##dates`" .
- " WHERE d_file={$this->tree->id()} AND d_year<>0 AND d_fact = 'DIV' AND d_type IN ('@#DGREGORIAN@', '@#DJULIAN@')";
+ " WHERE d_file={$this->tree->getId()} AND d_year<>0 AND d_fact = 'DIV' AND d_type IN ('@#DGREGORIAN@', '@#DJULIAN@')";
if ($year1 >= 0 && $year2 >= 0) {
$sql .= " AND d_year BETWEEN '{$year1}' AND '{$year2}'";
}
@@ -3231,11 +3231,11 @@ class Stats {
$sql =
" SELECT SQL_CACHE fam.f_id AS fams, fam.f_husb, fam.f_wife, divorced.d_julianday2 AS age, divorced.d_month AS month, indi.i_id AS indi" .
" FROM `##families` AS fam" .
- " LEFT JOIN `##dates` AS divorced ON divorced.d_file = {$this->tree->id()}" .
- " LEFT JOIN `##individuals` AS indi ON indi.i_file = {$this->tree->id()}" .
+ " LEFT JOIN `##dates` AS divorced ON divorced.d_file = {$this->tree->getId()}" .
+ " LEFT JOIN `##individuals` AS indi ON indi.i_file = {$this->tree->getId()}" .
" WHERE" .
" divorced.d_gid = fam.f_id AND" .
- " fam.f_file = {$this->tree->id()} AND" .
+ " fam.f_file = {$this->tree->getId()} AND" .
" divorced.d_fact = 'DIV' AND" .
" divorced.d_julianday2 <> 0 AND" .
$years .
@@ -3244,7 +3244,7 @@ class Stats {
} else {
$sql =
"SELECT SQL_CACHE d_month, COUNT(*) AS total FROM `##dates` " .
- "WHERE d_file={$this->tree->id()} AND d_fact = 'DIV'";
+ "WHERE d_file={$this->tree->getId()} AND d_fact = 'DIV'";
if ($year1 >= 0 && $year2 >= 0) {
$sql .= " AND d_year BETWEEN '{$year1}' AND '{$year2}'";
}
@@ -3449,7 +3449,7 @@ class Stats {
"JOIN `##dates` AS birth ON (birth.d_gid=fam.f_husb AND birth.d_file=fam.f_file) " .
"WHERE " .
" '{$sex}' IN ('M', 'BOTH') AND " .
- " married.d_file={$this->tree->id()} AND married.d_type IN ('@#DGREGORIAN@', '@#DJULIAN@') AND married.d_fact='MARR' AND " .
+ " married.d_file={$this->tree->getId()} AND married.d_type IN ('@#DGREGORIAN@', '@#DJULIAN@') AND married.d_fact='MARR' AND " .
" birth.d_type IN ('@#DGREGORIAN@', '@#DJULIAN@') AND birth.d_fact='BIRT' AND " .
" married.d_julianday1>birth.d_julianday1 AND birth.d_julianday1<>0 " .
"GROUP BY century, sex " .
@@ -3463,7 +3463,7 @@ class Stats {
"JOIN `##dates` AS birth ON (birth.d_gid=fam.f_wife AND birth.d_file=fam.f_file) " .
"WHERE " .
" '{$sex}' IN ('F', 'BOTH') AND " .
- " married.d_file={$this->tree->id()} AND married.d_type IN ('@#DGREGORIAN@', '@#DJULIAN@') AND married.d_fact='MARR' AND " .
+ " married.d_file={$this->tree->getId()} AND married.d_type IN ('@#DGREGORIAN@', '@#DJULIAN@') AND married.d_fact='MARR' AND " .
" birth.d_type IN ('@#DGREGORIAN@', '@#DJULIAN@') AND birth.d_fact='BIRT' AND " .
" married.d_julianday1>birth.d_julianday1 AND birth.d_julianday1<>0 " .
" GROUP BY century, sex ORDER BY century"
@@ -3569,7 +3569,7 @@ class Stats {
"JOIN `##dates` AS birth ON (birth.d_gid=fam.f_husb AND birth.d_file=fam.f_file) " .
"WHERE " .
" '{$sex}' IN ('M', 'BOTH') AND {$years} " .
- " married.d_file={$this->tree->id()} AND married.d_type IN ('@#DGREGORIAN@', '@#DJULIAN@') AND married.d_fact='MARR' AND " .
+ " married.d_file={$this->tree->getId()} AND married.d_type IN ('@#DGREGORIAN@', '@#DJULIAN@') AND married.d_fact='MARR' AND " .
" birth.d_type IN ('@#DGREGORIAN@', '@#DJULIAN@') AND birth.d_fact='BIRT' AND " .
" married.d_julianday1>birth.d_julianday1 AND birth.d_julianday1<>0 " .
"UNION ALL " .
@@ -3582,7 +3582,7 @@ class Stats {
"JOIN `##dates` AS birth ON (birth.d_gid=fam.f_wife AND birth.d_file=fam.f_file) " .
"WHERE " .
" '{$sex}' IN ('F', 'BOTH') AND {$years} " .
- " married.d_file={$this->tree->id()} AND married.d_type IN ('@#DGREGORIAN@', '@#DJULIAN@') AND married.d_fact='MARR' AND " .
+ " married.d_file={$this->tree->getId()} AND married.d_type IN ('@#DGREGORIAN@', '@#DJULIAN@') AND married.d_fact='MARR' AND " .
" birth.d_type IN ('@#DGREGORIAN@', '@#DJULIAN@') AND birth.d_fact='BIRT' AND " .
" married.d_julianday1>birth.d_julianday1 AND birth.d_julianday1<>0 "
);
@@ -3888,7 +3888,7 @@ class Stats {
*/
public function totalMarriedMales() {
$n = Database::prepare("SELECT SQL_CACHE COUNT(DISTINCT f_husb) FROM `##families` WHERE f_file=? AND f_gedcom LIKE '%\\n1 MARR%'")
- ->execute(array($this->tree->id()))
+ ->execute(array($this->tree->getId()))
->fetchOne();
return I18N::number($n);
}
@@ -3898,7 +3898,7 @@ class Stats {
*/
public function totalMarriedFemales() {
$n = Database::prepare("SELECT SQL_CACHE COUNT(DISTINCT f_wife) FROM `##families` WHERE f_file=? AND f_gedcom LIKE '%\\n1 MARR%'")
- ->execute(array($this->tree->id()))
+ ->execute(array($this->tree->getId()))
->fetchOne();
return I18N::number($n);
}
@@ -3913,11 +3913,11 @@ class Stats {
" SELECT SQL_CACHE f_numchil AS tot, f_id AS id" .
" FROM `##families`" .
" WHERE" .
- " f_file={$this->tree->id()}" .
+ " f_file={$this->tree->getId()}" .
" AND f_numchil = (" .
" SELECT max( f_numchil )" .
" FROM `##families`" .
- " WHERE f_file ={$this->tree->id()}" .
+ " WHERE f_file ={$this->tree->getId()}" .
" )" .
" LIMIT 1"
);
@@ -3963,7 +3963,7 @@ class Stats {
"SELECT SQL_CACHE f_numchil AS tot, f_id AS id" .
" FROM `##families`" .
" WHERE" .
- " f_file={$this->tree->id()}" .
+ " f_file={$this->tree->getId()}" .
" ORDER BY tot DESC" .
" LIMIT " . $total
);
@@ -4028,11 +4028,11 @@ class Stats {
" link2.l_to AS ch2," .
" child1.d_julianday2-child2.d_julianday2 AS age" .
" FROM `##link` AS link1" .
- " LEFT JOIN `##dates` AS child1 ON child1.d_file = {$this->tree->id()}" .
- " LEFT JOIN `##dates` AS child2 ON child2.d_file = {$this->tree->id()}" .
- " LEFT JOIN `##link` AS link2 ON link2.l_file = {$this->tree->id()}" .
+ " LEFT JOIN `##dates` AS child1 ON child1.d_file = {$this->tree->getId()}" .
+ " LEFT JOIN `##dates` AS child2 ON child2.d_file = {$this->tree->getId()}" .
+ " LEFT JOIN `##link` AS link2 ON link2.l_file = {$this->tree->getId()}" .
" WHERE" .
- " link1.l_file = {$this->tree->id()} AND" .
+ " link1.l_file = {$this->tree->getId()} AND" .
" link1.l_from = link2.l_from AND" .
" link1.l_type = 'CHIL' AND" .
" child1.d_gid = link1.l_to AND" .
@@ -4165,10 +4165,10 @@ class Stats {
" child1.d_month as d_month" .
$sql_sex1 .
" FROM `##link` AS link1" .
- " LEFT JOIN `##dates` AS child1 ON child1.d_file = {$this->tree->id()}" .
+ " LEFT JOIN `##dates` AS child1 ON child1.d_file = {$this->tree->getId()}" .
$sql_sex2 .
" WHERE" .
- " link1.l_file = {$this->tree->id()} AND" .
+ " link1.l_file = {$this->tree->getId()} AND" .
" link1.l_type = 'CHIL' AND" .
" child1.d_gid = link1.l_to AND" .
" child1.d_fact = 'BIRT' AND" .
@@ -4336,7 +4336,7 @@ class Stats {
$rows = $this->runSql(
" SELECT SQL_CACHE f_numchil AS tot, f_id AS id" .
" FROM `##families`" .
- " WHERE f_file={$this->tree->id()}" .
+ " WHERE f_file={$this->tree->getId()}" .
" ORDER BY tot DESC" .
" LIMIT " . $total
);
@@ -4370,7 +4370,7 @@ class Stats {
* @return string
*/
public function totalChildren() {
- $rows = $this->runSql("SELECT SQL_CACHE SUM(f_numchil) AS tot FROM `##families` WHERE f_file={$this->tree->id()}");
+ $rows = $this->runSql("SELECT SQL_CACHE SUM(f_numchil) AS tot FROM `##families` WHERE f_file={$this->tree->getId()}");
return I18N::number($rows[0]['tot']);
}
@@ -4379,7 +4379,7 @@ class Stats {
* @return string
*/
public function averageChildren() {
- $rows = $this->runSql("SELECT SQL_CACHE AVG(f_numchil) AS tot FROM `##families` WHERE f_file={$this->tree->id()}");
+ $rows = $this->runSql("SELECT SQL_CACHE AVG(f_numchil) AS tot FROM `##families` WHERE f_file={$this->tree->getId()}");
return I18N::number($rows[0]['tot'], 2);
}
@@ -4406,7 +4406,7 @@ class Stats {
" SELECT SQL_CACHE ROUND(AVG(f_numchil),2) AS num, FLOOR(d_year/100+1) AS century" .
" FROM `##families`" .
" JOIN `##dates` ON (d_file = f_file AND d_gid=f_id)" .
- " WHERE f_file = {$this->tree->id()}" .
+ " WHERE f_file = {$this->tree->getId()}" .
" AND d_julianday1<>0" .
" AND d_fact = 'MARR'" .
" AND d_type IN ('@#DGREGORIAN@', '@#DJULIAN@')" .
@@ -4453,7 +4453,7 @@ class Stats {
"(SELECT count(i_sex) AS num FROM `##link` " .
"LEFT OUTER JOIN `##individuals` " .
"ON l_from=i_id AND l_file=i_file AND i_sex='M' AND l_type='FAMC' " .
- "JOIN `##families` ON f_file=l_file AND f_id=l_to WHERE f_file={$this->tree->id()} GROUP BY l_to" .
+ "JOIN `##families` ON f_file=l_file AND f_id=l_to WHERE f_file={$this->tree->getId()} GROUP BY l_to" .
") boys" .
" GROUP BY num" .
" ORDER BY num";
@@ -4463,7 +4463,7 @@ class Stats {
"(SELECT count(i_sex) AS num FROM `##link` " .
"LEFT OUTER JOIN `##individuals` " .
"ON l_from=i_id AND l_file=i_file AND i_sex='F' AND l_type='FAMC' " .
- "JOIN `##families` ON f_file=l_file AND f_id=l_to WHERE f_file={$this->tree->id()} GROUP BY l_to" .
+ "JOIN `##families` ON f_file=l_file AND f_id=l_to WHERE f_file={$this->tree->getId()} GROUP BY l_to" .
") girls" .
" GROUP BY num" .
" ORDER BY num";
@@ -4471,14 +4471,14 @@ class Stats {
$sql = "SELECT SQL_CACHE f_numchil, COUNT(*) AS total FROM `##families` ";
if ($year1 >= 0 && $year2 >= 0) {
$sql .=
- "AS fam LEFT JOIN `##dates` AS married ON married.d_file = {$this->tree->id()}"
+ "AS fam LEFT JOIN `##dates` AS married ON married.d_file = {$this->tree->getId()}"
. " WHERE"
. " married.d_gid = fam.f_id AND"
- . " fam.f_file = {$this->tree->id()} AND"
+ . " fam.f_file = {$this->tree->getId()} AND"
. " married.d_fact = 'MARR' AND"
. " married.d_year BETWEEN '{$year1}' AND '{$year2}'";
} else {
- $sql .= "WHERE f_file={$this->tree->id()}";
+ $sql .= "WHERE f_file={$this->tree->getId()}";
}
$sql .= " GROUP BY f_numchil";
}
@@ -4540,7 +4540,7 @@ class Stats {
$rows = $this->runSql(
" SELECT SQL_CACHE COUNT(*) AS tot" .
" FROM `##families`" .
- " WHERE f_numchil = 0 AND f_file = {$this->tree->id()}");
+ " WHERE f_numchil = 0 AND f_file = {$this->tree->getId()}");
return $rows[0]['tot'];
}
@@ -4568,7 +4568,7 @@ class Stats {
$rows = $this->runSql(
" SELECT SQL_CACHE f_id AS family" .
" FROM `##families` AS fam" .
- " WHERE f_numchil = 0 AND fam.f_file = {$this->tree->id()}");
+ " WHERE f_numchil = 0 AND fam.f_file = {$this->tree->getId()}");
if (!isset($rows[0])) {
return '';
}
@@ -4637,7 +4637,7 @@ class Stats {
" `##dates` AS married ON (married.d_file = fam.f_file AND married.d_gid = fam.f_id)" .
" WHERE" .
" f_numchil = 0 AND" .
- " fam.f_file = {$this->tree->id()} AND" .
+ " fam.f_file = {$this->tree->getId()} AND" .
$years .
" married.d_fact = 'MARR' AND" .
" married.d_type IN ('@#DGREGORIAN@', '@#DJULIAN@')" .
@@ -4710,11 +4710,11 @@ class Stats {
$rows = $this->runSql(
"SELECT SQL_CACHE COUNT(*) AS tot, f_id AS id" .
" FROM `##families`" .
- " JOIN `##link` AS children ON children.l_file = {$this->tree->id()}" .
- " JOIN `##link` AS mchildren ON mchildren.l_file = {$this->tree->id()}" .
- " JOIN `##link` AS gchildren ON gchildren.l_file = {$this->tree->id()}" .
+ " JOIN `##link` AS children ON children.l_file = {$this->tree->getId()}" .
+ " JOIN `##link` AS mchildren ON mchildren.l_file = {$this->tree->getId()}" .
+ " JOIN `##link` AS gchildren ON gchildren.l_file = {$this->tree->getId()}" .
" WHERE" .
- " f_file={$this->tree->id()} AND" .
+ " f_file={$this->tree->getId()} AND" .
" children.l_from=f_id AND" .
" children.l_type='CHIL' AND" .
" children.l_to=mchildren.l_from AND" .
@@ -4832,7 +4832,7 @@ class Stats {
* @return string
*/
public function getCommonSurname() {
- $surnames = array_keys(get_top_surnames($this->tree->id(), 1, 1));
+ $surnames = array_keys(get_top_surnames($this->tree->getId(), 1, 1));
return array_shift($surnames);
}
@@ -5980,7 +5980,7 @@ class Stats {
public function totalGedcomNews() {
try {
$number = (int) Database::prepare("SELECT COUNT(*) FROM `##news` WHERE gedcom_id = ?")
- ->execute(array($this->tree->id()))
+ ->execute(array($this->tree->getId()))
->fetchOne();
} catch (PDOException $ex) {
// The module may not be installed, so the table may not exist.
diff --git a/app/Theme/BaseTheme.php b/app/Theme/BaseTheme.php
index bd78c590af..65bd3721f8 100644
--- a/app/Theme/BaseTheme.php
+++ b/app/Theme/BaseTheme.php
@@ -426,7 +426,7 @@ abstract class BaseTheme {
return
'<form action="search.php" class="header-search" method="post" role="search">' .
'<input type="hidden" name="action" value="general">' .
- '<input type="hidden" name="ged" value="' . $this->tree->nameHtml() . '">' .
+ '<input type="hidden" name="ged" value="' . $this->tree->getNameHtml() . '">' .
'<input type="hidden" name="topsearch" value="yes">' .
$this->formQuickSearchFields() .
'</form>';
@@ -453,7 +453,7 @@ abstract class BaseTheme {
*/
protected function formatTreeTitle() {
if ($this->tree) {
- return '<h1 class="header-title">' . $this->tree->titleHtml() . '</h1>';
+ return '<h1 class="header-title">' . $this->tree->getTitleHtml() . '</h1>';
} else {
return '';
}
@@ -954,7 +954,7 @@ abstract class BaseTheme {
*/
final public function init(Zend_Session_Namespace $session, $search_engine, Tree $tree = null) {
$this->tree = $tree;
- $this->tree_url = $tree ? 'ged=' . $tree->nameUrl() : '';
+ $this->tree_url = $tree ? 'ged=' . $tree->getNameUrl() : '';
$this->session = $session;
$this->search_engine = $search_engine;
@@ -1293,11 +1293,11 @@ abstract class BaseTheme {
$ALLOW_CHANGE_GEDCOM = Site::getPreference('ALLOW_CHANGE_GEDCOM') && count(Tree::getAll()) > 1;
foreach (Tree::getAll() as $tree) {
- if ($tree->id() === WT_GED_ID || $ALLOW_CHANGE_GEDCOM) {
+ if ($tree->getId() === WT_GED_ID || $ALLOW_CHANGE_GEDCOM) {
$submenu = new Menu(
- $tree->titleHtml(),
- 'index.php?ctype=gedcom&amp;ged=' . $tree->nameUrl(),
- 'menu-tree-' . $tree->id() // Cannot use name - it must be a CSS identifier
+ $tree->getTitleHtml(),
+ 'index.php?ctype=gedcom&amp;ged=' . $tree->getNameUrl(),
+ 'menu-tree-' . $tree->getId() // Cannot use name - it must be a CSS identifier
);
$submenus[] = $submenu;
}
diff --git a/app/Tree.php b/app/Tree.php
index 543446d6e6..53570dbec8 100644
--- a/app/Tree.php
+++ b/app/Tree.php
@@ -57,7 +57,7 @@ class Tree {
*
* @return integer
*/
- public function id() {
+ public function getId() {
return $this->id;
}
@@ -66,7 +66,7 @@ class Tree {
*
* @return string
*/
- public function name() {
+ public function getName() {
return $this->name;
}
@@ -75,7 +75,7 @@ class Tree {
*
* @return string
*/
- public function nameHtml() {
+ public function getNameHtml() {
return Filter::escapeHtml($this->name);
}
@@ -84,7 +84,7 @@ class Tree {
*
* @return string
*/
- public function nameUrl() {
+ public function getNameUrl() {
return Filter::escapeUrl($this->name);
}
@@ -93,7 +93,7 @@ class Tree {
*
* @return string
*/
- public function title() {
+ public function getTitle() {
return $this->title;
}
@@ -102,7 +102,7 @@ class Tree {
*
* @return string
*/
- public function titleHtml() {
+ public function getTitleHtml() {
return Filter::escapeHtml($this->title);
}
diff --git a/app/User.php b/app/User.php
index 72a43ab966..b6b507e884 100644
--- a/app/User.php
+++ b/app/User.php
@@ -88,7 +88,7 @@ class User {
"SELECT SQL_CACHE user_id" .
" FROM `##user_gedcom_setting`" .
" WHERE gedcom_id = ? AND setting_name = 'gedcomid' AND setting_value = ?"
- )->execute(array($tree->id(), $individual->getXref()))->fetchOne();
+ )->execute(array($tree->getId(), $individual->getXref()))->fetchOne();
return self::find($user_id);
}
diff --git a/includes/functions/functions_db.php b/includes/functions/functions_db.php
index 284329187c..d1510d7e96 100644
--- a/includes/functions/functions_db.php
+++ b/includes/functions/functions_db.php
@@ -66,7 +66,7 @@ function exists_pending_change(User $user = null, Tree $tree = null) {
"SELECT 1" .
" FROM `##change`" .
" WHERE status='pending' AND gedcom_id=?"
- )->execute(array($tree->id()))->fetchOne();
+ )->execute(array($tree->getId()))->fetchOne();
}
/**
diff --git a/includes/session.php b/includes/session.php
index 719023cef9..487f306bf8 100644
--- a/includes/session.php
+++ b/includes/session.php
@@ -410,17 +410,17 @@ if (isset($_REQUEST['ged'])) {
$WT_TREE = null;
foreach (Tree::getAll() as $tree) {
$WT_TREE = $tree;
- if ($WT_TREE->name() == $GEDCOM && ($WT_TREE->getPreference('imported') || Auth::isAdmin())) {
+ if ($WT_TREE->getName() == $GEDCOM && ($WT_TREE->getPreference('imported') || Auth::isAdmin())) {
break;
}
}
// These attributes of the currently-selected tree are used frequently
if ($WT_TREE) {
- define('WT_GEDCOM', $WT_TREE->name());
- define('WT_GED_ID', $WT_TREE->id());
- define('WT_GEDURL', $WT_TREE->nameUrl());
- define('WT_TREE_TITLE', $WT_TREE->titleHtml());
+ define('WT_GEDCOM', $WT_TREE->getName());
+ define('WT_GED_ID', $WT_TREE->getId());
+ define('WT_GEDURL', $WT_TREE->getNameUrl());
+ define('WT_TREE_TITLE', $WT_TREE->getTitleHtml());
define('WT_USER_GEDCOM_ADMIN', Auth::isManager($WT_TREE));
define('WT_USER_CAN_ACCEPT', Auth::isModerator($WT_TREE));
define('WT_USER_CAN_EDIT', Auth::isEditor($WT_TREE));
diff --git a/login.php b/login.php
index 9b4dbfb265..a2d692e710 100644
--- a/login.php
+++ b/login.php
@@ -314,7 +314,7 @@ case 'register':
$mail1_body =
I18N::translate('Hello administrator…') . Mail::EOL . Mail::EOL .
/* I18N: %s is a server name/URL */
- I18N::translate('A prospective user has registered with webtrees at %s.', WT_BASE_URL . ' ' . $WT_TREE->titleHtml()) . Mail::EOL . Mail::EOL .
+ I18N::translate('A prospective user has registered with webtrees at %s.', WT_BASE_URL . ' ' . $WT_TREE->getTitleHtml()) . Mail::EOL . Mail::EOL .
I18N::translate('Username') . ' ' . Filter::escapeHtml($user->getUserName()) . Mail::EOL .
I18N::translate('Real name') . ' ' . Filter::escapeHtml($user->getRealName()) . Mail::EOL .
I18N::translate('Email address:') . ' ' . Filter::escapeHtml($user->getEmail()) . Mail::EOL .
@@ -336,7 +336,7 @@ case 'register':
$mail2_body =
I18N::translate('Hello %s…', $user->getRealName()) . Mail::EOL . Mail::EOL .
/* I18N: %1$s is the site URL and %2$s is an email address */
- I18N::translate('You (or someone claiming to be you) has requested an account at %1$s using the email address %2$s.', WT_BASE_URL . ' ' . $WT_TREE->titleHtml(), $user->getEmail()) . ' ' .
+ I18N::translate('You (or someone claiming to be you) has requested an account at %1$s using the email address %2$s.', WT_BASE_URL . ' ' . $WT_TREE->getTitleHtml(), $user->getEmail()) . ' ' .
I18N::translate('Information about the request is shown under the link below.') . Mail::EOL .
I18N::translate('Please click on the following link and fill in the requested data to confirm your request and email address.') . Mail::EOL . Mail::EOL .
'<a href="' . WT_LOGIN_URL . "?user_name=" . Filter::escapeUrl($user->getUserName()) . "&amp;user_hashcode=" . $user->getPreference('reg_hashcode') . '&amp;action=userverify">' .
@@ -580,7 +580,7 @@ case 'verify_hash':
'</a>' .
Mail::auditFooter();
- $mail1_subject = /* I18N: %s is a server name/URL */ I18N::translate('New user at %s', WT_BASE_URL . ' ' . $WT_TREE->title());
+ $mail1_subject = /* I18N: %s is a server name/URL */ I18N::translate('New user at %s', WT_BASE_URL . ' ' . $WT_TREE->getTitle());
// Change to the new user’s language
I18N::init($user->getPreference('language'));
diff --git a/modules_v3/faq/module.php b/modules_v3/faq/module.php
index fd652c0000..ab9f56596e 100644
--- a/modules_v3/faq/module.php
+++ b/modules_v3/faq/module.php
@@ -391,7 +391,7 @@ class faq_WT_Module extends Module implements ModuleMenuInterface, ModuleConfigI
if ($faq->gedcom_id == null) {
echo I18N::translate('All');
} else {
- echo $trees[$faq->gedcom_id]->titleHtml();
+ echo $trees[$faq->gedcom_id]->getTitleHtml();
}
echo '</td>';
// NOTE: Print the edit options of the current item
diff --git a/modules_v3/googlemap/module.php b/modules_v3/googlemap/module.php
index 618d308e8c..513c610555 100644
--- a/modules_v3/googlemap/module.php
+++ b/modules_v3/googlemap/module.php
@@ -1609,7 +1609,7 @@ class googlemap_WT_Module extends Module implements ModuleConfigInterface, Modul
case 'go':
//Identify gedcom file
$trees = Tree::getAll();
- echo '<div id="gm_check_title">', $trees[$gedcom_id]->titleHtml(), '</div>';
+ echo '<div id="gm_check_title">', $trees[$gedcom_id]->getTitleHtml(), '</div>';
//Select all '2 PLAC ' tags in the file and create array
$place_list = array();
$ged_data = Database::prepare("SELECT i_gedcom FROM `##individuals` WHERE i_gedcom LIKE ? AND i_file=?")
diff --git a/modules_v3/html/module.php b/modules_v3/html/module.php
index ac42e3b194..c8f452fe4c 100644
--- a/modules_v3/html/module.php
+++ b/modules_v3/html/module.php
@@ -57,7 +57,7 @@ class html_WT_Module extends Module implements ModuleBlockInterface {
$GEDCOM = Site::getPreference('DEFAULT_GEDCOM');
if (!$GEDCOM) {
foreach (Tree::getAll() as $tree) {
- $GEDCOM = $tree->name();
+ $GEDCOM = $tree->getName();
break;
}
}
@@ -280,8 +280,8 @@ class html_WT_Module extends Module implements ModuleBlockInterface {
'<option value="__current__" ', $sel_current, '>', I18N::translate('Current'), '</option>',
'<option value="__default__" ', $sel_default, '>', I18N::translate('Default'), '</option>';
foreach (Tree::getAll() as $tree) {
- if ($tree->name() === $gedcom) {$sel = 'selected'; } else {$sel = ''; }
- echo '<option value="', $tree->nameHtml(), '" ', $sel, ' dir="auto">', $tree->titleHtml(), '</option>';
+ if ($tree->getName() === $gedcom) {$sel = 'selected'; } else {$sel = ''; }
+ echo '<option value="', $tree->getNameHtml(), '" ', $sel, ' dir="auto">', $tree->getTitleHtml(), '</option>';
}
echo '</select>';
echo '</td></tr>';
diff --git a/modules_v3/sitemap/module.php b/modules_v3/sitemap/module.php
index 9fdb951756..031955e5eb 100644
--- a/modules_v3/sitemap/module.php
+++ b/modules_v3/sitemap/module.php
@@ -79,40 +79,40 @@ class sitemap_WT_Module extends Module implements ModuleConfigInterface {
if ($tree->getPreference('include_in_sitemap')) {
$n = Database::prepare(
"SELECT COUNT(*) FROM `##individuals` WHERE i_file = :tree_id"
- )->execute(array('tree_id' => $tree->id()))->fetchOne();
+ )->execute(array('tree_id' => $tree->getId()))->fetchOne();
for ($i = 0; $i <= $n / self::RECORDS_PER_VOLUME; ++$i) {
- $data .= '<sitemap><loc>' . WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&amp;mod_action=generate&amp;file=sitemap-' . $tree->id() . '-i-' . $i . '.xml</loc>' . $lastmod . '</sitemap>' . PHP_EOL;
+ $data .= '<sitemap><loc>' . WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&amp;mod_action=generate&amp;file=sitemap-' . $tree->getId() . '-i-' . $i . '.xml</loc>' . $lastmod . '</sitemap>' . PHP_EOL;
}
$n = Database::prepare(
"SELECT COUNT(*) FROM `##sources` WHERE s_file = :tree_id"
- )->execute(array('tree_id' => $tree->id()))->fetchOne();
+ )->execute(array('tree_id' => $tree->getId()))->fetchOne();
if ($n) {
for ($i = 0; $i <= $n / self::RECORDS_PER_VOLUME; ++$i) {
- $data .= '<sitemap><loc>' . WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&amp;mod_action=generate&amp;file=sitemap-' . $tree->id() . '-s-' . $i . '.xml</loc>' . $lastmod . '</sitemap>' . PHP_EOL;
+ $data .= '<sitemap><loc>' . WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&amp;mod_action=generate&amp;file=sitemap-' . $tree->getId() . '-s-' . $i . '.xml</loc>' . $lastmod . '</sitemap>' . PHP_EOL;
}
}
$n = Database::prepare(
"SELECT COUNT(*) FROM `##other` WHERE o_file = :tree_id AND o_type = 'REPO'"
- )->execute(array('tree_id' => $tree->id()))->fetchOne();
+ )->execute(array('tree_id' => $tree->getId()))->fetchOne();
if ($n) {
for ($i = 0; $i <= $n / self::RECORDS_PER_VOLUME; ++$i) {
- $data .= '<sitemap><loc>' . WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&amp;mod_action=generate&amp;file=sitemap-' . $tree->id() . '-r-' . $i . '.xml</loc>' . $lastmod . '</sitemap>' . PHP_EOL;
+ $data .= '<sitemap><loc>' . WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&amp;mod_action=generate&amp;file=sitemap-' . $tree->getId() . '-r-' . $i . '.xml</loc>' . $lastmod . '</sitemap>' . PHP_EOL;
}
}
$n = Database::prepare(
"SELECT COUNT(*) FROM `##other` WHERE o_file = :tree_id AND o_type = 'NOTE'"
- )->execute(array('tree_id' => $tree->id()))->fetchOne();
+ )->execute(array('tree_id' => $tree->getId()))->fetchOne();
if ($n) {
for ($i = 0; $i <= $n / self::RECORDS_PER_VOLUME; ++$i) {
- $data .= '<sitemap><loc>' . WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&amp;mod_action=generate&amp;file=sitemap-' . $tree->id() . '-n-' . $i . '.xml</loc>' . $lastmod . '</sitemap>' . PHP_EOL;
+ $data .= '<sitemap><loc>' . WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&amp;mod_action=generate&amp;file=sitemap-' . $tree->getId() . '-n-' . $i . '.xml</loc>' . $lastmod . '</sitemap>' . PHP_EOL;
}
}
$n = Database::prepare(
"SELECT COUNT(*) FROM `##media` WHERE m_file = :tree_id"
- )->execute(array('tree_id' => $tree->id()))->fetchOne();
+ )->execute(array('tree_id' => $tree->getId()))->fetchOne();
if ($n) {
for ($i = 0; $i <= $n / self::RECORDS_PER_VOLUME; ++$i) {
- $data .= '<sitemap><loc>' . WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&amp;mod_action=generate&amp;file=sitemap-' . $tree->id() . '-m-' . $i . '.xml</loc>' . $lastmod . '</sitemap>' . PHP_EOL;
+ $data .= '<sitemap><loc>' . WT_BASE_URL . 'module.php?mod=' . $this->getName() . '&amp;mod_action=generate&amp;file=sitemap-' . $tree->getId() . '-m-' . $i . '.xml</loc>' . $lastmod . '</sitemap>' . PHP_EOL;
}
}
}
@@ -142,7 +142,7 @@ class sitemap_WT_Module extends Module implements ModuleConfigInterface {
$data = $this->getSetting('sitemap-' . $ged_id . '-' . $rec_type . '-' . $volume . '.xml');
} else {
$tree = Tree::get($ged_id);
- $data = '<url><loc>' . WT_BASE_URL . 'index.php?ctype=gedcom&amp;ged=' . $tree->nameUrl() . '</loc></url>' . PHP_EOL;
+ $data = '<url><loc>' . WT_BASE_URL . 'index.php?ctype=gedcom&amp;ged=' . $tree->getNameUrl() . '</loc></url>' . PHP_EOL;
$records = array();
switch ($rec_type) {
case 'i':
@@ -266,7 +266,7 @@ class sitemap_WT_Module extends Module implements ModuleConfigInterface {
// Save the updated preferences
if (Filter::post('action') == 'save') {
foreach (Tree::getAll() as $tree) {
- $tree->setPreference('include_in_sitemap', Filter::postBool('include' . $tree->id()));
+ $tree->setPreference('include_in_sitemap', Filter::postBool('include' . $tree->getId()));
}
// Clear cache and force files to be regenerated
Database::prepare(
@@ -294,12 +294,12 @@ class sitemap_WT_Module extends Module implements ModuleConfigInterface {
'<form method="post" action="module.php?mod=' . $this->getName() . '&amp;mod_action=admin">',
'<input type="hidden" name="action" value="save">';
foreach (Tree::getAll() as $tree) {
- echo '<p><input type="checkbox" name="include', $tree->id(), '" ';
+ echo '<p><input type="checkbox" name="include', $tree->getId(), '" ';
if ($tree->getPreference('include_in_sitemap')) {
echo 'checked';
$include_any = true;
}
- echo '>', $tree->titleHtml(), '</p>';
+ echo '>', $tree->getTitleHtml(), '</p>';
}
echo
'<input type="submit" value="', I18N::translate('save'), '">',
diff --git a/search.php b/search.php
index 2f3cb46377..8a860f1fb6 100644
--- a/search.php
+++ b/search.php
@@ -195,11 +195,11 @@ echo '<div id="search-page">
<div id="search_trees" class="value">';
//-- sorting menu by gedcom filename
foreach (Tree::getAll() as $tree) {
- $str = str_replace(array(".", "-", " "), array("_", "_", "_"), $tree->name());
+ $str = str_replace(array(".", "-", " "), array("_", "_", "_"), $tree->getName());
$controller->inputFieldNames[] = "$str";
echo '<p><input type="checkbox" ';
echo isset ($_REQUEST[$str]) ? 'checked' : '';
- echo ' value="yes" id="checkbox_', $tree->id(), '" name="', $str, '"><label for="checkbox_', $tree->id(), '">', $tree->titleHtml(), '</label></p>', "\n";
+ echo ' value="yes" id="checkbox_', $tree->getId(), '" name="', $str, '"><label for="checkbox_', $tree->getId(), '">', $tree->getTitleHtml(), '</label></p>', "\n";
}
echo '</div>';
}