Legacy Source Mod
Legacy version 7 introduced a new utility called SourceWriter to aid in writing sources. While this is very handy, there are still a few bugs that need to be ironed out and the numerous fields available to the SourceWriter templates don't always translate correctly to the limited number of fields that a GEDCOM gives to sources.
This page is meant to document the edits I have made to the gedimport_souces.php file to get my SourceWriter sources properly formatted in TNG during the import process (and without having to do any special editing in Legacy).
These edits are meant to work with GEDCOMs created using the 7.0.0.55 version of Legacy. Things seem to be changing fairly regularly with this, so these modifications will likely change as new Legacy versions are released.
gedimport_sources.php
I have broken this page up into different sections to discuss import problems with different source types. You can pick and choose which ones are relative to you and them into your gedimport_sources.php file. The edits should be added into the getSourceRecord function (around line 164).
while( $lineinfo[tag] && $lineinfo[level] >= $prevlevel ) { if( $lineinfo[level] == $prevlevel ) { ... } } $inschangedt = $changedate ? $changedate : ($tngimpcfg[chdate] ? "" : $today); >>>>>> YOUR EDITS GO HERE <<<<<<< $query = "INSERT IGNORE INTO $sources_table (sourceID, callnum, title, author, publisher, shorttitle, repoID, actualtext, changedate, gedcom, changedby, type, other, comments) VALUES(\"$sourceID\", \"$info[CALN]\", \"$info[TITL]\", \"$info[AUTH]\", \"$info[PUBL]\", \"$info[ABBR]\", \"$info[REPO]\", \"" . trim($info[TEXT]) . "\", \"$changedate\", \"$tree\", \"$currentuser\", \"\",\"\",\"\")";
Census Records
I enter my census records using the following entries for the SourceWriter template.
0 @S1@ SOUR 1 ABBR 1900 U.S. census, Ohio, Washington County 1 TITL 1900 U.S. census, \i Ancestry.com\i0 1 AUTH Ohio, Washington County 1 PUBL http://www.ancestry.com: National Archives and Records Admi 2 CONC nistration, 2006 1 _ITALIC Y 1 _PAREN Y
I get all of my census images from Ancestry.com, so I want to put that in the author field, and I want the TITL field to match the ABBR field. My "Master Source List Name" (which shows up in the ABBR field in the GEDCOM) is likely different than yours, so you may need to modify the preg_match statement to work with your own syntax. I do that switch with the following code:
if (preg_match("/(\d{4} U\.S\. census)/", $info[ABBR], $matches)) { $info[TITL] = "$matches[1], $info[AUTH]"; $info[AUTH] = "digital image, <i>Ancestry.com</i>"; }
Artifacts
I use the "artifact" source to keep track of loose newspaper clipping that I don't know the publication info for. My SourceWriter template looks like this:
In my GEDCOM file these appear as:
0 @S1@ SOUR 1 ABBR Obituary of Helen (Jones) Ballou 1 TITL Helen Ballou Passes Away at 94," undated clipping from unknown newspaper 1 _ITALIC Y 1 _PAREN Y
I have no idea why that extra quote appears there, or why they put what I would consider publication info on the TITL entry? Anyway, here's how I clean this up:
if (preg_match('/^([^"]+),\\\\" (.+)/', $info[TITL], $matches)) { $info[TITL] = '\"'.$matches[1].'\"'; $info[PUBL] = $matches[2]; }