summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2010-06-19 10:12:12 +0000
committerfisharebest <fisharebest@gmail.com>2010-06-19 10:12:12 +0000
commit2a0806e85ec8a60e1b6b381779b8aa865fe2b812 (patch)
tree316ccee7d743c741552c424c5a4e7eae35e9d578
parent7f75fa314ef5b501d1619b449e1a5f082fac2c0c (diff)
downloadwebtrees-2a0806e85ec8a60e1b6b381779b8aa865fe2b812.tar.gz
webtrees-2a0806e85ec8a60e1b6b381779b8aa865fe2b812.tar.bz2
webtrees-2a0806e85ec8a60e1b6b381779b8aa865fe2b812.zip
Use API to access object data
-rw-r--r--autocomplete.php6
-rw-r--r--compact.php2
-rw-r--r--edit_interface.php2
-rw-r--r--includes/classes/class_gedcomrecord.php2
-rw-r--r--includes/classes/class_stats.php2
-rw-r--r--includes/controllers/hourglass_ctrl.php2
-rw-r--r--includes/controllers/individual_ctrl.php2
-rw-r--r--modules/notes/module.php2
-rw-r--r--modules/sources_tab/module.php2
9 files changed, 11 insertions, 11 deletions
diff --git a/autocomplete.php b/autocomplete.php
index 77819a4403..056e2eb1b1 100644
--- a/autocomplete.php
+++ b/autocomplete.php
@@ -293,7 +293,7 @@ function autocomplete_INDI_BURI_CEME($FILTER) {
if ($person->canDisplayDetails()) {
$i = 1;
do {
- $srec = get_sub_record("BURI", 1, $person->gedrec, $i++);
+ $srec = get_sub_record("BURI", 1, $person->getGedcomRecord(), $i++);
$ceme = get_gedcom_value("CEME", 2, $srec);
if (stripos($ceme, $FILTER)!==false || empty($FILTER)) {
$data[] = $ceme;
@@ -319,7 +319,7 @@ function autocomplete_INDI_SOUR_PAGE($FILTER, $OPTION) {
for ($level=1; $level<=2; $level++) {
$i = 1;
do {
- $srec = get_sub_record("SOUR @{$OPTION}@", $level, $person->gedrec, $i++);
+ $srec = get_sub_record("SOUR @{$OPTION}@", $level, $person->getGedcomRecord(), $i++);
$page = get_gedcom_value("PAGE", $level+1, $srec);
if (stripos($page, $FILTER)!==false || empty($FILTER)) {
$data[] = $page;
@@ -346,7 +346,7 @@ function autocomplete_FAM_SOUR_PAGE($FILTER, $OPTION) {
for ($level=1; $level<=2; $level++) {
$i = 1;
do {
- $srec = get_sub_record("SOUR @{$OPTION}@", $level, $family->gedrec, $i++);
+ $srec = get_sub_record("SOUR @{$OPTION}@", $level, $family->getGedcomRecord(), $i++);
$page = get_gedcom_value("PAGE", $level+1, $srec);
if (stripos($page, $FILTER)!==false || empty($FILTER)) {
$data[] = $page;
diff --git a/compact.php b/compact.php
index 41ac4979a5..ea945c8954 100644
--- a/compact.php
+++ b/compact.php
@@ -308,7 +308,7 @@ function print_td_person($n) {
$addname=$indi->getAddName();
if ($showthumbs && $MULTI_MEDIA && $SHOW_HIGHLIGHT_IMAGES) {
- $object = find_highlighted_object($pid, WT_GED_ID, $indi->gedrec);
+ $object = find_highlighted_object($pid, WT_GED_ID, $indi->getGedcomRecord());
if (!empty($object)) {
$whichFile = thumb_or_main($object); // Do we send the main image or a thumbnail?
$size = findImageSize($whichFile);
diff --git a/edit_interface.php b/edit_interface.php
index 725617c2ca..0d11401b80 100644
--- a/edit_interface.php
+++ b/edit_interface.php
@@ -1544,7 +1544,7 @@ case 'addchildaction':
$newchild = Person::getInstance($xref);
$family = Family::getInstance($famid);
if ($family->getUpdatedFamily()) $family = $family->getUpdatedFamily();
- $gedrec = $family->gedrec;
+ $gedrec = $family->getGedcomRecord();
$done = false;
foreach ($family->getChildren() as $key=>$child) {
if (GedcomDate::Compare($newchild->getEstimatedBirthDate(), $child->getEstimatedBirthDate())<0) {
diff --git a/includes/classes/class_gedcomrecord.php b/includes/classes/class_gedcomrecord.php
index 51eabc35ec..83d92318fc 100644
--- a/includes/classes/class_gedcomrecord.php
+++ b/includes/classes/class_gedcomrecord.php
@@ -46,7 +46,7 @@ require_once WT_ROOT.'includes/classes/class_serviceclient.php';
class GedcomRecord {
protected $xref =null; // The record identifier
protected $type =null; // INDI, FAM, etc.
- protected $ged_id =null; // The gedcom file, only set if this record comes from the database
+ public $ged_id =null; // The gedcom file, only set if this record comes from the database
protected $gedrec =null; // Raw gedcom text (privatised)
protected $rfn =null;
protected $facts =null;
diff --git a/includes/classes/class_stats.php b/includes/classes/class_stats.php
index edd77cb857..808116fb99 100644
--- a/includes/classes/class_stats.php
+++ b/includes/classes/class_stats.php
@@ -1068,7 +1068,7 @@ class stats {
$surn_countries=array();
$indis = get_indilist_indis(utf8_strtoupper($surname), '', '', false, false, WT_GED_ID);
foreach ($indis as $person) {
- if (preg_match_all('/^2 PLAC (?:.*, *)*(.*)/m', $person->gedrec, $matches)) {
+ if (preg_match_all('/^2 PLAC (?:.*, *)*(.*)/m', $person->getGedcomRecord(), $matches)) {
// webtrees uses 3 letter country codes and localised country names, but google uses 2 letter codes.
foreach ($matches[1] as $country) {
$country=trim($country);
diff --git a/includes/controllers/hourglass_ctrl.php b/includes/controllers/hourglass_ctrl.php
index bb789675ad..c14dbd2bef 100644
--- a/includes/controllers/hourglass_ctrl.php
+++ b/includes/controllers/hourglass_ctrl.php
@@ -490,7 +490,7 @@ class HourglassControllerRoot extends BaseController {
if ($person->getNumberOfChildren()==0) return $depth-1;
$maxdc = $depth;
foreach($famids as $famid => $family){
- $ct = preg_match_all("/1 CHIL @(.*)@/", $family->gedrec, $match, PREG_SET_ORDER);
+ $ct = preg_match_all("/1 CHIL @(.*)@/", $family->getGedcomRecord(), $match, PREG_SET_ORDER);
for($i=0; $i<$ct; $i++) {
$chil = trim($match[$i][1]);
$dc = $this->max_descendency_generations($chil, $depth+1);
diff --git a/includes/controllers/individual_ctrl.php b/includes/controllers/individual_ctrl.php
index d61602e2aa..f1ba015d23 100644
--- a/includes/controllers/individual_ctrl.php
+++ b/includes/controllers/individual_ctrl.php
@@ -958,7 +958,7 @@ class IndividualControllerRoot extends BaseController {
if ($children[$i]->getXref()==$this->pid) {
$label = "<img src=\"images/selected.png\" alt=\"\" />";
}
- $famcrec = get_sub_record(1, "1 FAMC @".$family->getXref()."@", $children[$i]->gedrec);
+ $famcrec = get_sub_record(1, "1 FAMC @".$family->getXref()."@", $children[$i]->getGedcomRecord());
$pedi = get_gedcom_value("PEDI", 2, $famcrec, '', false);
if ($pedi) {
if ($sex=="F" && isset($PEDI_CODES[$pedi])) $label .= " (".$PEDI_CODES_F[$pedi].")";
diff --git a/modules/notes/module.php b/modules/notes/module.php
index dab64acf1f..133b19c679 100644
--- a/modules/notes/module.php
+++ b/modules/notes/module.php
@@ -131,7 +131,7 @@ if (!$SHOW_LEVEL2_NOTES) {
function get_note_count() {
if ($this->noteCount===null) {
- $ct = preg_match_all("/\d NOTE /", $this->controller->indi->gedrec, $match, PREG_SET_ORDER);
+ $ct = preg_match_all("/\d NOTE /", $this->controller->indi->getGedcomRecord(), $match, PREG_SET_ORDER);
foreach ($this->controller->indi->getSpouseFamilies() as $k => $sfam)
$ct += preg_match("/\d NOTE /", $sfam->getGedcomRecord());
$this->noteCount = $ct;
diff --git a/modules/sources_tab/module.php b/modules/sources_tab/module.php
index 15bacfe1e6..50470fbcf5 100644
--- a/modules/sources_tab/module.php
+++ b/modules/sources_tab/module.php
@@ -120,7 +120,7 @@ class sources_tab_WT_Module extends WT_Module implements WT_Module_Tab {
function get_source_count() {
if ($this->sourceCount===null) {
- $ct = preg_match_all("/\d SOUR @(.*)@/", $this->controller->indi->gedrec, $match, PREG_SET_ORDER);
+ $ct = preg_match_all("/\d SOUR @(.*)@/", $this->controller->indi->getGedcomRecord(), $match, PREG_SET_ORDER);
foreach ($this->controller->indi->getSpouseFamilies() as $k => $sfam)
$ct += preg_match("/\d SOUR /", $sfam->getGedcomRecord());
$this->sourceCount = $ct;