diff --git a/dynamic-site/cgi-bin/page.fcgi b/dynamic-site/cgi-bin/page.fcgi index 4611af5b..90668483 100755 --- a/dynamic-site/cgi-bin/page.fcgi +++ b/dynamic-site/cgi-bin/page.fcgi @@ -429,9 +429,12 @@ sub doit lingua => $lingua, config => $config, }; + + # Display the requested page eval { my $page = $info->param('page'); $page =~ s/#.*$//; + $display = do { my $class = "Ged2site::Display::$page"; eval { $class->new($args) }; diff --git a/ged2site b/ged2site index 4c7e3c4c..7888bdef 100755 --- a/ged2site +++ b/ged2site @@ -234,6 +234,7 @@ print "Language = $language\n" if($opts{'v'}); my @modules = (); @needfull = (); +my $grave_modules; if($opts{'d'} || $opts{'m'} || $opts{'w'}) { push @modules, 'File::Spec', 'XML::Hash'; @@ -305,6 +306,34 @@ if($opts{'m'} || $opts{'w'}) { if($opts{'v'}) { push @modules, 'Log::Any::Adapter'; } +if($opts{'w'} && $opts{'c'}) { + # If you have a locally written module to look up entries, + # list them in gedcom.config, + # otherwise use Genealogy::FindaGrave + my $config; + + eval { $config = Config::Auto::parse() }; + + if($config && $config->{'grave_modules'}) { + $grave_modules = $config->{'grave_modules'}; + + if(ref($grave_modules)) { + foreach my $module(@{$grave_modules}) { + autoload $module; + } + } else { + autoload $grave_modules; + } + } else { + push @modules, 'FindaGrave'; + + $grave_modules = 'Genealogy::FindaGrave'; + } + + # if(!$ged->validate() && $opts{'f'}) { + # die "$ARGV[0] is not a valid gedcom file"; + # } +} # my $libdir1 = File::Spec->catfile($FindBin::Bin, File::Spec->updir(), 'lib'); # if(-d $libdir1) { @@ -9001,6 +9030,54 @@ sub print_person }); } } + my $lastname = $surname; + if(defined($sex) && ($sex eq 'F')) { + if(my $husband = $person->husband()) { + $lastname = $husband->surname(); + } + } + if($yod && $firstname && $lastname) { + my %opts = ( + date_of_death => $yod, + firstname => $firstname, + lastname => $lastname, + ua => $browser, + ); + if($placeofburial) { + if($placeofburial =~ /.+,\s+(\w+)$/) { + $opts{'country'} = $1; + } + } elsif($placeofdeath) { + if($placeofdeath =~ /.+,\s+(\w+)$/) { + $opts{'country'} = $1; + } + } + if($opts{'country'} && ($opts{'country'} eq 'USA')) { + $opts{'country'} = 'United States of America'; + } + # foreach my $b(Genealogy::FindaGrave->new(\%opts)) { + if(defined($grave_modules)) { + if(ref($grave_modules)) { + foreach my $m(@{$grave_modules}) { + my $b = $m->new(\%opts); + while(my $url = $b->get_next_entry()) { + complain({ + person => $person, + warning => "possible burial link $url" + }); + } + } + } else { + my $b = $grave_modules->new(\%opts); + while(my $url = $b->get_next_entry()) { + complain({ + person => $person, + warning => "possible burial link $url" + }); + } + } + } + } } }