summaryrefslogtreecommitdiff
path: root/modules/GEDFact_assistant
diff options
context:
space:
mode:
authorVeit Olschinski <veit@olschinski.de>2010-04-05 10:29:41 +0000
committerVeit Olschinski <veit@olschinski.de>2010-04-05 10:29:41 +0000
commit5bc7b36708d272081ffd2df5658ddf12275447dd (patch)
tree7884d88bd634f62d94e0239c911305ac4349dba8 /modules/GEDFact_assistant
parent5dbb23df7f03aeb32c6c5a3fa6139dd479f9c0b4 (diff)
downloadwebtrees-5bc7b36708d272081ffd2df5658ddf12275447dd.tar.gz
webtrees-5bc7b36708d272081ffd2df5658ddf12275447dd.tar.bz2
webtrees-5bc7b36708d272081ffd2df5658ddf12275447dd.zip
Diffstat (limited to 'modules/GEDFact_assistant')
-rw-r--r--modules/GEDFact_assistant/CENS_ctrl.php58
-rw-r--r--modules/GEDFact_assistant/MEDIA_ctrl.php62
-rw-r--r--modules/GEDFact_assistant/_CENS/addnoteaction_assisted.php146
-rw-r--r--modules/GEDFact_assistant/_CENS/census_1_ctrl.php128
-rw-r--r--modules/GEDFact_assistant/_CENS/census_2_source_input.php1049
-rw-r--r--modules/GEDFact_assistant/_CENS/census_3_find.php885
-rw-r--r--modules/GEDFact_assistant/_CENS/census_3_search_add.php2282
-rw-r--r--modules/GEDFact_assistant/_CENS/census_4_text.php76
-rw-r--r--modules/GEDFact_assistant/_CENS/census_5_input.php40
-rw-r--r--modules/GEDFact_assistant/_CENS/census_asst_date.php83
-rw-r--r--modules/GEDFact_assistant/_CENS/census_asst_help.php36
-rw-r--r--modules/GEDFact_assistant/_CENS/census_note_decode.php101
-rw-r--r--modules/GEDFact_assistant/_CENS/census_query1.php119
-rw-r--r--modules/GEDFact_assistant/_CENS/census_query1a.php94
-rw-r--r--modules/GEDFact_assistant/_CENS/census_query_1b.php115
-rw-r--r--modules/GEDFact_assistant/_CENS/census_query_2a.php225
-rw-r--r--modules/GEDFact_assistant/_CENS/js/census_5_input.js.php2616
-rw-r--r--modules/GEDFact_assistant/_CENS/js/chapman_codes.js398
-rw-r--r--modules/GEDFact_assistant/_CENS/js/date.js503
-rw-r--r--modules/GEDFact_assistant/_CENS/js/dynamicoptionlist.js473
-rw-r--r--modules/GEDFact_assistant/_MEDIA/media_0_inverselink.php284
-rw-r--r--modules/GEDFact_assistant/_MEDIA/media_1_ctrl.php90
-rw-r--r--modules/GEDFact_assistant/_MEDIA/media_3_find.php807
-rw-r--r--modules/GEDFact_assistant/_MEDIA/media_3_search_add.php1485
-rw-r--r--modules/GEDFact_assistant/_MEDIA/media_5_input.js340
-rw-r--r--modules/GEDFact_assistant/_MEDIA/media_5_input.php87
-rw-r--r--modules/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php116
-rw-r--r--modules/GEDFact_assistant/_MEDIA/media_query_1a.php112
-rw-r--r--modules/GEDFact_assistant/_MEDIA/media_query_2a.php81
-rw-r--r--modules/GEDFact_assistant/_MEDIA/media_query_3a.php73
-rw-r--r--modules/GEDFact_assistant/css/gf_styles.css100
-rw-r--r--modules/GEDFact_assistant/css/media_0_inverselink.css36
32 files changed, 13100 insertions, 0 deletions
diff --git a/modules/GEDFact_assistant/CENS_ctrl.php b/modules/GEDFact_assistant/CENS_ctrl.php
new file mode 100644
index 0000000000..dfdf78afeb
--- /dev/null
+++ b/modules/GEDFact_assistant/CENS_ctrl.php
@@ -0,0 +1,58 @@
+<?php
+ /**
+ * GEDFact page
+ *
+ * GEDFact Census information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Census Assistant
+ * @version $Id$
+ */
+// require_once './config.php';
+require_once 'includes/controllers/individual_ctrl.php';
+$controller = new IndividualController();
+$controller->init();
+
+global $USE_THUMBS_MAIN, $mediacnt, $tabno;
+global $linkToID;
+global $SEARCH_SPIDER, $GOOGLEMAP_PH_CONTROLS;
+
+ global $SHOW_ID_NUMBERS, $WT_IMAGE_DIR, $WT_IMAGES, $SHOW_AGE_DIFF;
+ global $pgv_changes, $GEDCOM, $ABBREVIATE_CHART_LABELS;
+ global $show_full;
+ global $famid;
+
+ $summary=$controller->indi->format_first_major_fact(WT_EVENTS_BIRT, 2);
+ if (!($controller->indi->isDead())) {
+ // If alive display age
+ $bdate=$controller->indi->getBirthDate();
+ $age = GedcomDate::GetAgeGedcom($bdate);
+ if ($age!="")
+ $summary.= "<span class=\"label\">".i18n::translate('Age').":</span><span class=\"field\"> ".get_age_at_event($age, true)."</span>";
+ }
+ $summary.=$controller->indi->format_first_major_fact(WT_EVENTS_DEAT, 2);
+
+ $controller->census_assistant();
+
+// print_footer();
+?>
diff --git a/modules/GEDFact_assistant/MEDIA_ctrl.php b/modules/GEDFact_assistant/MEDIA_ctrl.php
new file mode 100644
index 0000000000..e9ae7333ce
--- /dev/null
+++ b/modules/GEDFact_assistant/MEDIA_ctrl.php
@@ -0,0 +1,62 @@
+<?php
+ /**
+ * GEDFact page
+ *
+ * GEDFact information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2008 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Census Assistant
+ * @version $Id$
+ */
+require_once './config.php';
+require_once WT_ROOT.'includes/controllers/individual_ctrl.php';
+$controller = new IndividualController();
+$controller->init();
+echo "<link href =\"modules/GEDFact_assistant/css/gf_styles.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />";
+
+global $USE_THUMBS_MAIN, $mediacnt, $tabno;
+global $linkToID;
+global $SEARCH_SPIDER, $GOOGLEMAP_PH_CONTROLS;
+
+ global $SHOW_ID_NUMBERS, $WT_IMAGE_DIR, $WT_IMAGES, $SHOW_AGE_DIFF;
+ global $pgv_changes, $GEDCOM, $ABBREVIATE_CHART_LABELS;
+ global $show_full;
+ global $famid, $censyear, $censdate;
+
+// print_simple_header("Census");
+
+ $summary=$controller->indi->format_first_major_fact(WT_EVENTS_BIRT, 2);
+ if (!($controller->indi->isDead())) {
+ // If alive display age
+ $bdate=$controller->indi->getBirthDate();
+ $age = GedcomDate::GetAgeGedcom($bdate);
+ // if ($age!="") {
+ // $summary.= "<span class=\"label\">".i18n::translate('Age').":</span><span class=\"field\"> ".get_age_at_event($age, true)."</span>";
+ // }
+ }
+ $summary.=$controller->indi->format_first_major_fact(WT_EVENTS_DEAT, 2);
+
+ $controller->medialink_assistant();
+
+// print_footer();
+?>
diff --git a/modules/GEDFact_assistant/_CENS/addnoteaction_assisted.php b/modules/GEDFact_assistant/_CENS/addnoteaction_assisted.php
new file mode 100644
index 0000000000..0fd83a65ea
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/addnoteaction_assisted.php
@@ -0,0 +1,146 @@
+<?php
+/**
+* Include for GEDFact Assistant - Census.
+*
+* webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+* Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*
+* @package webtrees
+* @subpackage Edit
+* @version $Id$
+*/
+
+// This file is required by the addnoteaction_assisted function in edit_interface.php
+
+//------------------------------------------------------------------------------
+//-- create a shared note record from the incoming variables
+
+ if (WT_DEBUG) {
+ phpinfo(INFO_VARIABLES);
+ }
+ $newgedrec = "0 @XREF@ NOTE\n";
+
+ if (isset($_REQUEST['EVEN'])) $EVEN = $_REQUEST['EVEN'];
+ if (!empty($EVEN) && count($EVEN)>0) {
+ $newgedrec .= "1 DATA\n";
+ $newgedrec .= "2 EVEN ".implode(",", $EVEN)."\n";
+ if (!empty($EVEN_DATE)) $newgedrec .= "3 DATE ".$EVEN_DATE."\n";
+ if (!empty($EVEN_PLAC)) $newgedrec .= "3 PLAC ".$EVEN_PLAC."\n";
+ if (!empty($AGNC)) $newgedrec .= "2 AGNC ".$AGNC."\n";
+ }
+ if (isset($_REQUEST['ABBR'])) $ABBR = $_REQUEST['ABBR'];
+ if (isset($_REQUEST['TITL'])) $TITL = $_REQUEST['TITL'];
+ if (isset($_REQUEST['DATE'])) $DATE = $_REQUEST['DATE'];
+ if (isset($_REQUEST['NOTE'])) $NOTE = $_REQUEST['NOTE'];
+ if (isset($_REQUEST['_HEB'])) $_HEB = $_REQUEST['_HEB'];
+ if (isset($_REQUEST['ROMN'])) $ROMN = $_REQUEST['ROMN'];
+ if (isset($_REQUEST['AUTH'])) $AUTH = $_REQUEST['AUTH'];
+ if (isset($_REQUEST['PUBL'])) $PUBL = $_REQUEST['PUBL'];
+ if (isset($_REQUEST['REPO'])) $REPO = $_REQUEST['REPO'];
+ if (isset($_REQUEST['CALN'])) $CALN = $_REQUEST['CALN'];
+
+ if (isset($_REQUEST['pid_array'])) $pid_array = $_REQUEST['pid_array'];
+ if (isset($_REQUEST['pid'])) $pid = $_REQUEST['pid'];
+
+ global $pid;
+
+ if (!empty($NOTE)) {
+ $newlines = preg_split("/\r?\n/", $NOTE, -1);
+ for ($k=0; $k<count($newlines); $k++) {
+ if ( $k==0 && count($newlines)>1) {
+ $newgedrec = "0 @XREF@ NOTE $newlines[$k]\n";
+ }else if ( $k==0 ) {
+ $newgedrec = "0 @XREF@ NOTE $newlines[$k]\n1 CONT\n";
+ } else {
+ $newgedrec .= "1 CONT $newlines[$k]\n";
+ }
+ }
+ }
+
+ if (!empty($ABBR)) $newgedrec .= "1 ABBR $ABBR\n";
+ if (!empty($TITL)) {
+ // $newgedrec .= "1 TITL $TITL\n";
+ // $newgedrec .= "2 DATE $DATE\n";
+ if (!empty($_HEB)) $newgedrec .= "2 _HEB $_HEB\n";
+ if (!empty($ROMN)) $newgedrec .= "2 ROMN $ROMN\n";
+ }
+ if (!empty($AUTH)) $newgedrec .= "1 AUTH $AUTH\n";
+ if (!empty($PUBL)) {
+ $newlines = preg_split("/\r?\n/", $PUBL, -1, PREG_SPLIT_NO_EMPTY);
+ foreach ($newlines as $k=>$line) {
+ if ( $k==0 ) {
+ $newgedrec .= "1 PUBL $line\n";
+ } else {
+ $newgedrec .= "2 CONT $line\n";
+ }
+ }
+ }
+ if (!empty($NOTE)) {
+ //$newgedrec .= "1 NOTE @$NOTE@\n";
+ if (!empty($CALN)) $newgedrec .= "2 CALN $CALN\n";
+ }
+ if (WT_DEBUG) {
+ echo "<pre>$newgedrec</pre>";
+ }
+ // $xref = "Test";
+ if ($pid_array != '') {
+ $xref = append_gedrec($newgedrec);
+ } else {
+ $xref="none";
+ echo "<br /><br /><br />";
+ echo "<div class=indent> No individuals entered, close and try again </div>";
+ echo "<br /><br /><br />";
+ }
+
+ if ($xref != "none") {
+ echo "<br /><br />\n".i18n::translate('New Shared Note created successfully.')." (".$xref.")<br /><br />";
+ echo "<br /><br />";
+ echo " &nbsp;&nbsp;&nbsp; The Census event (when saved) will be linked to Indi id's: &nbsp;&nbsp;&nbsp;&nbsp; ". $pid_array;
+ echo "<br /><br />";
+ echo "<br /><br />";
+ echo "&nbsp;&nbsp;&nbsp; <a href=\"javascript://NOTE $xref\" onclick=\"openerpasteid('$xref'); return false;\">".i18n::translate('Paste the following ID into your editing fields to reference the newly created record ')." <b>$xref</b></a>\n";
+ echo "<br /><br /><br /><br />";
+
+ ?>
+ <script>
+ if (parent.opener.document.getElementById("pids_array_edit") == null || parent.opener.document.getElementById("pids_array_edit") == 'undefined') {
+ //alert ("EDIT NOT HERE");
+ } else {
+ // alert("WE ARE EDITING an EVENT");
+ // alert(parent.opener.document.editform.pids_array_edit.value);
+ parent.opener.document.editform.pids_array_edit.value="<?php echo $pid_array; ?>";
+ // alert(parent.opener.document.editform.pids_array_edit.value);
+ }
+ if (parent.opener.document.getElementById("pids_array_add") == null || parent.opener.document.getElementById("pids_array_add") == 'undefined') {
+ //alert ("ADD NOT HERE");
+ } else {
+ // alert("WE ARE ADDING an EVENT");
+ // alert(parent.opener.document.addform.pids_array_add.value);
+ parent.opener.document.addform.pids_array_add.value="<?php echo $pid_array; ?>";
+ // alert(parent.opener.document.addform.pids_array_add.value);
+ }
+ </script>
+ <?php
+
+ echo "<br /><br /><br /><br />";
+ }
+
+
+?>
diff --git a/modules/GEDFact_assistant/_CENS/census_1_ctrl.php b/modules/GEDFact_assistant/_CENS/census_1_ctrl.php
new file mode 100644
index 0000000000..b8c6d546e5
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/census_1_ctrl.php
@@ -0,0 +1,128 @@
+<?php
+/**
+ * Census Assistant Control module for phpGedView
+ *
+ * Census information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Census Assistant
+ * @version $Id$
+ */
+
+ if (!defined('WT_WEBTREES')) {
+ header('HTTP/1.0 403 Forbidden');
+ exit;
+}
+
+global $summary, $theme_name, $censyear, $censdate;
+
+$pid = safe_get('pid');
+
+$censdate = new GedcomDate("31 MAR 1901");
+$censyear = $censdate->date1->y;
+
+$ctry = "UK";
+// $married = GedcomDate::Compare($censdate, $marrdate);
+$married=-1;
+
+$person=Person::getInstance($pid);
+// var_dump($person->getAllNames());
+$nam = $person->getAllNames();
+if (PrintReady($person->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($person->getDeathYear()); }
+if (PrintReady($person->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($person->getBirthYear()); }
+if ($married>=0 && isset($nam[1])){
+ $wholename = rtrim($nam[1]['fullNN']);
+} else {
+ $wholename = rtrim($nam[0]['fullNN']);
+}
+
+$currpid=$pid;
+?>
+<script src="modules/GEDFact_assistant/_CENS/js/dynamicoptionlist.js" type="text/javascript"></script>
+<script src="modules/GEDFact_assistant/_CENS/js/date.js" type="text/javascript"></script>
+
+
+<?php
+ echo WT_JS_START;
+ echo "var TheCenYear = opener.document.getElementById('setyear').value;";
+ echo "var TheCenCtry = opener.document.getElementById('setctry').value;";
+ echo WT_JS_END;
+
+
+ // Header of assistant window =====================================================
+ echo "<div class=\"cens_header\">";
+ echo "<div class=\"cens_header_left\">";
+ echo i18n::translate('Head of Household:');
+ echo " &nbsp;" . $wholename . "&nbsp; (" . $pid . ")";
+ echo "</div>";
+ if ($summary) {
+ echo "<div class=\"cens_header_right\"/>". $summary. "</div>";
+ }
+ echo "</div>";
+
+
+ //-- Census & Source Information Area =============================================
+ echo "<div class=\" cens_container\">";
+ echo "<span >";
+ include('modules/GEDFact_assistant/_CENS/census_2_source_input.php');
+ echo "</span>";
+ //-- Proposed Census Text Area ================================================
+ echo "<span>";
+ include('modules/GEDFact_assistant/_CENS/census_4_text.php');
+ echo "</span>";
+ echo "</div>";
+
+ //-- Search and Add Family Members Area ==========================================
+ echo "<div class=\"optionbox cens_search\" style=\"overflow:-moz-scrollbars-horizontal;overflow-x:hidden;overflow-y:scroll;\">";
+ ?><!--[if lte IE 7]><style>.cens_search{margin-top:-0.7em;}</style><![EndIf]--><?php
+ include('modules/GEDFact_assistant/_CENS/census_3_search_add.php');
+ echo "</div>";
+
+ //-- Census Text Input Area =======================================================
+ ?>
+ <div class="optionbox cens_textinput">
+ <div class="cens_textinput_left">
+ <input type="button" value="<?php echo i18n::translate('Add/Insert Blank Row'); ?>" onclick="insertRowToTable('', '', '', '', '', '', '', '', 'Age', '', '', '', '', '', '');" />
+ </div>
+ <div class="cens_textinput_right">
+ <?php echo i18n::translate('Add'); ?><br>
+ <input type="radio" name="totallyrad" value="0" checked="checked" />
+ </div>
+ <?php
+
+ //-- Census Add Rows Area =========================================================
+ echo "<div class=\"cens_addrows\">";
+ include('modules/GEDFact_assistant/_CENS/census_5_input.php');
+ echo "</div>";
+ ?>
+ </div>
+
+
+<script>
+
+</script>
+
+<script language="JavaScript" type="text/javascript">
+ window.onLoad = initDynamicOptionLists();
+</script>
+
diff --git a/modules/GEDFact_assistant/_CENS/census_2_source_input.php b/modules/GEDFact_assistant/_CENS/census_2_source_input.php
new file mode 100644
index 0000000000..8b4f11e857
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/census_2_source_input.php
@@ -0,0 +1,1049 @@
+<?php
+/**
+ * Census Assistant Control module for phpGedView
+ *
+ * Census and Souce Input Area File File
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2007 to 2010 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Module
+ * @version $Id$
+ * @author Brian Holland
+ */
+if (!defined('WT_WEBTREES')) {
+ header('HTTP/1.0 403 Forbidden');
+ exit;
+}
+global $TEXT_DIRECTION;
+?>
+
+<script>
+ function getCenDate(cenyear) {
+ // Calculate census date from the census year selected
+ // UK CENSUS DATES
+ if (cenyear == 1841) { var cendate = new Date(1841, 5, 06); // 06 JUN 1841
+ } else if (cenyear == 1851) { var cendate = new Date(1851, 2, 30); // 30 MAR 1851
+ } else if (cenyear == 1861) { var cendate = new Date(1861, 3, 07); // 07 APR 1861
+ } else if (cenyear == 1871) { var cendate = new Date(1871, 3, 02); // 02 APR 1871
+ } else if (cenyear == 1881) { var cendate = new Date(1881, 3, 03); // 03 APR 1881
+ } else if (cenyear == 1891) { var cendate = new Date(1891, 3, 05); // 05 APR 1891
+ } else if (cenyear == 1901) { var cendate = new Date(1901, 2, 31); // 31 MAR 1901
+ } else if (cenyear == 1911) { var cendate = new Date(1911, 3, 02); // 02 APR 1911
+ } else if (cenyear == 1921) { var cendate = new Date(1921, 3, 02); // 02 APR 1921 // For Test Purposes
+ } else if (cenyear == 1931) { var cendate = new Date(1931, 3, 02); // 02 APR 1931 // For Test Purposes
+ // USA CENSUS DATES
+ } else if (cenyear == 1790) { var cendate = new Date(1790, 7, 02); // 02 AUG 1790
+ } else if (cenyear == 1800) { var cendate = new Date(1800, 7, 04); // 04 AUG 1800
+ } else if (cenyear == 1810) { var cendate = new Date(1810, 7, 06); // 06 AUG 1810
+ } else if (cenyear == 1820) { var cendate = new Date(1820, 7, 07); // 07 AUG 1820
+ } else if (cenyear == 1830) { var cendate = new Date(1830, 5, 01); // 01 JUN 1830
+ } else if (cenyear == 1840) { var cendate = new Date(1840, 5, 01); // 01 JUN 1840
+ } else if (cenyear == 1850) { var cendate = new Date(1850, 5, 01); // 01 JUN 1850
+ } else if (cenyear == 1860) { var cendate = new Date(1860, 5, 01); // 01 JUN 1860
+ } else if (cenyear == 1870) { var cendate = new Date(1870, 5, 01); // 01 JUN 1870
+ } else if (cenyear == 1880) { var cendate = new Date(1880, 5, 01); // 01 JUN 1880
+ } else if (cenyear == 1890) { var cendate = new Date(1890, 5, 01); // 01 JUN 1890
+ } else if (cenyear == 1900) { var cendate = new Date(1900, 5, 01); // 01 JUN 1900
+ } else if (cenyear == 1910) { var cendate = new Date(1910, 3, 15); // 15 APR 1910
+ } else if (cenyear == 1920) { var cendate = new Date(1920, 0, 01); // 01 JAN 1920
+ } else if (cenyear == 1930) { var cendate = new Date(1930, 3, 01); // 01 APR 1930
+ } else if (cenyear == 1940) { var cendate = new Date(1940, 3, 01); // 01 APR 1940
+ // Default Date
+ } else {
+ var cendate = new Date(1901, 2, 31);
+ }
+ return cendate;
+ }
+
+ function getPrevCenDate(cenyear) {
+ // UK PREVIOUS CENSUS DATES
+ if (prevcenyear == 1841) { var prevcendate = new Date(1841, 5, 06); // 06 JUN 1841
+ } else if (prevcenyear == 1951) { var prevcendate = new Date(1851, 2, 30); // 30 MAR 1851
+ } else if (prevcenyear == 1861) { var prevcendate = new Date(1861, 3, 07); // 07 APR 1861
+ } else if (prevcenyear == 1871) { var prevcendate = new Date(1871, 3, 02); // 02 APR 1871
+ } else if (prevcenyear == 1881) { var prevcendate = new Date(1881, 3, 03); // 03 APR 1881
+ } else if (prevcenyear == 1891) { var prevcendate = new Date(1891, 3, 05); // 05 APR 1891
+ } else if (prevcenyear == 1901) { var prevcendate = new Date(1901, 2, 31); // 31 MAR 1901
+ } else if (prevcenyear == 1911) { var prevcendate = new Date(1911, 3, 02); // 02 APR 1911
+ } else if (trevcenyear == 1921) { var prevcendate = new Date(1921, 3, 02); // 02 APR 1921 // For Test Purposes
+ } else if (prevcenyear == 1931) { var prevcendate = new Date(1931, 3, 02); // 02 APR 1931 // For Test Purposes
+ // USA PREVIOUS CENSUS DATES
+ } else if (prevcenyear == 1790) { var prevcendate = new Date(1790, 7, 02); // 02 AUG 1790
+ } else if (prevcenyear == 1800) { var prevcendate = new Date(1800, 7, 04); // 04 AUG 1800
+ } else if (prevcenyear == 1810) { var prevcendate = new Date(1810, 7, 06); // 06 AUG 1810
+ } else if (prevcenyear == 1820) { var prevcendate = new Date(1820, 7, 07); // 07 AUG 1820
+ } else if (prevcenyear == 1830) { var prevcendate = new Date(1830, 5, 01); // 01 JUN 1830
+ } else if (prevcenyear == 1840) { var prevcendate = new Date(1840, 5, 01); // 01 JUN 1840
+ } else if (prevcenyear == 1850) { var prevcendate = new Date(1850, 5, 01); // 01 JUN 1850
+ } else if (prevcenyear == 1860) { var prevcendate = new Date(1860, 5, 01); // 01 JUN 1860
+ } else if (prevcenyear == 1870) { var prevcendate = new Date(1870, 5, 01); // 01 JUN 1870
+ } else if (prevcenyear == 1880) { var prevcendate = new Date(1880, 5, 01); // 01 JUN 1880
+ } else if (prevcenyear == 1890) { var prevcendate = new Date(1890, 5, 01); // 01 JUN 1890
+ } else if (prevcenyear == 1900) { var prevcendate = new Date(1900, 5, 01); // 01 JUN 1900
+ } else if (prevcenyear == 1910) { var prevcendate = new Date(1910, 3, 15); // 15 APR 1910
+ } else if (prevcenyear == 1920) { var prevcendate = new Date(1920, 0, 01); // 01 JAN 1920
+ } else if (prevcenyear == 1930) { var prevcendate = new Date(1930, 3, 01); // 01 APR 1930
+ } else if (prevcenyear == 1940) { var prevcendate = new Date(1940, 3, 01); // 01 APR 1940
+ // Default Date
+ } else {
+ var prevcendate = new Date(1901, 2, 31);
+ }
+ return prevcendate;
+ }
+
+ function findSource(field) {
+ pastefield = field;
+ findwin = window.open('find.php?type=source', '_blank', 'left=50,top=50,width=600,height=500,resizable=1,scrollbars=1');
+ return false;
+ }
+ function openerpasteid(id) {
+ window.opener.paste_id(id);
+ window.close();
+ }
+
+ function paste_id(value) {
+ pastefield.value = value;
+ }
+
+ function paste_char(value,lang,mag) {
+ pastefield.value += value;
+ language_filter = lang;
+ magnify = mag;
+ }
+
+ function edit_close(newurl) {
+ if (newurl)
+ window.opener.location=newurl;
+ else
+ if (window.opener.showchanges)
+ window.opener.showchanges();
+ window.close();
+ }
+
+ function changeCtry() {
+ // Change Year field Colour ----------------------------------------------
+ if (document.getElementById('censYear').value=="choose") {
+ document.getElementById('censYear').style.backgroundColor = "#ffaaaa";
+ } else {
+ document.getElementById('censYear').style.backgroundColor = "#ffffff";
+ }
+ return;
+ }
+
+ function changeYear(cenyear) {
+
+ var cenctry=document.getElementById('censCtry').value;
+ // alert("Set Date is in the "+TheCenCtry+" --- "+"Now in "+cenctry);
+
+ var tbl = document.getElementById('tblSample');
+ if (tbl.rows.length==0) {
+ create_header();
+ }
+ // Change Date field -----------------------------------------------------
+ var cendate = getCenDate(cenyear);
+ var cdate = cendate.format("dd NNN yyyy");
+ document.getElementById('censDate').value = cdate;
+ // Change Year field Colour ----------------------------------------------
+ if (document.getElementById('censYear').value=="choose") {
+ document.getElementById('censYear').style.backgroundColor = "#ffaaaa";
+ } else {
+ document.getElementById('censYear').style.backgroundColor = "#ffffff";
+ }
+ changeAge(cenyear);
+ changeCols(cenyear);
+ changeMC(cenyear);
+ changeChBorn(cenyear)
+ preview();
+
+ // Toggle Countries when the preset UK Cens Date has been been used -------------
+ if (TheCenCtry=="UK") {
+ if (cenyear!=TheCenYear && cenctry!=TheCenCtry) {
+ // alert('IN THE USA');
+ censyear = new DynamicOptionList();
+ censyear.addDependentFields("censCtry","censYear");
+ censyear.forValue("UK").addOptions("choose", "1841", "1851", "1861", "1871", "1881", "1891", "1901", "1911", "1921", "1931");
+ censyear.forValue("USA").addOptions("choose", "1790", "1800", "1810", "1820", "1830", "1840", "1850", "1860", "1870", "1880", "1890", "1900", "1910", "1920", "1930", cenyear);
+ censyear.forValue("UK").setDefaultOptions("choose");
+ censyear.forValue("USA").setDefaultOptions(cenyear);
+ initDynamicOptionLists();
+ TheCenYear='';
+ }
+ if (TheCenYear=='' && cenctry==TheCenCtry) {
+ // alert('IN THE UK');
+ censyear = new DynamicOptionList();
+ censyear.addDependentFields("censCtry","censYear");
+ censyear.forValue("UK").addOptions("choose", "1841", "1851", "1861", "1871", "1881", "1891", "1901", "1911", "1921", "1931", cenyear);
+ censyear.forValue("USA").addOptions("choose", "1790", "1800", "1810", "1820", "1830", "1840", "1850", "1860", "1870", "1880", "1890", "1900", "1910", "1920", "1930");
+ censyear.forValue("UK").setDefaultOptions(cenyear);
+ censyear.forValue("USA").setDefaultOptions("choose");
+ initDynamicOptionLists();
+ TheCenYear='';
+ }
+ }
+ // Toggle Countries when the preset US Cens Date has been been used -------------
+ if (TheCenCtry=="USA") {
+ if (cenyear!=TheCenYear && cenctry!=TheCenCtry) {
+ // alert('NOW IN THE UK');
+ censyear = new DynamicOptionList();
+ censyear.addDependentFields("censCtry","censYear");
+ censyear.forValue("UK").addOptions("choose", "1841", "1851", "1861", "1871", "1881", "1891", "1901", "1911", "1921", "1931", cenyear);
+ censyear.forValue("USA").addOptions("choose", "1790", "1800", "1810", "1820", "1830", "1840", "1850", "1860", "1870", "1880", "1890", "1900", "1910", "1920", "1930");
+ censyear.forValue("UK").setDefaultOptions(cenyear);
+ censyear.forValue("USA").setDefaultOptions("choose");
+ initDynamicOptionLists();
+ TheCenYear='';
+ }
+ if (TheCenYear=='' && cenctry==TheCenCtry) {
+ // alert('NOW IN THE USA');
+ censyear = new DynamicOptionList();
+ censyear.addDependentFields("censCtry","censYear");
+ censyear.forValue("UK").addOptions("choose", "1841", "1851", "1861", "1871", "1881", "1891", "1901", "1911", "1921", "1931");
+ censyear.forValue("USA").addOptions("choose", "1790", "1800", "1810", "1820", "1830", "1840", "1850", "1860", "1870", "1880", "1890", "1900", "1910", "1920", "1930", cenyear);
+ censyear.forValue("UK").setDefaultOptions("choose");
+ censyear.forValue("USA").setDefaultOptions(cenyear);
+ initDynamicOptionLists();
+ TheCenYear='';
+ }
+ }
+
+
+ }
+
+ // Change Marital Condition and Years Married based on Census Year ======================
+ function changeMC(cenyear) {
+ var cendate = getCenDate(cenyear);
+ // Get Married Date from Input Fields and re-calculate Marital Condition ============
+ var tbl = document.getElementById('tblSample');
+ for(var i=1; i<tbl.rows.length; i++) { // start at i=1 because we need to avoid header
+ var tr = tbl.rows[i];
+ for(var j=2; j<tr.cells.length; j++){
+ if (j!=4 && j!=15) {
+ // 4 and 15 are the marital condition columns (fields)
+ // therefore miss out all cols except these marital condition cols
+ continue;
+ } else {
+ var marrcond = (tr.cells[j].childNodes[0].value);
+ var dob = (tr.cells[11].childNodes[0].value); // DOB Birth date in Julian Format
+ var yrsmarr = (tr.cells[16].childNodes[0].value); // Years married
+ var agemarr = (tr.cells[20].childNodes[0].value); // Age at 1st marriage
+ var dom = (tr.cells[69].childNodes[0].value); // DOM Marriage date in Julian format
+ var fullnam = (tr.cells[70].childNodes[0].value); // Full Name
+ var marrnam = (tr.cells[71].childNodes[0].value); // Married Name
+ var dod = (tr.cells[72].childNodes[0].value); // DOD Death date in Julian format
+
+ var one_day = 1000*60*60*24;
+ var one_month = (365.26*one_day)/12;
+ var one_year = 365.26*one_day;
+
+ // Date of Birth (dob) - passed as Julian Date String
+ if (dob>1721060) {
+ IJD = Math.floor(dob);
+ L = Math.floor(IJD + 68569);
+ N = Math.floor(4 * L / 146097);
+ L = L - Math.floor((146097*N + 3)/4);
+ I = Math.floor(4000*(L + 1)/1461001);
+ L = L - Math.floor(1461 * I / 4) + 31;
+ J = Math.floor(80 * L / 2447);
+ K = L - Math.floor(2447 * J / 80);
+ L = Math.floor(J/11);
+ J = J + 2 - 12*L;
+ I = 100*(N - 49) + I + L;
+ dob = (I+', '+J+', '+K);
+ }
+ // Create Date of Birth object from passed string dob
+ var jsdob = Date.parseString(dob, 'y, M, d');
+
+ // Date of Marriage (dom) - passed as Julian Date String
+ if (dom>1721060) {
+ IJD = Math.floor(dom);
+ L = Math.floor(IJD + 68569);
+ N = Math.floor(4 * L / 146097);
+ L = L - Math.floor((146097*N + 3)/4);
+ I = Math.floor(4000*(L + 1)/1461001);
+ L = L - Math.floor(1461 * I / 4) + 31;
+ J = Math.floor(80 * L / 2447);
+ K = L - Math.floor(2447 * J / 80);
+ L = Math.floor(J/11);
+ J = J + 2 - 12*L;
+ I = 100*(N - 49) + I + L;
+ dom = (I+', '+J+', '+K);
+ }
+ // Create Date of Marriage object from passed string dom
+ var jsdom = Date.parseString(dom, 'y, M, d');
+
+ // Date of Death (dod) - passed as Julian Date String
+ if (dod>1721060) {
+ IJD = Math.floor(dod);
+ L = Math.floor(IJD + 68569);
+ N = Math.floor(4 * L / 146097);
+ L = L - Math.floor((146097*N + 3)/4);
+ I = Math.floor(4000*(L + 1)/1461001);
+ L = L - Math.floor(1461 * I / 4) + 31;
+ J = Math.floor(80 * L / 2447);
+ K = L - Math.floor(2447 * J / 80);
+ L = Math.floor(J/11);
+ J = J + 2 - 12*L;
+ I = 100*(N - 49) + I + L;
+ dod = (I+', '+J+', '+K);
+ }
+ // Create Date of Marriage object from passed string dom
+ var jsdod = Date.parseString(dod, 'y, M, d');
+
+ if (cendate > jsdom) {
+ yrsmarr = Math.floor((cendate-jsdom)/one_year);
+ agemarr = Math.floor((jsdom-jsdob)/one_year);
+ marrcond = "M";
+ // if married in census year, use "<1" as "under 1" ---
+ if (yrsmarr == 0) {
+ yrsmarr = "<1";
+ }
+ }else{
+ yrsmarr = "-";
+ agemarr = "-";
+ marrcond = "S";
+ }
+ }
+
+ tr.cells[j].childNodes[0].value = marrcond;
+ tr.cells[16].childNodes[0].value = yrsmarr;
+
+ //-- If single and USA 1930, set Years married to "-" ------------------
+ if (marrcond=="S" && cenyear=="1930") {
+ tr.cells[20].childNodes[0].value = "-";
+ }
+ //-- If married or widowed set name to married name --------------------
+ if (marrcond=="M" || marrcond=="W") {
+ tr.cells[2].childNodes[0].value = marrnam;
+ }
+ //-- If single or unmarried set name to birth (full) name --------------
+ if (marrcond=="S" || marrcond=="U") {
+ tr.cells[2].childNodes[0].value = fullnam;
+ }
+
+ var age = (tr.cells[7].childNodes[0].value); // Age
+
+ }
+ }
+ }
+
+ function changeChBorn(cenyear) {
+ var cendate = getCenDate(cenyear);
+ // Get Children born Array from Input Fields and re-calculate Born Alive Died Condition ============
+ var tbl = document.getElementById('tblSample');
+ for(var i=1; i<tbl.rows.length; i++) { // start at i=1 because we need to avoid header
+ var tr = tbl.rows[i];
+ for(var j=2; j<tr.cells.length; j++){
+ if (j!=73) {
+ // 73 is the Chil born array column
+ // therefore miss out all cols except this column's cells
+ continue;
+ } else {
+ // Calculate Children Born, Living, Died --------------------------
+ var chilBLD = (tr.cells[73].childNodes[0].value);
+ chBLDarray = chilBLD.split('::');
+ var cdat = calculateJD(cendate);
+ // Variables to be used ---------
+ var ChilBorn = chBLDarray.length;
+ //var ChilLivg = "-";
+ //var ChilDied = "-";
+ var chBLD = new Array();
+ var x;
+ var ALIVE=0;
+ var DEAD=0;
+ var NOTBORN=0;
+ for (x = 0; x<ChilBorn; x++) {
+ chBLD[x] = new Array(); // This declares each column in turn
+ chBLDarray2 = chBLDarray[x].split(', ');
+ var y;
+ for (y = 0; y<chBLDarray2.length; y++) {
+ chBLD[x][y] = chBLDarray2[y];
+ if (y==2 && (cdat>(chBLD[x][1]) && chBLD[x][1]!=0) && (chBLD[x][2]==0 || cdat<(chBLD[x][2]))) {
+ ALIVE=ALIVE+1;
+ } else if (y==2 && cdat>(chBLD[x][2]) && (chBLD[x][2])!=0) {
+ DEAD=DEAD+1;
+ } else if (y==2) {
+ NOTBORN=NOTBORN+1;
+ }
+ }
+ }
+ var BORN = ALIVE+DEAD;
+ if (BORN == 0) {
+ tr.cells[17].childNodes[0].value = "-"; // BORN
+ tr.cells[18].childNodes[0].value = "-"; // ALIVE
+ tr.cells[19].childNodes[0].value = "-"; // DEAD
+ } else {
+ tr.cells[17].childNodes[0].value = BORN; // BORN
+ tr.cells[18].childNodes[0].value = ALIVE; // ALIVE
+ tr.cells[19].childNodes[0].value = DEAD; // DEAD
+ }
+ if (ALIVE == 0) {
+ tr.cells[18].childNodes[0].value = "-"; // ALIVE
+ }
+ if (DEAD == 0) {
+ tr.cells[19].childNodes[0].value = "-"; // DEAD
+ }
+ }
+ }
+ }
+ }
+
+ // Change Age based on Census Year =====================================================
+ function changeAge(cenyear) {
+ var base1901 = "<?php echo $censyear; ?>";
+ var prevyr = document.getElementById('prevYear');
+ if (prevyr.value !="") {
+ var prevcenyear=prevyr.value;
+ } else {
+ // alert("cenyear = "+cenyear+" ... prevcenyear = base_"+base1901);
+ }
+
+ var cendate = getCenDate(cenyear);
+
+ var one_day = 1000*60*60*24;
+ var one_month = (365.26*one_day)/12;
+ var one_year = 365.26*one_day;
+
+ // Get Age from Input Fields and re-calculate =======================================
+ var tbl = document.getElementById('tblSample');
+
+ for(var i=1; i<tbl.rows.length; i++){ // start at i=1 because we need to avoid header
+ var tr = tbl.rows[i];
+ for(var j=2; j<tr.cells.length; j++){
+ if (j!=7 && j!=12) {
+ // miss out all cols except age cols
+ continue;
+ }else if (tr.cells[j].childNodes[0].value=="") {
+ tr.cells[j].childNodes[0].value=null
+ }else{
+ // Calculate Birth Year =======================================
+ var bage = (tr.cells[68].childNodes[0].value);
+ // If valid Julian date used, then use this instead -----------
+ if (bage>1721060) {
+ var IJD = Math.floor(bage);
+ var L = Math.floor(IJD + 68569);
+ var N = Math.floor(4 * L / 146097);
+ L = L - Math.floor((146097*N + 3)/4);
+ var I = Math.floor(4000*(L + 1)/1461001);
+ L = L - Math.floor(1461 * I / 4) + 31;
+ var J = Math.floor(80 * L / 2447);
+ var K = L - Math.floor(2447 * J / 80);
+ L = Math.floor(J/11);
+ J = J + 2 - 12*L;
+ I = 100*(N - 49) + I + L;
+ bage = (I+', '+J+', '+K);
+ }
+ // Calculate Death Year =======================================
+ var dage = (tr.cells[72].childNodes[0].value);
+ // If valid Julian date used, then use this instead -----------
+ if (dage>1721060) {
+ var IJD = Math.floor(dage);
+ var L = Math.floor(IJD + 68569);
+ var N = Math.floor(4 * L / 146097);
+ L = L - Math.floor((146097*N + 3)/4);
+ var I = Math.floor(4000*(L + 1)/1461001);
+ L = L - Math.floor(1461 * I / 4) + 31;
+ var J = Math.floor(80 * L / 2447);
+ var K = L - Math.floor(2447 * J / 80);
+ L = Math.floor(J/11);
+ J = J + 2 - 12*L;
+ I = 100*(N - 49) + I + L;
+ dage = (I+', '+J+', '+K);
+ }
+
+ // Caculate Age (or if Dead) on the selected Census Date ===================
+ var bage2 = Date.parseString(bage, 'y, M, d');
+ var dage2 = Date.parseString(dage, 'y, M, d');
+
+ if (cendate > dage2) {
+ newage = "-";
+ } else if (bage2 != "Invalid Date") {
+ var newage = (cendate-bage2);
+ if (Math.floor(newage/one_year) < 0) {
+ newage = "-";
+ } else if (Math.floor(newage/one_year) > 0) {
+ newage = Math.floor(newage/one_year);
+ } else if (Math.floor(newage/one_day) > 31) {
+ newage = Math.floor(newage/one_month)+"m";
+ } else if (Math.floor(newage/one_day) < 31) {
+ newage = Math.floor(newage/one_day)+"d";
+ } else if (Math.floor(newage/one_day) < 0) {
+ newage = "-";
+ } else {
+ newage = "nn";
+ }
+ if (newage == "nn") {
+ newage = Math.floor(cendate-bage2/one_year);
+ }
+ } else {
+ newage = "-";
+ }
+ tr.cells[j].childNodes[0].value=newage;
+
+ // Highlight in Pink the Name field and Age fields for any person not born or who died before census date -----
+ if (newage != "-") {
+ tr.cells[2].childNodes[0].style.background = '#ffffff';
+ tr.cells[7].childNodes[0].style.background = '#ffffff';
+ tr.cells[12].childNodes[0].style.background = '#ffffff';
+ }else{
+ // alert(tr.cells[2].childNodes[0].value+" - Not Born Yet");
+ tr.cells[2].childNodes[0].style.background = '#ffaaaa';
+ tr.cells[7].childNodes[0].style.background = '#ffaaaa';
+ tr.cells[12].childNodes[0].style.background = '#ffaaaa';
+ }
+
+ }
+ }
+ }
+ var cens_ctry_a = document.getElementById('censCtry');
+ var cens_ctry = cens_ctry_a.value;
+ if (cens_ctry =="USA") {
+ document.getElementById('Titl').value = '<?php echo 'Federal Census Transcription - '.$wholename.' - Household';?>';
+ }else{
+ document.getElementById('Titl').value = '<?php echo 'Census Transcription - '.$wholename.' - Household';?>';
+ }
+ var prev = document.getElementById('prevYear');
+ prev.value = cenyear;
+ }
+
+ // Add or Remove columns ===========================
+ function changeCols(cenyear) {
+ var cens_ctry = document.getElementById('censCtry').value;
+
+ var cols_0 = document.getElementsByName('col_0');
+ var cols_1 = document.getElementsByName('col_1');
+ var cols_2 = document.getElementsByName('col_2');
+ var cols_3 = document.getElementsByName('col_3');
+ var cols_4 = document.getElementsByName('col_4');
+ var cols_5 = document.getElementsByName('col_5');
+ var cols_6 = document.getElementsByName('col_6');
+ var cols_7 = document.getElementsByName('col_7');
+ var cols_8 = document.getElementsByName('col_8');
+ var cols_9 = document.getElementsByName('col_9');
+ var cols_10 = document.getElementsByName('col_10');
+ var cols_11 = document.getElementsByName('col_11');
+ var cols_12 = document.getElementsByName('col_12');
+ var cols_13 = document.getElementsByName('col_13');
+ var cols_14 = document.getElementsByName('col_14');
+ var cols_15 = document.getElementsByName('col_15');
+ var cols_16 = document.getElementsByName('col_16');
+ var cols_17 = document.getElementsByName('col_17');
+ var cols_18 = document.getElementsByName('col_18');
+ var cols_19 = document.getElementsByName('col_19');
+ var cols_20 = document.getElementsByName('col_20');
+ var cols_21 = document.getElementsByName('col_21');
+ var cols_22 = document.getElementsByName('col_22');
+ var cols_23 = document.getElementsByName('col_23');
+ var cols_24 = document.getElementsByName('col_24');
+ var cols_25 = document.getElementsByName('col_25');
+ var cols_26 = document.getElementsByName('col_26');
+ var cols_27 = document.getElementsByName('col_27');
+ var cols_28 = document.getElementsByName('col_28');
+ var cols_29 = document.getElementsByName('col_29');
+ var cols_30 = document.getElementsByName('col_30');
+ var cols_31 = document.getElementsByName('col_31');
+ var cols_32 = document.getElementsByName('col_32');
+ var cols_33 = document.getElementsByName('col_33');
+ var cols_34 = document.getElementsByName('col_34');
+ var cols_35 = document.getElementsByName('col_35');
+ var cols_36 = document.getElementsByName('col_36');
+ var cols_37 = document.getElementsByName('col_37');
+ var cols_38 = document.getElementsByName('col_38');
+ var cols_39 = document.getElementsByName('col_39');
+ var cols_40 = document.getElementsByName('col_40');
+ var cols_41 = document.getElementsByName('col_41');
+ var cols_42 = document.getElementsByName('col_42');
+ var cols_43 = document.getElementsByName('col_43');
+ var cols_44 = document.getElementsByName('col_44');
+ var cols_45 = document.getElementsByName('col_45');
+ var cols_46 = document.getElementsByName('col_46');
+ var cols_47 = document.getElementsByName('col_47');
+ var cols_48 = document.getElementsByName('col_48');
+ var cols_49 = document.getElementsByName('col_49');
+ var cols_50 = document.getElementsByName('col_50');
+ var cols_51 = document.getElementsByName('col_51');
+ var cols_52 = document.getElementsByName('col_52');
+ var cols_53 = document.getElementsByName('col_53');
+ var cols_54 = document.getElementsByName('col_54');
+ var cols_55 = document.getElementsByName('col_55');
+ var cols_56 = document.getElementsByName('col_56');
+ var cols_57 = document.getElementsByName('col_57');
+ var cols_58 = document.getElementsByName('col_58');
+ var cols_59 = document.getElementsByName('col_59');
+ var cols_60 = document.getElementsByName('col_60');
+ var cols_61 = document.getElementsByName('col_61');
+ var cols_62 = document.getElementsByName('col_62');
+ var cols_63 = document.getElementsByName('col_63');
+ var cols_64 = document.getElementsByName('col_64');
+ var cols_65 = document.getElementsByName('col_65');
+ var cols_66 = document.getElementsByName('col_66');
+ var cols_67 = document.getElementsByName('col_67');
+ // var cols_68 = document.getElementsByName('col_68');
+
+
+ var flip_3 = "none";
+ var flip_4 = "none";
+ var flip_5 = "none";
+ var flip_6 = "none";
+ var flip_7 = "none";
+ var flip_8 = "none";
+ var flip_9 = "none";
+ var flip_10 = "none";
+ var flip_11 = "none";
+ var flip_12 = "none";
+ var flip_13 = "none";
+ var flip_14 = "none";
+ var flip_15 = "none";
+ var flip_16 = "none";
+ var flip_17 = "none";
+ var flip_18 = "none";
+ var flip_19 = "none";
+ var flip_20 = "none";
+ var flip_21 = "none";
+ var flip_22 = "none";
+ var flip_23 = "none";
+ var flip_24 = "none";
+ var flip_25 = "none";
+ var flip_26 = "none";
+ var flip_27 = "none";
+ var flip_28 = "none";
+ var flip_29 = "none";
+ var flip_30 = "none";
+ var flip_31 = "none";
+ var flip_32 = "none";
+ var flip_33 = "none";
+ var flip_34 = "none";
+ var flip_35 = "none";
+ var flip_36 = "none";
+ var flip_37 = "none";
+ var flip_38 = "none";
+ var flip_39 = "none";
+ var flip_40 = "none";
+ var flip_41 = "none";
+ var flip_42 = "none";
+ var flip_43 = "none";
+ var flip_44 = "none";
+ var flip_45 = "none";
+ var flip_46 = "none";
+ var flip_47 = "none";
+ var flip_48 = "none";
+ var flip_49 = "none";
+ var flip_50 = "none";
+ var flip_51 = "none";
+ var flip_52 = "none";
+ var flip_53 = "none";
+ var flip_54 = "none";
+ var flip_55 = "none";
+ var flip_56 = "none";
+ var flip_57 = "none";
+ var flip_58 = "none";
+ var flip_59 = "none";
+ var flip_60 = "none";
+ var flip_61 = "none";
+ var flip_62 = "none";
+ var flip_63 = "none";
+ var flip_64 = "none";
+ var flip_65 = "none";
+ var flip_66 = "none";
+ var flip_67 = "none";
+ // var flip_68 = "none";
+
+ if (cens_ctry=="UK") {
+
+ if (cenyear=="1911" || cenyear=="1921" || cenyear=="1931") {
+ flip_3 = "";
+ flip_4 = "";
+ flip_7 = "";
+ flip_9 = "";
+ flip_16 = "";
+ flip_17 = "";
+ flip_18 = "";
+ flip_19 = "";
+ flip_35 = "";
+ flip_37 = "";
+ flip_38 = "";
+ flip_42 = "";
+ flip_50 = "";
+ flip_63 = "";
+ }else
+ if (cenyear=="1901") {
+ flip_3 = "";
+ flip_4 = "";
+ flip_7 = "";
+ flip_9 = "";
+ flip_35 = "";
+ flip_38 = "";
+ flip_42 = "";
+ flip_50 = "";
+ flip_63 = "";
+ }else
+ if (cenyear=="1891") {
+ flip_3 = "";
+ flip_4 = "";
+ flip_7 = "";
+ flip_9 = "";
+ flip_35 = "";
+ flip_39 = "";
+ flip_40 = "";
+ flip_43 = "";
+ flip_50 = "";
+ flip_63 = "";
+ }else
+ if (cenyear=="1881" || cenyear=="1871" || cenyear=="1861" || cenyear=="1851") {
+ flip_3 = "";
+ flip_4 = "";
+ flip_7 = "";
+ flip_9 = "";
+ flip_35 = "";
+ flip_50 = "";
+ flip_63 = "";
+ }else
+ if (cenyear=="1841") {
+ flip_7 = "";
+ flip_9 = "";
+ flip_35 = "";
+ flip_52 = "";
+ flip_53 = "";
+ }
+
+ } else if (cens_ctry=="USA") {
+ if (cenyear=="1930") {
+ flip_3 = "";
+ flip_6 = "";
+ flip_9 = "";
+ flip_10 = "";
+ flip_12 = "";
+ flip_15 = "";
+ flip_20 = "";
+ flip_46 = "";
+ flip_51 = "";
+ flip_54 = "";
+ flip_55 = "";
+ flip_56 = "";
+ flip_57 = "";
+ flip_58 = "";
+ flip_59 = "";
+ flip_60 = "";
+ flip_61 = "";
+ flip_62 = "";
+ flip_65 = "";
+ flip_66 = "";
+ }else
+ if (cenyear=="1920") {
+ flip_3 = "";
+ flip_5 = "";
+ flip_9 = "";
+ flip_10 = "";
+ flip_12 = "";
+ flip_15 = "";
+ flip_31 = "";
+ flip_32 = "";
+ flip_33 = "";
+ flip_46 = "";
+ flip_51 = "";
+ flip_54 = "";
+ flip_55 = "";
+ flip_56 = "";
+ flip_59 = "";
+ flip_60 = "";
+ flip_61 = "";
+ flip_62 = "";
+ }else
+ if (cenyear=="1910") {
+ flip_3 = "";
+ flip_9 = "";
+ flip_10 = "";
+ flip_12 = "";
+ flip_15 = "";
+ flip_16 = "";
+ flip_17 = "";
+ flip_18 = "";
+ // flip_22 = "";
+ flip_27 = "";
+ flip_28 = "";
+ flip_29 = "";
+ flip_30 = "";
+ flip_31 = "";
+ flip_32 = "";
+ flip_34 = "";
+ flip_35 = "";
+ flip_37 = "";
+ flip_38 = "";
+ flip_43 = "";
+ flip_44 = "";
+ flip_46 = "";
+ flip_49 = "";
+ flip_65 = "";
+ flip_67 = "";
+ }else
+ if (cenyear=="1900") {
+ flip_3 = "";
+ flip_8 = "";
+ flip_9 = "";
+ flip_11 = "";
+ flip_12 = "";
+ flip_15 = "";
+ flip_16 = "";
+ flip_17 = "";
+ flip_18 = "";
+ // flip_22 = "";
+ flip_27 = "";
+ flip_28 = "";
+ flip_29 = "";
+ flip_30 = "";
+ flip_31 = "";
+ flip_32 = "";
+ flip_35 = "";
+ flip_45 = "";
+ flip_46 = "";
+ flip_48 = "";
+ flip_49 = "";
+ }else
+ if (cenyear=="1890") {
+ flip_3 = "";
+ flip_8 = "";
+ flip_9 = "";
+ // flip_11 = "";
+ flip_12 = "";
+ flip_15 = "";
+ flip_16 = "";
+ flip_17 = "";
+ flip_18 = "";
+ // flip_22 = "";
+ flip_27 = "";
+ flip_28 = "";
+ flip_29 = "";
+ flip_30 = "";
+ flip_32 = "";
+ flip_35 = "";
+ flip_38 = "";
+ flip_41 = "";
+ flip_46 = "";
+ flip_48 = "";
+ flip_64 = "";
+ }else
+ if (cenyear=="1880") {
+ flip_8 = "";
+ flip_9 = "";
+ flip_12 = "";
+ flip_13 = "";
+ flip_14 = "";
+ flip_15 = "";
+ flip_16 = "";
+ flip_35 = "";
+ flip_36 = "";
+ // flip_42 = "";
+ flip_45 = "";
+ flip_47= "";
+ flip_48 = "";
+ flip_51 = "";
+ flip_54= "";
+ flip_55 = "";
+ }else
+ if (cenyear=="1870" ) {
+ flip_7 = "";
+ flip_9 = "";
+ flip_10 = "";
+ flip_21 = "";
+ flip_22 = "";
+ flip_23 = "";
+ flip_24 = "";
+ flip_25 = "";
+ flip_26 = "";
+ flip_47 = "";
+ flip_63 = "";
+ }else
+ if (cenyear=="1860" || cenyear=="1850") {
+ flip_7 = "";
+ flip_9 = "";
+ flip_10 = "";
+ flip_21 = "";
+ flip_22 = "";
+ flip_23 = "";
+ flip_26 = "";
+ flip_47 = "";
+ flip_63 = "";
+ }
+
+ }
+
+ // Hide or show ===============
+ for (var i=0; i<cols_0.length; i++) {
+ cols_3[i].style.display = flip_3;
+ cols_4[i].style.display = flip_4;
+ cols_5[i].style.display = flip_5;
+ cols_6[i].style.display = flip_6;
+ cols_7[i].style.display = flip_7;
+ cols_8[i].style.display = flip_8;
+ cols_9[i].style.display = flip_9;
+ cols_10[i].style.display = flip_10;
+ cols_11[i].style.display = flip_11;
+ cols_12[i].style.display = flip_12;
+ cols_13[i].style.display = flip_13;
+ cols_14[i].style.display = flip_14;
+ cols_15[i].style.display = flip_15;
+ cols_16[i].style.display = flip_16;
+ cols_17[i].style.display = flip_17;
+ cols_18[i].style.display = flip_18;
+ cols_19[i].style.display = flip_19;
+ cols_20[i].style.display = flip_20;
+ cols_21[i].style.display = flip_21;
+ cols_22[i].style.display = flip_22;
+ cols_23[i].style.display = flip_23;
+ cols_24[i].style.display = flip_24;
+ cols_25[i].style.display = flip_25;
+ cols_26[i].style.display = flip_26;
+ cols_27[i].style.display = flip_27;
+ cols_28[i].style.display = flip_28;
+ cols_29[i].style.display = flip_29;
+ cols_30[i].style.display = flip_30;
+ cols_31[i].style.display = flip_31;
+ cols_32[i].style.display = flip_32;
+ cols_33[i].style.display = flip_33;
+ cols_34[i].style.display = flip_34;
+ cols_35[i].style.display = flip_35;
+ cols_36[i].style.display = flip_36;
+ cols_37[i].style.display = flip_37;
+ cols_38[i].style.display = flip_38;
+ cols_39[i].style.display = flip_39;
+ cols_40[i].style.display = flip_40;
+ cols_41[i].style.display = flip_41;
+ cols_42[i].style.display = flip_42;
+ cols_43[i].style.display = flip_43;
+ cols_44[i].style.display = flip_44;
+ cols_45[i].style.display = flip_45;
+ cols_46[i].style.display = flip_46;
+ cols_47[i].style.display = flip_47;
+ cols_48[i].style.display = flip_48;
+ cols_49[i].style.display = flip_49;
+ cols_50[i].style.display = flip_50;
+ cols_51[i].style.display = flip_51;
+ cols_52[i].style.display = flip_52;
+ cols_53[i].style.display = flip_53;
+ cols_54[i].style.display = flip_54;
+ cols_55[i].style.display = flip_55;
+ cols_56[i].style.display = flip_56;
+ cols_57[i].style.display = flip_57;
+ cols_58[i].style.display = flip_58;
+ cols_59[i].style.display = flip_59;
+ cols_60[i].style.display = flip_60;
+ cols_61[i].style.display = flip_61;
+ cols_62[i].style.display = flip_62;
+ cols_63[i].style.display = flip_63;
+ cols_64[i].style.display = flip_64;
+ cols_65[i].style.display = flip_65;
+ cols_66[i].style.display = flip_66;
+ cols_67[i].style.display = flip_67;
+ // cols_68[i].style.display = flip_68;
+ }
+ }
+
+</script>
+
+<div class="optionbox cens_sour">
+ <div class="cens_sour_country">
+ <span><?php echo i18n::translate('Country'); ?><br /></span>
+ <select id="censCtry" name="censCtry" >
+ <option id="UKOPT" name="UKOPT" value="UK">UK</option>
+ <option id="USOPT" name="USOPT" value="USA">USA</option>
+ </select>
+
+ <script type="text/javascript">
+ if (TheCenYear=='') {
+ var censyear = new DynamicOptionList();
+ censyear.addDependentFields("censCtry","censYear");
+ censyear.forValue("UK").addOptions( "choose", "1841", "1851", "1861", "1871", "1881", "1891", "1901", "1911", "1921", "1931");
+ censyear.forValue("USA").addOptions( "choose", "1790", "1800", "1810", "1820", "1830", "1840", "1850", "1860", "1870", "1880", "1890", "1900", "1910", "1920", "1930");
+ censyear.forValue("UK").setDefaultOptions("choose");
+ censyear.forValue("USA").setDefaultOptions("choose");
+ }
+ else if (TheCenYear!='' && TheCenCtry=='UK') {
+ var censyear = new DynamicOptionList();
+ censyear.addDependentFields("censCtry","censYear");
+ censyear.forValue("UK").addOptions( "choose", "1841", "1851", "1861", "1871", "1881", "1891", "1901", "1911", "1921", "1931", TheCenYear);
+ censyear.forValue("USA").addOptions( "choose", "1790", "1800", "1810", "1820", "1830", "1840", "1850", "1860", "1870", "1880", "1890", "1900", "1910", "1920", "1930");
+ censyear.forValue("UK").setDefaultOptions(TheCenYear);
+ censyear.forValue("USA").setDefaultOptions("choose");
+ document.getElementById("UKOPT").selected = true;
+ document.getElementById("USOPT").selected = false;
+ }
+ else if (TheCenYear!='' && TheCenCtry=='USA') {
+ var censyear = new DynamicOptionList();
+ censyear.addDependentFields("censCtry","censYear");
+ censyear.forValue("UK").addOptions( "choose", "1841", "1851", "1861", "1871", "1881", "1891", "1901", "1911", "1921", "1931");
+ censyear.forValue("USA").addOptions( "choose", "1790", "1800", "1810", "1820", "1830", "1840", "1850", "1860", "1870", "1880", "1890", "1900", "1910", "1920", "1930", TheCenYear);
+ censyear.forValue("UK").setDefaultOptions("choose");
+ censyear.forValue("USA").setDefaultOptions(TheCenYear);
+ document.getElementById("UKOPT").selected = false;
+ document.getElementById("USOPT").selected = true;
+ }
+ </script>
+
+ <div>
+ <table><tr><td nowrap="nowrap">
+ <br />
+ <?php
+ // echo "&nbsp;".i18n::translate('Date').":&nbsp;&nbsp;";
+ echo "<font size=2>";
+ // Input renamed as type=hidden to hide the date field ----- //
+ // Note Input field is still required ---------------------- //
+ ?>
+ <input type="hidden" style="width:6em; background:#bbddff;" id="censDate" name="censDate" type="text" value="<?php echo "";?>" READONLY/>
+ </font>
+ </td></tr></table>
+ </div>
+
+
+ </div>
+
+ <div class="cens_sour_year">
+ <span><?php echo i18n::translate('Year'); ?><br /></span>
+ <select style = "background:#ffaaaa;";
+ onchange = "if( this.options[this.selectedIndex].value!='') {
+ changeYear(this.options[this.selectedIndex].value);
+ }"
+ id="censYear" name="censYear">
+ </select>
+ <input type="hidden" id="prevYear" name="prevYear" value="" />&nbsp;&nbsp;&nbsp;
+ </div>
+
+ <div class="cens_sour_scs">
+ <div class="cens_sour_1">
+ <div class="cens_sour_2">Title:</div>
+ <script type="text/javascript">
+ document.writeln('<input id="Titl" name="Titl" type="text" value="<?php echo "Census Transcription - ".$wholename." - Household";?>" />');
+ </script>
+ </div>
+ <div class="cens_sour_1">
+ <div class="cens_sour_2">Reference:</div>
+ <input id="citation" name="citation" type="text" value="<?php echo "";?>" />
+ </div>
+ <div class="cens_sour_1">
+ <div class="cens_sour_2">Locality:</div>
+ <input id="locality" name="locality" type="text" value="<?php echo "";?>" />
+ </div>
+ <div class="cens_sour_1">
+ <div class="cens_sour_2">Notes:</div>
+ <input id="notes" name="notes" type="text" value="<?php echo "";?>" />
+ </div>
+ </div>
+</div>
+
diff --git a/modules/GEDFact_assistant/_CENS/census_3_find.php b/modules/GEDFact_assistant/_CENS/census_3_find.php
new file mode 100644
index 0000000000..020d01ed54
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/census_3_find.php
@@ -0,0 +1,885 @@
+<?php
+/**
+ * Facility in Census assistant that will allow a user to search for a person id
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Display
+ * @version $Id$
+ */
+
+require WT_ROOT.'includes/functions/functions_print_lists.php';
+
+$type =safe_GET('type', WT_REGEX_ALPHA, 'indi');
+$filter =safe_GET('filter');
+$action =safe_GET('action');
+$callback =safe_GET('callback', WT_REGEX_NOSCRIPT, 'paste_id');
+$create =safe_GET('create');
+$media =safe_GET('media');
+$external_links =safe_GET('external_links');
+$directory =safe_GET('directory', WT_REGEX_NOSCRIPT, $MEDIA_DIRECTORY);
+$multiple =safe_GET_bool('multiple');
+$showthumb =safe_GET_bool('showthumb');
+$all =safe_GET_bool('all');
+$subclick =safe_GET('subclick');
+$choose =safe_GET('choose', WT_REGEX_NOSCRIPT, '0all');
+$level =safe_GET('level', WT_REGEX_INTEGER, 0);
+$language_filter=safe_GET('language_filter');
+$magnify =safe_GET_bool('magnify');
+
+if ($showthumb) {
+ $thumbget='&showthumb=true';
+} else {
+ $thumbget='';
+}
+
+if ($subclick=='all') {
+ $all=true;
+}
+
+$embed = substr($choose, 0, 1)=="1";
+$chooseType = substr($choose, 1);
+if ($chooseType!="media" && $chooseType!="0file") {
+ $chooseType = "all";
+}
+
+//-- force the thumbnail directory to have the same layout as the media directory
+//-- Dots and slashes should be escaped for the preg_replace
+$srch = "/".addcslashes($MEDIA_DIRECTORY, '/.')."/";
+$repl = addcslashes($MEDIA_DIRECTORY."thumbs/", '/.');
+$thumbdir = stripcslashes(preg_replace($srch, $repl, $directory));
+
+//-- prevent script from accessing an area outside of the media directory
+//-- and keep level consistency
+if (($level < 0) || ($level > $MEDIA_DIRECTORY_LEVELS)){
+ $directory = $MEDIA_DIRECTORY;
+ $level = 0;
+} elseif (preg_match("'^$MEDIA_DIRECTORY'", $directory)==0){
+ $directory = $MEDIA_DIRECTORY;
+ $level = 0;
+}
+// End variables for find media
+
+// Variables for Find Special Character
+if (empty($language_filter)) {
+ if (!empty($_SESSION["language_filter"])) {
+ $language_filter=$_SESSION["language_filter"];
+ } else {
+ $language_filter=WT_LOCALE;
+ }
+}
+require WT_ROOT.'includes/specialchars.php';
+// End variables for Find Special Character
+
+switch ($type) {
+case "indi":
+ print_simple_header(i18n::translate('Find Individual ID'));
+ break;
+case "fam":
+ print_simple_header(i18n::translate('Find Family List'));
+ break;
+case "media":
+ print_simple_header(i18n::translate('Find Media'));
+ $action="filter";
+ break;
+case "place":
+ print_simple_header(i18n::translate('Find Place'));
+ $action="filter";
+ break;
+case "repo":
+ print_simple_header(i18n::translate('Repositories'));
+ $action="filter";
+ break;
+case "note":
+ print_simple_header(i18n::translate('Find Shared Note'));
+ $action="filter";
+ break;
+case "source":
+ print_simple_header(i18n::translate('Find Source'));
+ $action="filter";
+ break;
+case "specialchar":
+ print_simple_header(i18n::translate('Find Special Characters'));
+ $action="filter";
+ break;
+}
+
+echo WT_JS_START;
+?>
+
+ function pasterow(id, nam, mnam, label, gend, cond, dom, dob, dod, occu, age, birthpl, fbirthpl, mbirthpl, chilBLD) {
+ window.opener.insertRowToTable(id, nam, mnam, label, gend, cond, dom, dob, dod, occu, age, birthpl, fbirthpl, mbirthpl, chilBLD);
+ <?php if (!$multiple) print "window.close();"; ?>
+ }
+
+ function pasteid(id, name, thumb) {
+ if(thumb) {
+ window.opener.<?php echo $callback; ?>(id, name, thumb);
+ <?php if (!$multiple) echo "window.close();"; ?>
+ } else {
+ // GEDFact_assistant ========================
+ if (window.opener.document.getElementById('addlinkQueue')) {
+ window.opener.insertRowToTable(id, name);
+ // Check if Indi, Fam or source ===================
+ /*
+ if (id.match("I")=="I") {
+ var win01 = window.opener.window.open('edit_interface.php?action=addmedia_links&noteid=newnote&pid='+id, 'win01', 'top=50, left=600, width=420, height=650, resizable=1, scrollbars=1');
+ if (window.focus) {win01.focus();}
+ }else if (id.match("F")=="F") {
+ // TODO --- alert('Opening Navigator with family id entered will come later');
+ }
+ */
+ }
+ window.opener.<?php echo $callback; ?>(id);
+ if (window.opener.pastename) window.opener.pastename(name);
+ <?php if (!$multiple) echo "window.close();"; ?>
+ }
+ }
+ var language_filter;
+ function paste_char(selected_char, language_filter, magnify) {
+ window.opener.paste_char(selected_char, language_filter, magnify);
+ return false;
+ }
+ function setMagnify() {
+ document.filterspecialchar.magnify.value = '<?php echo !$magnify; ?>';
+ document.filterspecialchar.submit();
+ }
+ function checknames(frm) {
+ if (document.forms[0].subclick) button = document.forms[0].subclick.value;
+ else button = "";
+ if (frm.filter.value.length<2&button!="all") {
+ alert("<?php echo i18n::translate('Please enter more than one character'); ?>");
+ frm.filter.focus();
+ return false;
+ }
+ if (button=="all") {
+ frm.filter.value = "";
+ }
+ return true;
+ }
+<?php
+echo WT_JS_END;
+
+$options = array();
+$options["option"][]= "findindi";
+$options["option"][]= "findfam";
+$options["option"][]= "findmedia";
+$options["option"][]= "findplace";
+$options["option"][]= "findrepo";
+$options["option"][]= "findnote";
+$options["option"][]= "findsource";
+$options["option"][]= "findspecialchar";
+$options["form"][]= "formindi";
+$options["form"][]= "formfam";
+$options["form"][]= "formmedia";
+$options["form"][]= "formplace";
+$options["form"][]= "formrepo";
+$options["form"][]= "formnote";
+$options["form"][]= "formsource";
+$options["form"][]= "formspecialchar";
+
+echo "<div align=\"center\">";
+echo "<table class=\"list_table $TEXT_DIRECTION width90\" border=\"0\">";
+echo "<tr><td style=\"padding: 10px;\" valign=\"top\" class=\"facts_label03 width90\">"; // start column for find text header
+
+switch ($type) {
+case "indi":
+ echo i18n::translate('Find Individual ID');
+ break;
+case "fam":
+ echo i18n::translate('Find Family List');
+ break;
+case "media":
+ echo i18n::translate('Find Media');
+ break;
+case "place":
+ echo i18n::translate('Find Place');
+ break;
+case "repo":
+ echo i18n::translate('Repositories');
+ break;
+case "note":
+ echo i18n::translate('Find Shared Note');
+ break;
+case "source":
+ echo i18n::translate('Find Source');
+ break;
+case "specialchar":
+ echo i18n::translate('Find Special Characters');
+ break;
+}
+
+echo "</td>"; // close column for find text header
+
+ // start column for find options
+ print "</tr><tr><td class=\"list_value\" style=\"padding: 5px;\">";
+
+// Show indi and hide the rest
+if ($type == "indi") {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filterindi\" method=\"get\" onsubmit=\"return checknames(this);\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"$callback\" />";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"indi\" />";
+ echo "<input type=\"hidden\" name=\"multiple\" value=\"$multiple\" />";
+/*
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo i18n::translate('Name contains:'), " <input type=\"text\" name=\"filter\" value=\"";
+ if ($filter) echo $filter;
+ echo "\" />";
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo "<input type=\"submit\" value=\"", i18n::translate('Filter'), "\" /><br />";
+ echo "</td></tr></table>";
+*/
+ echo "</form></div>";
+}
+
+// Show fam and hide the rest
+if ($type == "fam") {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filterfam\" method=\"get\" onsubmit=\"return checknames(this);\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"fam\" />";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"$callback\" />";
+ echo "<input type=\"hidden\" name=\"multiple\" value=\"$multiple\" />";
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo i18n::translate('Name contains:'), " <input type=\"text\" name=\"filter\" value=\"";
+ if ($filter) echo $filter;
+ echo "\" />";
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo "<input type=\"submit\" value=\"", i18n::translate('Filter'), "\" /><br />";
+ echo "</td></tr></table>";
+ echo "</form></div>";
+}
+
+// Show media and hide the rest
+if ($type == "media" && $MULTI_MEDIA) {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filtermedia\" method=\"get\" onsubmit=\"return checknames(this);\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"choose\" value=\"", $choose, "\" />";
+ echo "<input type=\"hidden\" name=\"directory\" value=\"", $directory, "\" />";
+ echo "<input type=\"hidden\" name=\"thumbdir\" value=\"", $thumbdir, "\" />";
+ echo "<input type=\"hidden\" name=\"level\" value=\"", $level, "\" />";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"media\" />";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"$callback\" />";
+ echo "<input type=\"hidden\" name=\"subclick\">"; // This is for passing the name of which submit button was clicked
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo i18n::translate('Media contains:'), " <input type=\"text\" name=\"filter\" value=\"";
+ if ($filter) echo $filter;
+ echo "\" />";
+ echo help_link('simple_filter');
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" wstyle=\"padding: 5px;\">";
+ echo "<input type=\"checkbox\" name=\"showthumb\" value=\"true\"";
+ if( $showthumb) echo "checked=\"checked\"";
+ echo "onclick=\"javascript: this.form.submit();\" />", i18n::translate('Show thumbnails');
+ echo help_link('show_thumb');
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo "<input type=\"submit\" name=\"search\" value=\"", i18n::translate('Filter'), "\" onclick=\"this.form.subclick.value=this.name\" />&nbsp;";
+ echo "<input type=\"submit\" name=\"all\" value=\"", i18n::translate('Display all'), "\" onclick=\"this.form.subclick.value=this.name\" />";
+ echo "</td></tr></table>";
+ echo "</form></div>";
+}
+
+// Show place and hide the rest
+if ($type == "place") {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filterplace\" method=\"get\" onsubmit=\"return checknames(this);\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"place\" />";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"$callback\" />";
+ echo "<input type=\"hidden\" name=\"subclick\">"; // This is for passing the name of which submit button was clicked
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo i18n::translate('Place contains:'), " <input type=\"text\" name=\"filter\" value=\"";
+ if ($filter) echo $filter;
+ echo "\" />";
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo "<input type=\"submit\" name=\"search\" value=\"", i18n::translate('Filter'), "\" onclick=\"this.form.subclick.value=this.name\" />&nbsp;";
+ echo "<input type=\"submit\" name=\"all\" value=\"", i18n::translate('Display all'), "\" onclick=\"this.form.subclick.value=this.name\" />";
+ echo "</td></tr></table>";
+ echo "</form></div>";
+}
+
+// Show repo and hide the rest
+if ($type == "repo" && $SHOW_SOURCES>=WT_USER_ACCESS_LEVEL) {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filterrepo\" method=\"get\" onsubmit=\"return checknames(this);\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"repo\" />";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"$callback\" />";
+ echo "<input type=\"hidden\" name=\"subclick\">"; // This is for passing the name of which submit button was clicked
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo i18n::translate('Repository contains:'), " <input type=\"text\" name=\"filter\" value=\"";
+ if ($filter) echo $filter;
+ echo "\" />";
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo "<input type=\"submit\" name=\"search\" value=\"", i18n::translate('Filter'), "\" onclick=\"this.form.subclick.value=this.name\" />&nbsp;";
+ echo "<input type=\"submit\" name=\"all\" value=\"", i18n::translate('Display all'), "\" onclick=\"this.form.subclick.value=this.name\" />";
+ echo "</td></tr></table>";
+ echo "</form></div>";
+}
+
+// Show Shared Notes and hide the rest
+if ($type == "note") {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filternote\" method=\"get\" onsubmit=\"return checknames(this);\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"note\" />";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"$callback\" />";
+ echo "<input type=\"hidden\" name=\"subclick\">"; // This is for passing the name of which submit button was clicked
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo i18n::translate('Shared Note contains:'), " <input type=\"text\" name=\"filter\" value=\"";
+ if ($filter) echo $filter;
+ echo "\" />";
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo "<input type=\"submit\" name=\"search\" value=\"", i18n::translate('Filter'), "\" onclick=\"this.form.subclick.value=this.name\" />&nbsp;";
+ echo "<input type=\"submit\" name=\"all\" value=\"", i18n::translate('Display all'), "\" onclick=\"this.form.subclick.value=this.name\" />";
+ echo "</td></tr></table>";
+ echo "</form></div>";
+}
+
+// Show source and hide the rest
+if ($type == "source" && $SHOW_SOURCES>=WT_USER_ACCESS_LEVEL) {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filtersource\" method=\"get\" onsubmit=\"return checknames(this);\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"source\" />";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"$callback\" />";
+ echo "<input type=\"hidden\" name=\"subclick\">"; // This is for passing the name of which submit button was clicked
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo i18n::translate('Source contains:'), " <input type=\"text\" name=\"filter\" value=\"";
+ if ($filter) echo $filter;
+ echo "\" />";
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo "<input type=\"submit\" name=\"search\" value=\"", i18n::translate('Filter'), "\" onclick=\"this.form.subclick.value=this.name\" />&nbsp;";
+ echo "<input type=\"submit\" name=\"all\" value=\"", i18n::translate('Display all'), "\" onclick=\"this.form.subclick.value=this.name\" />";
+ echo "</td></tr></table>";
+ echo "</form></div>";
+}
+
+// Show specialchar and hide the rest
+if ($type == "specialchar") {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filterspecialchar\" method=\"get\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"specialchar\" />";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"", $callback, "\" />";
+ echo "<input type=\"hidden\" name=\"magnify\" value=\"", $magnify, "\" />";
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label\" style=\"padding: 5px;\">";
+ echo "<select id=\"language_filter\" name=\"language_filter\" onchange=\"submit();\">";
+ echo "<option value=\"\">", i18n::translate('Change Language'), "</option>";
+ $language_options = "";
+ foreach($specialchar_languages as $key=>$value) {
+ $language_options.= "<option value=\"$key\">$value</option>";
+ }
+ $language_options = str_replace("\"$language_filter\"", "\"$language_filter\" selected", $language_options);
+ echo $language_options;
+ echo "</select><br /><a href=\"javascript:;\" onclick=\"setMagnify()\">", i18n::translate('Magnify'), "</a>";
+ echo "</td></tr></table>";
+ echo "</form></div>";
+}
+// end column for find options
+echo "</td></tr>";
+echo "</table>"; // Close table with find options
+
+echo "<br />";
+echo "<a href=\"javascript:;\" onclick=\"if (window.opener.showchanges) window.opener.showchanges(); window.close();\">", i18n::translate('Close Window'), "</a><br />";
+echo "<br />";
+
+if ($action=="filter") {
+ $filter = trim($filter);
+ $filter_array=explode(' ', preg_replace('/ {2,}/', ' ', $filter));
+
+ // Output Individual fot GEDFact Assistant ======================
+ if ($type == "indi") {
+ echo "<table class=\"tabs_table $TEXT_DIRECTION width90\"><tr>";
+ $myindilist=search_indis_names($filter_array, array(WT_GED_ID), 'AND');
+ if ($myindilist) {
+ echo "<td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>";
+ usort($myindilist, array('GedcomRecord', 'Compare'));
+ foreach($myindilist as $indi ) {
+
+ $nam = $indi->getAllNames();
+ $wholename = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = str_replace('"', '\'', $fulln); // Replace double quotes
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $fulmn = str_replace('"', '\'', $fulmn); // Replace double quotes
+ $fulmn = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulmn);
+ $fulmn = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulmn);
+ $marn = $nam[1]['surname'];
+ } else {
+ $fulmn = $fulln;
+ }
+
+ //-- Build Indi Parents Family to get FBP and MBP -----------
+ $families = $indi->getChildFamilies();
+ foreach($families as $famid=>$family) {
+ if (!is_null($family)) {
+ $father = $family->getHusband();
+ $mother = $family->getWife();
+ if (!is_null($father)) {
+ $FBP = $father->getBirthPlace();
+ }
+ if (!is_null($mother)) {
+ $MBP = $mother->getBirthPlace();
+ }
+ }
+ }
+ if (!isset($FBP)) { $FBP = "UNK, UNK, UNK, UNK"; }
+ if (!isset($MBP)) { $MBP = "UNK, UNK, UNK, UNK"; }
+
+ //-- Build Indi Spouse Family to get marriage Date ----------
+ $families = $indi->getSpouseFamilies();
+ foreach($families as $famid=>$family) {
+ $marrdate = $family->getMarriageDate();
+ $marrdate = ($marrdate->minJD()+$marrdate->maxJD())/2; // Julian
+ $children = $family->getChildren();
+ }
+ if (!isset($marrdate)) { $marrdate = ""; }
+
+ //-- Get Children's Name, DOB, DOD --------------------------
+ if (isset($children)) {
+ $chBLDarray = Array();
+ foreach ($children as $key=>$child) {
+ $chnam = $child->getAllNames();
+ $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname'];
+ $chfulln = str_replace('"', "", $chfulln); // Must remove quotes completely here
+ $chfulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $chfulln); // Child's Full Name
+ $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child's Date of Birth (Julian)
+ if (!isset($chdob)) { $chdob = ""; }
+ $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child's Date of Death (Julian)
+ if (!isset($chdod)) { $chdod = ""; }
+ $chBLD = ($chfulln.", ".$chdob.", ".$chdod);
+ array_push($chBLDarray, $chBLD);
+ }
+ }
+ if (isset($chBLDarray) && $indi->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ } else {
+ $chBLDarray = '';
+ }
+
+ echo "<li>";
+ // ==============================================================================================================================
+ // NOTES = is equivalent to= function pasterow(id, nam, mnam, label, gend, cond, dom, dob, age, dod, occu, birthpl, fbirthpl, mbirthpl, chilBLD) {
+ // ==============================================================================================================================
+ echo "<a href=\"javascript:;\" onclick=\"window.opener.insertRowToTable(";
+ echo "'".$indi->getXref()."', "; // id - Indi Id
+ echo "'".addslashes(strip_tags($fulln))."', "; // nam - Name
+ echo "'".addslashes(strip_tags($fulmn))."', "; // mnam - Married Name
+ echo "'-', "; // label - Relation to Head of Household
+ echo "'".$indi->getSex()."', "; // gend - Sex
+ echo "'S', "; // cond - Marital Condition
+ echo "'".$marrdate."', "; // dom - Date of Marriage
+ echo "'".(($indi->getBirthDate()->minJD() + $indi->getBirthDate()->maxJD())/2)."' ,"; // dob - Date of Birth
+ echo "'".(1901-$indi->getbirthyear())."' ,"; // ~age~ - Census Date minus YOB (Preliminary)
+ echo "'".(($indi->getDeathDate()->minJD() + $indi->getDeathDate()->maxJD())/2)."' ,"; // dod - Date of Death
+ echo "'', "; // occu - Occupation
+ echo "'".$indi->getbirthplace()."', "; // birthpl - Birthplace
+ echo "'".$FBP."', "; // fbirthpl - Father's Birthplace
+ echo "'".$MBP."', "; // mbirthpl - Mother's Birthplace
+ echo "'".$chBLDarray."'"; // chilBLD - Array of Children (name, birthdate, deathdate)
+ echo ");";
+ echo "return false;\">";
+ echo "<b>".$indi->getFullName()."</b>&nbsp;&nbsp;&nbsp;"; // Name Link
+
+ if ($ABBREVIATE_CHART_LABELS) {
+ $born=i18n::fact_abbreviation('BIRT');
+ } else {
+ $born=i18n::translate('BIRT');
+ }
+
+ echo "</span><br><span class=\"list_item\">", $born, " ", $indi->getbirthyear(), "&nbsp;&nbsp;&nbsp;", $indi->getbirthplace(), "</span>";
+ echo "</a>";
+ echo "</li>";
+
+ echo "<hr />";
+ }
+ echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Total individuals'), ' ', count($myindilist), '</tr></td>';
+ } else {
+ echo "<td class=\"list_value_wrap\">";
+ echo i18n::translate('No results found.');
+ echo "</td></tr>";
+ }
+ echo "</table>";
+ }
+
+ // Output Family
+ if ($type == "fam") {
+ echo "<table class=\"tabs_table $TEXT_DIRECTION width90\"><tr>";
+ // Get the famrecs with hits on names from the family table
+ // Get the famrecs with hits in the gedcom record from the family table
+ $myfamlist = pgv_array_merge(
+ search_fams_names($filter_array, array(WT_GED_ID), 'AND'),
+ search_fams($filter_array, array(WT_GED_ID), 'AND', true)
+ );
+ if ($myfamlist) {
+ $curged = $GEDCOM;
+ echo "<td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>";
+ usort($myfamlist, array('GedcomRecord', 'Compare'));
+ foreach($myfamlist as $family) {
+ echo $family->format_list('li', true);
+ }
+ echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Total families'), ' ', count($myfamlist), '</tr></td>';
+ } else {
+ echo "<td class=\"list_value_wrap\">";
+ echo i18n::translate('No results found.');
+ echo "</td></tr>";
+ }
+ echo "</table>";
+ }
+
+ // Output Media
+ if ($type == "media") {
+ global $dirs;
+
+ $medialist = get_medialist(true, $directory);
+
+ echo "<table class=\"tabs_table $TEXT_DIRECTION width90\">";
+ // Show link to previous folder
+ if ($level>0) {
+ $levels = explode("/", $directory);
+ $pdir = "";
+ for($i=0; $i<count($levels)-2; $i++) $pdir.=$levels[$i]."/";
+ $levels = explode("/", $thumbdir);
+ $pthumb = "";
+ for($i=0; $i<count($levels)-2; $i++) $pthumb.=$levels[$i]."/";
+ $uplink = "<a href=\"".encode_url("find.php?directory={$pdir}&thumbdir={$pthumb}&level=".($level-1)."{$thumbget}&type=media&choose={$choose}")."\">&nbsp;&nbsp;&nbsp;&lt;-- <span dir=\"ltr\">".$pdir."</span>&nbsp;&nbsp;&nbsp;</a><br />";
+ }
+
+ // Start of media directory table
+ echo "<table class=\"list_table $TEXT_DIRECTION width90\">";
+
+ // Tell the user where he is
+ echo "<tr>";
+ echo "<td class=\"topbottombar\" colspan=\"2\">";
+ echo i18n::translate('Current directory');
+ echo "<br />";
+ echo substr($directory, 0, -1);
+ echo "</td>";
+ echo "</tr>";
+
+ // display the directory list
+ if (count($dirs) || $level) {
+ sort($dirs);
+ if ($level){
+ echo "<tr><td class=\"list_value $TEXT_DIRECTION\" colspan=\"2\">";
+ echo $uplink, "</td></tr>";
+ }
+ echo "<tr><td class=\"descriptionbox $TEXT_DIRECTION\" colspan=\"2\">";
+ echo "<a href=\"", encode_url("find.php?directory={$directory}&thumbdir=".str_replace($MEDIA_DIRECTORY, $MEDIA_DIRECTORY."thumbs/", $directory)."&level={$level}{$thumbget}&external_links=http&type=media&choose={$choose}"), "\">", i18n::translate('External objects'), "</a>";
+ echo "</td></tr>";
+ foreach ($dirs as $indexval => $dir) {
+ echo "<tr><td class=\"list_value $TEXT_DIRECTION\" colspan=\"2\">";
+ echo "<a href=\"", encode_url("find.php?directory={$directory}{$dir}/&thumbdir={$directory}{$dir}/&level=".($level+1)."{$thumbget}&type=media&choose={$choose}"), "\"><span dir=\"ltr\">", $dir, "</span></a>";
+ echo "</td></tr>";
+ }
+ }
+ echo "<tr><td class=\"descriptionbox $TEXT_DIRECTION\" colspan=\"2\"></td></tr>";
+
+ /**
+ * This action generates a thumbnail for the file
+ *
+ * @name $create->thumbnail
+ */
+ if ($create=="thumbnail") {
+ $filename = $_REQUEST["file"];
+ generate_thumbnail($directory.$filename, $thumbdir.$filename);
+ }
+
+ echo "<br />";
+
+ // display the images TODO x across if lots of files??
+ if (count($medialist) > 0) {
+ foreach ($medialist as $indexval => $media) {
+
+ // Check if the media belongs to the current folder
+ preg_match_all("/\//", $media["FILE"], $hits);
+ $ct = count($hits[0]);
+
+ if (($ct <= $level+1 && $external_links != "http" && !isFileExternal($media["FILE"])) || (isFileExternal($media["FILE"]) && $external_links == "http")) {
+ // simple filter to reduce the number of items to view
+ $isvalid = filterMedia($media, $filter, 'http');
+ if ($isvalid && $chooseType!="all") {
+ if ($chooseType=="0file" && !empty($media["XREF"])) $isvalid = false; // skip linked media files
+ if ($chooseType=="media" && empty($media["XREF"])) $isvalid = false; // skip unlinked media files
+ }
+ if ($isvalid) {
+ if ($media["EXISTS"] && media_filesize($media["FILE"]) != 0){
+ $imgsize = findImageSize($media["FILE"]);
+ $imgwidth = $imgsize[0]+40;
+ $imgheight = $imgsize[1]+150;
+ }
+ else {
+ $imgwidth = 0;
+ $imgheight = 0;
+ }
+
+ echo "<tr>";
+
+ //-- thumbnail field
+ if ($showthumb) {
+ echo "<td class=\"list_value $TEXT_DIRECTION width10\">";
+ if (isset($media["THUMB"])) echo "<a href=\"javascript:;\" onclick=\"return openImage('", rawurlencode($media["FILE"]), "', $imgwidth, $imgheight);\"><img src=\"", filename_decode($media["THUMB"]), "\" border=\"0\" width=\"50\" alt=\"\" /></a>";
+ else echo "&nbsp;";
+ }
+
+ //-- name and size field
+ echo "<td class=\"list_value $TEXT_DIRECTION\">";
+ if ($media["TITL"] != "") {
+ echo "<b>", PrintReady($media["TITL"]), "</b>&nbsp;&nbsp;";
+ if ($TEXT_DIRECTION=="rtl") echo getRLM();
+ echo "(", $media["XREF"], ")";
+ if ($TEXT_DIRECTION=="rtl") echo getRLM();
+ echo "<br />";
+ }
+ if (!$embed){
+ echo "<a href=\"javascript:;\" onclick=\"pasteid('", addslashes($media["FILE"]), "');\"><span dir=\"ltr\">", $media["FILE"], "</span></a> -- ";
+ }
+ else echo "<a href=\"javascript:;\" onclick=\"pasteid('", $media["XREF"], "','", addslashes($media["TITL"]), "','", addslashes($media["THUMB"]), "');\"><span dir=\"ltr\">", $media["FILE"], "</span></a> -- ";
+ echo "<a href=\"javascript:;\" onclick=\"return openImage('", rawurlencode($media["FILE"]), "', $imgwidth, $imgheight);\">", i18n::translate('View'), "</a><br />";
+ if (!$media["EXISTS"] && !isFileExternal($media["FILE"])) echo $media["FILE"], "<br /><span class=\"error\">", i18n::translate('The filename entered does not exist.'), "</span><br />";
+ else if (!isFileExternal($media["FILE"]) && !empty($imgsize[0])) {
+ echo "<br /><sub>&nbsp;&nbsp;", i18n::translate('Image Dimensions'), " -- ", $imgsize[0], "x", $imgsize[1], "</sub><br />";
+ }
+ if ($media["LINKED"]) {
+ echo i18n::translate('This media object is linked to the following:'), "<br />";
+ foreach ($media["LINKS"] as $indi => $type_record) {
+ if ($type_record!='INDI' && $type_record!='FAM' && $type_record!='SOUR' && $type_record!='OBJE') continue;
+ $record=GedcomRecord::getInstance($indi);
+ echo '<br /><a href="', encode_url($record->getLinkUrl()), '">';
+ switch($type_record) {
+ case 'INDI':
+ echo i18n::translate('View Person'), ' - ';
+ break;
+ case 'FAM':
+ echo i18n::translate('View Family'), ' - ';
+ break;
+ case 'SOUR':
+ echo i18n::translate('View Source'), ' - ';
+ break;
+ case 'OBJE':
+ echo i18n::translate('View Object'), ' - ';
+ break;
+ }
+ echo PrintReady($record->getFullName()), '</a>';
+ }
+ } else {
+ echo i18n::translate('This media object is not linked to any GEDCOM record.');
+ }
+ echo "</td>";
+ }
+ }
+ }
+ }
+ else {
+ echo "<tr><td class=\"list_value_wrap\">";
+ echo i18n::translate('No results found.');
+ echo "</td></tr>";
+ }
+ echo "</table>";
+ }
+
+ // Output Places
+ if ($type == "place") {
+ echo "<table class=\"tabs_table $TEXT_DIRECTION width90\"><tr>";
+ $placelist = array();
+ if ($all || $filter) {
+ $placelist=find_place_list($filter);
+ $ctplace = count($placelist);
+ if ($ctplace>0) {
+ $revplacelist = array();
+ foreach ($placelist as $indexval => $place) {
+ $levels = explode(',', $place); // -- split the place into comma seperated values
+ $levels = array_reverse($levels); // -- reverse the array so that we get the top level first
+ $placetext = "";
+ $j=0;
+ foreach($levels as $indexval => $level) {
+ if ($j>0) $placetext .= ", ";
+ $placetext .= trim($level);
+ $j++;
+ }
+ $revplacelist[] = $placetext;
+ }
+ uasort($revplacelist, "utf8_strcasecmp");
+ echo "<td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>";
+ foreach($revplacelist as $place) {
+ echo "<li><a href=\"javascript:;\" onclick=\"pasteid('", str_replace(array("'", '"'), array("\'", '&quot;'), $place), "');\">", PrintReady($place), "</a></li>";
+ }
+ echo "</ul></td></tr>";
+ echo "<tr><td class=\"list_label\">", i18n::translate('Places found'), " ", $ctplace;
+ echo "</td></tr>";
+ }
+ else {
+ echo "<tr><td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>";
+ echo i18n::translate('No results found.');
+ echo "</td></tr>";
+ }
+ }
+ echo "</table>";
+ }
+
+ // Output Repositories
+ if ($type == "repo") {
+ echo "<table class=\"tabs_table $TEXT_DIRECTION width90\"><tr>";
+ $repo_list = get_repo_list(WT_GED_ID);
+ if ($repo_list) {
+ echo "<td class=\"list_value_wrap\"><ul>";
+ foreach ($repo_list as $repo) {
+ echo "<li><a href=\"javascript:;\" onclick=\"pasteid('", $repo->getXref(), "');\"><span class=\"list_item\">", $repo->getListName(), "&nbsp;&nbsp;&nbsp;";
+ echo WT_LPARENS.$repo->getXref().WT_RPARENS;
+ echo "</span></a></li>";
+ }
+ echo "</ul></td></tr>";
+ echo "<tr><td class=\"list_label\">", i18n::translate('Repositories found'), " ", count($repo_list);
+ echo "</td></tr>";
+ }
+ else {
+ echo "<tr><td class=\"list_value_wrap\">";
+ echo i18n::translate('No results found.');
+ echo "</td></tr>";
+ }
+ echo "</table>";
+ }
+
+ // Output Shared Notes
+ if ($type=="note") {
+ echo '<table class="tabs_table ', $TEXT_DIRECTION, ' width90">';
+ if ($filter) {
+ $mynotelist = search_notes($filter_array, array(WT_GED_ID), 'AND', true);
+ } else {
+ $mynotelist = get_note_list(WT_GED_ID);
+ }
+ if ($mynotelist) {
+ usort($mynotelist, array('GedcomRecord', 'Compare'));
+ echo '<tr><td class="list_value_wrap"><ul>';
+ foreach ($mynotelist as $note) {
+ echo '<li><a href="javascript:;" onclick="pasteid(\'', $note->getXref(), "', '", preg_replace("/(['\"])/", "\\$1", PrintReady($note->getListName())), '\'); return false;"><span class="list_item">', PrintReady($note->getListName()), '</span></a></li>';
+ }
+ echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Shared Notes found'), ' ', count($mynotelist), '</td></tr>';
+ }
+ else {
+ echo '<tr><td class="list_value_wrap">', i18n::translate('No results found.'), '</td></tr>';
+ }
+ echo '</table>';
+ }
+
+ // Output Sources
+ if ($type=="source") {
+ echo '<table class="tabs_table ', $TEXT_DIRECTION, ' width90">';
+ if ($filter) {
+ $mysourcelist = search_sources($filter_array, array(WT_GED_ID), 'AND', true);
+ } else {
+ $mysourcelist = get_source_list(WT_GED_ID);
+ }
+ if ($mysourcelist) {
+ usort($mysourcelist, array('GedcomRecord', 'Compare'));
+ echo '<tr><td class="list_value_wrap"><ul>';
+ foreach ($mysourcelist as $source) {
+ echo '<li><a href="javascript:;" onclick="pasteid(\'', $source->getXref(), "', '", preg_replace("/(['\"])/", "\\$1", PrintReady($source->getFullName())), '\'); return false;"><span class="list_item">', PrintReady($source->getFullName()), '</span></a></li>';
+ }
+ echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Total Sources'), ' ', count($mysourcelist), '</td></tr>';
+ }
+ else {
+ echo '<tr><td class="list_value_wrap">', i18n::translate('No results found.'), '</td></tr>';
+ }
+ echo '</table>';
+ }
+
+ // Output Special Characters
+ if ($type == "specialchar") {
+ echo "<table class=\"tabs_table $TEXT_DIRECTION width90\"><tr><td class=\"list_value center wrap\" dir=\"$TEXT_DIRECTION\"><br/>";
+ // lower case special characters
+ if ($magnify) {
+ echo '<span class="largechars">';
+ }
+ foreach($lcspecialchars as $key=>$value) {
+ $value = str_replace("'", "\'", $value);
+ echo "<a href=\"javascript:;\" onclick=\"return paste_char('$value', '$language_filter', '$magnify');\">";
+ echo $key;
+ echo "</span></a> ";
+ }
+ if ($magnify) {
+ echo '<span class="largechars">';
+ }
+ echo '<br/><br/>';
+ //upper case special characters
+ if ($magnify) {
+ echo '<span class="largechars">';
+ }
+ foreach($ucspecialchars as $key=>$value) {
+ $value = str_replace("'", "\'", $value);
+ echo "<a href=\"javascript:;\" onclick=\"return paste_char('$value', '$language_filter', '$magnify');\">";
+ echo $key;
+ echo "</span></a> ";
+ }
+ if ($magnify) {
+ echo '<span class="largechars">';
+ }
+ echo '<br/><br/>';
+ // other special characters (not letters)
+ if ($magnify) {
+ echo '<span class="largechars">';
+ }
+ foreach($otherspecialchars as $key=>$value) {
+ $value = str_replace("'", "\'", $value);
+ echo "<a href=\"javascript:;\" onclick=\"return paste_char('$value', '$language_filter', '$magnify');\">";
+ echo $key;
+ echo "</span></a> ";
+ }
+ if ($magnify) {
+ echo '<span class="largechars">';
+ }
+ echo '<br/><br/></td></tr></table>';
+ }
+}
+echo "</div>"; // Close div that centers table
+
+// Set focus to the input field
+echo WT_JS_START, 'document.filter', $type, '.filter.focus();', WT_JS_END;
+
+print_simple_footer();
+
+?>
diff --git a/modules/GEDFact_assistant/_CENS/census_3_search_add.php b/modules/GEDFact_assistant/_CENS/census_3_search_add.php
new file mode 100644
index 0000000000..caac54332a
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/census_3_search_add.php
@@ -0,0 +1,2282 @@
+<?php
+/**
+ * Census Assistant Control module for phpGedView
+ *
+ * Census Search and Add Area File
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2007 to 2010 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Module
+ * @version $Id$
+ * @author Brian Holland
+ */
+if (!defined('WT_WEBTREES')) {
+ header('HTTP/1.0 403 Forbidden');
+ exit;
+}
+?>
+
+
+ <table id="navenclose" class="optionbox" width="100%">
+ <?php
+
+ //-- Search Function ------------------------------------------------------------
+ ?>
+ <tr>
+ <td align="center" class="descriptionbox"><font size=1>Search for People to add:</font></td>
+ </tr>
+ <tr>
+ <td class="optionbox" >
+ <script>
+ function findindi(persid) {
+ var findInput = document.getElementById('personid');
+ txt = findInput.value;
+ if (txt=="") {
+ alert("<?php echo i18n::translate('You must enter a name'); ?>");
+ }else{
+ var win02 = window.open(
+ "module.php?mod=GEDFact_assistant&pgvaction=_CENS/census_3_find&callback=paste_id&action=filter&type=indi&multiple=&filter="+txt, "win02", "resizable=1, menubar=0, scrollbars=1, top=180, left=600, HEIGHT=400, WIDTH=450 ");
+ if (window.focus) {win02.focus();}
+ }
+ }
+ </script>
+ <?php
+ print "<input id=personid type=\"text\" size=\"20\" STYLE=\"color: #000000;\" value=\"\" />";
+ print "<a href=\"javascript: onclick=findindi()\">" ;
+ print "&nbsp;<font size=\"2\">&nbsp;Find</font>";
+ print '</a>';
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td style="border: 0px solid transparent;">
+ <br />
+ </td>
+ </tr>
+
+ <?php
+ //-- Add Family Members to Census -------------------------------------------
+ global $SHOW_ID_NUMBERS, $WT_IMAGE_DIR, $WT_IMAGES, $WT_MENUS_AS_LISTS;
+ global $spouselinks, $parentlinks, $DeathYr, $BirthYr;
+ global $TEXT_DIRECTION, $GEDCOM;
+ // echo "CENS = " . $censyear;
+ ?>
+
+ <tr>
+ <td align="center" style="border: 0px solid transparent;">
+ <table width="100%" class="fact_table" cellspacing="0" border="0">
+ <tr>
+ <td align="center" colspan=3 class="descriptionbox">
+ <font size=1>
+ <?php
+ // Header text with "Head" button =================================================
+ if (isset($WT_IMAGES["head"]["button"])) {
+ $headImg = "<img class=\"headimg vmiddle\" src=\"".$WT_IMAGE_DIR."/".$WT_IMAGES["head"]["button"]."\" />";
+ $headImg2 = "<img class=\"headimg2 vmiddle\" src=\"".$WT_IMAGE_DIR."/".$WT_IMAGES["head"]["button"]."\" alt=\"".i18n::translate('Click to choose person as Head of family.')."\" title=\"".i18n::translate('Click to choose person as Head of family.')."\" />";
+ } else {
+ $headImg = "<img class=\"headimg vmiddle\" src=\"images/buttons/head.gif\" />";
+ $headImg2 = "<img class=\"headimg2 vmiddle\" src=\"images/buttons/head.gif\" alt=\"".i18n::translate('Click to choose person as Head of family.')."\" title=\"".i18n::translate('Click to choose person as Head of family.')."\" />";
+ }
+ global $tempStringHead;
+ $tempStringHead = PrintReady($headImg);
+ echo i18n::translate('Click %s to choose person as Head of family.', $tempStringHead);
+ ?>
+ </font>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <font size=1><br /></font>
+ </td>
+ </tr>
+
+ <?php
+
+ //-- Parents Family ---------------------------------------------------
+
+ //-- Build Parents Family --------------------------------------
+ $personcount=0;
+ $families = $this->indi->getChildFamilies();
+ foreach($families as $famid=>$family) {
+ $label = $this->indi->getChildFamilyLabel($family);
+ $people = $this->buildFamilyList($family, "parents");
+ $marrdate = $family->getMarriageDate();
+
+ //-- Get Parents Children's Name, DOB, DOD --------------------------
+ if (isset($people["children"])) {
+ $chBLDarray = Array();
+ foreach ($people["children"] as $key=>$child) {
+ $chnam = $child->getAllNames();
+ $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname'];
+ $chfulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = addslashes($chfulln); // Child's Full Name
+ $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child's Date of Birth (Julian)
+ $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child's Date of Death (Julian)
+ $chBLD = ($chfulln.", ".$chdob.", ".$chdod);
+ array_push($chBLDarray, $chBLD);
+ }
+ }
+
+ //-- Parents Husband -------------------
+ $styleadd = "";
+ if (isset($people["husb"])) {
+
+ //-- Parents Husbands Parents --------------------------------------
+ $gparent=Person::getInstance($people["husb"]->getXref());
+ $fams = $gparent->getChildFamilies();
+ foreach($fams as $famid=>$family) {
+ if (!is_null($family)) {
+ $phusb = $family->getHusband($gparent);
+ $pwife = $family->getWife($gparent);
+ }
+ if ($phusb) { $HusbFBP = $phusb->getBirthPlace(); }
+ if ($pwife) { $HusbMBP = $pwife->getBirthPlace(); }
+ }
+
+ //-- Parents Husbands Details --------------------------------------
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $people["husb"]->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+ $menu = new Menu($people["husb"]->getLabel()."\n");
+ $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $people["husb"]->getLabel(), $censdate);
+ $slabel .= $parentlinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu);
+
+ ?>
+ <tr>
+ <td align="left" class="linkcell optionbox" width="25%">
+ <font size=1>
+ <?php
+ // print $people["husb"]->getLabel();
+ $menu->printMenu();
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value" style="text-decoration:none;" >
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}")."\">";
+ echo $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value" nowrap="nowrap">
+ <font size=1>
+ <?php
+ if ( ($people["husb"]->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:insertRowToTable("<?php
+ print PrintReady($people["husb"]->getXref()) ; // pid = PID
+ ?>", "<?php
+ echo addslashes($fulln); // nam = Full Name
+ ?>", "<?php
+ if (isset($nam[1])){
+ echo addslashes($fulmn); // mnam = Full Married Name
+ }else{
+ echo addslashes($fulln); // mnam = Full Name
+ }
+ ?>", "<?php
+ print PrintReady($people["husb"]->getLabel()); // label = Relationship
+ ?>", "<?php
+ print PrintReady($people["husb"]->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>=0){
+ echo "M"; // cond = Condition (Married)
+ }else{
+ echo "S"; // cond = Condition (Single)
+ }
+ ?>", "<?php
+ if ($marrdate) {
+ echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian)
+ }
+ ?>", "<?php
+ echo ($people["husb"]->getBirthDate()->minJD()+$people["husb"]->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian)
+ ?>", "<?php
+ print PrintReady($censyear-$people["husb"]->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ echo ($people["husb"]->getDeathDate()->minJD()+$people["husb"]->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian)
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($people["husb"]->getBirthPlace()); // birthpl = Husband Place of Birth
+ ?>", "<?php
+ if (isset($HusbFBP)) {
+ print PrintReady($HusbFBP); // fbirthpl = Husband Father's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // fbirthpl = Husband Father's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($HusbMBP)) {
+ print PrintReady($HusbMBP); // mbirthpl = Husband Mother's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // mbirthpl = Husband Mother's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($chBLDarray) && $people["husb"]->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ echo PrintReady($chBLDarray); // Array of Children (name, birthdate, deathdate)
+ } else {
+ echo PrintReady('');
+ }
+ ?>");'>
+ <?php
+ print PrintReady($people["husb"]->getFullName()); // Full Name (Link)
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ </tr>
+ <?php
+ }
+
+ //-- Parents Wife ---------------------------------------------------------
+ if (isset($people["wife"])) {
+
+ //-- Parents Wifes Parent Family ---------------------------
+ $gparent=Person::getInstance($people["wife"]->getXref());
+ $fams = $gparent->getChildFamilies();
+ foreach($fams as $famid=>$family) {
+ if (!is_null($family)) {
+ $phusb = $family->getHusband($gparent);
+ $pwife = $family->getWife($gparent);
+ }
+ if ($phusb) { $WifeFBP = $phusb->getBirthPlace(); }
+ if ($pwife) { $WifeMBP = $pwife->getBirthPlace(); }
+ }
+
+ //-- Wifes Details --------------------------------------
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $people["wife"]->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ // Get wifes married name if available
+ if (isset($people["husb"])) {
+ $husbnams = $people["husb"]->getAllNames();
+ if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") {
+ // Husband or his name is not known
+ } else {
+ $husbnam = $people["husb"]->getAllNames();
+ }
+ }
+ if (isset($nam[1]) && isset($husbnam)) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$husbnam[0]['surname'];
+ }else{
+ $fulmn = $fulln;
+ }
+ $menu = new Menu($people["wife"]->getLabel()."\n");
+ $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $people["wife"]->getLabel(), $censyear);
+ $slabel .= $parentlinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu);
+ ?>
+ <tr>
+ <td align="left" class="linkcell optionbox">
+ <font size=1>
+ <?php
+ //print $people["wife"]->getLabel();
+ $menu->printMenu();
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}")."\">";
+ print $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value" nowrap="nowrap">
+ <font size=1>
+ <?php
+ if ( ($people["wife"]->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:insertRowToTable("<?php
+ print $people["wife"]->getXref() ; // pid = PID
+ ?>", "<?php
+ echo addslashes($fulln); // nam = Full Name
+ ?>", "<?php
+ if (isset($nam[1])){
+ echo addslashes($fulmn); // mnam = Full Married Name
+ }else{
+ echo addslashes($fulln); // mnam = Full Name
+ }
+ ?>", "<?php
+ print PrintReady($people["wife"]->getLabel()); // label = Relationship
+ ?>", "<?php
+ print PrintReady($people["wife"]->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>=0 && isset($nam[1])){
+ echo "M"; // cond = Condition (Married)
+ }else{
+ echo "S"; // cond = Condition (Single)
+ }
+ ?>", "<?php
+ if ($marrdate) {
+ echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian)
+ }
+ ?>", "<?php
+ echo ($people["wife"]->getBirthDate()->minJD()+$people["wife"]->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian)
+ ?>", "<?php
+ print PrintReady($censyear-$people["wife"]->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ echo ($people["wife"]->getDeathDate()->minJD()+$people["wife"]->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian)
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($people["wife"]->getBirthPlace()); // birthpl = Wife Place of Birth
+ ?>", "<?php
+ if (isset($WifeFBP)) {
+ print PrintReady($WifeFBP); // fbirthpl = Wife Father's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // fbirthpl = Wife Father's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($WifeMBP)) {
+ print PrintReady($WifeMBP); // mbirthpl = Wife Mother's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // mbirthpl = Wife Mother's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($chBLDarray) && $people["wife"]->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ echo PrintReady($chBLDarray); // Array of Children (name, birthdate, deathdate)
+ } else {
+ echo PrintReady('');
+ }
+ ?>");'>
+ <?php
+ print PrintReady($people["wife"]->getFullName()); // Full Name (Link)
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ </tr>
+ <?php
+ }
+
+ //-- Parents Children -------------------
+ if (isset($people["children"])) {
+
+ //-- Parent's Children's Details --------------------------------------
+ $elderdate = $family->getMarriageDate();
+ foreach($people["children"] as $key=>$child) {
+
+ // Get Child's Children's Name DOB DOD ----
+ $chBLDarray=Array();
+ foreach ($child->getSpouseFamilies() as $childfamily) {
+ $chchildren = $childfamily->getChildren();
+ foreach ($chchildren as $key=>$chchild) {
+ $chnam = $chchild->getAllNames();
+ $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname'];
+ $chfulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = addslashes($chfulln); // Child's Full Name// Child's Full Name
+ $chdob = ($chchild->getBirthDate()->minJD()+$chchild->getBirthDate()->maxJD())/2; // Child's Date of Birth (Julian)
+ $chdod = ($chchild->getDeathDate()->minJD()+$chchild->getDeathDate()->maxJD())/2; // Child's Date of Death (Julian)
+ $chBLD = ($chfulln.", ".$chdob.", ".$chdod);
+ array_push($chBLDarray, $chBLD);
+ }
+ }
+
+ // Get child's marriage status ----
+ $married="";
+ $marrdate="";
+ foreach ($child->getSpouseFamilies() as $childfamily) {
+ $marrdate=$childfamily->getMarriageDate();
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ }
+ $nam = $child->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+
+ $menu = new Menu($child->getLabel()."\n");
+ $slabel = print_pedigree_person_nav2($child->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $child->getLabel(), $censyear);
+ $slabel .= $spouselinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu);
+
+ if ($child->getXref()==$pid) {
+ //Only print Head of Family in Immediate Family Block
+ } else {
+ ?>
+ <tr>
+ <td align="left" class="linkcell optionbox">
+ <font size=1>
+ <?php
+ if ($child->getXref()==$pid) {
+ print $child->getLabel();
+ }else{
+ $menu->printMenu();
+ }
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}")."\">";
+ print $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value" nowrap="nowrap">
+ <font size=1>
+ <?php
+ if ( ($child->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:insertRowToTable("<?php
+ print $child->getXref(); // pid = PID
+ ?>", "<?php
+ echo addslashes($fulln); // nam = Full Name
+ ?>", "<?php
+ if (isset($nam[1])){
+ echo addslashes($fulmn); // mnam = Full Married Name
+ }else{
+ echo addslashes($fulln); // mnam = Full Name
+ }
+ ?>", "<?php
+ if ($child->getXref()==$pid) {
+ print "Head"; // label = Head
+ }else{
+ print PrintReady($child->getLabel()); // label = Relationship
+ }
+ ?>", "<?php
+ print PrintReady($child->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>0) {
+ echo "M"; // cond = Condition (Married)
+ } else if ($married<0 || ($married=="0") ) {
+ echo "S"; // cond = Condition (Single)
+ } else {
+ echo ""; // cond = Condition (Not Known)
+ }
+ ?>", "<?php
+ if ($marrdate) {
+ echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian)
+ }
+ ?>", "<?php
+ echo ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian)
+ ?>", "<?php
+ print PrintReady($censyear-$child->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ echo ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian)
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($child->getBirthPlace()); // birthpl = Child Place of Birt
+ ?>", "<?php
+ if (isset($people["husb"])) {
+ print PrintReady($people["husb"]->getBirthPlace()); // fbirthpl = Child Father's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // fbirthpl = Child Father's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($people["wife"])) {
+ print PrintReady($people["wife"]->getBirthPlace()); // mbirthpl = Child Mother's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // mbirthpl = Child Mother's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($chBLDarray) && $child->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ echo PrintReady($chBLDarray); // Array of Children (name, birthdate, deathdate)
+ } else {
+ echo PrintReady('');
+ }
+ ?>");'>
+ <?php
+ print PrintReady($child->getFullName()); // Full Name (Link)
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ </tr>
+ <?php
+ }
+ }
+ $elderdate = $child->getBirthDate(false);
+ }
+ }
+
+ //-- Step families ---------------------------------------------------------
+
+ //-- Build step families ---------------------------------------------------
+ foreach($this->indi->getStepFamilies() as $famid=>$family) {
+ $label = $this->indi->getStepFamilyLabel($family);
+ $people = $this->buildFamilyList($family, "step");
+ if ($people){
+ echo "<tr><td><br /></td><td></td></tr>";
+ }
+ $marrdate = $family->getMarriageDate();
+
+ //-- Get Children's Name, DOB, DOD --------------------------
+ if (isset($people["children"])) {
+ $chBLDarray = Array();
+ foreach ($people["children"] as $key=>$child) {
+ $chnam = $child->getAllNames();
+ $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname'];
+ $chfulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = addslashes($chfulln); // Child's Full Name
+ $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child's Date of Birth (Julian)
+ $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child's Date of Death (Julian)
+ $chBLD = ($chfulln.", ".$chdob.", ".$chdod);
+ array_push($chBLDarray, $chBLD);
+ }
+ }
+
+ // Step Husband -----------------------------
+ $styleadd = "";
+ $elderdate = "";
+ if (isset($people["husb"])) {
+
+ //-- Step Husbands Parent Family --------------------------------------
+ $gparent=Person::getInstance($people["husb"]->getXref());
+ $fams = $gparent->getChildFamilies();
+ foreach($fams as $famid=>$family) {
+ if (!is_null($family)) {
+ $phusb = $family->getHusband($gparent);
+ $pwife = $family->getWife($gparent);
+ }
+ if ($phusb) { $HusbFBP = $phusb->getBirthPlace(); }
+ if ($pwife) { $HusbMBP = $pwife->getBirthPlace(); }
+ }
+
+ //-- Step Husbands Details --------------------------------------
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $people["husb"]->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+ $menu = new Menu();
+ if ($people["husb"]->getLabel() == ".") {
+ $menu->addLabel(i18n::translate('Step-Father')."\n");
+ }else{
+ $menu->addLabel($people["husb"]->getLabel()."\n");
+ }
+ $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $people["husb"]->getLabel(), $censyear);
+ $slabel .= $parentlinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu);
+ if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["husb"]->getDeathYear()); }
+ if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["husb"]->getBirthYear()); }
+ ?>
+ <tr>
+ <td align="left" class="linkcell optionbox">
+ <font size=1>
+ <?php
+ $menu->printMenu();
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}")."\">";
+ print $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value" nowrap="nowrap">
+ <font size=1>
+ <?php
+ if ( ($people["husb"]->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:insertRowToTable("<?php
+ print PrintReady($people["husb"]->getXref()); // pid = PID
+ ?>", "<?php
+ echo addslashes($fulln); // nam = Full Name
+ ?>", "<?php
+ if (isset($nam[1])){
+ echo addslashes($fulmn); // mnam = Full Married Name
+ }else{
+ echo addslashes($fulln); // mnam = Full Name
+ }
+ ?>", "<?php
+ if ($people["husb"]->getLabel() == ".") {
+ print PrintReady(i18n::translate('Step-Father')); // label = Relationship
+ }else{
+ print PrintReady($people["husb"]->getLabel()); // label = Relationship
+ }
+ ?>", "<?php
+ print PrintReady($people["husb"]->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>=0){
+ echo "M"; // cond = Condition (Married)
+ }else{
+ echo "S"; // cond = Condition (Single)
+ }
+ ?>", "<?php
+ if ($marrdate) {
+ echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian)
+ }
+ ?>", "<?php
+ echo ($people["husb"]->getBirthDate()->minJD()+$people["husb"]->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian)
+ ?>", "<?php
+ print PrintReady($censyear-$people["husb"]->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ echo ($people["husb"]->getDeathDate()->minJD()+$people["husb"]->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian)
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($people["husb"]->getBirthPlace()); // birthpl = Step Husband Place of Birth
+ ?>", "<?php
+ if (isset($HusbFBP)) {
+ print PrintReady($HusbFBP); // fbirthpl = Step Husband Father's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // fbirthpl = Step Husband Father's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($HusbMBP)) {
+ print PrintReady($HusbMBP); // mbirthpl = Step Husband Mother's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // mbirthpl = Step Husband Mother's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($chBLDarray) && $people["husb"]->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ echo PrintReady($chBLDarray); // Array of Children (name, birthdate, deathdate)
+ } else {
+ echo PrintReady('');
+ }
+ ?>");'>
+ <?php
+ print PrintReady($people["husb"]->getFullName()); // Full Name (Link)
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ </tr>
+ <?php
+ $elderdate = $people["husb"]->getBirthDate(false);
+ }
+
+ // Step Wife -------------------
+ $styleadd = "";
+ if (isset($people["wife"])) {
+
+ //-- Step Wifes Parent Family --------------------------------------
+ $gparent=Person::getInstance($people["wife"]->getXref());
+ $fams = $gparent->getChildFamilies();
+ foreach($fams as $famid=>$family) {
+ if (!is_null($family)) {
+ $phusb = $family->getHusband($gparent);
+ $pwife = $family->getWife($gparent);
+ }
+ if ($phusb) { $WifeFBP = $phusb->getBirthPlace(); }
+ if ($pwife) { $WifeMBP = $pwife->getBirthPlace(); }
+ }
+
+ //-- Step Wifes Details --------------------------------------
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $people["wife"]->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ // Get wifes married name if available
+ if (isset($people["husb"])){
+ $husbnams = $people["husb"]->getAllNames();
+ if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") {
+ // Husband or his name is not known
+ } else {
+ $husbnam = $people["husb"]->getAllNames();
+ }
+ }
+ if (isset($nam[1]) && isset($husbnam)) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$husbnam[0]['surname'];
+ }else{
+ $fulmn = $fulln;
+ }
+ $menu = new Menu();
+ if ($people["wife"]->getLabel() == ".") {
+ $menu->addLabel(i18n::translate('Step-Mother')."\n");
+ }else{
+ $menu->addLabel($people["wife"]->getLabel()."\n");
+ }
+ $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $people["wife"]->getLabel(), $censyear);
+ $slabel .= $parentlinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu);
+ if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["wife"]->getDeathYear()); }
+ if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["wife"]->getBirthYear()); }
+ ?>
+ <tr>
+ <td align="left" class="linkcell optionbox">
+ <font size=1>
+ <?php
+ $menu->printMenu();
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}")."\">";
+ print $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value" nowrap="nowrap">
+ <font size=1>
+ <?php
+ if ( ($people["wife"]->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:insertRowToTable("<?php
+ print PrintReady($people["wife"]->getXref()) ; // pid = PID
+ ?>", "<?php
+ echo addslashes($fulln); // nam = Full Name
+ ?>", "<?php
+ if (isset($nam[1])){
+ echo addslashes($fulmn); // mnam = Full Married Name
+ }else{
+ echo addslashes($fulln); // mnam = Full Name
+ }
+ ?>", "<?php
+ if ($people["wife"]->getLabel() == ".") {
+ print PrintReady(i18n::translate('Step-Mother')); // label = Relationship
+ }else{
+ print PrintReady($people["wife"]->getLabel()); // label = Relationship
+ }
+ ?>", "<?php
+ print PrintReady($people["wife"]->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>=0 && isset($nam[1])){
+ echo "M"; // cond = Condition (Married)
+ }else{
+ echo "S"; // cond = Condition (Single)
+ }
+ ?>", "<?php
+ if ($marrdate) {
+ echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian)
+ }
+ ?>", "<?php
+ echo ($people["wife"]->getBirthDate()->minJD()+$people["wife"]->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian)
+ ?>", "<?php
+ print PrintReady($censyear-$people["wife"]->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ echo ($people["wife"]->getDeathDate()->minJD()+$people["wife"]->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian)
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($people["wife"]->getBirthPlace()); // birthpl = Step Wife Place of Birth
+ ?>", "<?php
+ if (isset($WifeFBP)) {
+ print PrintReady($WifeFBP); // fbirthpl = Step Wife Father's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // fbirthpl = Step Wife Father's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($WifeMBP)) {
+ print PrintReady($WifeMBP); // mbirthpl = Step Wife Mother's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // mbirthpl = Step Wife Mother's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($chBLDarray) && $people["wife"]->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ echo PrintReady($chBLDarray); // Array of Children (name, birthdate, deathdate)
+ } else {
+ echo PrintReady('');
+ }
+ ?>");'>
+ <?php
+ print PrintReady($people["wife"]->getFullName()); // Full Name (Link)
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ </tr>
+ <?php
+ }
+
+ // Step Children ---------------------
+ $styleadd = "";
+ if (isset($people["children"])) {
+ $elderdate = $family->getMarriageDate();
+ foreach($people["children"] as $key=>$child) {
+
+ // Get Child's Children
+ $chBLDarray=Array();
+ foreach ($child->getSpouseFamilies() as $childfamily) {
+ $chchildren = $childfamily->getChildren();
+ foreach ($chchildren as $key=>$chchild) {
+ $chnam = $chchild->getAllNames();
+ $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname'];
+ $chfulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = addslashes($chfulln); // Child's Full Name
+ $chdob = ($chchild->getBirthDate()->minJD()+$chchild->getBirthDate()->maxJD())/2; // Child's Date of Birth (Julian)
+ $chdod = ($chchild->getDeathDate()->minJD()+$chchild->getDeathDate()->maxJD())/2; // Child's Date of Death (Julian)
+ $chBLD = ($chfulln.", ".$chdob.", ".$chdod);
+ array_push($chBLDarray, $chBLD);
+ }
+ }
+
+ $nam = $child->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+ $menu = new Menu($child->getLabel()."\n");
+ $slabel = print_pedigree_person_nav2($child->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $child->getLabel(), $censyear);
+ $slabel .= $spouselinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu);
+ if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($child->getDeathYear()); }
+ if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($child->getBirthYear()); }
+ ?>
+ <tr>
+ <td align="left" class="linkcell optionbox">
+ <font size=1>
+ <?php
+ $menu->printMenu();
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}")."\">";
+ print $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value" nowrap="nowrap">
+ <font size=1>
+ <?php
+ if ( ($child->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:insertRowToTable("<?php
+ print PrintReady($child->getXref()) ; // pid = PID
+ ?>", "<?php
+ echo addslashes($fulln); // nam = Full Name
+ ?>", "<?php
+ if (isset($nam[1])){
+ echo addslashes($fulmn); // mnam = Full Married Name
+ }else{
+ echo addslashes($fulln); // mnam = Full Name
+ }
+ ?>", "<?php
+ print PrintReady($child->getLabel()); // label = Relationship
+ ?>", "<?php
+ print PrintReady($child->getSex()); // gend = Gender
+ ?>", "<?php
+ print ""; // cond = Condition (Married or Single)
+ ?>", "<?php
+ if ($marrdate) {
+ echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian)
+ }
+ ?>", "<?php
+ echo ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian)
+ ?>", "<?php
+ print PrintReady($censyear-$child->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ echo ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian)
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($child->getBirthPlace()); // birthpl = Child Place of Birth
+ ?>", "<?php
+ if (isset($people["husb"])) {
+ print PrintReady($people["husb"]->getBirthPlace()); // fbirthpl = Child Father's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // fbirthpl = Child Father's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($people["wife"])) {
+ print PrintReady($people["wife"]->getBirthPlace()); // mbirthpl = Child Mother's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // mbirthpl = Child Mother's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($chBLDarray) && $child->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ echo PrintReady($chBLDarray); // Array of Children (name, birthdate, deathdate)
+ } else {
+ echo PrintReady('');
+ }
+ ?>");'>
+ <?php
+ print PrintReady($child->getFullName()); // Full Name (Link)
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ </tr>
+ <?php
+ //$elderdate = $child->getBirthDate(false);
+ }
+ }
+ }
+
+ print "<tr><td><font size=1><br /></font></td></tr>";
+
+ //-- Build Spouse Family ---------------------------------------------------
+ $families = $this->indi->getSpouseFamilies();
+ //$personcount = 0;
+ foreach($families as $famid=>$family) {
+ $people = $this->buildFamilyList($family, "spouse");
+ if ($this->indi->equals($people["husb"])) {
+ $spousetag = 'WIFE';
+ }else{
+ $spousetag = 'HUSB';
+ }
+ $marrdate = $family->getMarriageDate();
+
+ //-- Get Children's Name, DOB, DOD --------------------------
+ if (isset($people["children"])) {
+ $chBLDarray = Array();
+ foreach ($people["children"] as $key=>$child) {
+ $chnam = $child->getAllNames();
+ $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname'];
+ $chfulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = addslashes($chfulln); // Child's Full Name
+ $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child's Date of Birth (Julian)
+ $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child's Date of Death (Julian)
+ $chBLD = ($chfulln.", ".$chdob.", ".$chdod);
+ array_push($chBLDarray, $chBLD);
+ }
+ }
+
+ //-- Spouse Husband ---------------------------------------------------
+ if ( isset($people["husb"])) {
+
+ //-- Spouse Husbands Parents --------------------------------------
+ $gparent=Person::getInstance($people["husb"]->getXref());
+ $fams = $gparent->getChildFamilies();
+ foreach($fams as $famid=>$family) {
+ if (!is_null($family)) {
+ $phusb = $family->getHusband($gparent);
+ $pwife = $family->getWife($gparent);
+ }
+ if ($phusb) { $HusbFBP = $phusb->getBirthPlace(); }
+ if ($pwife) { $HusbMBP = $pwife->getBirthPlace(); }
+ }
+
+ //-- Spouse Husbands Details --------------------------------------
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $people["husb"]->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+ $menu = new Menu($people["husb"]->getLabel()."\n");
+ $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $people["husb"]->getLabel(), $censyear);
+ $slabel .= $parentlinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu);
+ if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["husb"]->getDeathYear()); }
+ if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["husb"]->getBirthYear()); }
+ ?>
+ <tr class="fact_value">
+ <td align="left" nowrap="nowrap" class="linkcell optionbox<?php print $styleadd; ?>">
+ <font size=1>
+ <?php
+ if ($people["husb"]->getXref()==$pid) {
+ print "&nbsp" .($people["husb"]->getLabel());
+ }else{
+ $menu->printMenu();
+ }
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}")."\">";
+ print $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value" nowrap="nowrap">
+ <font size=1>
+ <?php
+ if ( ($people["husb"]->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:insertRowToTable("<?php
+ print $people["husb"]->getXref() ; // pid = PID
+ ?>", "<?php
+ echo addslashes($fulln); // nam = Full Name
+ ?>", "<?php
+ if (isset($nam[1])){
+ echo addslashes($fulmn); // mnam = Full Married Name
+ }else{
+ echo addslashes($fulln); // mnam = Full Name
+ }
+ ?>", "<?php
+ if ($people["husb"]->getXref()==$pid) {
+ print "Head"; // label = Relationship
+ }else{
+ print $people["husb"]->getLabel(); // label = Relationship
+ }
+ ?>", "<?php
+ print PrintReady($people["husb"]->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>=0){
+ echo "M"; // cond = Condition (Married)
+ }else{
+ echo "S"; // cond = Condition (Single)
+ }
+ ?>", "<?php
+ if ($marrdate) {
+ echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian)
+ }
+ ?>", "<?php
+ echo ($people["husb"]->getBirthDate()->minJD()+$people["husb"]->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian)
+ ?>", "<?php
+ print PrintReady($censyear-$people["husb"]->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ echo ($people["husb"]->getDeathDate()->minJD()+$people["husb"]->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian)
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($people["husb"]->getBirthPlace()); // birthpl = Husband Place of Birth
+ ?>", "<?php
+ if (isset($HusbFBP)) {
+ print PrintReady($HusbFBP); // fbirthpl = Husband Father's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // fbirthpl = Husband Father's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($HusbMBP)) {
+ print PrintReady($HusbMBP); // mbirthpl = Husband Mother's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // mbirthpl = Husband Mother's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($chBLDarray) && $people["husb"]->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ echo PrintReady($chBLDarray); // Array of Children (name, birthdate, deathdate)
+ } else {
+ echo PrintReady('');
+ }
+ ?>");'>
+ <?php
+ print PrintReady($people["husb"]->getFullName()); // Full Name (Link)
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ <tr>
+ <?php
+ }
+
+ //-- Spouse Wife -----------------------------------------------------
+ if (isset($people["wife"])) {
+
+ //-- Spouse Wifes Parents --------------------------------------
+ $gparent=Person::getInstance($people["wife"]->getXref());
+ $fams = $gparent->getChildFamilies();
+ foreach($fams as $famid=>$family) {
+ if (!is_null($family)) {
+ $husb = $family->getHusband($gparent);
+ $wife = $family->getWife($gparent);
+ }
+ if ($husb) { $WifeFBP = $husb->getBirthPlace(); }
+ if ($wife) { $WifeMBP = $wife->getBirthPlace(); }
+ }
+
+ //-- Spouse Wifes Details --------------------------------------
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $people["wife"]->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ //$fulln = str_replace('"', '\"', $fulln);
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ // Get wifes married name if available
+ if (isset($people["husb"])){
+ $husbnams = $people["husb"]->getAllNames();
+ if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") {
+ // Husband or his name is not known
+ } else {
+ $husbnam = $people["husb"]->getAllNames();
+ }
+ }
+ if (isset($nam[1]) && isset($husbnam)) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$husbnam[0]['surname'];
+ //$fulmn = str_replace('"', '\"', $fulmn);
+ }else{
+ $fulmn = $fulln;
+ //$fulmn = str_replace('"', '\"', $fulmn);
+ }
+ $menu = new Menu($people["wife"]->getLabel()."\n");
+ $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $people["wife"]->getLabel(), $censyear);
+ $slabel .= $parentlinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu);
+ if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["wife"]->getDeathYear()); }
+ if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["wife"]->getBirthYear()); }
+ ?>
+ <tr>
+ <td align="left" nowrap="nowrap" class="linkcell optionbox<?php print $styleadd; ?>">
+ <font size=1>
+ <?php
+ if ($people["wife"]->getXref()==$pid) {
+ print "&nbsp" .($people["wife"]->getLabel());
+ }else{
+ $menu->printMenu();
+ }
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}")."\">";
+ print $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value" nowrap="nowrap">
+ <font size=1>
+ <?php
+ if ( ($people["wife"]->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:insertRowToTable("<?php
+ print $people["wife"]->getXref() ; // pid = PID
+ ?>", "<?php
+ echo addslashes($fulln); // nam = Full Name
+ ?>", "<?php
+ if (isset($nam[1])){
+ echo addslashes($fulmn); // mnam = Full Married Name
+ }else{
+ echo addslashes($fulln); // mnam = Full Name
+ }
+ ?>", "<?php
+ if ($people["wife"]->getXref()==$pid) {
+ print "Head"; // label = Head
+ }else{
+ print PrintReady($people["wife"]->getLabel()); // label = Relationship
+ }
+ ?>", "<?php
+ print PrintReady($people["wife"]->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>=0 && isset($nam[1])){
+ echo "M"; // cond = Condition (Married)
+ }else{
+ echo "S"; // cond = Condition (Single)
+ }
+ ?>", "<?php
+ if ($marrdate) {
+ echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian)
+ }
+ ?>", "<?php
+ echo ($people["wife"]->getBirthDate()->minJD()+$people["wife"]->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian)
+ ?>", "<?php
+ print PrintReady($censyear-$people["wife"]->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ echo ($people["wife"]->getDeathDate()->minJD()+$people["wife"]->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian)
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($people["wife"]->getBirthPlace()); // birthpl = Wife Place of Birth
+ ?>", "<?php
+ if (isset($WifeFBP)) {
+ print PrintReady($WifeFBP); // fbirthpl = Wife Father's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // fbirthpl = Wife Father's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($WifeMBP)) {
+ print PrintReady($WifeMBP); // mbirthpl = Wife Mother's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // mbirthpl = Wife Mother's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($chBLDarray) && $people["wife"]->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ echo PrintReady($chBLDarray); // Array of Children (name, birthdate, deathdate)
+ } else {
+ echo PrintReady('');
+ }
+ ?>");'>
+ <?php
+ print PrintReady($people["wife"]->getFullName()); // Full Name (Link)
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ <tr> <?php
+ }
+
+ // Spouse Children
+ foreach($people["children"] as $key=>$child) {
+
+ // Get Spouse child's marriage status
+ $married="";
+ $marrdate="";
+ foreach ($child->getSpouseFamilies() as $childfamily) {
+ $marrdate=$childfamily->getMarriageDate();
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ }
+
+ // Get Child's Children
+ $chBLDarray=Array();
+ foreach ($child->getSpouseFamilies() as $childfamily) {
+ $chchildren = $childfamily->getChildren();
+ foreach ($chchildren as $key=>$chchild) {
+ $chnam = $chchild->getAllNames();
+ $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname'];
+ $chfulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = addslashes($chfulln); // Child's Full Name// Child's Full Name
+ $chdob = ($chchild->getBirthDate()->minJD()+$chchild->getBirthDate()->maxJD())/2; // Child's Date of Birth (Julian)
+ $chdod = ($chchild->getDeathDate()->minJD()+$chchild->getDeathDate()->maxJD())/2; // Child's Date of Death (Julian)
+ $chBLD = ($chfulln.", ".$chdob.", ".$chdod);
+ array_push($chBLDarray, $chBLD);
+ }
+ }
+
+ // Get Spouse child's details
+ $nam = $child->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }else{
+ $fulmn = $fulln;
+ $marn = $surn;
+ }
+ $menu = new Menu($child->getLabel()."\n");
+ $slabel = print_pedigree_person_nav2($child->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $child->getLabel(), $censyear);
+ $slabel .= $spouselinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubmenu($submenu);
+ ?>
+ <tr>
+ <td align="left" class="linkcell optionbox">
+ <font size=1>
+ <?php if ($WT_MENUS_AS_LISTS) echo "<ul>\n";
+ $menu->printMenu();
+ if ($WT_MENUS_AS_LISTS) echo "</ul>\n";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addnewnote_assisted&noteid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}")."\">";
+ print $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value" nowrap="nowrap">
+ <font size=1>
+ <?php
+ if ( ($child->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:insertRowToTable("<?php
+ print $child->getXref() ; // pid = PID
+ ?>", "<?php
+ echo addslashes($fulln); // nam = Full Name
+ ?>", "<?php
+ if (isset($nam[1])){
+ echo addslashes($fulmn); // mnam = Full Married Name
+ }else{
+ echo addslashes($fulln); // mnam = Full Name
+ }
+ ?>", "<?php
+ print PrintReady($child->getLabel()); // label = Relationship
+ ?>", "<?php
+ print PrintReady($child->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>0) {
+ echo "M"; // cond = Condition (Married)
+ } else if ($married<0 || ($married=="0") ) {
+ echo "S"; // cond = Condition (Single)
+ } else {
+ echo ""; // cond = Condition (Not Known)
+ }
+ ?>", "<?php
+ if ($marrdate) {
+ echo ($marrdate->minJD()+$marrdate->maxJD())/2; // dom = Date of Marriage (Julian)
+ }
+ ?>", "<?php
+ echo ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // dob = Date of Birth (Julian)
+ ?>", "<?php
+ print PrintReady($censyear-$child->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ echo ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // dod = Date of Death (Julian)
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($child->getBirthPlace()); // birthpl = Child Place of Birth
+ ?>", "<?php
+ if (isset($people["husb"])) {
+ print PrintReady($people["husb"]->getBirthPlace()); // fbirthpl = Child Father's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // fbirthpl = Child Father's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($people["wife"])) {
+ print PrintReady($people["wife"]->getBirthPlace()); // mbirthpl = Child Mother's Place of Birth
+ } else {
+ print PrintReady('UNK, UNK, UNK, UNK'); // mbirthpl = Child Mother's Place of Birth Not known
+ }
+ ?>", "<?php
+ if (isset($chBLDarray) && $child->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ echo PrintReady($chBLDarray); // Array of Children (name, birthdate, deathdate)
+ } else {
+ echo PrintReady('');
+ }
+ ?>");'>
+ <?php
+ print PrintReady($child->getFullName()); // Full Name (Link)
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ </tr>
+ <?php
+ }
+
+ print "<tr><td><font size=1><br /></font></td></tr>";
+ }
+ ?>
+
+ </table>
+ <br /><br /><br />&nbsp;</td>
+ </tr>
+ </table>
+
+<?php
+// ==================================================================
+require_once 'includes/functions/functions_charts.php';
+/**
+ * print the information for an individual chart box
+ *
+ * find and print a given individuals information for a pedigree chart
+ * @param string $pid the Gedcom Xref ID of the to print
+ * @param int $style the style to print the box in, 1 for smaller boxes, 2 for larger boxes
+ * @param boolean $show_famlink set to true to show the icons for the popup links and the zoomboxes
+ * @param int $count on some charts it is important to keep a count of how many boxes were printed
+ */
+
+function print_pedigree_person_nav2($pid, $style=1, $show_famlink=true, $count=0, $personcount="1", $currpid, $censyear) {
+ global $HIDE_LIVE_PEOPLE, $SHOW_LIVING_NAMES, $ZOOM_BOXES, $LINK_ICONS, $SCRIPT_NAME, $GEDCOM;
+ global $MULTI_MEDIA, $SHOW_HIGHLIGHT_IMAGES, $bwidth, $bheight, $PEDIGREE_FULL_DETAILS, $SHOW_ID_NUMBERS, $SHOW_PEDIGREE_PLACES;
+ global $CONTACT_EMAIL, $CONTACT_METHOD, $TEXT_DIRECTION, $DEFAULT_PEDIGREE_GENERATIONS, $OLD_PGENS, $talloffset, $PEDIGREE_LAYOUT, $MEDIA_DIRECTORY;
+ global $WT_IMAGE_DIR, $WT_IMAGES, $ABBREVIATE_CHART_LABELS, $USE_MEDIA_VIEWER;
+ global $chart_style, $box_width, $generations, $show_spouse, $show_full;
+ global $CHART_BOX_TAGS, $SHOW_LDS_AT_GLANCE, $PEDIGREE_SHOW_GENDER;
+ global $SEARCH_SPIDER;
+
+ global $spouselinks, $parentlinks, $step_parentlinks, $persons, $person_step, $person_parent, $tabno, $theme_name, $spousetag;
+ global $natdad, $natmom, $censyear, $censdate;
+ // global $pHusbFBP, $pHusbMBP, $pWifeFBP, $pWifeMBP;
+ // global $phusb, $pwife, $pwhusb, $pwwife;
+
+ if ($style != 2) $style=1;
+ if (empty($show_full)) $show_full = 0;
+ if (empty($PEDIGREE_FULL_DETAILS)) $PEDIGREE_FULL_DETAILS = 0;
+
+ if (!isset($OLD_PGENS)) $OLD_PGENS = $DEFAULT_PEDIGREE_GENERATIONS;
+ if (!isset($talloffset)) $talloffset = $PEDIGREE_LAYOUT;
+
+ $person=Person::getInstance($pid);
+ if ($pid==false || empty($person)) {
+ $spouselinks = false;
+ $parentlinks = false;
+ $step_parentlinks = false;
+ }
+
+ $tmp=array('M'=>'','F'=>'F', 'U'=>'NN');
+ $isF=$tmp[$person->getSex()];
+ $spouselinks = "";
+ $parentlinks = "";
+ $step_parentlinks = "";
+ $disp=$person->canDisplayDetails();
+
+ if ($person->canDisplayName()) {
+ if ($show_famlink && (empty($SEARCH_SPIDER))) {
+ if ($LINK_ICONS!="disabled") {
+ //-- draw a box for the family popup
+
+ if ($TEXT_DIRECTION=="rtl") {
+ $spouselinks .= "\n\t\t\t<table class=\"rtlnav person_box$isF\"><tr><td align=\"right\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">";
+ $spouselinks .= "<b>" . i18n::translate('Family') . "</b> (" .$person->getFullName(). ")<br />";
+ $parentlinks .= "\n\t\t\t<table class=\"rtlnav person_box$isF\"><tr><td align=\"right\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">";
+ $parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />";
+ $step_parentlinks .= "\n\t\t\t<table class=\"rtlnav person_box$isF\"><tr><td align=\"right\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">";
+ $step_parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />";
+ }else{
+ $spouselinks .= "\n\t\t\t<table class=\"ltrnav person_box$isF\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">";
+ $spouselinks .= "<b>" . i18n::translate('Family') . "</b> (" .$person->getFullName(). ")<br />";
+ $parentlinks .= "\n\t\t\t<table class=\"ltrnav person_box$isF\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">";
+ $parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />";
+ $step_parentlinks .= "\n\t\t\t<table class=\"ltrnav person_box$isF\"><tr><td align=\"left\" style=\"font-size:10px;font-weight:normal;\" class=\"name2\" nowrap=\"nowrap\">";
+ $step_parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />";
+ }
+
+ $persons = "";
+ $person_parent = "";
+ $person_step = "";
+
+ //-- Parent families --------------------------------------
+ $fams = $person->getChildFamilies();
+ foreach($fams as $famid=>$family) {
+ $marrdate = $family->getMarriageDate();
+ $married = GedcomDate::Compare($censdate, $marrdate);
+
+ if (!is_null($family)) {
+ $husb = $family->getHusband($person);
+ $wife = $family->getWife($person);
+ $children = $family->getChildren();
+ $num = count($children);
+ $marrdate = $family->getMarriageDate();
+
+ //-- Get Parent Children's Name, DOB, DOD --------------------------
+ if (isset($children)) {
+ $chBLDarray = Array();
+ foreach ($children as $key=>$child) {
+ $chnam = $child->getAllNames();
+ $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname'];
+ $chfulln = str_replace('"', "", $chfulln); // Must remove quotes completely here
+ $chfulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $chfulln); // Child's Full Name
+ $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child's Date of Birth (Julian)
+ $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child's Date of Death (Julian)
+ $chBLD = ($chfulln.", ".$chdob.", ".$chdod);
+ array_push($chBLDarray, $chBLD);
+ }
+ }
+
+ //-- Parent Husband ------------------------------
+ if ($husb || $num>0) {
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Family Book Chart').": ".$famid;
+ }else{
+ $title = $famid." :".i18n::translate('Family Book Chart');
+ }
+ if ($husb) {
+ //-- Parent Husbands Parents ----------------------
+ $gparent=Person::getInstance($husb->getXref());
+ $parfams = $gparent->getChildFamilies();
+ foreach($parfams as $famid=>$pfamily) {
+ if (!is_null($pfamily)) {
+ $phusb = $pfamily->getHusband($gparent);
+ $pwife = $pfamily->getWife($gparent);
+ }
+ if ($phusb) { $pHusbFBP = $phusb->getBirthPlace(); }
+ if ($pwife) { $pHusbMBP = $pwife->getBirthPlace(); }
+ }
+ //-- Parent Husbands Details ----------------------
+ $person_parent="Yes";
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Individual Information').": ".$husb->getXref();
+ }else{
+ $title = $husb->getXref()." :".i18n::translate('Individual Information');
+ }
+ $tmp=$husb->getXref();
+ if ($husb->canDisplayName()) {
+ $nam = $husb->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surn'];
+ if (isset($nam[1]) ) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surn'];
+ $marn = $nam[1]['surn'];
+ }
+ $parentlinks .= "<a class=\"linka\" href=\"javascript:insertRowToTable(";
+ $parentlinks .= "'".PrintReady($husb->getXref())."',"; // pid = PID
+ $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // nam = Name
+ if (isset($nam[1])){
+ $parentlinks .= "'".addslashes(strip_tags($fulmn))."',"; // mnam = Full Married Name
+ } else {
+ $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // mnam = Full Name
+ }
+ if ($currpid=="Wife" || $currpid=="Husband") {
+ $parentlinks .= "'Father in Law',"; // label = 1st Gen Male Relationship
+ }else{
+ $parentlinks .= "'Grand-Father',"; // label = 2st Gen Male Relationship
+ }
+ $parentlinks .= "'".PrintReady($husb->getSex())."',"; // sex = Gender
+ $parentlinks .= "''".","; // cond = Condition (Married etc)
+ if ($marrdate) {
+ $parentlinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian)
+ }
+ $parentlinks .= "'".(($husb->getBirthDate()->minJD()+$husb->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth
+ if ($husb->getbirthyear()>=1) {
+ $parentlinks .= "'".PrintReady($censyear-$husb->getbirthyear())."',"; // age = Census Year - Year of Birth
+ } else {
+ $parentlinks .= "''".","; // age = Undefined
+ }
+ $parentlinks .= "'".(($husb->getDeathDate()->minJD()+$husb->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death
+ $parentlinks .= "''".","; // occu = Occupation
+ $parentlinks .= "'".PrintReady($husb->getBirthPlace())."'".","; // birthpl = Individuals Birthplace
+ if (isset($pHusbFBP)) {
+ $parentlinks .= "'".$pHusbFBP."'".","; // fbirthpl = Fathers Birthplace
+ } else {
+ $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace
+ }
+ if (isset($pHusbMBP)) {
+ $parentlinks .= "'".$pHusbMBP."'".","; // mbirthpl = Mothers Birthplace
+ } else {
+ $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace
+ }
+ if (isset($chBLDarray) && $husb->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ $parentlinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate)
+ } else {
+ $parentlinks .= "''";
+ }
+ $parentlinks .= ");\">";
+ $parentlinks .= PrintReady($husb->getFullName()); // Full Name (Link)
+ $parentlinks .= "</a>";
+ }else{
+ $parentlinks .= i18n::translate('Private');
+ }
+ $parentlinks .= "\n";
+ $natdad = "yes";
+ }
+ }
+
+ //-- Parent Wife ------------------------------
+ if ($wife || $num>0) {
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Family Book Chart').": ".$famid;
+ }else{
+ $title = $famid." :".i18n::translate('Family Book Chart');
+ }
+ if ($wife) {
+ //-- Parent Wifes Parents ----------------------
+ $gparent=Person::getInstance($wife->getXref());
+ $parfams = $gparent->getChildFamilies();
+ foreach($parfams as $famid=>$pfamily) {
+ if (!is_null($pfamily)) {
+ $pwhusb = $pfamily->getHusband($gparent);
+ $pwwife = $pfamily->getWife($gparent);
+ }
+ if ($pwhusb) { $pWifeFBP = $pwhusb->getBirthPlace(); }
+ if ($pwwife) { $pWifeMBP = $pwwife->getBirthPlace(); }
+ }
+ //-- Parent Wifes Details ----------------------
+ $person_parent="Yes";
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Individual Information').": ".$wife->getXref();
+ } else {
+ $title = $wife->getXref()." :".i18n::translate('Individual Information');
+ }
+ $tmp=$wife->getXref();
+ if ($wife->canDisplayName()) {
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $wife->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ // Get wifes married name if available
+ if (isset($husb)){
+ $husbnams = $husb->getAllNames();
+ if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") {
+ // Husband or his name is not known
+ } else {
+ $husbnam = $husb->getAllNames();
+ }
+ }
+ if (isset($nam[1]) && isset($husbnam)) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$husbnam[0]['surname'];
+ }else{
+ $fulmn = $fulln;
+ }
+ $parentlinks .= "<a class=\"linka\" href=\"javascript:insertRowToTable(";
+ $parentlinks .= "'".PrintReady($wife->getXref())."',"; // pid = PID
+ $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // nam = Name
+ if (isset($nam[1])){
+ $parentlinks .= "'".addslashes(strip_tags($fulmn))."',"; // mnam = Full Married Name
+ } else {
+ $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // mnam = Full Name
+ }
+ if ($currpid=="Wife" || $currpid=="Husband") {
+ $parentlinks .= "'Mother in Law',"; // label = 1st Gen Female Relationship
+ } else {
+ $parentlinks .= "'Grand-Mother',"; // label = 2st Gen Female Relationship
+ }
+ $parentlinks .= "'".PrintReady($wife->getSex())."',"; // sex = Gender
+ $parentlinks .= "''".","; // cond = Condition (Married etc)
+ if ($marrdate) {
+ $parentlinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian)
+ }
+ $parentlinks .= "'".(($wife->getBirthDate()->minJD()+$wife->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth
+ if ($wife->getbirthyear()>=1) {
+ $parentlinks .= "'".PrintReady($censyear-$wife->getbirthyear())."',"; // age = Census Year - Year of Birth
+ } else {
+ $parentlinks .= "''".","; // age = Undefined
+ }
+ $parentlinks .= "'".(($wife->getDeathDate()->minJD()+$wife->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death
+ $parentlinks .= "''".","; // occu = Occupation
+ $parentlinks .= "'".PrintReady($wife->getBirthPlace())."'".","; // birthpl = Individuals Birthplace
+ if (isset($pWifeFBP)) {
+ $parentlinks .= "'".$pWifeFBP."'".","; // fbirthpl = Fathers Birthplace
+ } else {
+ $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace Not Known
+ }
+ if (isset($pWifeMBP)) {
+ $parentlinks .= "'".$pWifeMBP."'".","; // mbirthpl = Mothers Birthplace
+ } else {
+ $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace Not Known
+ }
+ if (isset($chBLDarray) && $wife->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ $parentlinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate)
+ } else {
+ $parentlinks .= "''";
+ }
+ $parentlinks .= ");\">";
+ $parentlinks .= PrintReady($wife->getFullName()); // Full Name (Link)
+ $parentlinks .= "</a>";
+ }else{
+ $parentlinks .= i18n::translate('Private');
+ }
+ $parentlinks .= "\n";
+ $natmom = "yes";
+ }
+ }
+ }
+ }
+
+ //-- Step families -----------------------------------------
+ $fams = $person->getStepFamilies();
+ foreach($fams as $famid=>$family) {
+ $marrdate = $family->getMarriageDate();
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ if (!is_null($family)) {
+ $husb = $family->getHusband($person);
+ $wife = $family->getWife($person);
+ $children = $family->getChildren();
+ $num = count($children);
+ $marrdate = $family->getMarriageDate();
+
+ //-- Get StepParent's Children's Name, DOB, DOD --------------------------
+ if (isset($children)) {
+ $chBLDarray = Array();
+ foreach ($children as $key=>$child) {
+ $chnam = $child->getAllNames();
+ $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname'];
+ $chfulln = str_replace('"', "", $chfulln); // Must remove quotes completely here
+ $chfulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $chfulln); // Child's Full Name
+ $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child's Date of Birth (Julian)
+ $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child's Date of Death (Julian)
+ $chBLD = ($chfulln.", ".$chdob.", ".$chdod);
+ array_push($chBLDarray, $chBLD);
+ }
+ }
+
+ //-- Step Husband --------------------------------------
+ if ($natdad == "yes") {
+ }else{
+ if ( ($husb || $num>0) && $husb->getLabel() != "." ) {
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Family Book Chart').": ".$famid;
+ }else{
+ $title = $famid." :".i18n::translate('Family Book Chart');
+ }
+ if ($husb) {
+ //-- Step Husbands Parents -----------------------------
+ $gparent=Person::getInstance($husb->getXref());
+ $parfams = $gparent->getChildFamilies();
+ foreach($parfams as $famid=>$pfamily) {
+ if (!is_null($pfamily)) {
+ $phusb = $pfamily->getHusband($gparent);
+ $pwife = $pfamily->getWife($gparent);
+ }
+ if ($phusb) { $pHusbFBP = $phusb->getBirthPlace(); }
+ if ($pwife) { $pHusbMBP = $pwife->getBirthPlace(); }
+ }
+ //-- Step Husband Details ------------------------------
+ $person_step="Yes";
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Individual Information').": ".$husb->getXref();
+ }else{
+ $title = $husb->getXref()." :".i18n::translate('Individual Information');
+ }
+ $tmp=$husb->getXref();
+ if ($husb->canDisplayName()) {
+ $nam = $husb->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ //$fulln = strip_tags($husb->getFullName());
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+ $parentlinks .= "<a class=\"linka\" href=\"javascript:insertRowToTable(";
+ $parentlinks .= "'".PrintReady($husb->getXref())."',"; // pid = PID
+ $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // nam = Name
+ if (isset($nam[1])){
+ $parentlinks .= "'".addslashes(strip_tags($fulmn))."',"; // mnam = Full Married Name
+ } else {
+ $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // mnam = Full Name
+ }
+ if ($currpid=="Wife" || $currpid=="Husband") {
+ $parentlinks .= "'Step Father-in-Law',"; // label = 1st Gen Male Relationship
+ }else{
+ $parentlinks .= "'Step Grand-Father',"; // label = 2st Gen Male Relationship
+ }
+ $parentlinks .= "'".PrintReady($husb->getSex())."',"; // sex = Gender
+ $parentlinks .= "''".","; // cond = Condition (Married etc)
+ if ($marrdate) {
+ $parentlinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian)
+ }
+ $parentlinks .= "'".(($husb->getBirthDate()->minJD()+$husb->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth
+ if ($husb->getbirthyear()>=1) {
+ $parentlinks .= "'".PrintReady($censyear-$husb->getbirthyear())."',"; // age = Census Year - Year of Birth
+ } else {
+ $parentlinks .= "''".","; // age = Undefined
+ }
+ $parentlinks .= "'".(($husb->getDeathDate()->minJD()+$husb->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death
+ $parentlinks .= "''".","; // occu = Occupation
+ $parentlinks .= "'".PrintReady($husb->getBirthPlace())."'".","; // birthpl = Individuals Birthplace
+ if (isset($pHusbFBP)) {
+ $parentlinks .= "'".$pHusbFBP."'".","; // fbirthpl = Fathers Birthplace
+ } else {
+ $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace
+ }
+ if (isset($pHusbMBP)) {
+ $parentlinks .= "'".$pHusbMBP."'".","; // mbirthpl = Mothers Birthplace
+ } else {
+ $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace
+ }
+ if (isset($chBLDarray) && $husb->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ $parentlinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate)
+ } else {
+ $parentlinks .= "''";
+ }
+ $parentlinks .= ");\">";
+ $parentlinks .= PrintReady($husb->getFullName()); // Full Name (Link)
+ $parentlinks .= "</a>";
+ }else{
+ $parentlinks .= i18n::translate('Private');
+ }
+ $parentlinks .= "\n";
+ }
+ }
+ }
+
+ //-- Step Wife ----------------------------------------
+ if ($natmom == "yes") {
+ }else{
+ if ($wife || $num>0) {
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Family Book Chart').": ".$famid;
+ }else{
+ $title = $famid." :".i18n::translate('Family Book Chart');
+ }
+ if ($wife) {
+ //-- Step Wifes Parents ---------------------------
+ $gparent=Person::getInstance($wife->getXref());
+ $parfams = $gparent->getChildFamilies();
+ foreach($parfams as $famid=>$pfamily) {
+ if (!is_null($pfamily)) {
+ $pwhusb = $pfamily->getHusband($gparent);
+ $pwwife = $pfamily->getWife($gparent);
+ }
+ if ($pwhusb) { $pWifeFBP = $pwhusb->getBirthPlace(); }
+ if ($pwwife) { $pWifeMBP = $pwwife->getBirthPlace(); }
+ }
+ //-- Step Wife Details ------------------------------
+ $person_step="Yes";
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Individual Information').": ".$wife->getXref();
+ }else{
+ $title = $wife->getXref()." :".i18n::translate('Individual Information');
+ }
+ $tmp=$wife->getXref();
+ if ($wife->canDisplayName()) {
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $wife->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ //$fulln = strip_tags($wife->getFullName());
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ // Get wifes married name if available
+ if (isset($husb)){
+ $husbnams = $husb->getAllNames();
+ if ($husbnams[0]['surname']=="@N.N." || $husbnams[0]['surname']=="") {
+ // Husband or his name is not known
+ } else {
+ $husbnam = $husb->getAllNames();
+ }
+ }
+ if (isset($nam[1]) && isset($husbnam)) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$husbnam[0]['surname'];
+ }else{
+ $fulmn = $fulln;
+ }
+ $parentlinks .= "<a class=\"linka\" href=\"javascript:insertRowToTable(";
+ $parentlinks .= "'".PrintReady($wife->getXref())."',"; // pid = PID
+ $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // nam = Name
+ if (isset($nam[1])){
+ $parentlinks .= "'".addslashes(strip_tags($fulmn))."',"; // mnam = Full Married Name
+ } else {
+ $parentlinks .= "'".addslashes(strip_tags($fulln))."',"; // mnam = Full Name
+ }
+ if ($currpid=="Wife" || $currpid=="Husband") {
+ $parentlinks .= "'Step Mother-in-Law',"; // label = 1st Gen Female Relationship
+ } else {
+ $parentlinks .= "'Step Grand-Mother',"; // label = 2st Gen Female Relationship
+ }
+ $parentlinks .= "'".PrintReady($wife->getSex())."',"; // sex = Gender
+ $parentlinks .= "''".","; // cond = Condition (Married etc)
+ if ($marrdate) {
+ $parentlinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian)
+ }
+ $parentlinks .= "'".(($wife->getBirthDate()->minJD()+$wife->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth
+ if ($wife->getbirthyear()>=1) {
+ $parentlinks .= "'".PrintReady($censyear-$wife->getbirthyear())."',"; // age = Census Year - Year of Birth
+ } else {
+ $parentlinks .= "''".","; // age = Undefined
+ }
+ $parentlinks .= "'".(($wife->getDeathDate()->minJD()+$wife->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death
+ $parentlinks .= "''".","; // occu = Occupation
+ $parentlinks .= "'".PrintReady($wife->getBirthPlace())."'".","; // birthpl = Individuals Birthplace
+ if (isset($pWifeFBP)) {
+ $parentlinks .= "'".$pWifeFBP."'".","; // fbirthpl = Fathers Birthplace
+ } else {
+ $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace Not Known
+ }
+ if (isset($pWifeMBP)) {
+ $parentlinks .= "'".$pWifeMBP."'".","; // mbirthpl = Mothers Birthplace
+ } else {
+ $parentlinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace Not Known
+ }
+ if (isset($chBLDarray) && $wife->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ $parentlinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate)
+ } else {
+ $parentlinks .= "''";
+ }
+ $parentlinks .= ");\">";
+ $parentlinks .= PrintReady($wife->getFullName()); // Full Name (Link)
+ $parentlinks .= "</a>";
+ }else{
+ $parentlinks .= i18n::translate('Private');
+ }
+ $parentlinks .= "\n";
+ }
+ }
+ }
+ }
+ }
+
+ // Spouse Families ------------------------------------------
+ $fams = $person->getSpouseFamilies();
+ foreach($fams as $famid=>$family) {
+ if (!is_null($family)) {
+ $spouse = $family->getSpouse($person);
+ $children = $family->getChildren();
+ $num = count($children);
+ $marrdate = $family->getMarriageDate();
+ $married = GedcomDate::Compare($censdate, $marrdate);
+
+ //-- Get Spouse's Children's Name, DOB, DOD --------------------------
+ if (isset($children)) {
+ $chBLDarray = Array();
+ foreach ($children as $key=>$child) {
+ $chnam = $child->getAllNames();
+ $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname'];
+ $chfulln = str_replace('"', "", $chfulln); // Must remove quotes completely here
+ $chfulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $chfulln); // Child's Full Name
+ $chdob = ($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2; // Child's Date of Birth (Julian)
+ $chdod = ($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2; // Child's Date of Death (Julian)
+ $chBLD = ($chfulln.", ".$chdob.", ".$chdod);
+ array_push($chBLDarray, $chBLD);
+ }
+ }
+ //-- Spouse -----------------------------------------
+ if ($spouse || $num>0) {
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Family Book Chart').": ".$famid;
+ }else{
+ $title = $famid." :".i18n::translate('Family Book Chart');
+ }
+ if ($spouse) {
+
+ //-- Spouse Parents -----------------------------
+ $gparent=Person::getInstance($spouse->getXref());
+ $spousefams = $gparent->getChildFamilies();
+ foreach($spousefams as $famid=>$pfamily) {
+ if (!is_null($pfamily)) {
+ $phusb = $pfamily->getHusband($gparent);
+ $pwife = $pfamily->getWife($gparent);
+ }
+ if ($phusb) { $pSpouseFBP = $phusb->getBirthPlace(); }
+ if ($pwife) { $pSpouseMBP = $pwife->getBirthPlace(); }
+ }
+
+ //-- Spouse Details -----------------------------
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Individual Information').": ".$spouse->getXref();
+ }else{
+ $title = $spouse->getXref()." :".i18n::translate('Individual Information');
+ }
+ $tmp=$spouse->getXref();
+ if ($spouse->canDisplayName()) {
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $spouse->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+ $spouselinks .= "<a href=\"javascript:insertRowToTable(";
+ $spouselinks .= "'".PrintReady($spouse->getXref())."',"; // pid = PID
+ $spouselinks .= "'".addslashes(strip_tags($fulln))."',"; // nam = Name
+ if (isset($nam[1])){
+ $spouselinks .= "'".addslashes(strip_tags($fulmn))."',"; // mnam = Full Married Name
+ } else {
+ $spouselinks .= "'".addslashes(strip_tags($fulln))."',"; // mnam = Full Name
+ }
+ if ($currpid=="Son" || $currpid=="Daughter") {
+ if ($spouse->getSex()=="M") {
+ $spouselinks .= "'Son in Law',"; // label = Male Relationship
+ }else{
+ $spouselinks .= "'Daughter in Law',"; // label = Female Relationship
+ }
+ } else {
+ if ($spouse->getSex()=="M") {
+ $spouselinks .= "'Brother in Law',"; // label = Male Relationship
+ } else {
+ $spouselinks .= "'Sister in Law',"; // label = Female Relationship
+ }
+ }
+ $spouselinks .= "'".PrintReady($spouse->getSex())."',"; // sex = Gender
+ $spouselinks .= "''".","; // cond = Condition (Married etc)
+ if ($marrdate) {
+ $spouselinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian)
+ }
+ $spouselinks .= "'".(($spouse->getBirthDate()->minJD()+$spouse->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth
+ if ($spouse->getbirthyear()>=1) {
+ $spouselinks .= "'".PrintReady($censyear-$spouse->getbirthyear())."',"; // age = Census Year - Year of Birth
+ } else {
+ $spouselinks .= "''".","; // age = Undefined
+ }
+ $spouselinks .= "'".(($spouse->getDeathDate()->minJD()+$spouse->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death
+ $spouselinks .= "''".","; // occu = Occupation
+ $spouselinks .= "'".PrintReady($spouse->getBirthPlace())."'".","; // birthpl = Individuals Birthplace
+ if (isset($pSpouseFBP)) {
+ $spouselinks .= "'".$pSpouseFBP."'".","; // fbirthpl = Fathers Birthplace
+ } else {
+ $spouselinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace Not Known
+ }
+ if (isset($pSpouseMBP)) {
+ $spouselinks .= "'".$pSpouseMBP."'".","; // mbirthpl = Mothers Birthplace
+ } else {
+ $spouselinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace Not Known
+ }
+ if (isset($chBLDarray) && $spouse->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ $spouselinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate)
+ } else {
+ $spouselinks .= "''";
+ }
+ $spouselinks .= ");\">";
+ $spouselinks .= PrintReady($spouse->getFullName()); // Full Name (Link)
+ $spouselinks .= "</a>";
+ }else{
+ $spouselinks .= i18n::translate('Private');
+ }
+ $spouselinks .= "</a>\n";
+ if ($spouse->getFullName() != "") {
+ $persons = "Yes";
+ }
+ }
+ }
+
+ // Children -------------------------------------
+ $spouselinks .= "<ul class=\"clist ".$TEXT_DIRECTION."\">\n";
+ foreach($children as $c=>$child) {
+ $cpid = $child->getXref();
+ if ($child) {
+ $persons="Yes";
+
+ //-- Childs Parents ---------------------
+ $gparent=Person::getInstance($child->getXref());
+ $fams = $gparent->getChildFamilies();
+ $chfams = $gparent->getSpouseFamilies();
+ foreach($fams as $famid=>$family) {
+ if (!is_null($family)) {
+ $husb = $family->getHusband($gparent);
+ $wife = $family->getWife($gparent);
+ }
+ if ($husb) { $ChildFBP = $husb->getBirthPlace(); }
+ if ($wife) { $ChildMBP = $wife->getBirthPlace(); }
+ }
+
+ // Get Child's Children
+ $chBLDarray=Array();
+ foreach ($child->getSpouseFamilies() as $childfamily) {
+ $chchildren = $childfamily->getChildren();
+ foreach ($chchildren as $key=>$chchild) {
+ $chnam = $chchild->getAllNames();
+ $chfulln = rtrim($chnam[0]['givn'],'*')." ".$chnam[0]['surname'];
+ $chfulln = str_replace('"', "", $chfulln); // Must remove quotes completely here
+ $chfulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $chfulln);
+ $chfulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $chfulln); // Child's Full Name
+ $chdob = ($chchild->getBirthDate()->minJD()+$chchild->getBirthDate()->maxJD())/2; // Child's Date of Birth (Julian)
+ $chdod = ($chchild->getDeathDate()->minJD()+$chchild->getDeathDate()->maxJD())/2; // Child's Date of Death (Julian)
+ $chBLD = ($chfulln.", ".$chdob.", ".$chdod);
+ array_push($chBLDarray, $chBLD);
+ }
+ }
+
+ // Get Childs marriage status ------------
+ $married="";
+ $marrdate="";
+ foreach ($child->getSpouseFamilies() as $childfamily) {
+ $marrdate=$childfamily->getMarriageDate();
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ if ($childfamily->getHusband()) {
+ $chhusbnam = $childfamily->getHusband()->getAllNames();
+ $ChHusbName = $chhusbnam[0]['surname'];
+ }
+ }
+
+ // Childs Details -------------------------
+ $title = i18n::translate('Individual Information').": ".$cpid;
+ // $spouselinks .= "\n\t\t\t\to&nbsp;&nbsp;";
+ $spouselinks .= "<li>\n";
+ if ($child->canDisplayName()) {
+ $nam = $child->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $fulln = str_replace("@N.N.", "(".i18n::translate('unknown').")", $fulln);
+ $fulln = str_replace("@P.N.", "(".i18n::translate('unknown').")", $fulln);
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1]) && isset($ChHusbName)) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$ChHusbName;
+ }
+
+ $spouselinks .= "<a href=\"javascript:insertRowToTable(";
+ $spouselinks .= "'".PrintReady($child->getXref())."',"; // pid = PID
+ $spouselinks .= "'".addslashes(strip_tags($fulln))."',"; // nam = Name
+ if (isset($nam[1])){
+ $spouselinks .= "'".addslashes(strip_tags($fulmn))."',"; // mnam = Full Married Name
+ } else {
+ $spouselinks .= "'".addslashes(strip_tags($fulln))."',"; // mnam = Full Name
+ }
+ if ($currpid=="Son" || $currpid=="Daughter") {
+ if ($child->getSex()=="M") {
+ $spouselinks .= "'Grand-Son',"; // label = Male Relationship
+ }else{
+ $spouselinks .= "'Grand-Daughter',"; // label = Female Relationship
+ }
+ }else{
+ if ($child->getSex()=="M") {
+ $spouselinks .= "'Nephew',"; // label = Male Relationship
+ }else{
+ $spouselinks .= "'Niece',"; // label = Female Relationship
+ }
+ }
+ $spouselinks .= "'".PrintReady($child->getSex())."',"; // sex = Gender
+ $spouselinks .= "''".","; // cond = Condition (Married etc)
+ if ($marrdate) {
+ $spouselinks .= "'".(($marrdate->minJD()+$marrdate->maxJD())/2)."',"; // dom = Date of Marriage (Julian)
+ } else {
+ $spouselinks .= "'nm'".",";
+ }
+ $spouselinks .= "'".(($child->getBirthDate()->minJD()+$child->getBirthDate()->maxJD())/2)."',"; // dob = Date of Birth
+ if ($child->getbirthyear()>=1) {
+ $spouselinks .= "'".PrintReady($censyear-$child->getbirthyear())."',"; // age = Census Year - Year of Birth
+ }else{
+ $spouselinks .= "''".","; // age = Undefined
+ }
+ $spouselinks .= "'".(($child->getDeathDate()->minJD()+$child->getDeathDate()->maxJD())/2)."',"; // dod = Date of Death
+ $spouselinks .= "''".","; // occu = Occupation
+ $spouselinks .= "'".PrintReady($child->getBirthPlace())."'".","; // birthpl = Individuals Birthplace
+ if (isset($ChildFBP)) {
+ $spouselinks .= "'".$ChildFBP."'".","; // fbirthpl = Fathers Birthplace
+ } else {
+ $spouselinks .= "'UNK, UNK, UNK, UNK'".","; // fbirthpl = Fathers Birthplace Not Known
+ }
+ if (isset($ChildMBP)) {
+ $spouselinks .= "'".$ChildMBP."'".","; // mbirthpl = Mothers Birthplace
+ } else {
+ $spouselinks .= "'UNK, UNK, UNK, UNK'".","; // mbirthpl = Mothers Birthplace Not Known
+ }
+ if (isset($chBLDarray) && $child->getSex()=="F") {
+ $chBLDarray = implode("::", $chBLDarray);
+ $spouselinks .= "'".$chBLDarray."'"; // Array of Children (name, birthdate, deathdate)
+ } else {
+ $spouselinks .= "''";
+ }
+ $spouselinks .= ");\">";
+ $spouselinks .= PrintReady($child->getFullName()); // Full Name (Link)
+ $spouselinks .= "</a>";
+ $spouselinks .= "</li>\n";
+ }else{
+ $spouselinks .= i18n::translate('Private');
+ }
+ }
+ }
+ $spouselinks .= "</ul>\n";
+ }
+ }
+ ?>
+
+ <?php if ($theme_name=="Xenea" || $theme_name=="Standard" || $theme_name=="Wood" || $theme_name=="Ocean") { ?>
+ <style type="text/css" rel="stylesheet">
+ a:hover .name2 { color: #222222; }
+ </style>
+ <?php } ?>
+
+ <?php
+ if ($persons != "Yes") {
+ $spouselinks .= "(" . i18n::translate('None') . ")</td></tr></table>\n\t\t";
+ }else{
+ $spouselinks .= "</td></tr></table>\n\t\t";
+ }
+
+ if ($person_parent != "Yes") {
+ $parentlinks .= "(" . i18n::translate('unknown') . ")</td></tr></table>\n\t\t";
+ }else{
+ $parentlinks .= "</td></tr></table>\n\t\t";
+ }
+
+ if ($person_step != "Yes") {
+ $step_parentlinks .= "(" . i18n::translate('unknown') . ")</td></tr></table>\n\t\t";
+ }else{
+ $step_parentlinks .= "</td></tr></table>\n\t\t";
+ }
+ }
+ }
+ }
+}
+// ==============================================================
+?>
diff --git a/modules/GEDFact_assistant/_CENS/census_4_text.php b/modules/GEDFact_assistant/_CENS/census_4_text.php
new file mode 100644
index 0000000000..fb8e79da27
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/census_4_text.php
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Census Assistant Control module for phpGedView
+ *
+ * Census Proposed Text Area File
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2007 to 2010 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Module
+ * @version $Id$
+ * @author Brian Holland
+ */
+if (!defined('WT_WEBTREES')) {
+ header('HTTP/1.0 403 Forbidden');
+ exit;
+}
+global $theme_name;
+?>
+
+<script>
+function help_window2(frm) {
+ var aWindow = window.open('http://wiki.phpgedview.net/en/index.php?title=GedFactAssistant_module#Sub-module:_Census_Assistant', 'HelpWindow',
+ 'scrollbars=yes,menubar=no,resizable=yes,location=no,toolbar=no,width=900,height=700');
+ aWindow.focus();
+ // set the target to the blank window
+ frm.target = 'TableAddRow2NewWindow';
+}
+</script>
+
+<!-- ---- The proposed Census Text -------- -->
+<div class="optionbox cens_text">
+<!--[if IE]><style>.cens_text{margin-top:-1.3em;}</style><![EndIf]-->
+ <span><input type="button" value="<?php echo i18n::translate('Help'); ?>" onclick="javascript: help_window2(this.form)" /></span>
+ <span><?php echo i18n::translate('Click &quot;Preview&quot; to copy Edit Input Fields'); ?></span>
+ <span><input type="button" value="<?php echo i18n::translate('Preview'); ?>" onclick="preview();" /></span>
+ <span><b><?php echo i18n::translate('Proposed Census Text&nbsp;&nbsp;'); ?></b></span>
+ <span><input type="submit" value="<?php echo i18n::translate('Save'); ?>" onclick="caSave();" /></span>
+ <br /><br />
+ <span class="descriptionbox width15 nowrap <?php $TEXT_DIRECTION; ?>">
+ <?php
+ echo i18n::translate('Shared Note'), help_link('SHARED_NOTE');
+ ?>
+ </span>
+ <div class="optionbox">
+ <textarea wrap="off" name="NOTE" id="NOTE"></textarea><br />
+ <?php if ($theme_name=="Minimal") { ?>
+ <!--[if IE]><style>textarea#NOTE{height: 18.1em;}</style><![EndIf]-->
+ <?php } ?>
+ <center>
+ <?php print_specialchar_link("NOTE",true); ?>
+ </center>
+ </div>
+</div>
+
+
+
+
diff --git a/modules/GEDFact_assistant/_CENS/census_5_input.php b/modules/GEDFact_assistant/_CENS/census_5_input.php
new file mode 100644
index 0000000000..1c3fc0fa40
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/census_5_input.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Census Assistant Control module for phpGedView
+ *
+ * Census input table area
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Census Assistant
+ * @version $Id$
+ */
+include 'modules/GEDFact_assistant/_CENS/js/census_5_input.js.php';
+
+?>
+
+<div class="cens_data">
+ <table id="tblSample" cellpadding=0>
+ <thead></thead>
+ <tbody></tbody>
+ </table>
+</div> \ No newline at end of file
diff --git a/modules/GEDFact_assistant/_CENS/census_asst_date.php b/modules/GEDFact_assistant/_CENS/census_asst_date.php
new file mode 100644
index 0000000000..863654acba
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/census_asst_date.php
@@ -0,0 +1,83 @@
+<?php
+/**
+ * Census Assistant Control module for phpGedView
+ *
+ * Census information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Census Assistant
+ * @version $Id$
+*/
+?>
+
+ <script>
+ function addDate(theCensDate) {
+ var ddate = theCensDate.split(', ');
+ document.getElementById('setctry').value = ddate[3];
+ document.getElementById('setyear').value = ddate[0];
+ cal_setDateField('<?php echo $element_id;?>', parseInt(ddate[0]), parseInt(ddate[1]), parseInt(ddate[2])); return false;
+ }
+ function pasteAsstDate(setcy, setyr) {
+ document.getElementById(setcy+setyr).selected = true;
+ addDate(document.getElementById('selcensdate').options[document.getElementById('selcensdate').selectedIndex].value);
+ }
+ </script>
+
+ <select id="selcensdate" name="selcensdate" onchange = "if (this.options[this.selectedIndex].value!='') {
+ addDate(this.options[this.selectedIndex].value);
+ }">
+ <option id="defdate" name="defdate" value='' SELECTED>Census Date</option>
+ <option value=""></option>
+ <option id="UK1911" name="UK1911" class="UK" value='1911, 3, 02, UK'>UK 1911</option>
+ <option id="UK1901" name="UK1901" class="UK" value="1901, 2, 31, UK">UK 1901</option>
+ <option id="UK1891" name="UK1891" class="UK" value="1891, 3, 05, UK">UK 1891</option>
+ <option id="UK1881" name="UK1881" class="UK" value="1881, 3, 03, UK">UK 1881</option>
+ <option id="UK1871" name="UK1871" class="UK" value="1871, 3, 02, UK">UK 1871</option>
+ <option id="UK1861" name="UK1861" class="UK" value="1861, 3, 07, UK">UK 1861</option>
+ <option id="UK1851" name="UK1851" class="UK" value="1851, 2, 30, UK">UK 1851</option>
+ <option id="UK1841" name="UK1841" class="UK" value="1841, 5, 06, UK">UK 1841</option>
+ <option value=""></option>
+ <option id="USA1930" name="USA1930" class="USA" value="1930, 3, 01, USA">US 1930</option>
+ <option id="USA1920" name="USA1920" class="USA" value="1920, 0, 01, USA">US 1920</option>
+ <option id="USA1910" name="USA1910" class="USA" value="1910, 3, 15, USA">US 1910</option>
+ <option id="USA1900" name="USA1900" class="USA" value="1900, 5, 01, USA">US 1900</option>
+ <option id="USA1890" name="USA1890" class="USA" value="1890, 5, 01, USA">US 1890</option>
+ <option id="USA1880" name="USA1880" class="USA" value="1880, 5, 01, USA">US 1880</option>
+ <option id="USA1870" name="USA1870" class="USA" value="1870, 5, 01, USA">US 1870</option>
+ <option id="USA1860" name="USA1860" class="USA" value="1860, 5, 01, USA">US 1860</option>
+ <option id="USA1850" name="USA1850" class="USA" value="1850, 5, 01, USA">US 1850</option>
+ <option id="USA1840" name="USA1840" class="USA" value="1840, 5, 01, USA">US 1840</option>
+ <option id="USA1830" name="USA1830" class="USA" value="1830, 5, 01, USA">US 1830</option>
+ <option id="USA1820" name="USA1820" class="USA" value="1820, 7, 07, USA">US 1820</option>
+ <option id="USA1810" name="USA1810" class="USA" value="1810, 7, 06, USA">US 1810</option>
+ <option id="USA1800" name="USA1800" class="USA" value="1800, 7, 04, USA">US 1800</option>
+ <option id="USA1790" name="USA1790" class="USA" value="1790, 7, 02, USA">US 1790</option>
+ <option value=""></option>
+ </select>
+
+ <input type="hidden" id="setctry" name="setctry" value="" />
+ <input type="hidden" id="setyear" name="setyear" value="" />
+
+
+
+
diff --git a/modules/GEDFact_assistant/_CENS/census_asst_help.php b/modules/GEDFact_assistant/_CENS/census_asst_help.php
new file mode 100644
index 0000000000..125ade6944
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/census_asst_help.php
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html <?php echo i18n::html_markup(); ?>>
+<head>
+<title>Help window</title>
+<script language="JavaScript">
+/*
+ <!--
+ function printToPage()
+ {
+ var pos;
+ var searchStr = window.location.search;
+ var searchArray = searchStr.substring(1,searchStr.length).split('&');
+ var htmlOutput = '';
+ for (var i=0; i<searchArray.length; i++) {
+ htmlOutput += searchArray[i] + '<br />';
+ }
+ return(htmlOutput);
+ }
+ //-->
+*/
+</script>
+</head>
+
+<body>
+<b>Census Assistant - Help window</b>
+<br /><br />
+Here will be the help for the Census Assistant window:
+<p>
+<script language="JavaScript">
+<!--
+document.write(printToPage());
+//-->
+</script>
+</p>
+</body>
+</html>
diff --git a/modules/GEDFact_assistant/_CENS/census_note_decode.php b/modules/GEDFact_assistant/_CENS/census_note_decode.php
new file mode 100644
index 0000000000..21e5a4556a
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/census_note_decode.php
@@ -0,0 +1,101 @@
+<?php
+/**
+ * Census Assistant Control module for phpGedView
+ *
+ * Census Shared Note Decode for a formatted file
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Census Assistant
+ * @version $Id$
+ */
+
+ $text = "xCxAx<table cellpadding=\"0\"><tr><td>" . $text;
+ $text = str_replace("<br />.start_formatted_area.<br />", "</td></tr></table><table cellpadding=\"0\"><tr><td class=\"notecell\">&nbsp;", $text);
+
+ // -- Create View Header Tooltip explanations (Use embolden) -----------
+ $text = str_replace(".b.".i18n::translate('Name'), "<span class=\"note2\" alt=\"".i18n::translate('Full Name or Married name if married')."\" title=\"".i18n::translate('Full Name or Married name if married')."\"> <b>".i18n::translate('Name')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Relation'), "<span class=\"note1\" alt=\"".i18n::translate('Relationship to Head of Household')."\" title=\"".i18n::translate('Relationship to Head of Household')."\"> <b>".i18n::translate('Relation')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Assets'), "<span class=\"note1\" alt=\"".i18n::translate('Assets = Owned,Rented - Value,Rent - Radio - Farm')."\" title=\"".i18n::translate('Assets = Owned,Rented - Value,Rent - Radio - Farm')."\"> <b>".i18n::translate('Assets')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Sex'), "<span class=\"note1\" alt=\"".i18n::translate('Male or Female')."\" title=\"".i18n::translate('Male or Female')."\"> <b>".i18n::translate('Sex')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Race'), "<span class=\"note1\" alt=\"".i18n::translate('Race or Color - Black, White, Mulatto, Asian, Indian, Chinese etc')."\" title=\"".i18n::translate('Race or Color - Black, White, Mulatto, Asian, Indian, Chinese etc')."\"> <b>".i18n::translate('Race')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Age'), "<span class=\"note1\" alt=\"".i18n::translate('Age at last birthday')."\" title=\"".i18n::translate('Age at last birthday')."\"> <b>".i18n::translate('Age')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('MC'), "<span class=\"note1\" alt=\"".i18n::translate('Marital Condition - Married, Single, Unmarried, Widowed or Divorced')."\" title=\"".i18n::translate('Marital Condition - Married, Single, Unmarried, Widowed or Divorced')."\"> <b>".i18n::translate('MC')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('DOB'), "<span class=\"note1\" alt=\"".i18n::translate('Date of Birth')."\" title=\"".i18n::translate('Date of Birth')."\"> <b>".i18n::translate('DOB')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Bmth'), "<span class=\"note1\" alt=\"".i18n::translate('Month of birth - If born within Census year')."\" title=\"".i18n::translate('Month of birth - If born within Census year')."\"> <b>".i18n::translate('Bmth')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('YrsM'), "<span class=\"note1\" alt=\"".i18n::translate('Years Married, or Y if married in Census Year')."\" title=\"".i18n::translate('Years Married, or Y if married in Census Year')."\"> <b>".i18n::translate('YrsM')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('ChB'), "<span class=\"note1\" alt=\"".i18n::translate('Children born alive')."\" title=\"".i18n::translate('Children born alive')."\"> <b>".i18n::translate('ChB')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('ChL'), "<span class=\"note1\" alt=\"".i18n::translate('Children still living')."\" title=\"".i18n::translate('Children still living')."\"> <b>".i18n::translate('ChL')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('ChD'), "<span class=\"note1\" alt=\"".i18n::translate('Children who have died')."\" title=\"".i18n::translate('Children who have died')."\"> <b>".i18n::translate('ChD')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('AgM'), "<span class=\"note1\" alt=\"".i18n::translate('Age at first marriage')."\" title=\"".i18n::translate('Age at first marriage')."\"> <b>".i18n::translate('AgM')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Occupation'), "<span class=\"note1\" alt=\"".i18n::translate('Occupation')."\" title=\"".i18n::translate('Occupation')."\"> <b>".i18n::translate('Occupation')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Birthplace'), "<span class=\"note1\" alt=\"".i18n::translate('Birthplace (Full format)')."\" title=\"".i18n::translate('Birthplace (Full format)')."\"><b>".i18n::translate('Birthplace')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('BP'), "<span class=\"note1\" alt=\"".i18n::translate('Birthplace - (Chapman format)')."\" title=\"".i18n::translate('Birthplace - (Chapman format)')."\"> <b>".i18n::translate('BP')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('FBP'), "<span class=\"note1\" alt=\"".i18n::translate('Father\'s Birthplace - (Chapman format)')."\" title=\"".i18n::translate('Father\'s Birthplace - (Chapman format)')."\"> <b>".i18n::translate('FBP')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('MBP'), "<span class=\"note1\" alt=\"".i18n::translate('Mother\'s Birthplace - (Chapman format)')."\" title=\"".i18n::translate('Mother\'s Birthplace - (Chapman format)')."\"> <b>".i18n::translate('MBP')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('NL'), "<span class=\"note1\" alt=\"".i18n::translate('If Foreign Born - Native Language')."\" title=\"".i18n::translate('If Foreign Born - Native Language')."\"> <b>".i18n::translate('NL')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('YUS'), "<span class=\"note1\" alt=\"".i18n::translate('If Foreign Born - Years in the USA')."\" title=\"".i18n::translate('If Foreign Born - Years in the USA')."\"> <b>".i18n::translate('YUS')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('YOI'), "<span class=\"note1\" alt=\"".i18n::translate('If Foreign Born - Year of Immigration')."\" title=\"".i18n::translate('If Foreign Born - Year of Immigration')."\"> <b>".i18n::translate('YOI')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('N/A'), "<span class=\"note1\" alt=\"".i18n::translate('If Foreign Born - Naturalized, Alien')."\" title=\"".i18n::translate('If Foreign Born - Naturalized, Alien')."\"> <b>".i18n::translate('N/A')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('YON'), "<span class=\"note1\" alt=\"".i18n::translate('If Foreign Born - Year of Naturalization')."\" title=\"".i18n::translate('If Foreign Born - Year of Naturalization')."\"> <b>".i18n::translate('YON')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('EngL'), "<span class=\"note1\" alt=\"".i18n::translate('English spoken?, if not, Native Language')."\" title=\"".i18n::translate('English spoken?, if not, Native Language')."\"> <b>".i18n::translate('EngL')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Health'), "<span class=\"note1\" alt=\"".i18n::translate('Health - 1.Blind, 2.Deaf&Dumb, 3.Idiotic, 4.Insane, 5.Disabled etc')."\" title=\"".i18n::translate('Health - 1.Blind, 2.Deaf&Dumb, 3.Idiotic, 4.Insane, 5.Disabled etc')."\"><b>".i18n::translate('Health')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Industry'), "<span class=\"note1\" alt=\"".i18n::translate('Industry')."\" title=\"".i18n::translate('Industry')."\"> <b>".i18n::translate('Industry')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Employ'), "<span class=\"note1\" alt=\"".i18n::translate('Employment')."\" title=\"".i18n::translate('Employment')."\"> <b>".i18n::translate('Employ')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('EmR'), "<span class=\"note1\" alt=\"".i18n::translate('Employer?')."\" title=\"".i18n::translate('Employer?')."\"> <b>".i18n::translate('EmR')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('EmD'), "<span class=\"note1\" alt=\"".i18n::translate('Employed?')."\" title=\"".i18n::translate('Employed?')."\"> <b>".i18n::translate('EmD')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('WH'), "<span class=\"note1\" alt=\"".i18n::translate('Working at Home?')."\" title=\"".i18n::translate('Working at Home?')."\"> <b>".i18n::translate('WH')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('EmN'), "<span class=\"note1\" alt=\"".i18n::translate('Unemployed?')."\" title=\"".i18n::translate('Unemployed?')."\"> <b>".i18n::translate('EmN')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Edu'), "<span class=\"note1\" alt=\"".i18n::translate('Education - At School, Can Read, Can Write')."\" title=\"".i18n::translate('Education - At School, Can Read, Can Write')."\"> <b>".i18n::translate('Edu')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Eng?'), "<span class=\"note1\" alt=\"".i18n::translate('English spoken?')."\" title=\"".i18n::translate('English spoken?')."\"> <b>".i18n::translate('Eng?')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('BIC'), "<span class=\"note1\" alt=\"".i18n::translate('Born in County')."\" title=\"".i18n::translate('Born in County')."\"> <b>".i18n::translate('BIC')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('BOE'), "<span class=\"note1\" alt=\"".i18n::translate('Born outside England')."\" title=\"".i18n::translate('Born outside England')."\"> <b>".i18n::translate('BOE')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Lang'), "<span class=\"note1\" alt=\"".i18n::translate('If Foreign Born - Native Language')."\" title=\"".i18n::translate('If Foreign Born - Native Language')."\"> <b>".i18n::translate('Lang')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Infirm'), "<span class=\"note1\" alt=\"".i18n::translate('Infirmaties - 1.Deaf&Dumb, 2.Blind, 3.Lunatic, 4.Imbecile/feeble-minded')."\" title=\"".i18n::translate('Infirmaties - 1.Deaf&Dumb, 2.Blind, 3.Lunatic, 4.Imbecile/feeble-minded')."\"><b>".i18n::translate('Infirm')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Vet'), "<span class=\"note1\" alt=\"".i18n::translate('War Veteran?')."\" title=\"".i18n::translate('War Veteran?')."\"> <b>".i18n::translate('Vet')."</span>", $text);
+
+ $text = str_replace(".b.".i18n::translate('Ten'), "<span class=\"note1\" alt=\"".i18n::translate('Tenure - Owned/Rented, (if owned)Free/Morgaged')."\" title=\"".i18n::translate('Tenure - Owned/Rented, (if owned)Free/Morgaged')."\"> <b>".i18n::translate('Ten')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Par'), "<span class=\"note1\" alt=\"".i18n::translate('Parentage - Father if foreign born, Mother if foreign born')."\" title=\"".i18n::translate('Parentage - Father if foreign born, Mother if foreign born')."\"> <b>".i18n::translate('Par')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Mmth'), "<span class=\"note1\" alt=\"".i18n::translate('Month of marriage - If married during Census Year')."\" title=\"".i18n::translate('Month of marriage - If married during Census Year')."\"> <b>".i18n::translate('Mmth')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('MnsE'), "<span class=\"note1\" alt=\"".i18n::translate('Months employed during Census Year')."\" title=\"".i18n::translate('Months employed during Census Year')."\"> <b>".i18n::translate('MnsE')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('WksU'), "<span class=\"note1\" alt=\"".i18n::translate('Weeks unemployed during Census Year')."\" title=\"".i18n::translate('Weeks unemployed during Census Year')."\"> <b>".i18n::translate('WksU')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('MnsU'), "<span class=\"note1\" alt=\"".i18n::translate('Months unemployed during Census Year')."\" title=\"".i18n::translate('English spoken?')."\"> <b>".i18n::translate('Eng?')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Edu'), "<span class=\"note1\" alt=\"".i18n::translate('Education - xxx - At School, Cannot Read, Cannot Write')."\" title=\"".i18n::translate('Education - xxx - At School, Cannot Read, Cannot Write')."\"><b>".i18n::translate('Edu')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Home'), "<span class=\"note1\" alt=\"".i18n::translate('Home Ownership - Owned/Rented-Free/Mortgaged-Farm/House-Farm Schedule number')."\" title=\"".i18n::translate('Home Ownership - Owned/Rented-Free/Mortgaged-Farm/House-Farm Schedule number')."\"> <b>".i18n::translate('Home')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Situ'), "<span class=\"note1\" alt=\"".i18n::translate('Situation - Disease, Infirmaty, Convict, Pauper etc')."\" title=\"".i18n::translate('Situation - Disease, Infirmaty, Convict, Pauper etc')."\"> <b>".i18n::translate('Situ')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('War'), "<span class=\"note1\" alt=\"".i18n::translate('War or Expedition')."\" title=\"".i18n::translate('War or Expedition')."\"> <b>".i18n::translate('War')."</span>", $text);
+ $text = str_replace(".b.".i18n::translate('Infirm'), "<span class=\"note1\" alt=\"".i18n::translate('Infirmaties - Whether blind, Whether Deaf and Dumb')."\" title=\"".i18n::translate('Infirmaties - Whether blind, Whether Deaf and Dumb')."\"> <b>".i18n::translate('Infirm')."</span>", $text);
+
+
+ // Regular Field Highlighting (Use embolden) ------------
+ $text = str_replace(".b.", "<b>", $text);
+
+ // Replace "pipe" with </td><td> ------------------------
+ $text = str_replace("|", "&nbsp;&nbsp;</td><td class=\"notecell\">", $text);
+
+ $text = str_replace(".end_formatted_area.<br />", "</td></tr></table><table cellpadding=\"0\"><tr><td>", $text);
+ $text = str_replace("<br />", "</td></tr><tr><td class=\"notecell\">&nbsp;", $text);
+ $text = $text . "</td></tr></table>";
+ $text = str_replace("xCxAx", $centitl."<br />", $text);
+ $text = str_replace("Notes:", "<b>Notes:</b>", $text);
+
+?>
diff --git a/modules/GEDFact_assistant/_CENS/census_query1.php b/modules/GEDFact_assistant/_CENS/census_query1.php
new file mode 100644
index 0000000000..6d3635268b
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/census_query1.php
@@ -0,0 +1,119 @@
+<?php
+/**
+* Code for Extracting Shared Note Indi Links for GEDFact_assistant
+*
+* webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+* Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*
+* @package webtrees
+* @subpackage GEDFact_assistant
+* @version $Id$
+*/
+
+if (stristr($_SERVER["SCRIPT_NAME"], basename(__FILE__))!==false) {
+ print "You cannot access an include file directly.";
+ exit;
+}
+
+require './config.php';
+
+?>
+<html <?php echo i18n::html_markup(); ?>>
+<head>
+<script language="JavaScript">
+<!--
+//these function from:
+//http://www.devshed.com/c/a/PHP/PHP-and-JavaScript-Pooling-Your-Resources/
+//this function calls the child file
+function attach_file(p_script_url) {
+ // create new script element, set its relative URL, and load it
+ script = document.createElement('script');
+ script.src = p_script_url;
+ document.getElementsByTagName('head')[0].appendChild( script );
+}
+
+//this function updates the status box
+function show_status(status_text) {
+ document.getElementById('status').innerHTML = status_text;
+}
+
+//-->
+</script>
+
+<!-- CSS Details -->
+<style type="text/css">
+<!--
+.table1 {
+border: 0px solid #CC6600;
+font-family: Verdana, Arial, Helvetica, sans-serif;
+font-size: 10px;
+font-style: normal;
+text-transform: none;
+}
+.style1 {
+color: #000000;
+font-weight: bold;
+}
+.row1 {
+background-color: #D8D8D8;
+}
+.row2 {
+background-color: #FFFFFF;
+}
+-->
+</style>
+</head>
+<body>
+
+<table width="220" border="0" cellpadding="1" cellspacing="3" class="table1">
+<tr>
+<td>
+
+<script language="JavaScript">
+ attach_file('modules/GEDFact_assistant/_CENS/census_query2.php?noteid=N1');
+</script>
+
+<?php
+$refresh = "<input class=\"button\" type=\"button\" name=\"Button\" value=\"Refresh\" ";
+$refresh .= "onClick=\"javascript:attach_file('modules/GEDFact_assistant/_CENS/census_query1a.php";
+$refresh .= "?noteid='+INDI_NOTE.value+'"; //
+$refresh .= "&tblprefix=$TBLPREFIX"; //
+$refresh .= "&dbtype=$DBTYPE"; //
+$refresh .= "&dbhost=$DBHOST"; //
+$refresh .= "&dbuser=$DBUSER"; //
+$refresh .= "&dbpass=$DBPASS"; //
+$refresh .= "&dbname=$DBNAME"; //
+$refresh .= "'); show_status('Busy...'); \" >";
+echo $refresh;
+?>
+</td>
+<td width="120" nowrap="nowrap"><span><b>&nbsp;&nbsp; Linked to: </b></span> </td>
+<td width="60" ><span id="status" /></span> </td>
+</tr>
+</table>
+<p />
+
+<!-- Do not remove this or the table will not show up -->
+<span id="from_mysql"></span>
+<br />
+
+</body>
+</html>
+
diff --git a/modules/GEDFact_assistant/_CENS/census_query1a.php b/modules/GEDFact_assistant/_CENS/census_query1a.php
new file mode 100644
index 0000000000..8573e3e4cc
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/census_query1a.php
@@ -0,0 +1,94 @@
+<?php
+/**
+* Code for Extracting Shared Note Indi Links for GEDFact_assistant
+*
+* webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+* Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*
+* @package webtrees
+* @subpackage GEDFact_assistant
+* @version $Id$
+*/
+// require './config.php';
+// require './includes/classes/class_wt_db.php';
+
+//get values of input fields
+ $noteid = addslashes($_GET['noteid']); //-- Note Id
+ $TBLPREFIX = addslashes($_GET['tblprefix']); //-- table prefix
+ $DBTYPE = addslashes($_GET['dbhost']); //-- MySQL host Name
+ $DBHOST = addslashes($_GET['dbhost']); //-- MySQL host Name
+ $DBUSER = addslashes($_GET['dbuser']); //-- MySQL database User Name
+ $DBPASS = addslashes($_GET['dbpass']); //-- MySQL database User Password
+ $DBNAME = addslashes($_GET['dbname']); //-- The MySQL database name where you want PHPGedView to build its tables
+
+// database info: Change password and DB Name ===================
+// $dbh = new PDO("$DBTYPE:host=$DBHOST;dbname=$DBNAME", $DBUSER, $DBPASS);
+// $statement=$DBH::prepare("SELECT 'INDI' AS type, l_from, l_to FROM {$TBLPREFIX}link, {$TBLPREFIX}individuals WHERE l_from LIKE 'I%' AND i_file=l_file AND i_id=l_from AND l_file='1' AND l_type='NOTE' AND l_to='$noteid'")->execute();
+
+ $db = mysql_connect($DBHOST, $DBUSER, $DBPASS) or die (mysql_error());
+ mysql_select_db ($DBNAME, $db) or die (mysql_error());
+
+//Now Refresh the table .. id=from_mysql
+ $row_count = 0;
+ $output = "<table width=\'250\' border=\'0\' cellpadding=\'0\' cellspacing=\'0\' class=\'table1\'>";
+ $output .= "<tr>";
+ $output .= "<td width=\'10\' align=\'left\' bgcolor=\'#AAAAAA\'><span class=\'style1\'>#</span></td>";
+ $output .= "<td width=\'30\' align=\'left\' bgcolor=\'#AAAAAA\'><span class=\'style1\'>Id</span></td>";
+ $output .= "<td wrap=\'nowrap\' width=\'80\' align=\'left\' bgcolor=\'#AAAAAA\'><span class=\'style1\'>Name</span></td>";
+ $output .= "<td width=\'25\' align=\'center\' bgcolor=\'#AAAAAA\' nowrap='nowrap'><span class=\'style1\'>&nbsp;Link</span></td>";
+ $output .= "<td width=\'25\' align=\'center\' bgcolor=\'#AAAAAA\' nowrap='nowrap'><span class=\'style1\'>&nbsp;&nbsp;Unlink</span></td>";
+ $output .= "</tr>";
+
+ $res_indis = mysql_query("SELECT 'INDI' AS type, l_from, l_to FROM {$TBLPREFIX}link, {$TBLPREFIX}individuals WHERE l_from LIKE 'I%' AND i_file=l_file AND i_id=l_from AND l_file='1' AND l_type='NOTE' AND l_to='$noteid'");
+
+// while ($rows = $statement->fetch(PDO::FETCH_NUM)) {
+// $output .= "<tr><td> $rows[0]</td><td> $rows[1]</td><td> $rows[2]</td></tr>";
+// }
+
+
+ while ($rows = mysql_fetch_array($res_indis)) {
+ $srno = $rows['l_from'];
+ $u_name = "Name for ".$rows['l_from'];
+ $u_email = $rows['l_to'];
+ $row_style = ($row_count % 2) ? "row1" : "row2";
+ $output .= "<tr class=\'".$row_style."\'><td>".($row_count+1)."<td>".$srno."</td><td>".$u_name."</td><td align='center'><input type='radio' name='rad_".$srno."' checked /></td><td align='center'><input type='radio' name='rad_".$srno."' /></td></tr>";
+ $row_count = $row_count + 1;
+ }
+
+
+//Free Results
+ mysql_free_result($res_indis);
+// $statement->closeCursor();
+
+ $output .= "</table>";
+
+?>
+
+<?php //update table ?>
+from_mysql_obj = document.getElementById( "from_mysql" );
+from_mysql_obj.innerHTML = "<?php echo $output; ?>";
+
+<?php //update status box ?>
+my_status = document.getElementById( "status" );
+my_status.innerHTML = 'Ready';
+
+
+
+
diff --git a/modules/GEDFact_assistant/_CENS/census_query_1b.php b/modules/GEDFact_assistant/_CENS/census_query_1b.php
new file mode 100644
index 0000000000..1b130c8b28
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/census_query_1b.php
@@ -0,0 +1,115 @@
+<?php
+/**
+ * Code for Extracting Shared Note Indi Links for GEDFact_assistant
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage GEDFact_assistant
+ * @version $Id$
+*/
+
+if (stristr($_SERVER["SCRIPT_NAME"], basename(__FILE__))!==false) {
+ print "You cannot access an include file directly.";
+ exit;
+}
+?>
+
+<html <?php echo i18n::html_markup(); ?>>
+<head>
+</head>
+<body>
+<?php
+require_once 'includes/functions/functions_print_lists.php';
+
+// $links = get_media_relations($mediaid);
+print_note_table(get_note_list(WT_GED_ID));
+
+ $links = get_note_list(WT_GED_ID);
+ // var_dump($links);
+ echo "<table><tr><td>";
+ echo "<table id=\"existLinkTbl\" width=\"430\" cellspacing=\"1\" >";
+ echo "<tr>";
+ echo '<td class="topbottombar" width="15" style="text-align:left;font-weight:100;" >#</td>';
+ echo '<td class="topbottombar" width="50" style="text-align:left;font-weight:100;" >ID:</td>';
+ echo '<td class="topbottombar" width="340" style="text-align:left;font-weight:100;" >', i18n::translate('Name'), '</td>';
+ echo '<td class="topbottombar" width="20" style="text-align:left;font-weight:100;" >', i18n::translate('Keep'), '</td>';
+ echo '<td class="topbottombar" width="20" style="text-align:left;font-weight:100;" >', i18n::translate('Unlink'), '</td>';
+ echo '<td class="topbottombar" width="20" style="text-align:left;font-weight:100;" >', i18n::translate('Navigator'), '</td>';
+ echo "</tr>";
+
+ $keys = array_keys($links);
+ $values = array_values($links);
+ $i=1;
+ foreach ($keys as $link) {
+ $record=GedcomRecord::getInstance($link);
+
+ echo "<tr ><td class=\"row2\"><font size='2'>";
+ echo $i;
+ echo "</td><td id=\"existId_".$i."\" class=\"row2\"><font size='2'>";
+ echo $link;
+ echo "</td><td class=\"row2\" ><font size='2'>";
+ if ($record->getType()=='INDI') {
+ $idrecord=Person::getInstance($link);
+ } elseif ($record->getType()=='FAM') {
+ $idrecord=Family::getInstance($link);
+ if ($idrecord->getHusbId()) {
+ $head=$idrecord->getHusbId();
+ }else{
+ $head=$idrecord->getWifeId();
+ }
+ } elseif ($record->getType()=='SOUR') {
+ $idrecord=Source::getInstance($link);
+ } else {
+
+ }
+
+ $nam = $idrecord->getFullName();
+ echo $nam;
+ echo "</td>";
+ echo "<td class=\"row2\" align='center'><input alt='", i18n::translate('Keep Link in list'), "', title='", i18n::translate('Keep Link in list'), "' type='radio' id='".$link."_off' name='".$link."' checked /></td>";
+ echo "<td class=\"row2\" align='center'><input alt='", i18n::translate('Remove Link from list'), "', title='", i18n::translate('Remove Link from list'), "' type='radio' id='".$link."_on' name='".$link."' /></td>";
+
+ if ($record->getType()=='INDI') {
+ ?>
+ <td class="row2" align="center"><a href="#"><img style="border-style:none; margin-top:5px;" src="<?php echo $WT_IMAGE_DIR;?>/buttons/family.gif" alt="<?php echo i18n::translate('Open Family Navigator'); ?>" title="<?php echo i18n::translate('Open Family Navigator'); ?>" name="family_'<?php echo $link; ?>'" onclick="javascript:openFamNav('<?php echo $link; ?>');" /></a></td>
+ <?php
+ } elseif ($record->getType()=='FAM') {
+ ?>
+ <td class="row2" align="center"><a href="#"><img style="border-style:none; margin-top:5px;" src="<?php echo $WT_IMAGE_DIR;?>/buttons/family.gif" alt="<?php echo i18n::translate('Open Family Navigator'); ?>" title="<?php echo i18n::translate('Open Family Navigator'); ?>" name="family_'<?php echo $link; ?>'" onclick="javascript:openFamNav('<?php echo $head; ?>');" /></a></td>
+ <?php
+ } else {
+ echo '<td></td>';
+ }
+ echo '</tr>';
+ $i= $i+1;
+ }
+
+ echo "</table>";
+ echo "</td></tr></table>";
+ echo "<br />";
+?>
+
+</body>
+</html>
+
+
+
diff --git a/modules/GEDFact_assistant/_CENS/census_query_2a.php b/modules/GEDFact_assistant/_CENS/census_query_2a.php
new file mode 100644
index 0000000000..f6d7439f6c
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/census_query_2a.php
@@ -0,0 +1,225 @@
+<?php
+/**
+ * Census Assistant Control module for phpGedView
+ *
+ * Census information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Census Assistant
+ * @version $Id$
+ */
+
+ global $TEXT_DIRECTION, $CensDate;
+
+ $CensDate="yes";
+
+ require WT_ROOT.'includes/functions/functions_print_lists.php'; // *** NOTE THIS is necessary for the function below ***
+
+// *** LINKS tags --- This will be added later **** =========================================
+/*
+ echo "<tr><td class=\"descriptionbox ".$TEXT_DIRECTION." wrap width25\">";
+ echo help_link("edit_add_SHARED_NOTE");
+ echo "Links: <br />";
+ echo "</td><td class=\"optionbox wrap\">\n";
+ // print_indi_list(fetch_linked_indi('N1', "NOTE", "1")); // *** NOTE THIS needs fixing to replace "N1" with a variable, or use another function ***
+ // include ('modules/GEDFact_assistant/_CENS/census_query_1b.php');
+ echo "*** Not implemented yet ***";
+ echo "</td></tr>\n";
+ echo "<tr><td class=\"descriptionbox ".$TEXT_DIRECTION." wrap width25\">";
+ echo help_link("edit_add_SHARED_NOTE");
+ echo "Add Links: <br />";
+ echo "</td><td class=\"optionbox wrap\">\n";
+ // include ('modules/GEDFact_assistant/_CENS/census_query1.php');
+ echo "*** Not implemented yet ***";
+ echo "</td></tr>\n";
+*/
+
+
+// OLD CODE FROM HERE ON, NOT SURE WHETHER IT WILL BE NEEDED ================================
+/*
+ $linksAddLinks = "";
+ $linksAddLinks .= "<tr><td class=\"descriptionbox ".$TEXT_DIRECTION." wrap width25\">";
+ // $linksAddLinks .= help_link("edit_add_SHARED_NOTE");
+ $linksAddLinks .= "Currently Linked to: ";
+ $linksAddLinks .= "</td>";
+ $linksAddLinks .= "<td class=\"optionbox wrap\">\n";
+ // $linksAddLinks .= include('includes/functions/functions_print_lists.php'); // *** NOTE THIS is necessary for the function below ***
+ // $linksAddLinks .= print_indi_list(fetch_linked_indi('N1', "NOTE", "1")); // *** NOTE THIS needs fixing to replace "N1" with a variable, or use another function ***
+ // $linksAddLinks .= // include ('modules/GEDFact_assistant/_CENS/census_query_1b.php');
+ $linksAddLinks .= "xxx</td>";
+ $linksAddLinks .= "</tr>";
+
+ $linksAddLinks .= "<tr>";
+ $linksAddLinks .= "<td class=\"descriptionbox ".$TEXT_DIRECTION." wrap width25\">";
+ // $linksAddLinks .= help_link("edit_add_SHARED_NOTE");
+ $linksAddLinks .= "Add Other Links: ";
+ $linksAddLinks .= "</td><td class=\"optionbox wrap\">\n";
+ // $linksAddLinks .= // include ('modules/GEDFact_assistant/_CENS/census_query1.php');
+ $linksAddLinks .= "</td></tr>";
+
+ echo $linksAddLinks;
+*/
+
+
+// GEDFact\-assistant ================================
+/**
+ * print a list of individuals
+ *
+ * REQUIRES('includes/functions/functions_print_lists.php');
+ *
+ * @param array $datalist contain individuals that were extracted from the database.
+ * @param string $legend optional legend of the fieldset
+ */
+
+/*
+function print_indi_list($datalist, $legend="", $option="") {
+ global $GEDCOM, $SHOW_ID_NUMBERS, $SHOW_LAST_CHANGE, $SHOW_MARRIED_NAMES, $TEXT_DIRECTION;
+ global $WT_IMAGE_DIR, $WT_IMAGES, $SEARCH_SPIDER, $SHOW_EST_LIST_DATES;
+
+ if ($option=="MARR_PLAC") return;
+ if (count($datalist)<1) return;
+ $tiny = (count($datalist)<=500);
+ $name_subtags = array("", "_AKA", "_HEB", "ROMN");
+ if ($SHOW_MARRIED_NAMES) $name_subtags[] = "_MARNM";
+ require_once 'js/sorttable.js.htm';
+ require_once 'includes/classes/class_stats.php';
+ $stats = new stats($GEDCOM);
+ $max_age = $stats->LongestLifeAge()+1;
+ //-- init chart data
+ for ($age=0; $age<=$max_age; $age++) $deat_by_age[$age]="";
+ for ($year=1550; $year<2030; $year+=10) $birt_by_decade[$year]="";
+ for ($year=1550; $year<2030; $year+=10) $deat_by_decade[$year]="";
+
+ $table_id = "ID".floor(microtime()*1000000); // sorttable requires a unique ID
+ echo '<div id="'.$table_id.'-table" class="center">';
+ echo "<table id=\"".$table_id."\" >";
+
+ //-- table header
+ echo "<thead><tr>";
+ echo "<td></td>";
+ if ($SHOW_ID_NUMBERS) echo "<th class=\"list_label rela\">&nbsp; INDI &nbsp;</th>";
+ echo '<th class="list_label">'.i18n::translate('NAME').'</th>';
+ echo "<th class=\"list_label\">&nbsp;".i18n::translate('Add')."&nbsp; </th>";
+ echo "</tr></thead>\n";
+
+ //-- table body
+ echo "<tbody>";
+ $hidden = 0;
+ $n = 0;
+ $d100y=new GedcomDate(date('Y')-100); // 100 years ago
+ $dateY = date("Y");
+ $unique_indis=array(); // Don't double-count indis with multiple names.
+ foreach($datalist as $key => $value) {
+ if (is_object($value)) { // Array of objects
+ $person=$value;
+ } elseif (!is_array($value)) { // Array of IDs
+ $person = Person::getInstance($value);
+ } else { // Array of search results
+ $gid = $key;
+ if (isset($value["gid"])) $gid = $value["gid"]; // from indilist
+ if (isset($value[4])) $gid = $value[4]; // from indilist ALL
+ $person = Person::getInstance($gid);
+ }
+ // @var $person Person
+ if (is_null($person)) continue;
+ if ($person->getType() !== "INDI") continue;
+ if (!$person->canDisplayName()) {
+ $hidden++;
+ continue;
+ }
+ $unique_indis[$person->getXref()]=true;
+ //-- place filtering
+ if ($option=="BIRT_PLAC" && strstr($person->getBirthPlace(), $filter)===false) continue;
+ if ($option=="DEAT_PLAC" && strstr($person->getDeathPlace(), $filter)===false) continue;
+
+
+ //-- Counter
+ echo "<tr>";
+ echo "<td class=\"list_value_wrap rela list_item\">".++$n."</td>";
+
+ //-- Gedcom ID
+ if ($SHOW_ID_NUMBERS)
+ echo '<td class="list_value_wrap rela">'.$person->getXref("_blank").'</td>';
+
+ //-- Indi name(s)
+ $tdclass = "list_value_wrap";
+ if (!$person->isDead()) $tdclass .= " alive";
+ if (!$person->getChildFamilyIds()) $tdclass .= " patriarch";
+ echo "<td class=\"".$tdclass."\" align=\"".get_align($person->getListName())."\">";
+ $names_html=array();
+ list($surn, $givn)=explode(',', $person->getSortName());
+ // If we're showing search results, then the highlighted name is not
+ // necessarily the person's primary name.
+ $primary=$person->getPrimaryName();
+ $names=$person->getAllNames();
+ foreach ($names as $num=>$name) {
+ // Exclude duplicate names, which can occur when individuals have
+ // multiple surnames, such as in Spain/Portugal
+ $dupe_found=false;
+ foreach ($names as $dupe_num=>$dupe_name) {
+ if ($dupe_num>$num && $dupe_name['type']==$name['type'] && $dupe_name['full']==$name['full']) {
+ // Take care not to skip the "primary" name
+ if ($num==$primary) {
+ $primary=$dupe_num;
+ }
+ $dupe_found=true;
+ break;
+ }
+ }
+ if ($dupe_found) {
+ continue;
+ }
+ if ($title=$name['type']=='_MARNM') {
+ $title='title="'.i18n::translate('_MARNM').'"';
+ } else {
+ $title='';
+ }
+ if ($num==$primary) {
+ $class='list_item name2';
+ $sex_image=$person->getSexImage();
+ list($surn, $givn)=explode(',', $name['sort']);
+ } else {
+ $class='list_item';
+ $sex_image='';
+ }
+ $names_html[]='<span '.$title.' class="'.$class.'">'.PrintReady($name['list']).'</span>'.$sex_image;
+ }
+ echo implode('<br/>', $names_html);
+
+ //-- Birth date
+ echo "<td class=\"list_value_wrap rela\">";
+ echo "[x]";
+ echo "</td";
+
+ echo "</tr>\n";
+ }
+ echo "</tbody>";
+ echo "</table>\n";
+ echo "</div>";
+
+}
+*/
+// ==========================================================
+
+
+?>
diff --git a/modules/GEDFact_assistant/_CENS/js/census_5_input.js.php b/modules/GEDFact_assistant/_CENS/js/census_5_input.js.php
new file mode 100644
index 0000000000..d32b7534e0
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/js/census_5_input.js.php
@@ -0,0 +1,2616 @@
+<?php
+/**
+ * Census Assistant Control module for phpGedView
+ *
+ * Census information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Census Assistant
+ * @version $Id$
+ */
+
+// modified from tabledeleterow.js version 1.2 2006-02-21
+// mredkj.com
+
+// CONFIG notes. Below are some comments that point to where this script can be customized.
+// Note: Make sure to include a <tbody></tbody> in your table's HTML
+
+?>
+<script src="modules/GEDFact_assistant/_CENS/js/chapman_codes.js" type="text/javascript"></script>
+<script>
+
+//Load Language variables for Edit header and tooltip ============================
+var HeaderName = "<?php echo i18n::translate('Name');?>";
+var TTEditName = "<?php echo i18n::translate('Full Name or Married name if married');?>";
+var HeaderRela = "<?php echo i18n::translate('Relation');?>";
+var TTEditRela = "<?php echo i18n::translate('Relationship to Head of Household - Head, Wife, Son etc');?>";
+var HeaderMCond = "<?php echo i18n::translate('MC');?>";
+var TTEditMCond = "<?php echo i18n::translate('Marital Condition - M,S,U,W,D - Married, Single, Unmarried, Widowed or Divorced');?>";
+var HeaderAsset = "<?php echo i18n::translate('Assets');?>";
+var TTEditAsset = "<?php echo i18n::translate('Assets = O,R - value,rent - Y,N,R - Y,N,F = Owned,Rented - Value,Rent - Radio - Farm');?>";
+var HeaderAge = "<?php echo i18n::translate('Age');?>";
+var TTEditAge = "<?php echo i18n::translate('Age at last birthday');?>";
+var HeaderRace = "<?php echo i18n::translate('Race');?>";
+var TTEditRace = "<?php echo i18n::translate('Race or Color - B.W,M,A,I,C - Black, White, Mulatto, Asian, Indian, Chinese etc');?>";
+var HeaderSex = "<?php echo i18n::translate('Sex');?>";
+var TTEditSex = "<?php echo i18n::translate('Male(M) or Female(F)');?>";
+var HeaderYOB = "<?php echo i18n::translate('DOB');?>";
+var TTEditYOB = "<?php echo i18n::translate('Date of Birth - mmm yyyy');?>";
+var HeaderBmth = "<?php echo i18n::translate('Bmth');?>";
+var TTEditBmth = "<?php echo i18n::translate('If born within Census year - mmm - Month of birth');?>";
+var HeaderYrsM = "<?php echo i18n::translate('YrsM');?>";
+var TTEditYrsM = "<?php echo i18n::translate('Years Married or if married in Census Year - yy or Y');?>";
+var HeaderChilB = "<?php echo i18n::translate('ChB');?>";
+var TTEditChilB = "<?php echo i18n::translate('Children born alive - nn');?>";
+var HeaderChilL = "<?php echo i18n::translate('ChL');?>";
+var TTEditChilL = "<?php echo i18n::translate('Children still living - nn');?>";
+var HeaderChilD = "<?php echo i18n::translate('ChD');?>";
+var TTEditChilD = "<?php echo i18n::translate('Children who have died - nn');?>";
+var HeaderAgeM = "<?php echo i18n::translate('AgM');?>";
+var TTEditAgeM = "<?php echo i18n::translate('Age at first marriage - yy');?>";
+var HeaderOccu = "<?php echo i18n::translate('Occupation');?>";
+var TTEditOccu = "<?php echo i18n::translate('Occupation');?>";
+var HeaderBplace = "<?php echo i18n::translate('Birthplace');?>"; // Full format
+var TTEditBplace = "<?php echo i18n::translate('Birthplace (Full format)');?>"; // Full format
+var HeaderBP = "<?php echo i18n::translate('BP');?>"; // Chapman format
+var TTEditBP = "<?php echo i18n::translate('Birthplace - xx or xxx - State/Country (Chapman format)');?>"; // Chapman format
+var HeaderFBP = "<?php echo i18n::translate('FBP');?>"; // Chapman format
+var TTEditFBP = "<?php echo i18n::translate('Father\'s Birthplace - xx or xxx - State or Country (Chapman format)');?>"; // Chapman format
+var HeaderMBP = "<?php echo i18n::translate('MBP');?>"; // Chapman format
+var TTEditMBP = "<?php echo i18n::translate('Mother\'s Birthplace - xx or xxx - State or Country (Chapman format)');?>"; // Chapman format
+var HeaderNL = "<?php echo i18n::translate('NL');?>";
+var TTEditNL = "<?php echo i18n::translate('If Foreign Born - Native Language');?>";
+var HeaderHealth = "<?php echo i18n::translate('Health');?>";
+var TTEditHealth = "<?php echo i18n::translate('Health - 12345 = 1.Blind, 2.Deaf&Dumb, 3.Idiotic, 4.Insane, 5.Disabled etc');?>";
+var HeaderYrsUS = "<?php echo i18n::translate('YUS');?>";
+var TTEditYrsUS = "<?php echo i18n::translate('If Foreign Born - yy -Years in the USA');?>";
+var HeaderYOI = "<?php echo i18n::translate('YOI');?>";
+var TTEditYOI = "<?php echo i18n::translate('If Foreign Born - yyyy - Year of Immigration');?>";
+var HeaderNA = "<?php echo i18n::translate('N/A');?>";
+var TTEditNA = "<?php echo i18n::translate('If Foreign Born - N,A - Naturalized, Alien');?>";
+var HeaderYON = "<?php echo i18n::translate('YON');?>";
+var TTEditYON = "<?php echo i18n::translate('If Foreign Born - yyyy - Year of Naturalization');?>";
+var HeaderEngL = "<?php echo i18n::translate('EngL');?>";
+var TTEditEngL = "<?php echo i18n::translate('English spoken?, if not, Native Language');?>";
+var HeaderEng = "<?php echo i18n::translate('Eng?');?>";
+var TTEditEng = "<?php echo i18n::translate('English spoken? - Y/N');?>";
+var HeaderInd = "<?php echo i18n::translate('Industry');?>";
+var TTEditInd = "<?php echo i18n::translate('Industry');?>";
+var HeaderEmp = "<?php echo i18n::translate('Employ');?>";
+var TTEditEmp = "<?php echo i18n::translate('Employment - Yes, No, Worker, Employer etc');?>";
+var HeaderEmR = "<?php echo i18n::translate('EmR');?>";
+var TTEditEmR = "<?php echo i18n::translate('Employer? - Y/N');?>";
+var HeaderEmD = "<?php echo i18n::translate('EmD');?>";
+var TTEditEmD = "<?php echo i18n::translate('Employed? - Y/N');?>";
+var HeaderEmH = "<?php echo i18n::translate('WH');?>";
+var TTEditEmH = "<?php echo i18n::translate('Working at Home? - Y/N');?>";
+var HeaderEmN = "<?php echo i18n::translate('EmN');?>";
+var TTEditEmN = "<?php echo i18n::translate('UnEmployed? - Y/N');?>";
+var HeaderEduc = "<?php echo i18n::translate('Edu');?>";
+var TTEditEduc = "<?php echo i18n::translate('Education - xxx - At School? Y/N, Can Read? Y/N, Can Write? Y/N');?>";
+var HeaderBIC = "<?php echo i18n::translate('BIC');?>";
+var TTEditBIC = "<?php echo i18n::translate('Born in County - Y/N - (UK 1841 only)');?>";
+var HeaderBOE = "<?php echo i18n::translate('BOE');?>";
+var TTEditBOE = "<?php echo i18n::translate('Born outside England - SCO,IRE,WAL,FOReign - (UK 1841 only)');?>";
+var HeaderInfirm = "<?php echo i18n::translate('Infirm');?>";
+var TTEditInfirm = "<?php echo i18n::translate('Infirmaties - 1234 - 1.Deaf&Dumb, 2.Blind, 3.Lunatic, 4.Imbecile/feeble-minded');?>";
+var HeaderVet = "<?php echo i18n::translate('Vet');?>";
+var TTEditVet = "<?php echo i18n::translate('War Veteran? - Y/N');?>";
+var HeaderTenure = "<?php echo i18n::translate('Ten');?>";
+var TTEditTenure = "<?php echo i18n::translate('Tenure - xx - Owned/Rented, (if owned)Free/Mortgaged - eg OM, or R-, or OF');?>";
+var HeaderParent = "<?php echo i18n::translate('Par');?>";
+var TTEditParent = "<?php echo i18n::translate('Parentage - xx = Father if foreign born Y/N/-, Mother if foreign born Y/N/- = eg YY, YN, NY, or -');?>";
+var HeaderMmth = "<?php echo i18n::translate('Mmth');?>";
+var TTEditMmth = "<?php echo i18n::translate('Marriage month - mmm = If married within Census year - Month of marriage');?>";
+var HeaderMnse = "<?php echo i18n::translate('MnsE');?>";
+var TTEditMnse = "<?php echo i18n::translate('Months Employed - xx = Months employed during Census Year');?>";
+var HeaderWksu = "<?php echo i18n::translate('WksU');?>";
+var TTEditWksu = "<?php echo i18n::translate('Weeks Unemployed - xx = Weeks unemployed during Census Year');?>";
+var HeaderMnsu = "<?php echo i18n::translate('MnsU');?>";
+var TTEditMnsu = "<?php echo i18n::translate('Months Unemployed - xx = Months unemployed during Census Year');?>";
+var HeaderHome = "<?php echo i18n::translate('Home');?>";
+var TTEditHome = "<?php echo i18n::translate('Home Ownership - x-x-x-xxxx = O/R-F/M-F/H-#### = Owned/Rented-Free/Mortgaged-Farm/House-Farm Schedule number');?>";
+var HeaderSitu = "<?php echo i18n::translate('Situ');?>";
+var TTEditSitu = "<?php echo i18n::translate('Situation - 3 parameters - Diseases, Infimaties, Convict/Pauper etc');?>";
+var HeaderWar = "<?php echo i18n::translate('War');?>";
+var TTEditWar = "<?php echo i18n::translate('War or Expedition');?>";
+var HeaderInfirm1910 = "<?php echo i18n::translate('Infirm');?>";
+var TTEditInfirm1910 = "<?php echo i18n::translate('Infirmaties - xx = Whether blind (both eyes) Y/N, Whether Deaf and Dumb Y/N');?>";
+var HeaderEducpre1890 = "<?php echo i18n::translate('Edu');?>";
+var TTEditEducpre1890 = "<?php echo i18n::translate('Education - xxx = At School, Cannot Read, Cannot Write = eg x--, xxx, or -xx etc');?>";
+
+var HeaderLang = "<?php echo i18n::translate('Lang');?>";
+var TTEditLang = "<?php echo i18n::translate('If Foreign Born - Native Language');?>";
+
+// Load Edit Table variables =====================================================
+var INPUT_NAME_PREFIX = 'InputCell_'; // this is being set via script
+var RADIO_NAME = "totallyrad"; // this is being set via script
+var TABLE_NAME = 'tblSample'; // this should be named in the HTML
+var ROW_BASE = 0; // first number (for display)
+var hasLoaded = false;
+
+
+// Load Other variables =======================================================
+var NoteCtry = document.getElementById('censCtry');
+var NoteYear = document.getElementById('censYear');
+var NoteTitl = document.getElementById('Titl');
+
+// Functions ==================================================================
+function caSave() {
+ preview();
+ pastedate();
+}
+
+function pastedate() {
+ window.opener.pasteAsstDate(document.getElementById('censCtry').value, document.getElementById('censYear').value);
+}
+
+function preview() {
+ NoteCtry = document.getElementById('censCtry');
+ NoteYear = document.getElementById('censYear');
+ Citation = document.getElementById('citation');
+ Locality = document.getElementById('locality');
+ Notes = document.getElementById('notes');
+
+ str = NoteYear.value + " " + NoteCtry.value + " " + NoteTitl.value;
+ str += "\n";
+ if (Citation.value!="" && Citation.value!=null) {
+ str += Citation.value + "\n";
+ }
+ if (Locality.value!="" && Locality.value!=null) {
+ str += Locality.value + "\n";
+ }
+ str += "\n";
+ str += ".start_formatted_area.";
+
+ iid = "";
+
+ var tbl = document.getElementById('tblSample');
+
+
+ for(var i=0; i<tbl.rows.length; i++){
+ var tr = tbl.rows[i];
+ var strRow = '';
+
+ var pidList = '';
+
+ // ---------------------------------------------
+
+ // Extract Indi id's from created list --------------------------------------
+ for(var y=1; y<tr.cells.length-3; y++) {
+ if ( y>=2 && y<=73) {
+ continue;
+ }else{
+ if (i!=0) {
+ // pidList += '\'' + (pidList==''?'':' ') + tr.cells[1].childNodes[0].value + '\'';
+ pidList += (pidList==''?'':' ') + tr.cells[1].childNodes[0].value;
+ }
+ }
+ }
+
+ // Extract required columns for display based on Country and Year -----------
+ if (NoteCtry.value=="UK") {
+ // UK 1911 or 1921 or 1931 ===============
+ if (NoteYear.value=="1911" || NoteYear.value=="1921" || NoteYear.value=="1931") {
+ for(var j=2; j<tr.cells.length-3; j++) {
+ if (j==5 || j==6 || j==8 || (j>=10 && j<=15) || (j>=20 && j<=34) || j==36 || (j>=39 && j<=41) || (j>=43 && j<=49) || (j>=51 && j<=62) || (j>=64 && j<=73) ) {
+ continue;
+ }else{
+ if (i==0) {
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id;
+ }else{
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value;
+ }
+ }
+ }
+ // UK 1901 ===============
+ } else if (NoteYear.value=="1901") {
+ for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item #
+ if ( j==5 || j==6 || j==8 || (j>=10 && j<=34) || j==36 || j==37 || (j>=39 && j<=41) || (j>=43 && j<=49) || (j>=51 && j<=62) || (j>=64 && j<=73) ) {
+ continue;
+ }else{
+ if (i==0) {
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id;
+ }else{
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value;
+ }
+ }
+ }
+ // UK 1891 ===============
+ } else if (NoteYear.value=="1891") {
+ for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item #
+ if ( j==5 || j==6 || j==8 || (j>=10 && j<=34) || (j>=36 && j<=38) || j==41 || j==42 || (j>=44 && j<=49) || (j>=51 && j<=62) || (j>=64 && j<=73) ) {
+ continue;
+ }else{
+ if (i==0) {
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id;
+ }else{
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value;
+ }
+ }
+ }
+ // UK 1951-1881 ============
+ } else if (NoteYear.value=="1851" || NoteYear.value=="1861" || NoteYear.value=="1871" || NoteYear.value=="1881") {
+ for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item #
+ if ( j==5 || j==6 || j==8 || (j>=10 && j<=34) || (j>=36 && j<=49) || (j>=51 && j<=62) || (j>=64 && j<=73) ) {
+ continue;
+ }else{
+ if (i==0) {
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id;
+ }else{
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value;
+ }
+ }
+ }
+ // UK 1841 ===============
+ } else if (NoteYear.value=="1841") {
+ for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item #
+ if ( (j>=3 && j<=6) || j==8 || (j>=10 && j<=34) || (j>=36 && j<=51) || (j>=54 && j<=73) ) {
+ continue;
+ }else{
+ if (i==0) {
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id;
+ }else{
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value;
+ }
+ }
+ }
+ }
+
+ } else if (NoteCtry.value=="USA") {
+ // USA 1930 ===============
+ if (NoteYear.value=="1930") {
+ for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item #
+ if ( j==4 || j==5 || j==7 || j==8 || j==11 || j==13 || j==14 || (j>=16 && j<=19) || (j>=21 && j<=45) || (j>=47 && j<=50) || j==52 || j==53 || j==63 || j==64 || j>=67 && j<=73 ) {
+ continue;
+ }else{
+ if (i==0) {
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id;
+ }else{
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value;
+ }
+ }
+ }
+ }
+
+ // USA 1920 ===============
+ else if (NoteYear.value=="1920") {
+ for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item #
+ if ( j==4 || (j>=6 && j<=8) || j==11 || j==13 || j==14 || (j>=16 && j<=30) || (j>=34 && j<=45) || (j>=47 && j<=50) || j==52 || j==53 || j==57 || j==58 || (j>=63 && j<=73) ) {
+ continue;
+ }else{
+ if (i==0) {
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id;
+ }else{
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value;
+ }
+ }
+ }
+ }
+
+ // USA 1910 ===============
+ else if (NoteYear.value=="1910") {
+ for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item #
+ if ( (j>=4 && j<=8) || j==11 || j==13 || j==14 || (j>=19 && j<=26) || j==33 || j==36 || (j>=39 && j<=42) || j==45 || j==47 || j==48 || (j>=50 && j<=64) || j==66 || j>=68 && j<=73 ) {
+ continue;
+ }else{
+ if (i==0) {
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id;
+ }else{
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value;
+ }
+ }
+ }
+ }
+ // USA 1900 ===============
+ else if (NoteYear.value=="1900") {
+ for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item #
+ if ( (j>=4 && j<=7) || j==10 || j==13 || j==14 || (j>=19 && j<=26) || j==33 || j==34 || (j>=36 && j<=44) || j==47 || (j>=50 && j<=73) ) {
+ continue;
+ }else{
+ if (i==0) {
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id;
+ }else{
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value;
+ }
+ }
+ }
+ }
+ // USA 1890 ===============
+ else if (NoteYear.value=="1890") {
+ for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item #
+ if ( (j>=4 && j<=7) || j==10 || j==11 || j==13 || j==14 || (j>=19 && j<=26) || j==31 || j==33 || j==34 || j==36 || j==37 || j==39 || j==40 || (j>=42 && j<=45) || j==47 || (j>=49 && j<=63) || (j>=65 && j<=73) ) {
+ continue;
+ }else{
+ if (i==0) {
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id;
+ }else{
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value;
+ }
+ }
+ }
+ }
+ // USA 1880 ===============
+ else if (NoteYear.value=="1880") {
+ for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item #
+ if ( (j>=3 && j<=7) || j==10 || j==11 || (j>=17 && j<=34) || (j>=37 && j<=44) || (j>=40 && j<=42) || j==46 || j==49 || j==50 || j==52 || j==53 || (j>=56 && j<=73) ) {
+ continue;
+ }else{
+ if (i==0) {
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id;
+ }else{
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value;
+ }
+ }
+ }
+ }
+ // USA 1870 ===============
+ else if (NoteYear.value=="1870") {
+ for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item #
+ if ( (j>=3 && j<=6) || j==8 || (j>=11 && j<=20) || (j>=27 && j<=46) || (j>=48 && j<=62) || (j>=64 && j<=73) ) {
+ continue;
+ }else{
+ if (i==0) {
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id;
+ }else{
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value;
+ }
+ }
+ }
+ }
+ // USA 1860 or 1850 ===============
+ else if (NoteYear.value=="1860" || NoteYear.value=="1850") {
+ for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item #
+ if ( (j>=3 && j<=6) || j==8 || (j>=11 && j<=20) || j==24 || j==25 || (j>=27 && j<=46) || (j>=48 && j<=62) || (j>=64 && j<=73) ) {
+ continue;
+ }else{
+ if (i==0) {
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].id;
+ }else{
+ strRow += (strRow==''?'':'|') + tr.cells[j].childNodes[0].value;
+ }
+ }
+ }
+ }
+
+ }else{
+ // Other country stuff
+ }
+
+ str += (str==''?'':'\n') + strRow;
+ if (i!=0) {
+ iid += (iid==''?'':'') + pidList + ', ';
+ }
+
+ // Reset/Check the Pink Highlighting of the Name field and Age fields for any person not born ------------------
+ for(var j=2; j<tr.cells.length-3; j++) { // == j=2 means miss out cols 0 and 1 (# and pid), cells.length-3 means miss out del, ins and item #
+ if (i==0) {
+ // Do nothing as this is the header row.
+ }else{
+ if (tr.cells[7].childNodes[0].value != "-" || tr.cells[12].childNodes[0].value != "-") {
+ tr.cells[2].childNodes[0].style.background = '#ffffff';
+ tr.cells[7].childNodes[0].style.background = '#ffffff';
+ tr.cells[12].childNodes[0].style.background = '#ffffff';
+ }else{
+ // alert(tr.cells[2].childNodes[0].value+" - Not Born Yet");
+ tr.cells[2].childNodes[0].style.background = '#ffaaaa';
+ tr.cells[7].childNodes[0].style.background = '#ffaaaa';
+ tr.cells[12].childNodes[0].style.background = '#ffaaaa';
+ }
+ }
+ }
+
+ }
+
+ //-- TODO -- Check for corrected ages --- Sill to fix manual entry for override of values --------------------
+ //changeAge(NoteYear.value);
+
+ // --- Debug only - alert indi id's found --------
+ // if (i!=0) {
+ // alert(iid);
+ // }
+
+ var mem = document.getElementById('NOTE');
+ if (Notes.value!="" && Notes.value!=null) {
+ mem.value = str + "\n.end_formatted_area.\n\nNotes:\n"+Notes.value;
+ } else {
+ mem.value = str + "\n.end_formatted_area.\n";
+ }
+
+ // ---- Create an array of Indi id's ----------
+ var mem21 = document.getElementById('pid_array');
+ mem21.value = iid.slice(0, -2);
+
+} // ---- end function preview() -----
+
+
+window.onload=fillInRows;
+
+// fillInRows - can be used to pre-load a table with a header, row, or rows
+function fillInRows() {
+ hasLoaded = true;
+ // create_header();
+ // insertRowToTable();
+ // addRowToTable();
+ if (TheCenYear!='') {
+ changeYear(TheCenYear);
+ }
+}
+
+// myRowObject - an object for storing information about the table rows
+function myRowObject( zero, one, two, three, four, five, six, seven, eight, nine,
+ ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen,
+ twenty, twentyone, twentytwo, twentythree, twentyfour, twentyfive, twentysix, twentyseven, twentyeight, twentynine,
+ thirty, thirtyone, thirtytwo, thirtythree, thirtyfour, thirtyfive, thirtysix, thirtyseven, thirtyeight, thirtynine,
+ forty, fortyone, fortytwo, fortythree, fortyfour, fortyfive, fortysix, fortyseven, fortyeight, fortynine,
+ fifty, fiftyone, fiftytwo, fiftythree, fiftyfour, fiftyfive, fiftysix, fiftyseven, fiftyeight, fiftynine,
+ sixty, sixtyone, sixtytwo, sixtythree, sixtyfour, sixtyfive, sixtysix, sixtyseven, sixtyeight, sixtynine,
+ seventy, seventyone, seventytwo, seventythree,
+ cb, ra, index2
+ )
+{
+
+ this.zero = zero; // text object
+ this.one = one; // input text object
+ this.two = two; // input text object
+ this.three = three; // input text object
+ this.four = four; // input text object
+ this.five = five; // input text object
+ this.six = six; // input text object
+ this.seven = seven; // input text object
+ this.eight = eight; // input text object
+ this.nine = nine; // input text object
+ this.ten = ten; // input text object
+ this.eleven = eleven; // input text object
+ this.twelve = twelve; // input text object
+ this.thirteen = thirteen; // input text object
+ this.fourteen = fourteen; // input text object
+ this.fifteen = fifteen; // input text object
+ this.sixteen = sixteen; // input text object
+ this.seventeen = seventeen; // input text object
+ this.eighteen = eighteen; // input text object
+ this.nineteen = nineteen; // input text object
+ this.twenty = twenty; // input text object
+ this.twentyone = twentyone; // input text object
+ this.twentytwo = twentytwo; // input text object
+ this.twentythree = twentythree; // input text object
+ this.twentyfour = twentyfour; // input text object
+ this.twentyfive = twentyfive; // input text object
+ this.twentysix = twentysix; // input text object
+ this.twentyseven = twentyseven; // input text object
+ this.twentyeight = twentyeight; // input text object
+ this.twentynine = twentynine; // input text object
+ this.thirty = thirty; // input text object
+ this.thirtyone = thirtyone; // input text object
+ this.thirtytwo = thirtytwo; // input text object
+ this.thirtythree = thirtythree; // input text object
+ this.thirtyfour = thirtyfour; // input text object
+ this.thirtyfive = thirtyfive; // input text object
+ this.thirtysix = thirtysix; // input text object
+ this.thirtyseven = thirtyseven; // input text object
+ this.thirtyeight = thirtyeight; // input text object
+ this.thirtynine = thirtynine; // input text object
+ this.forty = forty; // input text object
+ this.fortyone = fortyone; // input text object
+ this.fortytwo = fortytwo; // input text object
+ this.fortythree = fortythree; // input text object
+ this.fortyfour = fortyfour; // input text object
+ this.fortyfive = fortyfive; // input text object
+ this.fortysix = fortysix; // input text object
+ this.fortyseven = fortyseven; // input text object
+ this.fortyeight = fortyeight; // input text object
+ this.fortynine = fortynine; // input text object
+ this.fifty = fifty; // input text object
+ this.fiftyone = fiftyone; // input text object
+ this.fiftytwo = fiftytwo; // input text object
+ this.fiftythree = fiftythree; // input text object
+ this.fiftyfour = fiftyfour; // input text object
+ this.fiftyfive = fiftyfive; // input text object
+ this.fiftysix = fiftysix; // input text object
+ this.fiftyseven = fiftyseven; // input text object
+ this.fiftyeight = fiftyeight; // input text object
+ this.fiftynine = fiftynine; // input text object
+ this.sixty = sixty; // input text object
+ this.sixtyone = sixtyone; // input text object
+ this.sixtytwo = sixtytwo; // input text object
+ this.sixtythree = sixtythree; // input text object
+ this.sixtyfour = sixtyfour; // input text object
+ this.sixtyfive = sixtyfive; // input text object
+ this.sixtysix = sixtysix; // input text object
+ this.sixtyseven = sixtyseven; // input text object
+ this.sixtyeight = sixtyeight; // input text object
+ this.sixtynine = sixtynine; // input text object
+ this.seventy = seventy; // input text object
+ this.seventyone = seventyone; // input text object
+ this.seventytwo = seventytwo; // input text object
+ this.seventythree = seventythree; // input text object
+
+ this.cb = cb; // input checkbox object
+ this.ra = ra; // input radio object
+ this.index2 = index2; // text object
+}
+
+function create_header() {
+ addRowToTable();
+}
+
+// insertRowToTable - inserts a row into the table (and reorders)
+function insertRowToTable(pid, nam, mnam, label, gend, cond, dom, dob, age, dod, occu, birthpl, fbirthpl, mbirthpl, chilBLD) {
+
+ if (hasLoaded) {
+
+ // calculate marriage status -----------------------
+ var cenyr = document.getElementById('censYear').value;
+
+ var tbl = document.getElementById(TABLE_NAME);
+ var rowToInsertAt = tbl.tBodies[0].rows.length;
+ for (var i=1; i<tbl.tBodies[0].rows.length; i++) { // i set to 1 to avoid header row of number 0
+ if (tbl.tBodies[0].rows[i].myRow && tbl.tBodies[0].rows[i].myRow.ra.getAttribute('type') == 'radio' && tbl.tBodies[0].rows[i].myRow.ra.checked) {
+ rowToInsertAt = i;
+ break;
+ }
+ }
+
+ addRowToTable(rowToInsertAt, pid, nam, mnam, label, gend, cond, dom, dob, age, dod, occu, birthpl, fbirthpl, mbirthpl, chilBLD);
+
+ reorderRows(tbl, rowToInsertAt);
+ currcenyear = document.getElementById('censYear').value;
+
+ changeCols(currcenyear);
+ changeMC(currcenyear);
+ changeAge(currcenyear);
+ preview();
+
+ }
+}
+
+// addRowToTable - Inserts at row 'num', or appends to the end if no arguments are passed in. Don't pass in empty strings.
+function addRowToTable(num, pid, nam, mnam, label, gend, cond, dom, dob, age2, dod, occu, birthpl, fbirthpl, mbirthpl, chilBLD, cb, ra) {
+
+ // Check if Census year filled in -------------
+ // var cctry = document.getElementById('censCtry').value;
+ var cyear = document.getElementById('censYear').value;
+ if (cyear!="choose") {
+ cyear=cyear;
+ }else{
+ alert ("You must choose a Census year first")
+ return;
+ }
+
+ if (num==0) {
+ var birthpl = '';
+ var fbirthpl = '';
+ var mbirthpl = '';
+ }
+
+ // Calculate various Dates and Places for input ===========================
+ currcenyear = document.getElementById('censYear').value;
+ currcenctry = document.getElementById('censCtry').value;
+ if (num>0) {
+
+
+ // Calculate Children Born, Living, Died --------------------------
+ var chBLDarray = chilBLD.split('::');
+ var cendat = getCenDate(currcenyear);
+ var cdat = calculateJD(cendat);
+ // Variables to be used ---------
+ var ChilBorn = chBLDarray.length;
+ var ChilLivg = "-";
+ var ChilDied = "-";
+ var chBLD = new Array();
+ var x;
+ var ALIVE=0;
+ var DEAD=0;
+ var NOTBORN=0;
+ for (x = 0; x<ChilBorn; x++) {
+ chBLD[x] = new Array(); // This declares each column in turn
+ chBLDarray2 = chBLDarray[x].split(', ');
+ var y;
+ for (y = 0; y<chBLDarray2.length; y++) {
+ chBLD[x][y] = chBLDarray2[y];
+ if (y==2 && (cdat>(chBLD[x][1]) && chBLD[x][1]!=0) && (chBLD[x][2]==0 || cdat<(chBLD[x][2]))) {
+ ALIVE=ALIVE+1;
+ } else if (y==2 && cdat>(chBLD[x][2]) && (chBLD[x][2])!=0) {
+ DEAD=DEAD+1;
+ } else if (y==2) {
+ NOTBORN=NOTBORN+1;
+ }
+ }
+ }
+ var BORN = ALIVE+DEAD;
+ if (BORN == 0) {
+ BORN = "-";
+ ALIVE = "-";
+ DEAD = "-";
+ }
+ if (ALIVE == 0) {
+ ALIVE = "-";
+ }
+ if (DEAD == 0) {
+ DEAD = "-";
+ }
+
+ // Calculate birth places -----------------------------------------
+ birthpl = birthpl.split(', ');
+ ibirthpl = birthpl.reverse();
+ fbirthpl = fbirthpl.split(', ');
+ fbirthpl = fbirthpl.reverse();
+ mbirthpl = mbirthpl.split(', ');
+ mbirthpl = mbirthpl.reverse();
+
+ // get Chapman Code for US ----------------------------------------
+ if (birthpl[0] == "United States" || birthpl[0] == "United States Of America" || birthpl[0] == "USA") {
+ var ibirthpl = getChapmanCode(ibirthpl[1]);
+ } else {
+ var ibirthpl = getChapmanCode(ibirthpl[0]);
+ }
+
+ if (fbirthpl[0] == "UNK") {
+ var fbirthpl = getChapmanCode(fbirthpl[0]);
+ } else if (fbirthpl[0] == "United States" || fbirthpl[0] == "United States Of America" || fbirthpl[0] == "USA") {
+ var fbirthpl = getChapmanCode(fbirthpl[1]);
+ } else {
+ var fbirthpl = getChapmanCode(fbirthpl[0]);
+ }
+
+ if (mbirthpl[0] == "UNK") {
+ var mbirthpl = getChapmanCode(mbirthpl[0]);
+ } else if (mbirthpl[0] == "United States" || mbirthpl[0] == "United States Of America" || mbirthpl[0] == "USA") {
+ var mbirthpl = getChapmanCode(mbirthpl[1]);
+ } else {
+ var mbirthpl = getChapmanCode(mbirthpl[0]);
+ }
+
+ // get birthplace for UK (check all countries in UK) --------------
+ if (birthpl==null || birthpl=='') {
+ birthpl = '-';
+ } else if (birthpl[0]!="England" && birthpl[0]!="Scotland" && birthpl[0]!="Wales" && birthpl[0]!="Northern Ireland" && birthpl[0]!="UK") {
+ birthpl = birthpl[0]+", "+birthpl[1];
+ }else {
+ birthpl = birthpl[1]+", "+birthpl[2];
+ }
+
+ // Calculate/Format Birth, Marriage and Death Dates ==========================
+ var one_day = 1000*60*60*24;
+ var one_month = (365.26*one_day)/12;
+ var one_year = 365.26*one_day;
+
+ // Date of Birth (dob) - passed as Julian Date String -----------------
+ if (dob>1721060) {
+ IJD = Math.floor(dob);
+ L = Math.floor(IJD + 68569);
+ N = Math.floor(4 * L / 146097);
+ L = L - Math.floor((146097*N + 3)/4);
+ I = Math.floor(4000*(L + 1)/1461001);
+ L = L - Math.floor(1461 * I / 4) + 31;
+ J = Math.floor(80 * L / 2447);
+ K = L - Math.floor(2447 * J / 80);
+ L = Math.floor(J/11);
+ J = J + 2 - 12*L;
+ I = 100*(N - 49) + I + L;
+ dob = (I+', '+J+', '+K);
+ yob = I;
+ }
+
+ // Date of Marriage (dom) - passed as Julian Date String --------------
+ if (dom>1721060) {
+ IJD = Math.floor(dom);
+ L = Math.floor(IJD + 68569);
+ N = Math.floor(4 * L / 146097);
+ L = L - Math.floor((146097*N + 3)/4);
+ I = Math.floor(4000*(L + 1)/1461001);
+ L = L - Math.floor(1461 * I / 4) + 31;
+ J = Math.floor(80 * L / 2447);
+ K = L - Math.floor(2447 * J / 80);
+ L = Math.floor(J/11);
+ J = J + 2 - 12*L;
+ I = 100*(N - 49) + I + L;
+ dom = (I+', '+J+', '+K);
+ }
+ // Create Date of Marriage object from passed string dom
+ var jsdom = Date.parseString(dom, 'y, M, d');
+
+ // Create Date of Birth object and Age at First Marriage from passed string dob
+ var jsdob = Date.parseString(dob, 'y, M, d');
+ // US Census - Create dob (month year) and Age at first marriage ------
+ if (jsdob != "Invalid Date" && jsdob != "" && jsdob != null) {
+ usdob = jsdob.format("NNN "+yob);
+ agemarr = Math.floor((jsdom-jsdob)/one_year);
+ } else {
+ usdob = '-';
+ agemarr = '-';
+ }
+
+ // Date of Death (dod) - passed as Julian Date String --------------
+ if (dod>1721060) {
+ IJD = Math.floor(dod);
+ L = Math.floor(IJD + 68569);
+ N = Math.floor(4 * L / 146097);
+ L = L - Math.floor((146097*N + 3)/4);
+ I = Math.floor(4000*(L + 1)/1461001);
+ L = L - Math.floor(1461 * I / 4) + 31;
+ J = Math.floor(80 * L / 2447);
+ K = L - Math.floor(2447 * J / 80);
+ L = Math.floor(J/11);
+ J = J + 2 - 12*L;
+ I = 100*(N - 49) + I + L;
+ dod = (I+', '+J+', '+K);
+ }
+ // Create Date of Marriage object from passed string dom
+ var jsdod = Date.parseString(dod, 'y, M, d');
+
+ }
+
+
+ if (hasLoaded) {
+
+ var tbl = document.getElementById(TABLE_NAME);
+ var nextRow = tbl.tBodies[0].rows.length;
+ var iteration = nextRow + ROW_BASE;
+ if (num == null) {
+ num = nextRow;
+ num2 = num;
+ } else {
+ iteration = num + ROW_BASE;
+ }
+
+ // Initial Age Calculation based on 1901 Census Year input ============
+ // *** NOTE ***
+ // *** This is then corrected when ChangeYear() function is run
+ // *** ChangeYear() is run each time Census Year is selected or changed
+ if (age2!="Age" && age2!=null) {
+ // Check if Census year filled in -------------
+ if (cyear!="choose") {
+ cyear=cyear;
+ }else{
+ alert ("You must choose a Census year first")
+ return;
+ }
+ var diffage=(1901-cyear);
+ age=(age2-diffage);
+ }else{
+ age="-";
+ }
+
+ // add the row =======================================================
+ var row = tbl.tBodies[0].insertRow(num);
+
+ // **A** Define Cells ===============================================
+ var cell_ = new Array(73);
+ for(var i=0; i<=73; i++){
+ cell_[i] = row.insertCell(i);
+ cell_[i].setAttribute('id', 'col_'+i);
+ cell_[i].setAttribute('name', 'col_'+i);
+ }
+
+ if (iteration == 0) {
+ var cell_tdel = row.insertCell(74); // text Del
+ var cell_tra = row.insertCell(75); // text Radio
+ }else{
+ var cell_del = row.insertCell(74); // Onclick = Delete Row
+ cell_del.setAttribute('align', 'center');
+ var cell_ra = row.insertCell(75); // Radio button used for inserting a row, rather than adding at end of table)
+ }
+
+ var cell_index2 = row.insertCell(76); // Item Number (#2)
+ cell_index2.setAttribute('id', 'index2');
+ cell_index2.setAttribute('name', 'index2');
+ cell_index2.setAttribute('align', 'center');
+
+
+ // **B** SHOW/HIDE Header Cell elements ===============================
+ // ---- Basic Hidden Columns (miss out 0,1,2 and >68)
+ for(var i=3; i<=69; i++){
+ cell_[i].style.display = "none";
+ }
+
+ // ---- Show Cell Columns =========================================
+ //var currcenyear = document.getElementById('censYear').value;
+ //changeCols(currcenyear);
+
+ // **C** Define Header Cell elements ==================================
+ if (iteration == 0) {
+ // 0. Item Number -----------------------------------------------------
+ var txt_itemNo = document.createElement('div');
+ txt_itemNo.setAttribute('class', 'descriptionbox');
+ txt_itemNo.className= 'descriptionbox'; //Required for IE
+ txt_itemNo.style.border='0px';
+ txt_itemNo.innerHTML = '#';
+ txt_itemNo.setAttribute('id', '.b.Item');
+ txt_itemNo.setAttribute('type', 'text');
+ txt_itemNo.style.fontSize="10px";
+ txt_itemNo.style.display="none";
+ // 1. Indi ID ---------------------------------------------------------
+ var txtInp_pid = document.createElement('div');
+ txtInp_pid.setAttribute('type', 'text');
+ txtInp_pid.setAttribute('class', 'descriptionbox');
+ txtInp_pid.className= 'descriptionbox'; //Required for IE
+ txtInp_pid.style.fontSize="10px";
+ txtInp_pid.style.border='0px';
+ txtInp_pid.innerHTML = '<a href="#" alt="ID" title="ID"> ID </a>';
+ // 2. Name ------------------------------------------------------------
+ var txtInp_nam = document.createElement('div');
+ txtInp_nam.setAttribute('class', 'descriptionbox');
+ txtInp_nam.className= 'descriptionbox'; //Required for IE
+ txtInp_nam.setAttribute('type', 'text');
+ txtInp_nam.style.fontSize="10px";
+ txtInp_nam.style.border='0px';
+ txtInp_nam.innerHTML = '<a href="#" alt="'+TTEditName+'" title="'+TTEditName+'">'+HeaderName+'</a>';
+ txtInp_nam.setAttribute('id', '.b.'+HeaderName);
+ // 3. Relationship_1 --------------------------------------------------
+ var txtInp_label = document.createElement('div');
+ txtInp_label.setAttribute('type', 'text');
+ txtInp_label.setAttribute('class', 'descriptionbox');
+ txtInp_label.className= 'descriptionbox'; //Required for IE
+ txtInp_label.style.fontSize="10px";
+ txtInp_label.style.border='0px';
+ txtInp_label.innerHTML = '<a href="#" alt="'+TTEditRela+'" title="'+TTEditRela+'">'+HeaderRela+'</a>';
+ txtInp_label.setAttribute('id', '.b.'+HeaderRela);
+ // 4. Conditition_1 ---------------------------------------------------
+ var txtInp_cond = document.createElement('div');
+ txtInp_cond.setAttribute('type', 'text');
+ txtInp_cond.setAttribute('class', 'descriptionbox');
+ txtInp_cond.className= 'descriptionbox'; //Required for IE
+ txtInp_cond.style.fontSize="10px";
+ txtInp_cond.style.border='0px';
+ txtInp_cond.innerHTML = '<a href="#" alt="'+TTEditMCond+'" title="'+TTEditMCond+'">'+HeaderMCond+'</a>';
+ txtInp_cond.setAttribute('id', '.b.'+HeaderMCond);
+ // 5. Tenure ----------------------------------------------------------
+ var txtInp_tenure = document.createElement('div');
+ txtInp_tenure.setAttribute('type', 'text');
+ txtInp_tenure.setAttribute('class', 'descriptionbox');
+ txtInp_tenure.className= 'descriptionbox'; //Required for IE
+ txtInp_tenure.style.fontSize="10px";
+ txtInp_tenure.style.border='0px';
+ txtInp_tenure.innerHTML = '<a href="#" alt="'+TTEditTenure+'" title="'+TTEditTenure+'">'+HeaderTenure+'</a>';
+ txtInp_tenure.setAttribute('id', '.b.'+HeaderTenure);
+ // 6. Assets ----------------------------------------------------------
+ var txtInp_assets = document.createElement('div');
+ txtInp_assets.setAttribute('type', 'text');
+ txtInp_assets.setAttribute('class', 'descriptionbox');
+ txtInp_assets.className= 'descriptionbox'; //Required for IE
+ txtInp_assets.style.fontSize="10px";
+ txtInp_assets.style.border='0px';
+ txtInp_assets.innerHTML = '<a href="#" alt="'+TTEditAsset+'" title="'+TTEditAsset+'">'+HeaderAsset+'</a>';
+ txtInp_assets.setAttribute('id', '.b.'+HeaderAsset);
+ // 7. Age_1 -----------------------------------------------------------
+ var txtInp_age = document.createElement('div');
+ txtInp_age.setAttribute('type', 'text');
+ txtInp_age.setAttribute('class', 'descriptionbox');
+ txtInp_age.className= 'descriptionbox'; //Required for IE
+ txtInp_age.style.fontSize="10px";
+ txtInp_age.style.border='0px';
+ txtInp_age.innerHTML = '<a href="#" alt="'+TTEditAge+'" title="'+TTEditAge+'">'+HeaderAge+'</a>';
+ txtInp_age.setAttribute('id', '.b.'+HeaderAge);
+ // 8. Race_1 ----------------------------------------------------------
+ var txtInp_race = document.createElement('div');
+ txtInp_race.setAttribute('type', 'text');
+ txtInp_race.setAttribute('class', 'descriptionbox');
+ txtInp_race.className= 'descriptionbox'; //Required for IE
+ txtInp_race.style.fontSize="10px";
+ txtInp_race.style.border='0px';
+ txtInp_race.innerHTML = '<a href="#" alt="'+TTEditRace+'" title="'+TTEditRace+'">'+HeaderRace+'</a>';
+ txtInp_race.setAttribute('id', '.b.'+HeaderRace);
+ // 9. Sex -------------------------------------------------------------
+ var txtInp_gend = document.createElement('div');
+ txtInp_gend.setAttribute('type', 'text');
+ txtInp_gend.setAttribute('class', 'descriptionbox');
+ txtInp_gend.className= 'descriptionbox'; //Required for IE
+ txtInp_gend.style.fontSize="10px";
+ txtInp_gend.style.border='0px';
+ txtInp_gend.innerHTML = '<a href="#" alt="'+TTEditSex+'" title="'+TTEditSex+'">'+HeaderSex+'</a>';
+ txtInp_gend.setAttribute('id', '.b.'+HeaderSex);
+ // 10. Race_2 ----------------------------------------------------------
+ var txtInp_race2 = document.createElement('div');
+ txtInp_race2.setAttribute('type', 'text');
+ txtInp_race2.setAttribute('class', 'descriptionbox');
+ txtInp_race2.className= 'descriptionbox'; //Required for IE
+ txtInp_race2.style.fontSize="10px";
+ txtInp_race2.style.border='0px';
+ txtInp_race2.innerHTML = '<a href="#" alt="'+TTEditRace+'" title="'+TTEditRace+'">'+HeaderRace+'</a>';
+ txtInp_race2.setAttribute('id', '.b.'+HeaderRace);
+ // 11. DOB/YOB ---------------------------------------------------------
+ var txtInp_yob = document.createElement('div');
+ txtInp_yob.setAttribute('type', 'text');
+ txtInp_yob.setAttribute('class', 'descriptionbox');
+ txtInp_yob.className= 'descriptionbox'; //Required for IE
+ txtInp_yob.style.fontSize="10px";
+ txtInp_yob.style.border='0px';
+ txtInp_yob.innerHTML = '<a href="#" alt="'+TTEditYOB+'" title="'+TTEditYOB+'">'+HeaderYOB+'</a>';
+ txtInp_yob.setAttribute('id', '.b.'+HeaderYOB);
+ // 12. Age_2 -----------------------------------------------------------
+ var txtInp_age2 = document.createElement('div');
+ txtInp_age2.setAttribute('type', 'text');
+ txtInp_age2.setAttribute('class', 'descriptionbox');
+ txtInp_age2.className= 'descriptionbox'; //Required for IE
+ txtInp_age2.style.fontSize="10px";
+ txtInp_age2.style.border='0px';
+ txtInp_age2.innerHTML = '<a href="#" alt="'+TTEditAge+'" title="'+TTEditAge+'">'+HeaderAge+'</a>';
+ txtInp_age2.setAttribute('id', '.b.'+HeaderAge);
+ // 13. MthB (if born within census year) -------------------------------
+ var txtInp_bmth = document.createElement('div');
+ txtInp_bmth.setAttribute('type', 'text');
+ txtInp_bmth.setAttribute('class', 'descriptionbox');
+ txtInp_bmth.className= 'descriptionbox'; //Required for IE
+ txtInp_bmth.style.fontSize="10px";
+ txtInp_bmth.style.border='0px';
+ txtInp_bmth.innerHTML = '<a href="#" alt="'+TTEditBmth+'" title="'+TTEditBmth+'">'+HeaderBmth+'</a>';
+ txtInp_bmth.setAttribute('id', '.b.'+HeaderBmth);
+ // 14. Relationship_2 --------------------------------------------------
+ var txtInp_label2 = document.createElement('div');
+ txtInp_label2.setAttribute('type', 'text');
+ txtInp_label2.setAttribute('class', 'descriptionbox');
+ txtInp_label2.className= 'descriptionbox'; //Required for IE
+ txtInp_label2.style.fontSize="10px";
+ txtInp_label2.style.border='0px';
+ txtInp_label2.innerHTML = '<a href="#" alt="'+TTEditRela+'" title="'+TTEditRela+'">'+HeaderRela+'</a>';
+ txtInp_label2.setAttribute('id', '.b.'+HeaderRela);
+ // 15. Conditition_2 ---------------------------------------------------
+ var txtInp_cond2 = document.createElement('div');
+ txtInp_cond2.setAttribute('type', 'text');
+ txtInp_cond2.setAttribute('class', 'descriptionbox');
+ txtInp_cond2.className= 'descriptionbox'; //Required for IE
+ txtInp_cond2.style.fontSize="10px";
+ txtInp_cond2.style.border='0px';
+ txtInp_cond2.innerHTML = '<a href="#" alt="'+TTEditMCond+'" title="'+TTEditMCond+'">'+HeaderMCond+'</a>';
+ txtInp_cond2.setAttribute('id', '.b.'+HeaderMCond);
+ // 16. Years Married ---------------------------------------------------
+ var txtInp_yrsm = document.createElement('div');
+ txtInp_yrsm.setAttribute('type', 'text');
+ txtInp_yrsm.setAttribute('class', 'descriptionbox');
+ txtInp_yrsm.className= 'descriptionbox'; //Required for IE
+ txtInp_yrsm.style.fontSize="10px";
+ txtInp_yrsm.style.border='0px';
+ txtInp_yrsm.innerHTML = '<a href="#" alt="'+TTEditYrsM+'" title="'+TTEditYrsM+'">'+HeaderYrsM+'</a>';
+ txtInp_yrsm.setAttribute('id', '.b.'+HeaderYrsM);
+ // 17. Children Born Alive ---------------------------------------------
+ var txtInp_chilB = document.createElement('div');
+ txtInp_chilB.setAttribute('type', 'text');
+ txtInp_chilB.setAttribute('class', 'descriptionbox');
+ txtInp_chilB.className= 'descriptionbox'; //Required for IE
+ txtInp_chilB.style.fontSize="10px";
+ txtInp_chilB.style.border='0px';
+ txtInp_chilB.innerHTML = '<a href="#" alt="'+TTEditChilB+'" title="'+TTEditChilB+'">'+HeaderChilB+'</a>';
+ txtInp_chilB.setAttribute('id', '.b.'+HeaderChilB);
+ // 18. Children Still Living -------------------------------------------
+ var txtInp_chilL = document.createElement('div');
+ txtInp_chilL.setAttribute('type', 'text');
+ txtInp_chilL.setAttribute('class', 'descriptionbox');
+ txtInp_chilL.className= 'descriptionbox'; //Required for IE
+ txtInp_chilL.style.fontSize="10px";
+ txtInp_chilL.style.border='0px';
+ txtInp_chilL.innerHTML = '<a href="#" alt="'+TTEditChilL+'" title="'+TTEditChilL+'">'+HeaderChilL+'</a>';
+ txtInp_chilL.setAttribute('id', '.b.'+HeaderChilL);
+ // 19. Children who have Died ------------------------------------------
+ var txtInp_chilD = document.createElement('div');
+ txtInp_chilD.setAttribute('type', 'text');
+ txtInp_chilD.setAttribute('class', 'descriptionbox');
+ txtInp_chilD.className= 'descriptionbox'; //Required for IE
+ txtInp_chilD.style.fontSize="10px";
+ txtInp_chilD.style.border='0px';
+ txtInp_chilD.innerHTML = '<a href="#" alt="'+TTEditChilD+'" title="'+TTEditChilD+'">'+HeaderChilD+'</a>';
+ txtInp_chilD.setAttribute('id', '.b.'+HeaderChilD);
+ // 20. Age at first Marriage -------------------------------------------
+ var txtInp_ageM = document.createElement('div');
+ txtInp_ageM.setAttribute('type', 'text');
+ txtInp_ageM.setAttribute('class', 'descriptionbox');
+ txtInp_ageM.className= 'descriptionbox'; //Required for IE
+ txtInp_ageM.style.fontSize="10px";
+ txtInp_ageM.style.border='0px';
+ txtInp_ageM.innerHTML = '<a href="#" alt="'+TTEditAgeM+'" title="'+TTEditAgeM+'">'+HeaderAgeM+'</a>';
+ txtInp_ageM.setAttribute('id', '.b.'+HeaderAgeM);
+ // 21. Occupation_1 ----------------------------------------------------
+ var txtInp_occu = document.createElement('div');
+ txtInp_occu.setAttribute('type', 'text');
+ txtInp_occu.setAttribute('class', 'descriptionbox');
+ txtInp_occu.className= 'descriptionbox'; //Required for IE
+ txtInp_occu.style.fontSize="10px";
+ txtInp_occu.style.border='0px';
+ txtInp_occu.innerHTML = '<a href="#" alt="'+TTEditOccu+'" title="'+TTEditOccu+'">'+HeaderOccu+'</a>';
+ txtInp_occu.setAttribute('id', '.b.'+HeaderOccu);
+ // 22. Assets_2 --------------------------------------------------------
+ var txtInp_assets2 = document.createElement('div');
+ txtInp_assets2.setAttribute('type', 'text');
+ txtInp_assets2.setAttribute('class', 'descriptionbox');
+ txtInp_assets2.className= 'descriptionbox'; //Required for IE
+ txtInp_assets2.style.fontSize="10px";
+ txtInp_assets2.style.border='0px';
+ txtInp_assets2.innerHTML = '<a href="#" alt="'+TTEditAsset+'" title="'+TTEditAsset+'">'+HeaderAsset+'</a>';
+ txtInp_assets2.setAttribute('id', '.b.'+HeaderAsset);
+ // 23. Birth Place_1 -----------------------------------------------
+ var txtInp_birthpl = document.createElement('div');
+ txtInp_birthpl.setAttribute('type', 'text');
+ txtInp_birthpl.setAttribute('class', 'descriptionbox');
+ txtInp_birthpl.className= 'descriptionbox'; //Required for IE
+ txtInp_birthpl.style.fontSize="10px";
+ txtInp_birthpl.style.border='0px';
+ txtInp_birthpl.innerHTML = '<a href="#" alt="'+TTEditBplace+'" title="'+TTEditBplace+'">'+HeaderBplace+'</a>';
+ txtInp_birthpl.setAttribute('id', '.b.'+HeaderBplace);
+ // 24. Parentage -----------------------------------------------
+ var txtInp_parent = document.createElement('div');
+ txtInp_parent.setAttribute('type', 'text');
+ txtInp_parent.setAttribute('class', 'descriptionbox');
+ txtInp_parent.className= 'descriptionbox'; //Required for IE
+ txtInp_parent.style.fontSize="10px";
+ txtInp_parent.style.border='0px';
+ txtInp_parent.innerHTML = '<a href="#" alt="'+TTEditParent+'" title="'+TTEditParent+'">'+HeaderParent+'</a>';
+ txtInp_parent.setAttribute('id', '.b.'+HeaderParent);
+ // 25. MthB_2 (if born within census year) -------------------------------
+ var txtInp_bmth2 = document.createElement('div');
+ txtInp_bmth2.setAttribute('type', 'text');
+ txtInp_bmth2.setAttribute('class', 'descriptionbox');
+ txtInp_bmth2.className= 'descriptionbox'; //Required for IE
+ txtInp_bmth2.style.fontSize="10px";
+ txtInp_bmth2.style.border='0px';
+ txtInp_bmth2.innerHTML = '<a href="#" alt="'+TTEditBmth+'" title="'+TTEditBmth+'">'+HeaderBmth+'</a>';
+ txtInp_bmth2.setAttribute('id', '.b.'+HeaderBmth);
+ // 26. MthM (if married within census year) -------------------------------
+ var txtInp_mmth = document.createElement('div');
+ txtInp_mmth.setAttribute('type', 'text');
+ txtInp_mmth.setAttribute('class', 'descriptionbox');
+ txtInp_mmth.className= 'descriptionbox'; //Required for IE
+ txtInp_mmth.style.fontSize="10px";
+ txtInp_mmth.style.border='0px';
+ txtInp_mmth.innerHTML = '<a href="#" alt="'+TTEditMmth+'" title="'+TTEditMmth+'">'+HeaderMmth+'</a>';
+ txtInp_mmth.setAttribute('id', '.b.'+HeaderMmth);
+ // 27. Indi Birth Place_1 -----------------------------------------------
+ var txtInp_ibirthpl = document.createElement('div');
+ txtInp_ibirthpl.setAttribute('type', 'text');
+ txtInp_ibirthpl.setAttribute('class', 'descriptionbox');
+ txtInp_ibirthpl.className= 'descriptionbox'; //Required for IE
+ txtInp_ibirthpl.style.fontSize="10px";
+ txtInp_ibirthpl.style.border='0px';
+ txtInp_ibirthpl.innerHTML = '<a href="#" alt="'+TTEditBP+'" title="'+TTEditBP+'">'+HeaderBP+'</a>';
+ txtInp_ibirthpl.setAttribute('id', '.b.'+HeaderBP);
+ // 28. Fathers Birth Place_1 ---------------------------------------------
+ var txtInp_fbirthpl = document.createElement('div');
+ txtInp_fbirthpl.setAttribute('type', 'text');
+ txtInp_fbirthpl.setAttribute('class', 'descriptionbox');
+ txtInp_fbirthpl.className= 'descriptionbox'; //Required for IE
+ txtInp_fbirthpl.style.fontSize="10px";
+ txtInp_fbirthpl.style.border='0px';
+ txtInp_fbirthpl.innerHTML = '<a href="#" alt="'+TTEditFBP+'" title="'+TTEditFBP+'">'+HeaderFBP+'</a>';
+ txtInp_fbirthpl.setAttribute('id', '.b.'+HeaderFBP);
+ // 29. Mothers Birth Place_1 ---------------------------------------------
+ var txtInp_mbirthpl = document.createElement('div');
+ txtInp_mbirthpl.setAttribute('type', 'text');
+ txtInp_mbirthpl.setAttribute('class', 'descriptionbox');
+ txtInp_mbirthpl.className= 'descriptionbox'; //Required for IE
+ txtInp_mbirthpl.style.fontSize="10px";
+ txtInp_mbirthpl.style.border='0px';
+ txtInp_mbirthpl.innerHTML = '<a href="#" alt="'+TTEditMBP+'" title="'+TTEditMBP+'">'+HeaderMBP+'</a>';
+ txtInp_mbirthpl.setAttribute('id', '.b.'+HeaderMBP);
+ // 30. Years in USA ----------------------------------------------------
+ var txtInp_yrsUS = document.createElement('div');
+ txtInp_yrsUS.setAttribute('type', 'text');
+ txtInp_yrsUS.setAttribute('class', 'descriptionbox');
+ txtInp_yrsUS.className= 'descriptionbox'; //Required for IE
+ txtInp_yrsUS.style.fontSize="10px";
+ txtInp_yrsUS.style.border='0px';
+ txtInp_yrsUS.innerHTML = '<a href="#" alt="'+TTEditYrsUS+'" title="'+TTEditYrsUS+'">'+HeaderYrsUS+'</a>';
+ txtInp_yrsUS.setAttribute('id', '.b.'+HeaderYrsUS);
+ // 31. Year of Immigration YOI_1 ----------------------------------------
+ var txtInp_yoi1 = document.createElement('div');
+ txtInp_yoi1.setAttribute('type', 'text');
+ txtInp_yoi1.setAttribute('class', 'descriptionbox');
+ txtInp_yoi1.className= 'descriptionbox'; //Required for IE
+ txtInp_yoi1.style.fontSize="10px";
+ txtInp_yoi1.style.border='0px';
+ txtInp_yoi1.innerHTML = '<a href="#" alt="'+TTEditYOI+'" title="'+TTEditYOI+'">'+HeaderYOI+'</a>';
+ txtInp_yoi1.setAttribute('id', '.b.'+HeaderYOI);
+ // 32. Natualized or Alien_1 ----------------------------------------
+ var txtInp_na1 = document.createElement('div');
+ txtInp_na1.setAttribute('type', 'text');
+ txtInp_na1.setAttribute('class', 'descriptionbox');
+ txtInp_na1.className= 'descriptionbox'; //Required for IE
+ txtInp_na1.style.fontSize="10px";
+ txtInp_na1.style.border='0px';
+ txtInp_na1.innerHTML = '<a href="#" alt="'+TTEditNA+'" title="'+TTEditNA+'">'+HeaderNA+'</a>';
+ txtInp_na1.setAttribute('id', '.b.'+HeaderNA);
+ // 33. Year of Naturalization YON_1 ----------------------------------------
+ var txtInp_yon = document.createElement('div');
+ txtInp_yon.setAttribute('type', 'text');
+ txtInp_yon.setAttribute('class', 'descriptionbox');
+ txtInp_yon.className= 'descriptionbox'; //Required for IE
+ txtInp_yon.style.fontSize="10px";
+ txtInp_yon.style.border='0px';
+ txtInp_yon.innerHTML = '<a href="#" alt="'+TTEditYON+'" title="'+TTEditYON+'">'+HeaderYON+'</a>';
+ txtInp_yon.setAttribute('id', '.b.'+HeaderYON);
+ // 34. English if spoken, or if not, Language spoken Eng/Lang ---------------
+ var txtInp_englang = document.createElement('div');
+ txtInp_englang.setAttribute('type', 'text');
+ txtInp_englang.setAttribute('class', 'descriptionbox');
+ txtInp_englang.className= 'descriptionbox'; //Required for IE
+ txtInp_englang.style.fontSize="10px";
+ txtInp_englang.style.border='0px';
+ txtInp_englang.innerHTML = '<a href="#" alt="'+TTEditEngL+'" title="'+TTEditEngL+'">'+HeaderEngL+'</a>';
+ txtInp_englang.setAttribute('id', '.b.'+HeaderEngL);
+ // 35. Occupation_2 ---------------------------------------------------------
+ var txtInp_occu2 = document.createElement('div');
+ txtInp_occu2.setAttribute('type', 'text');
+ txtInp_occu2.setAttribute('class', 'descriptionbox');
+ txtInp_occu2.className= 'descriptionbox'; //Required for IE
+ txtInp_occu2.style.fontSize="10px";
+ txtInp_occu2.style.border='0px';
+ txtInp_occu2.innerHTML = '<a href="#" alt="'+TTEditOccu+'" title="'+TTEditOccu+'">'+HeaderOccu+'</a>';
+ txtInp_occu2.setAttribute('id', '.b.'+HeaderOccu);
+ // 36. Health --------------------------------------------------------------
+ var txtInp_health = document.createElement('div');
+ txtInp_health.setAttribute('type', 'text');
+ txtInp_health.setAttribute('class', 'descriptionbox');
+ txtInp_health.className= 'descriptionbox'; //Required for IE
+ txtInp_health.style.fontSize="10px";
+ txtInp_health.style.border='0px';
+ txtInp_health.innerHTML = '<a href="#" alt="'+TTEditHealth+'" title="'+TTEditHealth+'">'+HeaderHealth+'</a>';
+ txtInp_health.setAttribute('id', '.b.'+HeaderHealth);
+ // 37. Industry ind_1 ------------------------------------------------------
+ var txtInp_ind1 = document.createElement('div');
+ txtInp_ind1.setAttribute('type', 'text');
+ txtInp_ind1.setAttribute('class', 'descriptionbox');
+ txtInp_ind1.className= 'descriptionbox'; //Required for IE
+ txtInp_ind1.style.fontSize="10px";
+ txtInp_ind1.style.border='0px';
+ txtInp_ind1.innerHTML = '<a href="#" alt="'+TTEditInd+'" title="'+TTEditInd+'">'+HeaderInd+'</a>';
+ txtInp_ind1.setAttribute('id', '.b.'+HeaderInd);
+ // 38. Employ_1 ------------------------------------------------------------
+ var txtInp_emp1 = document.createElement('div');
+ txtInp_emp1.setAttribute('type', 'text');
+ txtInp_emp1.setAttribute('class', 'descriptionbox');
+ txtInp_emp1.className= 'descriptionbox'; //Required for IE
+ txtInp_emp1.style.fontSize="10px";
+ txtInp_emp1.style.border='0px';
+ txtInp_emp1.innerHTML = '<a href="#" alt="'+TTEditEmp+'" title="'+TTEditEmp+'">'+HeaderEmp+'</a>';
+ txtInp_emp1.setAttribute('id', '.b.'+HeaderEmp);
+ // 39. Employer - EmR-----------------------------------------------------------
+ var txtInp_emR = document.createElement('div');
+ txtInp_emR.setAttribute('type', 'text');
+ txtInp_emR.setAttribute('class', 'descriptionbox');
+ txtInp_emR.className= 'descriptionbox'; //Required for IE
+ txtInp_emR.style.fontSize="10px";
+ txtInp_emR.style.border='0px';
+ txtInp_emR.innerHTML = '<a href="#" alt="'+TTEditEmR+'" title="'+TTEditEmR+'">'+HeaderEmR+'</a>';
+ txtInp_emR.setAttribute('id', '.b.'+HeaderEmR);
+ // 40. Employed EmD ------------------------------------------------------------
+ var txtInp_emD = document.createElement('div');
+ txtInp_emD.setAttribute('type', 'text');
+ txtInp_emD.setAttribute('class', 'descriptionbox');
+ txtInp_emD.className= 'descriptionbox'; //Required for IE
+ txtInp_emD.style.fontSize="10px";
+ txtInp_emD.style.border='0px';
+ txtInp_emD.innerHTML = '<a href="#" alt="'+TTEditEmD+'" title="'+TTEditEmD+'">'+HeaderEmD+'</a>';
+ txtInp_emD.setAttribute('id', '.b.'+HeaderEmD);
+ // 41. Months employed during Census Year ---------------------------------------
+ var txtInp_mnsE = document.createElement('div');
+ txtInp_mnsE.setAttribute('type', 'text');
+ txtInp_mnsE.setAttribute('class', 'descriptionbox');
+ txtInp_mnsE.className= 'descriptionbox'; //Required for IE
+ txtInp_mnsE.style.fontSize="10px";
+ txtInp_mnsE.style.border='0px';
+ txtInp_mnsE.innerHTML = '<a href="#" alt="'+TTEditMnse+'" title="'+TTEditMnse+'">'+HeaderMnse+'</a>';
+ txtInp_mnsE.setAttribute('id', '.b.'+HeaderMnse);
+ // 42. Working at Home WH ----------------------------------------------------
+ var txtInp_emH = document.createElement('div');
+ txtInp_emH.setAttribute('type', 'text');
+ txtInp_emH.setAttribute('class', 'descriptionbox');
+ txtInp_emH.className= 'descriptionbox'; //Required for IE
+ txtInp_emH.style.fontSize="10px";
+ txtInp_emH.style.border='0px';
+ txtInp_emH.innerHTML = '<a href="#" alt="'+TTEditEmH+'" title="'+TTEditEmH+'">'+HeaderEmH+'</a>';
+ txtInp_emH.setAttribute('id', '.b.'+HeaderEmH);
+ // 43. Not Employed EmN --------------------------------------------------------
+ var txtInp_emN = document.createElement('div');
+ txtInp_emN.setAttribute('type', 'text');
+ txtInp_emN.setAttribute('class', 'descriptionbox');
+ txtInp_emN.className= 'descriptionbox'; //Required for IE
+ txtInp_emN.style.fontSize="10px";
+ txtInp_emN.style.border='0px';
+ txtInp_emN.innerHTML = '<a href="#" alt="'+TTEditEmN+'" title="'+TTEditEmN+'">'+HeaderEmN+'</a>';
+ txtInp_emN.setAttribute('id', '.b.'+HeaderEmN);
+ // 44. Weeks unemployed during Census Year ---------------------------------------
+ var txtInp_wksU = document.createElement('div');
+ txtInp_wksU.setAttribute('type', 'text');
+ txtInp_wksU.setAttribute('class', 'descriptionbox');
+ txtInp_wksU.className= 'descriptionbox'; //Required for IE
+ txtInp_wksU.style.fontSize="10px";
+ txtInp_wksU.style.border='0px';
+ txtInp_wksU.innerHTML = '<a href="#" alt="'+TTEditWksu+'" title="'+TTEditWksu+'">'+HeaderWksu+'</a>';
+ txtInp_wksU.setAttribute('id', '.b.'+HeaderWksu);
+ // 45. Months unemployed during Census Year ---------------------------------------
+ var txtInp_mnsU = document.createElement('div');
+ txtInp_mnsU.setAttribute('type', 'text');
+ txtInp_mnsU.setAttribute('class', 'descriptionbox');
+ txtInp_mnsU.className= 'descriptionbox'; //Required for IE
+ txtInp_mnsU.style.fontSize="10px";
+ txtInp_mnsU.style.border='0px';
+ txtInp_mnsU.innerHTML = '<a href="#" alt="'+TTEditMnsu+'" title="'+TTEditMnsu+'">'+HeaderMnsu+'</a>';
+ txtInp_mnsU.setAttribute('id', '.b.'+HeaderMnsu);
+ // 46. Education -----------------------------------------------------------
+ var txtInp_educ = document.createElement('div');
+ txtInp_educ.setAttribute('type', 'text');
+ txtInp_educ.setAttribute('class', 'descriptionbox');
+ txtInp_educ.className= 'descriptionbox'; //Required for IE
+ txtInp_educ.style.fontSize="10px";
+ txtInp_educ.style.border='0px';
+ txtInp_educ.innerHTML = '<a href="#" alt="'+TTEditEduc+'" title="'+TTEditEduc+'">'+HeaderEduc+'</a>';
+ txtInp_educ.setAttribute('id', '.b.'+HeaderEduc);
+ // 47. Education pre 1890 Census ---------------------------------------------
+ var txtInp_educpre1890 = document.createElement('div');
+ txtInp_educpre1890.setAttribute('type', 'text');
+ txtInp_educpre1890.setAttribute('class', 'descriptionbox');
+ txtInp_educpre1890.className= 'descriptionbox'; //Required for IE
+ txtInp_educpre1890.style.fontSize="10px";
+ txtInp_educpre1890.style.border='0px';
+ txtInp_educpre1890.innerHTML = '<a href="#" alt="'+TTEditEducpre1890+'" title="'+TTEditEducpre1890+'">'+HeaderEducpre1890+'</a>';
+ txtInp_educpre1890.setAttribute('id', '.b.'+HeaderEducpre1890);
+ // 48. English Spoken y/n eng_1 ----------------------------------------
+ var txtInp_eng1 = document.createElement('div');
+ txtInp_eng1.setAttribute('type', 'text');
+ txtInp_eng1.setAttribute('class', 'descriptionbox');
+ txtInp_eng1.className= 'descriptionbox'; //Required for IE
+ txtInp_eng1.style.fontSize="10px";
+ txtInp_eng1.style.border='0px';
+ txtInp_eng1.innerHTML = '<a href="#" alt="'+TTEditEng+'" title="'+TTEditEng+'">'+HeaderEng+'</a>';
+ txtInp_eng1.setAttribute('id', '.b.'+HeaderEng);
+ // 49. Home Ownership -------------------------------------------------
+ var txtInp_home = document.createElement('div');
+ txtInp_home.setAttribute('type', 'text');
+ txtInp_home.setAttribute('class', 'descriptionbox');
+ txtInp_home.className= 'descriptionbox'; //Required for IE
+ txtInp_home.style.fontSize="10px";
+ txtInp_home.style.border='0px';
+ txtInp_home.innerHTML = '<a href="#" alt="'+TTEditHome+'" title="'+TTEditHome+'">'+HeaderHome+'</a>';
+ txtInp_home.setAttribute('id', '.b.'+HeaderHome);
+ // 50. Birth Place_2 -----------------------------------------------
+ var txtInp_birthpl2 = document.createElement('div');
+ txtInp_birthpl2.setAttribute('type', 'text');
+ txtInp_birthpl2.setAttribute('class', 'descriptionbox');
+ txtInp_birthpl2.className= 'descriptionbox'; //Required for IE
+ txtInp_birthpl2.style.fontSize="10px";
+ txtInp_birthpl2.style.border='0px';
+ txtInp_birthpl2.innerHTML = '<a href="#" alt="'+TTEditBplace+'" title="'+TTEditBplace+'">'+HeaderBplace+'</a>';
+ txtInp_birthpl2.setAttribute('id', '.b.'+HeaderBplace);
+ // 51. Indi Birth Place_2 ---------------------------------------------
+ var txtInp_ibirthpl2 = document.createElement('div');
+ txtInp_ibirthpl2.setAttribute('type', 'text');
+ txtInp_ibirthpl2.setAttribute('class', 'descriptionbox');
+ txtInp_ibirthpl2.className= 'descriptionbox'; //Required for IE
+ txtInp_ibirthpl2.style.fontSize="10px";
+ txtInp_ibirthpl2.style.border='0px';
+ txtInp_ibirthpl2.innerHTML = '<a href="#" alt="'+TTEditBP+'" title="'+TTEditBP+'">'+HeaderBP+'</a>';
+ txtInp_ibirthpl2.setAttribute('id', '.b.'+HeaderBP);
+ // 52. Born in Same Country (ENG) -----------------------------------------------
+ var txtInp_bic = document.createElement('div');
+ txtInp_bic.setAttribute('type', 'text');
+ txtInp_bic.setAttribute('class', 'descriptionbox');
+ txtInp_bic.className= 'descriptionbox'; //Required for IE
+ txtInp_bic.style.fontSize="10px";
+ txtInp_bic.style.border='0px';
+ txtInp_bic.innerHTML = '<a href="#" alt="'+TTEditBIC+'" title="'+TTEditBIC+'">'+HeaderBIC+'</a>';
+ txtInp_bic.setAttribute('id', '.b.'+HeaderBIC)
+ // 53. Born outside England (SCO, IRE, WAL, FOReign ----------------------------
+ var txtInp_boe = document.createElement('div');
+ txtInp_boe.setAttribute('type', 'text');
+ txtInp_boe.setAttribute('class', 'descriptionbox');
+ txtInp_boe.className= 'descriptionbox'; //Required for IE
+ txtInp_boe.style.fontSize="10px";
+ txtInp_boe.style.border='0px';
+ txtInp_boe.innerHTML = '<a href="#" alt="'+TTEditBOE+'" title="'+TTEditBOE+'">'+HeaderBOE+'</a>';
+ txtInp_boe.setAttribute('id', '.b.'+HeaderBOE)
+ // 54. Fathers Birth Place_2 ---------------------------------------------
+ var txtInp_fbirthpl2 = document.createElement('div');
+ txtInp_fbirthpl2.setAttribute('type', 'text');
+ txtInp_fbirthpl2.setAttribute('class', 'descriptionbox');
+ txtInp_fbirthpl2.className= 'descriptionbox'; //Required for IE
+ txtInp_fbirthpl2.style.fontSize="10px";
+ txtInp_fbirthpl2.style.border='0px';
+ txtInp_fbirthpl2.innerHTML = '<a href="#" alt="'+TTEditFBP+'" title="'+TTEditFBP+'">'+HeaderFBP+'</a>';
+ txtInp_fbirthpl2.setAttribute('id', '.b.'+HeaderFBP);
+ // 55. Mothers Birth Place_2 ---------------------------------------------
+ var txtInp_mbirthpl2 = document.createElement('div');
+ txtInp_mbirthpl2.setAttribute('type', 'text');
+ txtInp_mbirthpl2.setAttribute('class', 'descriptionbox');
+ txtInp_mbirthpl2.className= 'descriptionbox'; //Required for IE
+ txtInp_mbirthpl2.style.fontSize="10px";
+ txtInp_mbirthpl2.style.border='0px';
+ txtInp_mbirthpl2.innerHTML = '<a href="#" alt="'+TTEditMBP+'" title="'+TTEditMBP+'">'+HeaderMBP+'</a>';
+ txtInp_mbirthpl2.setAttribute('id', '.b.'+HeaderMBP);
+ // 56. Native Language ----------------------------------------------------
+ var txtInp_lang = document.createElement('div');
+ txtInp_lang.setAttribute('type', 'text');
+ txtInp_lang.setAttribute('class', 'descriptionbox');
+ txtInp_lang.className= 'descriptionbox'; //Required for IE
+ txtInp_lang.style.fontSize="10px";
+ txtInp_lang.style.border='0px';
+ txtInp_lang.innerHTML = '<a href="#" alt="'+TTEditNL+'" title="'+TTEditNL+'">'+HeaderNL+'</a>';
+ txtInp_lang.setAttribute('id', '.b.'+HeaderNL);
+ // 57. Year of Immigration YOI_2 ----------------------------------------
+ var txtInp_yoi2 = document.createElement('div');
+ txtInp_yoi2.setAttribute('type', 'text');
+ txtInp_yoi2.setAttribute('class', 'descriptionbox');
+ txtInp_yoi2.className= 'descriptionbox'; //Required for IE
+ txtInp_yoi2.style.fontSize="10px";
+ txtInp_yoi2.style.border='0px';
+ txtInp_yoi2.innerHTML = '<a href="#" alt="'+TTEditYOI+'" title="'+TTEditYOI+'">'+HeaderYOI+'</a>';
+ txtInp_yoi2.setAttribute('id', '.b.'+HeaderYOI);
+ // 58. Natualized or Alien_2 ----------------------------------------
+ var txtInp_na2 = document.createElement('div');
+ txtInp_na2.setAttribute('type', 'text');
+ txtInp_na2.setAttribute('class', 'descriptionbox');
+ txtInp_na2.className= 'descriptionbox'; //Required for IE
+ txtInp_na2.style.fontSize="10px";
+ txtInp_na2.style.border='0px';
+ txtInp_na2.innerHTML = '<a href="#" alt="'+TTEditNA+'" title="'+TTEditNA+'">'+HeaderNA+'</a>';
+ txtInp_na2.setAttribute('id', '.b.'+HeaderNA);
+ // 59. English Spoken y/n eng_2 ----------------------------------------
+ var txtInp_eng2 = document.createElement('div');
+ txtInp_eng2.setAttribute('type', 'text');
+ txtInp_eng2.setAttribute('class', 'descriptionbox');
+ txtInp_eng2.className= 'descriptionbox'; //Required for IE
+ txtInp_eng2.style.fontSize="10px";
+ txtInp_eng2.style.border='0px';
+ txtInp_eng2.innerHTML = '<a href="#" alt="'+TTEditEng+'" title="'+TTEditEng+'">'+HeaderEng+'</a>';
+ txtInp_eng2.setAttribute('id', '.b.'+HeaderEng);
+ // 60. Occupation_3 -----------------------------------------------------
+ var txtInp_occu3 = document.createElement('div');
+ txtInp_occu3.setAttribute('type', 'text');
+ txtInp_occu3.setAttribute('class', 'descriptionbox');
+ txtInp_occu3.className= 'descriptionbox'; //Required for IE
+ txtInp_occu3.style.fontSize="10px";
+ txtInp_occu3.style.border='0px';
+ txtInp_occu3.innerHTML = '<a href="#" alt="'+TTEditOccu+'" title="'+TTEditOccu+'">'+HeaderOccu+'</a>';
+ txtInp_occu3.setAttribute('id', '.b.'+HeaderOccu);
+ // 61. Industry ind_2 ------------------------------------------------------
+ var txtInp_ind2 = document.createElement('div');
+ txtInp_ind2.setAttribute('type', 'text');
+ txtInp_ind2.setAttribute('class', 'descriptionbox');
+ txtInp_ind2.className= 'descriptionbox'; //Required for IE
+ txtInp_ind2.style.fontSize="10px";
+ txtInp_ind2.style.border='0px';
+ txtInp_ind2.innerHTML = '<a href="#" alt="'+TTEditInd+'" title="'+TTEditInd+'">'+HeaderInd+'</a>';
+ txtInp_ind2.setAttribute('id', '.b.'+HeaderInd);
+ // 62. Employ_2 ------------------------------------------------------------
+ var txtInp_emp2 = document.createElement('div');
+ txtInp_emp2.setAttribute('type', 'text');
+ txtInp_emp2.setAttribute('class', 'descriptionbox');
+ txtInp_emp2.className= 'descriptionbox'; //Required for IE
+ txtInp_emp2.style.fontSize="10px";
+ txtInp_emp2.style.border='0px';
+ txtInp_emp2.innerHTML = '<a href="#" alt="'+TTEditEmp+'" title="'+TTEditEmp+'">'+HeaderEmp+'</a>';
+ txtInp_emp2.setAttribute('id', '.b.'+HeaderEmp);
+ /*
+ // 63. Nationality (UK 1911) ----------------------------------------------------
+ var txtInp_infirm = document.createElement('div');
+ txtInp_infirm.setAttribute('type', 'text');
+ txtInp_infirm.setAttribute('class', 'descriptionbox');
+ txtInp_infirm.className= 'descriptionbox'; //Required for IE
+ txtInp_infirm.style.fontSize="10px";
+ txtInp_infirm.style.border='0px';
+ txtInp_infirm.innerHTML = '<a href="#" alt="'+TTEditN-ality+'" title="'+TTEditNality+'">'+HeaderN-ality+'</a>';
+ txtInp_infirm.setAttribute('id', '.b.'+HeaderN-ality);
+ */
+ // 63. Infirmaties Infirm -------------------------------------------------------
+ var txtInp_infirm = document.createElement('div');
+ txtInp_infirm.setAttribute('type', 'text');
+ txtInp_infirm.setAttribute('class', 'descriptionbox');
+ txtInp_infirm.className= 'descriptionbox'; //Required for IE
+ txtInp_infirm.style.fontSize="10px";
+ txtInp_infirm.style.border='0px';
+ txtInp_infirm.innerHTML = '<a href="#" alt="'+TTEditInfirm+'" title="'+TTEditInfirm+'">'+HeaderInfirm+'</a>';
+ txtInp_infirm.setAttribute('id', '.b.'+HeaderInfirm);
+ // 64. Situation (1890) ------------------------------------------------------
+ var txtInp_situ = document.createElement('div');
+ txtInp_situ.setAttribute('type', 'text');
+ txtInp_situ.setAttribute('class', 'descriptionbox');
+ txtInp_situ.className= 'descriptionbox'; //Required for IE
+ txtInp_situ.style.fontSize="10px";
+ txtInp_situ.style.border='0px';
+ txtInp_situ.innerHTML = '<a href="#" alt="'+TTEditSitu+'" title="'+TTEditSitu+'">'+HeaderSitu+'</a>';
+ txtInp_situ.setAttribute('id', '.b.'+HeaderSitu);
+ // 65. Veteran ------------------------------------------------------
+ var txtInp_vet = document.createElement('div');
+ txtInp_vet.setAttribute('type', 'text');
+ txtInp_vet.setAttribute('class', 'descriptionbox');
+ txtInp_vet.className= 'descriptionbox'; //Required for IE
+ txtInp_vet.style.fontSize="10px";
+ txtInp_vet.style.border='0px';
+ txtInp_vet.innerHTML = '<a href="#" alt="'+TTEditVet+'" title="'+TTEditVet+'">'+HeaderVet+'</a>';
+ txtInp_vet.setAttribute('id', '.b.'+HeaderVet);
+ // 66. War or Expedition ---------------------------------------------
+ var txtInp_war = document.createElement('div');
+ txtInp_war.setAttribute('type', 'text');
+ txtInp_war.setAttribute('class', 'descriptionbox');
+ txtInp_war.className= 'descriptionbox'; //Required for IE
+ txtInp_war.style.fontSize="10px";
+ txtInp_war.style.border='0px';
+ txtInp_war.innerHTML = '<a href="#" alt="'+TTEditWar+'" title="'+TTEditWar+'">'+HeaderWar+'</a>';
+ txtInp_war.setAttribute('id', '.b.'+HeaderWar);
+ // 67. Infirm1910 (1910) -----------------------------------------------
+ var txtInp_infirm1910 = document.createElement('div');
+ txtInp_infirm1910.setAttribute('type', 'text');
+ txtInp_infirm1910.setAttribute('class', 'descriptionbox');
+ txtInp_infirm1910.className= 'descriptionbox'; //Required for IE
+ txtInp_infirm1910.style.fontSize="10px";
+ txtInp_infirm1910.style.border='0px';
+ txtInp_infirm1910.innerHTML = '<a href="#" alt="'+TTEditInfirm1910+'" title="'+TTEditInfirm1910+'">'+HeaderInfirm1910+'</a>';
+ txtInp_infirm1910.setAttribute('id', '.b.'+HeaderInfirm1910);
+
+ // Hidden Items ------------------------------------------------------
+ // 68. DOB date of Birth (Julian) actual or rough (ABT, BET)
+ // 69. DOM date of Marriage (Julian) actual or rough (ABT, BET)
+ // 70. Fullname
+ // 71. Married Name
+ // 72. DOD date of Death (Julian) actual or rough (ABT, BET)
+ // 73. Textual Array of Chil (Nam DOB DOD) for ChilB, ChilL, ChilD
+ //
+
+ // 74. Extra 1. Text Del Button -------------------------------------------------
+ var txtInp_tdel = document.createElement('div');
+ txtInp_tdel.setAttribute('type', 'text');
+ txtInp_tdel.setAttribute('class', 'descriptionbox');
+ txtInp_tdel.className= 'descriptionbox'; //Required for IE
+ txtInp_tdel.style.fontSize="10px";
+ txtInp_tdel.style.border='0px';
+ txtInp_tdel.innerHTML = 'Del';
+ txtInp_tdel.setAttribute('id', this);
+ // 75. Extra 2. Text Radio Button -----------------------------------------------
+ var txtInp_tra = document.createElement('div');
+ txtInp_tra.setAttribute('type', 'text');
+ txtInp_tra.setAttribute('class', 'descriptionbox');
+ txtInp_tra.className= 'descriptionbox'; //Required for IE
+ txtInp_tra.style.fontSize="10px";
+ txtInp_tra.style.border='0px';
+ txtInp_tra.innerHTML = 'Ins';
+ // 76. Extra 3. Item Number 2 -------------------------------------------------
+ var txt_itemNo2 = document.createElement('div');
+ txt_itemNo2.setAttribute('class', 'descriptionbox');
+ txt_itemNo2.className= 'descriptionbox'; //Required for IE
+ txt_itemNo2.style.border='0px';
+ txt_itemNo2.innerHTML = '#';
+ txt_itemNo2.setAttribute('id', '.b.Item2');
+ txt_itemNo2.setAttribute('type', 'text');
+ txt_itemNo2.style.fontSize="10px";
+
+ }else{
+
+ // **D** Define Cell Elements =======================================
+ var txtcolor = "#0000FF";
+ // 0. Item Number ---------------------------------------------------
+ // var txt_itemNo = document.createTextNode(iteration);
+ var txt_itemNo = document.createElement('div');
+ // txt_itemNo.style.display="none";
+ // 1. Indi ID -------------------------------------------------------
+ if ( pid == ''){
+ var txtcolor = "#000000";
+ // This adds a checkbox for adding an indi id .... to be implemented later
+ var txtInp_pid = document.createElement('input');
+ txtInp_pid.setAttribute('type', 'checkbox');
+ if (txtInp_pid.checked!=''){
+ txtInp_pid.setAttribute('value', 'no');
+ }else{
+ txtInp_pid.setAttribute('value', 'add');
+ }
+ // -------------------------------------------------------------------------
+ txtInp_pid.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_1');
+ txtInp_pid.setAttribute('size', '1');
+ txtInp_pid.style.fontSize="11px";
+ }else{
+ var txtInp_pid = document.createElement('input');
+ //txtInp_pid.style.border='0px';
+ txtInp_pid.style.background='#bbddff';
+ // txtInp_pid.style.display='none'
+ txtInp_pid.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_1');
+ txtInp_pid.setAttribute('value', pid);
+ txtInp_pid.setAttribute('size', '4');
+ txtInp_pid.setAttribute('readOnly','true');
+ txtInp_pid.style.fontSize="10px";
+ }
+ // 2. Full Name -----------------------------------------------------
+ var txtInp_nam = document.createElement('input');
+ txtInp_nam.setAttribute('type', 'text');
+ txtInp_nam.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_2');
+ txtInp_nam.setAttribute('size', '30');
+ txtInp_nam.setAttribute('value', nam);
+ txtInp_nam.style.color=txtcolor;
+ txtInp_nam.style.fontSize="10px";
+ txtInp_nam.style.width="14em";
+ // 3. Relationship_1 --------------------------------------------------
+ var txtInp_label = document.createElement('input');
+ txtInp_label.setAttribute('type', 'text');
+ txtInp_label.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_3');
+ txtInp_label.setAttribute('size', '15');
+ txtInp_label.setAttribute('value', label);
+ txtInp_label.style.color=txtcolor;
+ txtInp_label.style.fontSize="10px";
+ txtInp_label.style.width="7em";
+ // 4. Conditition_1 ---------------------------------------------------
+ var txtInp_cond = document.createElement('input');
+ txtInp_cond.setAttribute('type', 'text');
+ txtInp_cond.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_4');
+ txtInp_cond.setAttribute('size', '1');
+ txtInp_cond.setAttribute('value', cond);
+ txtInp_cond.style.color=txtcolor;
+ txtInp_cond.style.fontSize="10px";
+ txtInp_cond.style.width="1em";
+ // 5. Tenure ----------------------------------------------------------
+ var txtInp_tenure = document.createElement('input');
+ txtInp_tenure.setAttribute('type', 'text');
+ txtInp_tenure.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_5');
+ txtInp_tenure.setAttribute('size', '1');
+ txtInp_tenure.setAttribute('maxlength', '2');
+ txtInp_tenure.setAttribute('value', '');
+ txtInp_tenure.style.color=txtcolor;
+ txtInp_tenure.style.fontSize="10px";
+ txtInp_tenure.style.width="1.6em";
+ // 6. Assets_1 --------------------------------------------------------
+ var txtInp_assets = document.createElement('input');
+ txtInp_assets.setAttribute('type', 'text');
+ txtInp_assets.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_6');
+ txtInp_assets.setAttribute('size', '7');
+ txtInp_assets.setAttribute('maxlength', '9');
+ txtInp_assets.setAttribute('value', '');
+ txtInp_assets.style.color=txtcolor;
+ txtInp_assets.style.fontSize="10px";
+ // 7. Age_1 -----------------------------------------------------------
+ var txtInp_age = document.createElement('input');
+ txtInp_age.setAttribute('type', 'text');
+ txtInp_age.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_7');
+ txtInp_age.setAttribute('size', '2');
+ txtInp_age.setAttribute('maxlength', '4');
+ txtInp_age.setAttribute('value', age);
+ if (txtInp_age.value>=0) {
+ txtInp_age.style.color=txtcolor;
+ } else {
+ //txtInp_age.style.color="red";
+ txtInp_age.style.color=txtcolor;
+ }
+ txtInp_age.style.fontSize="10px";
+ txtInp_age.style.width="2.2em";
+ // 8. Race_1 -----------------------------------------------------------
+ var txtInp_race = document.createElement('input');
+ txtInp_race.setAttribute('type', 'text');
+ txtInp_race.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_8');
+ txtInp_race.setAttribute('size', '1');
+ txtInp_race.setAttribute('maxlength', '1');
+ txtInp_race.setAttribute('value', '');
+ txtInp_race.style.color=txtcolor;
+ txtInp_race.style.fontSize="10px";
+ txtInp_race.style.width="1em";
+ // 9. Sex -----------------------------------------------------------
+ var txtInp_gend = document.createElement('input');
+ txtInp_gend.setAttribute('type', 'text');
+ txtInp_gend.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_9');
+ txtInp_gend.setAttribute('size', '1');
+ txtInp_gend.setAttribute('maxlength', '1');
+ txtInp_gend.setAttribute('value', gend);
+ txtInp_gend.style.color=txtcolor;
+ txtInp_gend.style.fontSize="10px";
+ txtInp_gend.style.width="1em";
+ // 10. Race_2 -----------------------------------------------------------
+ var txtInp_race2 = document.createElement('input');
+ txtInp_race2.setAttribute('type', 'text');
+ txtInp_race2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_10');
+ txtInp_race2.setAttribute('size', '1');
+ txtInp_race2.setAttribute('maxlength', '1');
+ txtInp_race2.setAttribute('value', '');
+ txtInp_race2.style.color=txtcolor;
+ txtInp_race2.style.fontSize="10px";
+ txtInp_race2.style.width="1em";
+ // 11. DOB/YOB ---------------------------------------------------------
+ var txtInp_yob = document.createElement('input');
+ txtInp_yob.setAttribute('type', 'text');
+ txtInp_yob.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_11');
+ txtInp_yob.setAttribute('size', '3');
+ txtInp_yob.setAttribute('maxlength', '8');
+ txtInp_yob.setAttribute('value', usdob);
+ txtInp_yob.style.color=txtcolor;
+ txtInp_yob.style.fontSize="10px";
+ txtInp_yob.style.width="5em";
+ // 12. Age_2 -----------------------------------------------------------
+ var txtInp_age2 = document.createElement('input');
+ txtInp_age2.setAttribute('type', 'text');
+ txtInp_age2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_12');
+ txtInp_age2.setAttribute('size', '2');
+ txtInp_age2.setAttribute('maxlength', '4');
+ txtInp_age2.setAttribute('value', age);
+ if (txtInp_age2.value>=0) {
+ txtInp_age2.style.color=txtcolor;
+ } else {
+ // txtInp_age2.style.color="red";
+ txtInp_age2.style.color=txtcolor;
+ }
+ txtInp_age2.style.fontSize="10px";
+ txtInp_age2.style.width="2.0em";
+ // 13. Birth month if born in Census Year ------------------------------
+ var txtInp_bmth = document.createElement('input');
+ txtInp_bmth.setAttribute('type', 'text');
+ txtInp_bmth.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_13');
+ txtInp_bmth.setAttribute('size', '1');
+ txtInp_bmth.setAttribute('maxlength', '3');
+ txtInp_bmth.setAttribute('value', '');
+ txtInp_bmth.style.color=txtcolor;
+ txtInp_bmth.style.fontSize="10px";
+ txtInp_bmth.style.width="2.4em";
+ // 14. Relationship_2 --------------------------------------------------
+ var txtInp_label2 = document.createElement('input');
+ txtInp_label2.setAttribute('type', 'text');
+ txtInp_label2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_14');
+ txtInp_label2.setAttribute('size', '15');
+ txtInp_label2.setAttribute('value', label);
+ txtInp_label2.style.color=txtcolor;
+ txtInp_label2.style.fontSize="10px";
+ // 15. Conditition_2 ---------------------------------------------------
+ var txtInp_cond2 = document.createElement('input');
+ txtInp_cond2.setAttribute('type', 'text');
+ txtInp_cond2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_15');
+ txtInp_cond2.setAttribute('size', '1');
+ txtInp_cond2.setAttribute('maxlength', '1');
+ txtInp_cond2.setAttribute('value', cond);
+ txtInp_cond2.style.color=txtcolor;
+ txtInp_cond2.style.fontSize="10px";
+ txtInp_cond2.style.width="1em";
+ // 16. Years Married (or Yes if married in Census Year) ----------------
+ var txtInp_yrsm = document.createElement('input');
+ txtInp_yrsm.setAttribute('type', 'text');
+ txtInp_yrsm.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_16');
+ txtInp_yrsm.setAttribute('size', '1');
+ txtInp_yrsm.setAttribute('maxlength', '2');
+ txtInp_yrsm.setAttribute('value', '');
+ txtInp_yrsm.style.color=txtcolor;
+ txtInp_yrsm.style.fontSize="10px";
+ txtInp_yrsm.style.width="1.4em";
+ // 17. Children Born Alive --------------------------------------------
+ var txtInp_chilB = document.createElement('input');
+ txtInp_chilB.setAttribute('type', 'text');
+ txtInp_chilB.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_17');
+ txtInp_chilB.setAttribute('size', '1');
+ txtInp_chilB.setAttribute('maxlength', '2');
+ txtInp_chilB.setAttribute('value', BORN);
+ txtInp_chilB.style.color=txtcolor;
+ txtInp_chilB.style.fontSize="10px";
+ txtInp_chilB.style.width="1.4em";
+ if (gend=='M') {
+ txtInp_chilB.type = "hidden";
+ }
+ // 18. Children Still Living ------------------------------------------
+ var txtInp_chilL = document.createElement('input');
+ txtInp_chilL.setAttribute('type', 'text');
+ txtInp_chilL.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_18');
+ txtInp_chilL.setAttribute('size', '1');
+ txtInp_chilL.setAttribute('maxlength', '2');
+ txtInp_chilL.setAttribute('value', ALIVE);
+ txtInp_chilL.style.color=txtcolor;
+ txtInp_chilL.style.fontSize="10px";
+ txtInp_chilL.style.width="1.4em";
+ if (gend=='M') {
+ txtInp_chilL.type = "hidden";
+ }
+ // 19. Children who have Died ==---------------------------------------
+ var txtInp_chilD = document.createElement('input');
+ txtInp_chilD.setAttribute('type', 'text');
+ txtInp_chilD.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_19');
+ txtInp_chilD.setAttribute('size', '1');
+ txtInp_chilD.setAttribute('maxlength', '2');
+ txtInp_chilD.setAttribute('value', DEAD);
+ txtInp_chilD.style.color=txtcolor;
+ txtInp_chilD.style.fontSize="10px";
+ txtInp_chilD.style.width="1.4em";
+ if (gend=='M') {
+ txtInp_chilD.type = "hidden";
+ }
+ // 20. Age at first marriage -------------------------------------------
+ var txtInp_ageM = document.createElement('input');
+ txtInp_ageM.setAttribute('type', 'text');
+ txtInp_ageM.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_20');
+ txtInp_ageM.setAttribute('size', '1');
+ txtInp_ageM.setAttribute('maxlength', '2');
+ txtInp_ageM.setAttribute('value', agemarr);
+ txtInp_ageM.style.color=txtcolor;
+ txtInp_ageM.style.fontSize="10px";
+ txtInp_ageM.style.width="1.4em";
+ // 21. Occupation_1 ----------------------------------------------------
+ var txtInp_occu = document.createElement('input');
+ txtInp_occu.setAttribute('type', 'text');
+ txtInp_occu.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_21');
+ txtInp_occu.setAttribute('size', '22');
+ txtInp_occu.setAttribute('value', '');
+ txtInp_occu.style.color=txtcolor;
+ txtInp_occu.style.fontSize="10px";
+ txtInp_occu.style.width="11em";
+ // 22. Assets_2 -------------------------------------------
+ var txtInp_assets2 = document.createElement('input');
+ txtInp_assets2.setAttribute('type', 'text');
+ txtInp_assets2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_22');
+ txtInp_assets2.setAttribute('size', '7');
+ txtInp_assets2.setAttribute('maxlength', '9');
+ txtInp_assets2.setAttribute('value', '');
+ txtInp_assets2.style.color=txtcolor;
+ txtInp_assets2.style.fontSize="10px";
+ // 23. Birth Place_1 (Full format) ---------------------------------------
+ var txtInp_birthpl = document.createElement('input');
+ txtInp_birthpl.setAttribute('type', 'text');
+ txtInp_birthpl.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_23');
+ txtInp_birthpl.setAttribute('size', '25');
+ txtInp_birthpl.setAttribute('value', birthpl);
+ txtInp_birthpl.style.color=txtcolor;
+ txtInp_birthpl.style.fontSize="10px";
+ txtInp_birthpl.style.width="13em";
+ // 24. Parentage - x-x = Father foreign born Y/N and Mother foreign born Y/N --
+ var txtInp_parent = document.createElement('input');
+ txtInp_parent.setAttribute('type', 'text');
+ txtInp_parent.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_24');
+ txtInp_parent.setAttribute('size', '1');
+ txtInp_parent.setAttribute('maxlength', '3');
+ txtInp_parent.setAttribute('value', '');
+ txtInp_parent.style.color=txtcolor;
+ txtInp_parent.style.fontSize="10px";
+ txtInp_parent.style.width="2em";
+ // 25. Birth month Bmth_2) (if born in Census Year) ----------------------
+ var txtInp_bmth2 = document.createElement('input');
+ txtInp_bmth2.setAttribute('type', 'text');
+ txtInp_bmth2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_25');
+ txtInp_bmth2.setAttribute('size', '1');
+ txtInp_bmth2.setAttribute('maxlength', '3');
+ txtInp_bmth2.setAttribute('value', '');
+ txtInp_bmth2.style.color=txtcolor;
+ txtInp_bmth2.style.fontSize="10px";
+ txtInp_bmth2.style.width="2.4em";
+ // 26. Married month if married in Census Year ---------------------------
+ var txtInp_mmth = document.createElement('input');
+ txtInp_mmth.setAttribute('type', 'text');
+ txtInp_mmth.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_26');
+ txtInp_mmth.setAttribute('size', '1');
+ txtInp_mmth.setAttribute('maxlength', '3');
+ txtInp_mmth.setAttribute('value', '');
+ txtInp_mmth.style.color=txtcolor;
+ txtInp_mmth.style.fontSize="10px";
+ txtInp_mmth.style.width="2.4em";
+ // 27. POB_1 Indi Birth Place_1 (Chapman format) ------------------------
+ var txtInp_ibirthpl = document.createElement('input');
+ txtInp_ibirthpl.setAttribute('type', 'text');
+ txtInp_ibirthpl.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_27');
+ txtInp_ibirthpl.setAttribute('size', '1');
+ txtInp_ibirthpl.setAttribute('maxlength', '3');
+ txtInp_ibirthpl.setAttribute('value', ibirthpl);
+ txtInp_ibirthpl.style.color=txtcolor;
+ txtInp_ibirthpl.style.fontSize="10px";
+ txtInp_ibirthpl.style.width="2.4em";
+ // 28. FPOB_1 Fathers Birth Place_1 (Chapman format) ---------------------
+ var txtInp_fbirthpl = document.createElement('input');
+ txtInp_fbirthpl.setAttribute('type', 'text');
+ txtInp_fbirthpl.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_28');
+ txtInp_fbirthpl.setAttribute('size', '1');
+ txtInp_fbirthpl.setAttribute('maxlength', '3');
+ txtInp_fbirthpl.setAttribute('value', fbirthpl);
+ txtInp_fbirthpl.style.color=txtcolor;
+ txtInp_fbirthpl.style.fontSize="10px";
+ txtInp_fbirthpl.style.width="2.4em";
+ // 29. FPOB_1 Mothers Birth Place_1 (Chapman format )---------------------
+ var txtInp_mbirthpl = document.createElement('input');
+ txtInp_mbirthpl.setAttribute('type', 'text');
+ txtInp_mbirthpl.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_29');
+ txtInp_mbirthpl.setAttribute('size', '1');
+ txtInp_mbirthpl.setAttribute('maxlength', '3');
+ txtInp_mbirthpl.setAttribute('value', mbirthpl);
+ txtInp_mbirthpl.style.color=txtcolor;
+ txtInp_mbirthpl.style.fontSize="10px";
+ txtInp_mbirthpl.style.width="2.4em";
+ // 30. Years in USA ----------------------------------------------------
+ var txtInp_yrsUS = document.createElement('input');
+ txtInp_yrsUS.setAttribute('type', 'text');
+ txtInp_yrsUS.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_30');
+ txtInp_yrsUS.setAttribute('size', '1');
+ txtInp_yrsUS.setAttribute('maxlength', '2');
+ txtInp_yrsUS.setAttribute('value', '');
+ txtInp_yrsUS.style.color=txtcolor;
+ txtInp_yrsUS.style.fontSize="10px";
+ txtInp_yrsUS.style.width="1.4em";
+ // 31. Year of Immigration YOI_1 ----------------------------------------
+ var txtInp_yoi1 = document.createElement('input');
+ txtInp_yoi1.setAttribute('type', 'text');
+ txtInp_yoi1.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_31');
+ txtInp_yoi1.setAttribute('size', '2');
+ txtInp_yoi1.setAttribute('maxlength', '4');
+ txtInp_yoi1.setAttribute('value', '');
+ txtInp_yoi1.style.color=txtcolor;
+ txtInp_yoi1.style.fontSize="10px";
+ // 32. Naturalized or Alien N-A_1 ---------------------------------------
+ var txtInp_na1 = document.createElement('input');
+ txtInp_na1.setAttribute('type', 'text');
+ txtInp_na1.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_32');
+ txtInp_na1.setAttribute('size', '1');
+ txtInp_na1.setAttribute('maxlength', '1');
+ txtInp_na1.setAttribute('value', '');
+ txtInp_na1.style.color=txtcolor;
+ txtInp_na1.style.fontSize="10px";
+ txtInp_na1.style.width="1em";
+ // 33. Year of naturalization YON ---------------------------------------
+ var txtInp_yon = document.createElement('input');
+ txtInp_yon.setAttribute('type', 'text');
+ txtInp_yon.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_33');
+ txtInp_yon.setAttribute('size', '2');
+ txtInp_yon.setAttribute('maxlength', '4');
+ txtInp_yon.setAttribute('value', '');
+ txtInp_yon.style.color=txtcolor;
+ txtInp_yon.style.fontSize="10px";
+ // 34. English spoken, or if not, other Language spoken Eng/Lang --------
+ var txtInp_englang = document.createElement('input');
+ txtInp_englang.setAttribute('type', 'text');
+ txtInp_englang.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_34');
+ txtInp_englang.setAttribute('size', '8');
+ txtInp_englang.setAttribute('maxlength', '10');
+ txtInp_englang.setAttribute('value', '');
+ txtInp_englang.style.color=txtcolor;
+ txtInp_englang.style.fontSize="10px";
+ // 35. Occupation_2 ----------------------------------------------------
+ var txtInp_occu2 = document.createElement('input');
+ txtInp_occu2.setAttribute('type', 'text');
+ txtInp_occu2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_35');
+ txtInp_occu2.setAttribute('size', '22');
+ txtInp_occu2.setAttribute('value', '');
+ txtInp_occu2.style.color=txtcolor;
+ txtInp_occu2.style.fontSize="10px";
+ txtInp_occu2.style.width="11em";
+ // 36. Health ----------------------------------------------------------
+ var txtInp_health = document.createElement('input');
+ txtInp_health.setAttribute('type', 'text');
+ txtInp_health.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_36');
+ txtInp_health.setAttribute('size', '3');
+ txtInp_health.setAttribute('maxlength', '5');
+ txtInp_health.setAttribute('value', '');
+ txtInp_health.style.color=txtcolor;
+ txtInp_health.style.fontSize="10px";
+ // 37. Industry_1 ------------------------------------------------------
+ var txtInp_ind1 = document.createElement('input');
+ txtInp_ind1.setAttribute('type', 'text');
+ txtInp_ind1.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_37');
+ txtInp_ind1.setAttribute('size', '22');
+ txtInp_ind1.setAttribute('value', '');
+ txtInp_ind1.style.color=txtcolor;
+ txtInp_ind1.style.fontSize="10px";
+ // 38. Employ_1 --------------------------------------------------------
+ var txtInp_emp1 = document.createElement('input');
+ txtInp_emp1.setAttribute('type', 'text');
+ txtInp_emp1.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_38');
+ txtInp_emp1.setAttribute('size', '12');
+ txtInp_emp1.setAttribute('value', '');
+ txtInp_emp1.style.color=txtcolor;
+ txtInp_emp1.style.fontSize="10px";
+ txtInp_emp1.style.width="7em";
+ // 39. Employer EmR ----------------------------------------------------
+ var txtInp_emR = document.createElement('input');
+ txtInp_emR.setAttribute('type', 'text');
+ txtInp_emR.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_39');
+ txtInp_emR.setAttribute('size', '1');
+ txtInp_emR.setAttribute('maxlength', '1');
+ txtInp_emR.setAttribute('value', '');
+ txtInp_emR.style.color=txtcolor;
+ txtInp_emR.style.fontSize="10px";
+ txtInp_emR.style.width="1em";
+ // 40. Employed EmD ----------------------------------------------------
+ var txtInp_emD = document.createElement('input');
+ txtInp_emD.setAttribute('type', 'text');
+ txtInp_emD.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_40');
+ txtInp_emD.setAttribute('size', '1');
+ txtInp_emD.setAttribute('maxlength', '1');
+ txtInp_emD.setAttribute('value', '');
+ txtInp_emD.style.color=txtcolor;
+ txtInp_emD.style.fontSize="10px";
+ txtInp_emD.style.width="1em";
+ // 41. Months employed -------------------------------------------------
+ var txtInp_mnsE = document.createElement('input');
+ txtInp_mnsE.setAttribute('type', 'text');
+ txtInp_mnsE.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_41');
+ txtInp_mnsE.setAttribute('size', '1');
+ txtInp_mnsE.setAttribute('maxlength', '2');
+ txtInp_mnsE.setAttribute('value', '');
+ txtInp_mnsE.style.color=txtcolor;
+ txtInp_mnsE.style.fontSize="10px";
+ txtInp_mnsE.style.width="1.4em";
+ // 42. Working at Home WH ----------------------------------------------
+ var txtInp_emH = document.createElement('input');
+ txtInp_emH.setAttribute('type', 'text');
+ txtInp_emH.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_42');
+ txtInp_emH.setAttribute('size', '1');
+ txtInp_emH.setAttribute('maxlength', '1');
+ txtInp_emH.setAttribute('value', '');
+ txtInp_emH.style.color=txtcolor;
+ txtInp_emH.style.fontSize="10px";
+ txtInp_emH.style.width="1em";
+ // 43. Not Employed EmN ------------------------------------------------
+ var txtInp_emN = document.createElement('input');
+ txtInp_emN.setAttribute('type', 'text');
+ txtInp_emN.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_43');
+ txtInp_emN.setAttribute('size', '1');
+ txtInp_emN.setAttribute('maxlength', '1');
+ txtInp_emN.setAttribute('value', '');
+ txtInp_emN.style.color=txtcolor;
+ txtInp_emN.style.fontSize="10px";
+ txtInp_emN.style.width="1em";
+ // 44. Weeks unemployed ------------------------------------------------
+ var txtInp_wksU = document.createElement('input');
+ txtInp_wksU.setAttribute('type', 'text');
+ txtInp_wksU.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_44');
+ txtInp_wksU.setAttribute('size', '1');
+ txtInp_wksU.setAttribute('maxlength', '2');
+ txtInp_wksU.setAttribute('value', '');
+ txtInp_wksU.style.color=txtcolor;
+ txtInp_wksU.style.fontSize="10px";
+ txtInp_wksU.style.width="1.4em";
+ // 45. Months unemployed -----------------------------------------------
+ var txtInp_mnsU = document.createElement('input');
+ txtInp_mnsU.setAttribute('type', 'text');
+ txtInp_mnsU.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_45');
+ txtInp_mnsU.setAttribute('size', '1');
+ txtInp_mnsU.setAttribute('maxlength', '2');
+ txtInp_mnsU.setAttribute('value', '');
+ txtInp_mnsU.style.color=txtcolor;
+ txtInp_mnsU.style.fontSize="10px";
+ txtInp_mnsU.style.width="1.4em";
+ // 46. Education - xxx = School/Able to Read/Able to Write -------------
+ var txtInp_educ = document.createElement('input');
+ txtInp_educ.setAttribute('type', 'text');
+ txtInp_educ.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_46');
+ txtInp_educ.setAttribute('size', '1');
+ txtInp_educ.setAttribute('maxlength', '3');
+ txtInp_educ.setAttribute('value', '');
+ txtInp_educ.style.color=txtcolor;
+ txtInp_educ.style.fontSize="10px";
+ txtInp_educ.style.width="1.8em";
+ // 47. Education pre 1890 Census - xxx = School/Cannot Read/Cannot Write ----
+ var txtInp_educpre1890 = document.createElement('input');
+ txtInp_educpre1890.setAttribute('type', 'text');
+ txtInp_educpre1890.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_47');
+ txtInp_educpre1890.setAttribute('size', '1');
+ txtInp_educpre1890.setAttribute('maxlength', '3');
+ txtInp_educpre1890.setAttribute('value', '');
+ txtInp_educpre1890.style.color=txtcolor;
+ txtInp_educpre1890.style.fontSize="10px";
+ txtInp_educpre1890.width="1.8em";
+ // 48. English Spoken?_1 eng_1 -----------------------------------------
+ var txtInp_eng1 = document.createElement('input');
+ txtInp_eng1.setAttribute('type', 'text');
+ txtInp_eng1.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_48');
+ txtInp_eng1.setAttribute('size', '1');
+ txtInp_eng1.setAttribute('maxlength', '1');
+ txtInp_eng1.setAttribute('value', '');
+ txtInp_eng1.style.color=txtcolor;
+ txtInp_eng1.style.fontSize="10px";
+ txtInp_eng1.style.width="1em";
+ // 49. Home Ownership - x-x-x-xxxx = O/R-F/M-F/H-#### = Owned/Rented-Free/Mortgaged-Farm/House-Farm Schedule number ----
+ var txtInp_home = document.createElement('input');
+ txtInp_home.setAttribute('type', 'text');
+ txtInp_home.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_49');
+ txtInp_home.setAttribute('size', '7');
+ txtInp_home.setAttribute('maxlength', '12');
+ txtInp_home.setAttribute('value', '');
+ txtInp_home.style.color=txtcolor;
+ txtInp_home.style.fontSize="10px";
+ // 50. Birth Place_2 (full format) -------------------------------------
+ var txtInp_birthpl2 = document.createElement('input');
+ txtInp_birthpl2.setAttribute('type', 'text');
+ txtInp_birthpl2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_50');
+ txtInp_birthpl2.setAttribute('size', '25');
+ txtInp_birthpl2.setAttribute('value', birthpl);
+ txtInp_birthpl2.style.color=txtcolor;
+ txtInp_birthpl2.style.fontSize="10px";
+ txtInp_birthpl2.style.width="13em";
+ // 51. POB_2 Indi Birth Place_2 ----------------------------------------
+ var txtInp_ibirthpl2 = document.createElement('input');
+ txtInp_ibirthpl2.setAttribute('type', 'text');
+ txtInp_ibirthpl2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_51');
+ txtInp_ibirthpl2.setAttribute('size', '1');
+ txtInp_ibirthpl2.setAttribute('maxlength', '3');
+ txtInp_ibirthpl2.setAttribute('value', ibirthpl);
+ txtInp_ibirthpl2.style.color=txtcolor;
+ txtInp_ibirthpl2.style.fontSize="10px";
+ txtInp_ibirthpl2.style.width="2.4em";
+ // 52. Born in Same Country BIC ----------------------------------------
+ var txtInp_bic = document.createElement('input');
+ txtInp_bic.setAttribute('type', 'text');
+ txtInp_bic.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_52');
+ txtInp_bic.setAttribute('size', '1');
+ txtInp_bic.setAttribute('maxlength', '1');
+ txtInp_bic.setAttribute('value', '');
+ txtInp_bic.style.color=txtcolor;
+ txtInp_bic.style.fontSize="10px";
+ txtInp_bic.style.width="1em";
+ // 53. Born outside England BOE ----------------------------------------
+ var txtInp_boe = document.createElement('input');
+ txtInp_boe.setAttribute('type', 'text');
+ txtInp_boe.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_53');
+ txtInp_boe.setAttribute('size', '1');
+ txtInp_boe.setAttribute('maxlength', '3');
+ txtInp_boe.setAttribute('value', '');
+ txtInp_boe.style.color=txtcolor;
+ txtInp_boe.style.fontSize="10px";
+ txtInp_boe.style.width="2.4em";
+ // 54. FPOB_2 Birth Place_2 --------------------------------------------
+ var txtInp_fbirthpl2 = document.createElement('input');
+ txtInp_fbirthpl2.setAttribute('type', 'text');
+ txtInp_fbirthpl2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_54');
+ txtInp_fbirthpl2.setAttribute('size', '1');
+ txtInp_fbirthpl2.setAttribute('maxlength', '3');
+ txtInp_fbirthpl2.setAttribute('value', fbirthpl);
+ txtInp_fbirthpl2.style.color=txtcolor;
+ txtInp_fbirthpl2.style.fontSize="10px";
+ txtInp_fbirthpl2.style.width="2.4em";
+ // 55. MPOB_2 Birth Place_2 --------------------------------------------
+ var txtInp_mbirthpl2 = document.createElement('input');
+ txtInp_mbirthpl2.setAttribute('type', 'text');
+ txtInp_mbirthpl2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_55');
+ txtInp_mbirthpl2.setAttribute('size', '1');
+ txtInp_mbirthpl2.setAttribute('maxlength', '3');
+ txtInp_mbirthpl2.setAttribute('value', mbirthpl);
+ txtInp_mbirthpl2.style.color=txtcolor;
+ txtInp_mbirthpl2.style.fontSize="10px";
+ txtInp_mbirthpl2.style.width="2.4em";
+ // 56. Native Language -------------------------------------------------
+ var txtInp_lang = document.createElement('input');
+ txtInp_lang.setAttribute('type', 'text');
+ txtInp_lang.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_56');
+ txtInp_lang.setAttribute('size', '8');
+ txtInp_lang.setAttribute('maxlength', '10');
+ txtInp_lang.setAttribute('value', '');
+ txtInp_lang.style.color=txtcolor;
+ txtInp_lang.style.fontSize="10px";
+ // 57. Year of Immigration YOI_2 ---------------------------------------
+ var txtInp_yoi2 = document.createElement('input');
+ txtInp_yoi2.setAttribute('type', 'text');
+ txtInp_yoi2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_57');
+ txtInp_yoi2.setAttribute('size', '2');
+ txtInp_yoi2.setAttribute('maxlength', '4');
+ txtInp_yoi2.setAttribute('value', '');
+ txtInp_yoi2.style.color=txtcolor;
+ txtInp_yoi2.style.fontSize="10px";
+ // 58. Naturalized or Alien N-A_2 --------------------------------------
+ var txtInp_na2 = document.createElement('input');
+ txtInp_na2.setAttribute('type', 'text');
+ txtInp_na2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_58');
+ txtInp_na2.setAttribute('size', '1');
+ txtInp_na2.setAttribute('maxlength', '1');
+ txtInp_na2.setAttribute('value', '');
+ txtInp_na2.style.color=txtcolor;
+ txtInp_na2.style.fontSize="10px";
+ txtInp_na2.style.width="1em";
+ // 59. English Spoken?_2 eng_2 -----------------------------------------
+ var txtInp_eng2 = document.createElement('input');
+ txtInp_eng2.setAttribute('type', 'text');
+ txtInp_eng2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_59');
+ txtInp_eng2.setAttribute('size', '1');
+ txtInp_eng2.setAttribute('maxlength', '1');
+ txtInp_eng2.setAttribute('value', '');
+ txtInp_eng2.style.color=txtcolor;
+ txtInp_eng2.style.fontSize="10px";
+ txtInp_eng2.style.width="1em";
+ // 60. Occupation_3 ----------------------------------------------------
+ var txtInp_occu3 = document.createElement('input');
+ txtInp_occu3.setAttribute('type', 'text');
+ txtInp_occu3.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_60');
+ txtInp_occu3.setAttribute('size', '22');
+ txtInp_occu3.setAttribute('value', '');
+ txtInp_occu3.style.color=txtcolor;
+ txtInp_occu3.style.fontSize="10px";
+ txtInp_occu3.style.width="11em";
+ // 61. Industry_2 -----------------------------------------------------
+ var txtInp_ind2 = document.createElement('input');
+ txtInp_ind2.setAttribute('type', 'text');
+ txtInp_ind2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_61');
+ txtInp_ind2.setAttribute('size', '22');
+ txtInp_ind2.setAttribute('value', '');
+ txtInp_ind2.style.color=txtcolor;
+ txtInp_ind2.style.fontSize="10px";
+ // 62. Employ_2 -------------------------------------------------------
+ var txtInp_emp2 = document.createElement('input');
+ txtInp_emp2.setAttribute('type', 'text');
+ txtInp_emp2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_62');
+ txtInp_emp2.setAttribute('size', '12');
+ txtInp_emp2.setAttribute('value', '');
+ txtInp_emp2.style.color=txtcolor;
+ txtInp_emp2.style.fontSize="10px";
+ txtInp_emp2.style.width="7em";
+ /*
+ // 63. Nationality (UK 1911) ------------------------------------------
+ var txtInp_emp2 = document.createElement('input');
+ txtInp_emp2.setAttribute('type', 'text');
+ txtInp_emp2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_63');
+ txtInp_emp2.setAttribute('size', '22');
+ txtInp_emp2.setAttribute('value', '');
+ txtInp_emp2.style.color=txtcolor;
+ txtInp_emp2.style.fontSize="10px";
+ */
+ // 63. Infirmaties ----------------------------------------------------
+ var txtInp_infirm = document.createElement('input');
+ txtInp_infirm.setAttribute('type', 'text');
+ txtInp_infirm.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_63');
+ txtInp_infirm.setAttribute('size', '3');
+ txtInp_infirm.setAttribute('maxlength', '4');
+ txtInp_infirm.setAttribute('value', '');
+ txtInp_infirm.style.color=txtcolor;
+ txtInp_infirm.style.fontSize="10px";
+ txtInp_infirm.style.width="2.3em";
+ // 64. Health / Situation = Disease-Infirmaties-Convict,Pauper etc ----
+ var txtInp_situ = document.createElement('input');
+ txtInp_situ.setAttribute('type', 'text');
+ txtInp_situ.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_64');
+ txtInp_situ.setAttribute('size', '12');
+ txtInp_situ.setAttribute('value', '');
+ txtInp_situ.style.color=txtcolor;
+ txtInp_situ.style.fontSize="10px";
+ // 65. Veteran ? ------------------------------------------------------
+ var txtInp_vet = document.createElement('input');
+ txtInp_vet.setAttribute('type', 'text');
+ txtInp_vet.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_65');
+ txtInp_vet.setAttribute('size', '1');
+ txtInp_vet.setAttribute('maxlength', '1');
+ txtInp_vet.setAttribute('value', '');
+ txtInp_vet.style.color=txtcolor;
+ txtInp_vet.style.fontSize="10px";
+ txtInp_vet.style.width="1em";
+ // 66. War or Expedition ----------------------------------------------
+ var txtInp_war = document.createElement('input');
+ txtInp_war.setAttribute('type', 'text');
+ txtInp_war.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_66');
+ txtInp_war.setAttribute('size', '8');
+ txtInp_war.setAttribute('value', '');
+ txtInp_war.style.color=txtcolor;
+ txtInp_war.style.fontSize="10px";
+ // 67. Infirmaties (Census 1910) - x-x = Blind (both eyes) Y/N - Deaf and dumb Y/N ----
+ var txtInp_infirm1910 = document.createElement('input');
+ txtInp_infirm1910.setAttribute('type', 'text');
+ txtInp_infirm1910.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_67');
+ txtInp_infirm1910.setAttribute('size', '1');
+ txtInp_infirm1910.setAttribute('maxlength', '2');
+ txtInp_infirm1910.setAttribute('value', '');
+ txtInp_infirm1910.style.color=txtcolor;
+ txtInp_infirm1910.style.fontSize="10px";
+ txtInp_infirm1910.style.width="1.4em";
+
+ // Hidden =============================================================
+ // 68. DOB ------------------------------------------------------------
+ var txtInp_DOB = document.createElement('input');
+ txtInp_DOB.setAttribute('type', 'text');
+ txtInp_DOB.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_68');
+ txtInp_DOB.setAttribute('size', '9');
+ txtInp_DOB.setAttribute('maxlength', '20');
+ txtInp_DOB.setAttribute('value', dob);
+ txtInp_DOB.style.color=txtcolor;
+ txtInp_DOB.style.fontSize="10px";
+ txtInp_DOB.style.width="5.6em";
+ txtInp_DOB.type = "hidden";
+ // 69. DOM ------------------------------------------------------------
+ var txtInp_DOM = document.createElement('input');
+ txtInp_DOM.setAttribute('type', 'text');
+ txtInp_DOM.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_69');
+ txtInp_DOM.setAttribute('size', '8');
+ txtInp_DOM.setAttribute('maxlength', '20');
+ txtInp_DOM.setAttribute('value', dom);
+ txtInp_DOM.style.color=txtcolor;
+ txtInp_DOM.style.fontSize="10px";
+ txtInp_DOM.style.width="1.4em";
+ txtInp_DOM.type = "hidden";
+ // 70. Full Name ------------------------------------------------------
+ var txtInp_FullName = document.createElement('input');
+ txtInp_FullName.setAttribute('type', 'text');
+ txtInp_FullName.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_70');
+ txtInp_FullName.setAttribute('size', '8');
+ txtInp_FullName.setAttribute('maxlength', '40');
+ txtInp_FullName.setAttribute('value', nam);
+ txtInp_FullName.style.color=txtcolor;
+ txtInp_FullName.style.fontSize="10px";
+ txtInp_FullName.style.width="5.4em";
+ txtInp_FullName.type = "hidden";
+ // 71. Married Name ---------------------------------------------------
+ var txtInp_MarrName = document.createElement('input');
+ txtInp_MarrName.setAttribute('type', 'text');
+ txtInp_MarrName.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_71');
+ txtInp_MarrName.setAttribute('size', '8');
+ txtInp_MarrName.setAttribute('maxlength', '40');
+ txtInp_MarrName.setAttribute('value', mnam);
+ txtInp_MarrName.style.color=txtcolor;
+ txtInp_MarrName.style.fontSize="10px";
+ txtInp_MarrName.style.width="1.4em";
+ txtInp_MarrName.type = "hidden";
+ // 72. DOD ------------------------------------------------------------
+ var txtInp_DOD = document.createElement('input');
+ txtInp_DOD.setAttribute('type', 'text');
+ txtInp_DOD.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_72');
+ txtInp_DOD.setAttribute('size', '8');
+ txtInp_DOD.setAttribute('maxlength', '20');
+ txtInp_DOD.setAttribute('value', dod);
+ txtInp_DOD.style.color=txtcolor;
+ txtInp_DOD.style.fontSize="10px";
+ txtInp_DOD.style.width="1.4em";
+ txtInp_DOD.type = "hidden";
+ // 73. DOD ------------------------------------------------------------
+ var txtInp_ChBLD = document.createElement('input');
+ txtInp_ChBLD.setAttribute('type', 'text');
+ txtInp_ChBLD.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_73');
+ txtInp_ChBLD.setAttribute('size', '8');
+ txtInp_ChBLD.setAttribute('maxlength', '20');
+ txtInp_ChBLD.setAttribute('value', chilBLD);
+ txtInp_ChBLD.style.color=txtcolor;
+ txtInp_ChBLD.style.fontSize="10px";
+ txtInp_ChBLD.style.width="1.4em";
+ txtInp_ChBLD.type = "hidden";
+
+ // Extra Cells for Navigation =========================================
+ // 74. Extra 1. Delete Row Button -----------------------------------------
+ //var btnEl = document.createElement('input');
+ // btnEl.setAttribute('type', 'button');
+ // btnEl.setAttribute('value', 'x');
+ // btnEl.onclick = function () {deleteCurrentRow(this)};
+ var btnEl = document.createElement('button');
+ var btnEltext = document.createTextNode('X');
+ btnEl.style.color='red';
+ btnEl.appendChild(btnEltext);
+ btnEl.onclick = function () {deleteCurrentRow(this)};
+ // 75. Extra 2. Insert row Radio button -----------------------------------
+ var raEl;
+ try {
+ raEl = document.createElement('<input type="radio" name="' + RADIO_NAME + '" value="' + iteration + '">');
+ var failIfNotIE = raEl.name.length;
+ } catch(ex) {
+ raEl = document.createElement('input');
+ raEl.setAttribute('type', 'radio');
+ raEl.setAttribute('name', RADIO_NAME );
+ raEl.setAttribute('value', iteration);
+ }
+ // 76. Extra 3. Item Number -----------------------------------------------
+ var txt_itemNo2 = document.createTextNode(iteration);
+ }
+
+ // Cells Not visible but used for row re-order process =================
+ var cbEl = document.createElement('input');
+ cbEl.type = "hidden";
+
+
+ // **E** Append appropriate Cell elements to each cell ================
+ cell_[0].appendChild(txt_itemNo); // Item Number
+ cell_[1].appendChild(txtInp_pid); // Indi ID
+ cell_[2].appendChild(txtInp_nam); // Name
+ cell_[3].appendChild(txtInp_label); // Relationship_1
+ cell_[4].appendChild(txtInp_cond); // Condition_1
+ cell_[5].appendChild(txtInp_tenure); // Tenure
+ cell_[6].appendChild(txtInp_assets); // Assets_1
+ cell_[7].appendChild(txtInp_age); // Age_1
+ cell_[8].appendChild(txtInp_race); // Race_1
+ cell_[9].appendChild(txtInp_gend); // Sex
+
+ cell_[10].appendChild(txtInp_race2); // Race_2
+ cell_[11].appendChild(txtInp_yob); // DOB/YOB
+ cell_[12].appendChild(txtInp_age2); // Age_2
+ cell_[13].appendChild(txtInp_bmth); // Birth Month
+ cell_[14].appendChild(txtInp_label2); // Relationship_2
+ cell_[15].appendChild(txtInp_cond2); // Condition_2
+ cell_[16].appendChild(txtInp_yrsm); // Years Married
+ cell_[17].appendChild(txtInp_chilB); // Children Born Alive
+ cell_[18].appendChild(txtInp_chilL); // Children Still Living
+ cell_[19].appendChild(txtInp_chilD); // Children who have Died
+
+ cell_[20].appendChild(txtInp_ageM); // Age st first marriage
+ cell_[21].appendChild(txtInp_occu); // Occupation_1
+ cell_[22].appendChild(txtInp_assets2); // Assets_2
+ cell_[23].appendChild(txtInp_birthpl); // Place of Birth_1
+ cell_[24].appendChild(txtInp_parent); // Parentage
+ cell_[25].appendChild(txtInp_bmth2); // Month if born in Census Year - bmth2
+ cell_[26].appendChild(txtInp_mmth); // Month if married in Census Year
+ cell_[27].appendChild(txtInp_ibirthpl); // Indis POB_1
+ cell_[28].appendChild(txtInp_fbirthpl); // Father FPOB_1
+ cell_[29].appendChild(txtInp_mbirthpl); // Mother MPOB_1
+
+ cell_[30].appendChild(txtInp_yrsUS); // Years in USA
+ cell_[31].appendChild(txtInp_yoi1); // Year of Immigration YOI_1
+ cell_[32].appendChild(txtInp_na1); // Naturalized or Alien N-A_1
+ cell_[33].appendChild(txtInp_yon); // Year of Naturalization YON
+ cell_[34].appendChild(txtInp_englang); // English spoken, if not, Other Language spoken Eng/Lang
+ cell_[35].appendChild(txtInp_occu2); // Occupation_2
+ cell_[36].appendChild(txtInp_health); // Health - 5 parameters x--xx etc
+ cell_[37].appendChild(txtInp_ind1); // Industry ind_1
+ cell_[38].appendChild(txtInp_emp1); // Employ_1
+ cell_[39].appendChild(txtInp_emR); // Employer EmR
+
+ cell_[40].appendChild(txtInp_emD); // Employed EmD
+ cell_[41].appendChild(txtInp_mnsE); // Months employed during Census Year
+ cell_[42].appendChild(txtInp_emH); // Working At Home WH
+ cell_[43].appendChild(txtInp_emN); // Not Employed EmN
+ cell_[44].appendChild(txtInp_wksU); // Weeks unemployed during Census Year
+ cell_[45].appendChild(txtInp_mnsU); // Months unemployed during Census Year
+ cell_[46].appendChild(txtInp_educ); // Education 3 parameters Sch-Read-Write -xx
+ cell_[47].appendChild(txtInp_educpre1890); // Education (pre 1890 Census) - 3 parameters = Sch, Cannot Read, Cannot Write -xx
+ cell_[48].appendChild(txtInp_eng1); // English spoken Y/N eng_1
+ cell_[49].appendChild(txtInp_home); // Home Ownership x-x-x-xxxx = Owned/Rented - Free/Morgaged - Farm/House - Farm Sched #
+
+ cell_[50].appendChild(txtInp_birthpl2); // Birth Place_2
+ cell_[51].appendChild(txtInp_ibirthpl2); // Indis POB_2
+ cell_[52].appendChild(txtInp_bic); // Born in County (UK)
+ cell_[53].appendChild(txtInp_boe); // Born outside England (UK)
+ cell_[54].appendChild(txtInp_fbirthpl2); // Fathers FPOB_2
+ cell_[55].appendChild(txtInp_mbirthpl2); // Mothers MPOB_2
+ cell_[56].appendChild(txtInp_lang); // Mother Tongue lang
+ cell_[57].appendChild(txtInp_yoi2); // Year of Immigration YOI_2
+ cell_[58].appendChild(txtInp_na2); // Naturalized or Alien N-A_2
+ cell_[59].appendChild(txtInp_eng2); // English spoken Y/N eng_2
+
+ cell_[60].appendChild(txtInp_occu3); // Occupation_3
+ cell_[61].appendChild(txtInp_ind2); // Industry ind_2
+ cell_[62].appendChild(txtInp_emp2); // Employ_2
+ // cell_[63].appendChild(txtInp_N_ality); // Nationality (UK 1911) - British, OR Naturalised, OR(French, German, Russian etc)
+ cell_[63].appendChild(txtInp_infirm); // Infirmaties - up to 5 parameters x--xx etc
+ cell_[64].appendChild(txtInp_situ); // Health Situation 1890 - Disease, Infimaties, Convict, Pauper etc
+ cell_[65].appendChild(txtInp_vet); // Veteran ?
+ cell_[66].appendChild(txtInp_war); // War or expedition
+ cell_[67].appendChild(txtInp_infirm1910); // Infirmaties - xx = Blind (both eyes) Y/N/-, Deaf and Dumb Y/N/-
+
+ // Hidden Cells =======================================================
+ if (iteration > 0) {
+ cell_[68].appendChild(txtInp_DOB); // Date of Birth
+ cell_[69].appendChild(txtInp_DOM); // Date of Marriage
+ cell_[70].appendChild(txtInp_FullName); // Full Name
+ cell_[71].appendChild(txtInp_MarrName); // Married Name
+ cell_[72].appendChild(txtInp_DOD); // Date of Death
+ cell_[73].appendChild(txtInp_ChBLD); // Text Array - Children Born/Living/Died
+ }
+
+ // Extra Cells ========================================================
+ if (iteration == 0) {
+ cell_tdel.appendChild(txtInp_tdel); // Text Del
+ cell_tra.appendChild(txtInp_tra); // Text Ins
+ }else{
+ cell_del.appendChild(btnEl); // Onclick = Delete Row
+ cell_ra.appendChild(raEl); // Radio button used for inserting a row, rather than adding at end of table)
+ }
+
+ // cell_index2.appendChild(txt_itemNo2); // Text Item Number
+
+ // **F** Pass in the elements to be referenced later ==================
+ // Store the myRow object in each row
+ row.myRow = new myRowObject( txt_itemNo, txtInp_pid, txtInp_nam, txtInp_label, txtInp_cond, txtInp_tenure, txtInp_assets, txtInp_age, txtInp_race, txtInp_gend,
+ txtInp_race2, txtInp_yob, txtInp_age2, txtInp_bmth, txtInp_label2, txtInp_cond2, txtInp_yrsm, txtInp_chilB, txtInp_chilL, txtInp_chilD,
+ txtInp_ageM, txtInp_occu, txtInp_assets2, txtInp_birthpl, txtInp_parent, txtInp_bmth2, txtInp_mmth, txtInp_ibirthpl, txtInp_fbirthpl, txtInp_mbirthpl,
+ txtInp_yrsUS, txtInp_yoi1, txtInp_na1, txtInp_yon, txtInp_englang, txtInp_occu2, txtInp_health, txtInp_ind1, txtInp_emp1, txtInp_emR,
+ txtInp_emD, txtInp_mnsE, txtInp_emH, txtInp_emN, txtInp_wksU, txtInp_mnsU, txtInp_educ, txtInp_educpre1890, txtInp_eng1, txtInp_home,
+ txtInp_birthpl2, txtInp_ibirthpl2, txtInp_bic, txtInp_boe, txtInp_fbirthpl2, txtInp_mbirthpl2, txtInp_lang, txtInp_yoi2, txtInp_na2, txtInp_eng2,
+ txtInp_occu3, txtInp_ind2, txtInp_emp2, txtInp_infirm, txtInp_situ, txtInp_vet, txtInp_war, txtInp_infirm1910, txtInp_DOB, txtInp_DOM,
+ txtInp_FullName, txtInp_MarrName, txtInp_DOD, txtInp_ChBLD,
+ cbEl, raEl, txt_itemNo2
+ );
+ }
+}
+
+// deleteCurrentRow - function to delete a row
+function deleteCurrentRow(obj) {
+ if (hasLoaded) {
+ var delRow = obj.parentNode.parentNode;
+ var tbl = delRow.parentNode.parentNode;
+ var rIndex = delRow.sectionRowIndex;
+ var rowArray = new Array(delRow);
+ deleteRows(rowArray);
+ reorderRows(tbl, rIndex);
+ preview();
+ }
+}
+
+function deleteHeaderRow(obj) {
+ if (hasLoaded) {
+ var delRow = obj.parentNode.parentNode;
+ var tbl = delRow.parentNode.parentNode;
+ var rIndex = delRow.sectionRowIndex;
+ var rowArray = new Array(delRow);
+ deleteRows(rowArray);
+ }
+}
+
+function deleteRows(rowObjArray) {
+ if (hasLoaded) {
+ for (var i=0; i<rowObjArray.length; i++) { // i set to 1 to avoid table header row of number 0
+ var rIndex = rowObjArray[i].sectionRowIndex;
+ rowObjArray[i].parentNode.deleteRow(rIndex);
+ }
+ }
+}
+
+// reorderRows - used to reorder rows after an insert or delete
+function reorderRows(tbl, startingIndex) {
+ if (hasLoaded) {
+ if (tbl.tBodies[0].rows[startingIndex]) {
+ var count = startingIndex + ROW_BASE;
+ for (var i=startingIndex; i<tbl.tBodies[0].rows.length; i++) {
+ // CONFIG: next line is affected by myRowObject settings
+ tbl.tBodies[0].rows[i].myRow.zero.data = count; // text - (left column item number)
+
+ // ------------------------------------------------------------
+ tbl.tBodies[0].rows[i].myRow.one.id = INPUT_NAME_PREFIX + count + '_1'; // input text
+ tbl.tBodies[0].rows[i].myRow.two.id = INPUT_NAME_PREFIX + count + '_2'; // input text
+ tbl.tBodies[0].rows[i].myRow.three.id = INPUT_NAME_PREFIX + count + '_3'; // input text
+ tbl.tBodies[0].rows[i].myRow.four.id = INPUT_NAME_PREFIX + count + '_4'; // input text
+ tbl.tBodies[0].rows[i].myRow.five.id = INPUT_NAME_PREFIX + count + '_5'; // input text
+ tbl.tBodies[0].rows[i].myRow.six.id = INPUT_NAME_PREFIX + count + '_6'; // input text
+ tbl.tBodies[0].rows[i].myRow.seven.id = INPUT_NAME_PREFIX + count + '_7'; // input text
+ tbl.tBodies[0].rows[i].myRow.eight.id = INPUT_NAME_PREFIX + count + '_8'; // input text
+ tbl.tBodies[0].rows[i].myRow.nine.id = INPUT_NAME_PREFIX + count + '_9'; // input text
+
+ tbl.tBodies[0].rows[i].myRow.ten.id = INPUT_NAME_PREFIX + count + '_10'; // input text
+ tbl.tBodies[0].rows[i].myRow.eleven.id = INPUT_NAME_PREFIX + count + '_11'; // input text
+ tbl.tBodies[0].rows[i].myRow.twelve.id = INPUT_NAME_PREFIX + count + '_12'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirteen.id = INPUT_NAME_PREFIX + count + '_13'; // input text
+ tbl.tBodies[0].rows[i].myRow.fourteen.id = INPUT_NAME_PREFIX + count + '_14'; // input text
+ tbl.tBodies[0].rows[i].myRow.fifteen.id = INPUT_NAME_PREFIX + count + '_15'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixteen.id = INPUT_NAME_PREFIX + count + '_16'; // input text
+ tbl.tBodies[0].rows[i].myRow.seventeen.id = INPUT_NAME_PREFIX + count + '_17'; // input text
+ tbl.tBodies[0].rows[i].myRow.eighteen.id = INPUT_NAME_PREFIX + count + '_18'; // input text
+ tbl.tBodies[0].rows[i].myRow.nineteen.id = INPUT_NAME_PREFIX + count + '_19'; // input text
+
+ tbl.tBodies[0].rows[i].myRow.twenty.id = INPUT_NAME_PREFIX + count + '_20'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentyone.id = INPUT_NAME_PREFIX + count + '_21'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentytwo.id = INPUT_NAME_PREFIX + count + '_22'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentythree.id = INPUT_NAME_PREFIX + count + '_23'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentyfour.id = INPUT_NAME_PREFIX + count + '_24'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentyfive.id = INPUT_NAME_PREFIX + count + '_25'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentysix.id = INPUT_NAME_PREFIX + count + '_26'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentyseven.id = INPUT_NAME_PREFIX + count + '_27'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentyeight.id = INPUT_NAME_PREFIX + count + '_28'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentynine.id = INPUT_NAME_PREFIX + count + '_29'; // input text
+
+ tbl.tBodies[0].rows[i].myRow.thirty.id = INPUT_NAME_PREFIX + count + '_30'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtyone.id = INPUT_NAME_PREFIX + count + '_31'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtytwo.id = INPUT_NAME_PREFIX + count + '_32'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtythree.id = INPUT_NAME_PREFIX + count + '_33'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtyfour.id = INPUT_NAME_PREFIX + count + '_34'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtyfive.id = INPUT_NAME_PREFIX + count + '_35'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtysix.id = INPUT_NAME_PREFIX + count + '_36'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtyseven.id = INPUT_NAME_PREFIX + count + '_37'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtyeight.id = INPUT_NAME_PREFIX + count + '_38'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtynine.id = INPUT_NAME_PREFIX + count + '_39'; // input text
+
+ tbl.tBodies[0].rows[i].myRow.forty.id = INPUT_NAME_PREFIX + count + '_40'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortyone.id = INPUT_NAME_PREFIX + count + '_41'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortytwo.id = INPUT_NAME_PREFIX + count + '_42'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortythree.id = INPUT_NAME_PREFIX + count + '_43'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortyfour.id = INPUT_NAME_PREFIX + count + '_44'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortyfive.id = INPUT_NAME_PREFIX + count + '_45'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortysix.id = INPUT_NAME_PREFIX + count + '_46'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortyseven.id = INPUT_NAME_PREFIX + count + '_47'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortyeight.id = INPUT_NAME_PREFIX + count + '_48'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortynine.id = INPUT_NAME_PREFIX + count + '_49'; // input text
+
+ tbl.tBodies[0].rows[i].myRow.fifty.id = INPUT_NAME_PREFIX + count + '_50'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftyone.id = INPUT_NAME_PREFIX + count + '_51'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftytwo.id = INPUT_NAME_PREFIX + count + '_52'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftythree.id = INPUT_NAME_PREFIX + count + '_53'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftyfour.id = INPUT_NAME_PREFIX + count + '_54'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftyfive.id = INPUT_NAME_PREFIX + count + '_55'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftysix.id = INPUT_NAME_PREFIX + count + '_56'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftyseven.id = INPUT_NAME_PREFIX + count + '_57'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftyeight.id = INPUT_NAME_PREFIX + count + '_58'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftynine.id = INPUT_NAME_PREFIX + count + '_59'; // input text
+
+ tbl.tBodies[0].rows[i].myRow.sixty.id = INPUT_NAME_PREFIX + count + '_60'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtyone.id = INPUT_NAME_PREFIX + count + '_61'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtytwo.id = INPUT_NAME_PREFIX + count + '_62'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtythree.id = INPUT_NAME_PREFIX + count + '_63'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtyfour.id = INPUT_NAME_PREFIX + count + '_64'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtyfive.id = INPUT_NAME_PREFIX + count + '_65'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtysix.id = INPUT_NAME_PREFIX + count + '_66'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtyseven.id = INPUT_NAME_PREFIX + count + '_67'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtyeight.id = INPUT_NAME_PREFIX + count + '_68'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtynine.id = INPUT_NAME_PREFIX + count + '_69'; // input text
+ tbl.tBodies[0].rows[i].myRow.seventy.id = INPUT_NAME_PREFIX + count + '_70'; // input text
+ tbl.tBodies[0].rows[i].myRow.seventyone.id = INPUT_NAME_PREFIX + count + '_71'; // input text
+ tbl.tBodies[0].rows[i].myRow.seventytwo.id = INPUT_NAME_PREFIX + count + '_72'; // input text
+ tbl.tBodies[0].rows[i].myRow.seventythree.id = INPUT_NAME_PREFIX + count + '_73'; // input text
+ // ------------------------------------------------------------
+
+ // ------------------------------------------------------------
+ tbl.tBodies[0].rows[i].myRow.one.name = INPUT_NAME_PREFIX + count + '_1'; // input text
+ tbl.tBodies[0].rows[i].myRow.two.name = INPUT_NAME_PREFIX + count + '_2'; // input text
+ tbl.tBodies[0].rows[i].myRow.three.name = INPUT_NAME_PREFIX + count + '_3'; // input text
+ tbl.tBodies[0].rows[i].myRow.four.name = INPUT_NAME_PREFIX + count + '_4'; // input text
+ tbl.tBodies[0].rows[i].myRow.five.name = INPUT_NAME_PREFIX + count + '_5'; // input text
+ tbl.tBodies[0].rows[i].myRow.six.name = INPUT_NAME_PREFIX + count + '_6'; // input text
+ tbl.tBodies[0].rows[i].myRow.seven.name = INPUT_NAME_PREFIX + count + '_7'; // input text
+ tbl.tBodies[0].rows[i].myRow.eight.name = INPUT_NAME_PREFIX + count + '_8'; // input text
+ tbl.tBodies[0].rows[i].myRow.nine.name = INPUT_NAME_PREFIX + count + '_9'; // input text
+
+ tbl.tBodies[0].rows[i].myRow.ten.name = INPUT_NAME_PREFIX + count + '_10'; // input text
+ tbl.tBodies[0].rows[i].myRow.eleven.name = INPUT_NAME_PREFIX + count + '_11'; // input text
+ tbl.tBodies[0].rows[i].myRow.twelve.name = INPUT_NAME_PREFIX + count + '_12'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirteen.name = INPUT_NAME_PREFIX + count + '_13'; // input text
+ tbl.tBodies[0].rows[i].myRow.fourteen.name = INPUT_NAME_PREFIX + count + '_14'; // input text
+ tbl.tBodies[0].rows[i].myRow.fifteen.name = INPUT_NAME_PREFIX + count + '_15'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixteen.name = INPUT_NAME_PREFIX + count + '_16'; // input text
+ tbl.tBodies[0].rows[i].myRow.seventeen.name = INPUT_NAME_PREFIX + count + '_17'; // input text
+ tbl.tBodies[0].rows[i].myRow.eighteen.name = INPUT_NAME_PREFIX + count + '_18'; // input text
+ tbl.tBodies[0].rows[i].myRow.nineteen.name = INPUT_NAME_PREFIX + count + '_19'; // input text
+
+ tbl.tBodies[0].rows[i].myRow.twenty.name = INPUT_NAME_PREFIX + count + '_20'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentyone.name = INPUT_NAME_PREFIX + count + '_21'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentytwo.name = INPUT_NAME_PREFIX + count + '_22'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentythree.name = INPUT_NAME_PREFIX + count + '_23'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentyfour.name = INPUT_NAME_PREFIX + count + '_24'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentyfive.name = INPUT_NAME_PREFIX + count + '_25'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentysix.name = INPUT_NAME_PREFIX + count + '_26'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentyseven.name = INPUT_NAME_PREFIX + count + '_27'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentyeight.name = INPUT_NAME_PREFIX + count + '_28'; // input text
+ tbl.tBodies[0].rows[i].myRow.twentynine.name = INPUT_NAME_PREFIX + count + '_29'; // input text
+
+ tbl.tBodies[0].rows[i].myRow.thirty.name = INPUT_NAME_PREFIX + count + '_30'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtyone.name = INPUT_NAME_PREFIX + count + '_31'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtytwo.name = INPUT_NAME_PREFIX + count + '_32'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtythree.name = INPUT_NAME_PREFIX + count + '_33'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtyfour.name = INPUT_NAME_PREFIX + count + '_34'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtyfive.name = INPUT_NAME_PREFIX + count + '_35'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtysix.name = INPUT_NAME_PREFIX + count + '_36'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtyseven.name = INPUT_NAME_PREFIX + count + '_37'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtyeight.name = INPUT_NAME_PREFIX + count + '_38'; // input text
+ tbl.tBodies[0].rows[i].myRow.thirtynine.name = INPUT_NAME_PREFIX + count + '_39'; // input text
+
+ tbl.tBodies[0].rows[i].myRow.forty.name = INPUT_NAME_PREFIX + count + '_40'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortyone.name = INPUT_NAME_PREFIX + count + '_41'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortytwo.name = INPUT_NAME_PREFIX + count + '_42'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortythree.name = INPUT_NAME_PREFIX + count + '_43'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortyfour.name = INPUT_NAME_PREFIX + count + '_44'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortyfive.name = INPUT_NAME_PREFIX + count + '_45'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortysix.name = INPUT_NAME_PREFIX + count + '_46'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortyseven.name = INPUT_NAME_PREFIX + count + '_47'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortyeight.name = INPUT_NAME_PREFIX + count + '_48'; // input text
+ tbl.tBodies[0].rows[i].myRow.fortynine.name = INPUT_NAME_PREFIX + count + '_49'; // input text
+
+ tbl.tBodies[0].rows[i].myRow.fifty.name = INPUT_NAME_PREFIX + count + '_50'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftyone.name = INPUT_NAME_PREFIX + count + '_51'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftytwo.name = INPUT_NAME_PREFIX + count + '_52'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftythree.name = INPUT_NAME_PREFIX + count + '_53'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftyfour.name = INPUT_NAME_PREFIX + count + '_54'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftyfive.name = INPUT_NAME_PREFIX + count + '_55'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftysix.name = INPUT_NAME_PREFIX + count + '_56'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftyseven.name = INPUT_NAME_PREFIX + count + '_57'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftyeight.name = INPUT_NAME_PREFIX + count + '_58'; // input text
+ tbl.tBodies[0].rows[i].myRow.fiftynine.name = INPUT_NAME_PREFIX + count + '_59'; // input text
+
+ tbl.tBodies[0].rows[i].myRow.sixty.name = INPUT_NAME_PREFIX + count + '_60'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtyone.name = INPUT_NAME_PREFIX + count + '_61'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtytwo.name = INPUT_NAME_PREFIX + count + '_62'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtythree.name = INPUT_NAME_PREFIX + count + '_63'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtyfour.name = INPUT_NAME_PREFIX + count + '_64'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtyfive.name = INPUT_NAME_PREFIX + count + '_65'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtysix.name = INPUT_NAME_PREFIX + count + '_66'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtyseven.name = INPUT_NAME_PREFIX + count + '_67'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtyeight.name = INPUT_NAME_PREFIX + count + '_68'; // input text
+ tbl.tBodies[0].rows[i].myRow.sixtynine.name = INPUT_NAME_PREFIX + count + '_69'; // input text
+
+ tbl.tBodies[0].rows[i].myRow.seventy.name = INPUT_NAME_PREFIX + count + '_70'; // input text
+ tbl.tBodies[0].rows[i].myRow.seventyone.name = INPUT_NAME_PREFIX + count + '_71'; // input text
+ tbl.tBodies[0].rows[i].myRow.seventytwo.name = INPUT_NAME_PREFIX + count + '_72'; // input text
+ tbl.tBodies[0].rows[i].myRow.seventythree.name = INPUT_NAME_PREFIX + count + '_73'; // input text
+
+ // ------------------------------------------------------------
+ tbl.tBodies[0].rows[i].myRow.ra.value = count; // input radio
+ count++;
+ }
+ }
+ }
+}
+
+</script>
+
+
+
diff --git a/modules/GEDFact_assistant/_CENS/js/chapman_codes.js b/modules/GEDFact_assistant/_CENS/js/chapman_codes.js
new file mode 100644
index 0000000000..62021f2654
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/js/chapman_codes.js
@@ -0,0 +1,398 @@
+/**
+ * Census Assistant module for phpGedView
+ *
+ * Chapman Code information
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Census Assistant
+ * @version $Id$
+ * @author Brian Holland (windmillway)
+ */
+
+ function getChapmanCode(location) {
+ // Countries
+ if (location == 'All') { var ChapmanCode = 'ALL';
+ } else if (location == 'Anywhere') { var ChapmanCode = 'ANY';
+ } else if (location == 'At Sea') { var ChapmanCode = 'SEA';
+ } else if (location == 'Unknown') { var ChapmanCode = 'UNK';
+ } else if (location == 'UNK') { var ChapmanCode = '-';
+ } else if (location == '') { var ChapmanCode = '-';
+
+ } else if (location == 'Afghanistan') { var ChapmanCode = 'AFG';
+ } else if (location == 'Albania') { var ChapmanCode = 'ALB';
+ } else if (location == 'Algeria') { var ChapmanCode = 'DZA';
+ } else if (location == 'American Samoa') { var ChapmanCode = 'ASM';
+ } else if (location == 'Andorra') { var ChapmanCode = 'AND';
+ } else if (location == 'Angola') { var ChapmanCode = 'AGO';
+ } else if (location == 'Anguilla') { var ChapmanCode = 'AIA';
+ } else if (location == 'Antarctica') { var ChapmanCode = 'ATA';
+ } else if (location == 'Antigua and Barbuda') { var ChapmanCode = 'ATG';
+ } else if (location == 'Argentina') { var ChapmanCode = 'ARG';
+ } else if (location == 'Armenia') { var ChapmanCode = 'ARM';
+ } else if (location == 'Aruba') { var ChapmanCode = 'ABW';
+ } else if (location == 'Australia') { var ChapmanCode = 'AUS';
+ } else if (location == 'Austria') { var ChapmanCode = 'AUT';
+ } else if (location == 'Azerbaijan') { var ChapmanCode = 'AZE';
+ } else if (location == 'Bahamas') { var ChapmanCode = 'BHS';
+ } else if (location == 'Bahrain') { var ChapmanCode = 'BHR';
+ } else if (location == 'Bangladesh') { var ChapmanCode = 'BGD';
+ } else if (location == 'Barbados') { var ChapmanCode = 'BRB';
+ } else if (location == 'Belarus') { var ChapmanCode = 'BLR';
+ } else if (location == 'Belgium') { var ChapmanCode = 'BEL';
+ } else if (location == 'Belize') { var ChapmanCode = 'BLZ';
+ } else if (location == 'Benin') { var ChapmanCode = 'BEN';
+ } else if (location == 'Bermuda') { var ChapmanCode = 'BMU';
+ } else if (location == 'Bhutan') { var ChapmanCode = 'BTN';
+ } else if (location == 'Bolivia') { var ChapmanCode = 'BOL';
+ } else if (location == 'Bosnia and Herzegovina') { var ChapmanCode = 'BIH';
+ } else if (location == 'Botswana') { var ChapmanCode = 'BWA';
+ } else if (location == 'Bouvet Island') { var ChapmanCode = 'BVT';
+ } else if (location == 'Brazil') { var ChapmanCode = 'BRA';
+ } else if (location == 'British Indian Ocean Territory') { var ChapmanCode = 'IOT';
+ } else if (location == 'British West Indies') { var ChapmanCode = 'BWI';
+ } else if (location == 'Brunei Darussalam') { var ChapmanCode = 'BRN';
+ } else if (location == 'Bulgaria') { var ChapmanCode = 'BGR';
+ } else if (location == 'Burkina Faso') { var ChapmanCode = 'BFA';
+ } else if (location == 'Burma') { var ChapmanCode = 'MMR';
+ } else if (location == 'Burundi') { var ChapmanCode = 'BDI';
+ } else if (location == 'Cambodia') { var ChapmanCode = 'KHM';
+ } else if (location == 'Cameroon') { var ChapmanCode = 'CMR';
+ } else if (location == 'Canada') { var ChapmanCode = 'CAN';
+ } else if (location == 'Cape Verde') { var ChapmanCode = 'CPV';
+ } else if (location == 'Cayman Islands') { var ChapmanCode = 'CYM';
+ } else if (location == 'Central African Republic') { var ChapmanCode = 'CAF';
+ } else if (location == 'Central America') { var ChapmanCode = 'CAM';
+ } else if (location == 'Chad') { var ChapmanCode = 'TCD';
+ } else if (location == 'Channel Islands') { var ChapmanCode = 'CHI';
+ } else if (location == 'Chile') { var ChapmanCode = 'CHL';
+ } else if (location == 'China') { var ChapmanCode = 'CHN';
+ } else if (location == 'Christmas Island') { var ChapmanCode = 'CXR';
+ } else if (location == 'Cocos (Keeling) Islands') { var ChapmanCode = 'CCK';
+ } else if (location == 'Colombia') { var ChapmanCode = 'COL';
+ } else if (location == 'Comoros') { var ChapmanCode = 'COM';
+ } else if (location == 'Congo') { var ChapmanCode = 'COG';
+ } else if (location == 'Cook Islands') { var ChapmanCode = 'COK';
+ } else if (location == 'Costa Rica') { var ChapmanCode = 'CRI';
+ } else if (location == 'Cote D\'ivoire') { var ChapmanCode = 'CIV';
+ } else if (location == 'Croatia') { var ChapmanCode = 'HRV';
+ } else if (location == 'Hrvatska)') { var ChapmanCode = 'HRV';
+ } else if (location == 'Cuba') { var ChapmanCode = 'CUB';
+ } else if (location == 'Cyprus') { var ChapmanCode = 'CYP';
+ } else if (location == 'Czechoslovakia') { var ChapmanCode = 'CSK';
+ } else if (location == 'Czech Republic') { var ChapmanCode = 'CZE';
+ } else if (location == 'Denmark') { var ChapmanCode = 'DNK';
+ } else if (location == 'Deutschland') { var ChapmanCode = 'DEU';
+ } else if (location == 'Djibouti') { var ChapmanCode = 'DJI';
+ } else if (location == 'Dominica') { var ChapmanCode = 'DMA';
+ } else if (location == 'Dominican Republic') { var ChapmanCode = 'DOM';
+ } else if (location == 'Dutch New Guinea') { var ChapmanCode = 'DNG';
+ } else if (location == 'East Indies') { var ChapmanCode = 'IDN';
+ } else if (location == 'East Timor') { var ChapmanCode = 'TLS';
+ } else if (location == 'Ecuador') { var ChapmanCode = 'ECU';
+ } else if (location == 'Egypt') { var ChapmanCode = 'EGY';
+ } else if (location == 'Eire') { var ChapmanCode = 'EIR';
+ } else if (location == 'El Salvador') { var ChapmanCode = 'SLV';
+ } else if (location == 'England') { var ChapmanCode = 'ENG';
+ } else if (location == 'Equatorial Guinea') { var ChapmanCode = 'GNQ';
+ } else if (location == 'Eritrea') { var ChapmanCode = 'ERI';
+ } else if (location == 'Estonia') { var ChapmanCode = 'EST';
+ } else if (location == 'Ethiopia') { var ChapmanCode = 'ETH';
+ } else if (location == 'Falkland Islands') { var ChapmanCode = 'FLK';
+ } else if (location == 'Malvinas') { var ChapmanCode = 'FLK';
+ } else if (location == 'Faroe Islands') { var ChapmanCode = 'FRO';
+ } else if (location == 'Fiji') { var ChapmanCode = 'FJI';
+ } else if (location == 'Finland') { var ChapmanCode = 'FIN';
+ } else if (location == 'France') { var ChapmanCode = 'FRA';
+ } else if (location == 'France, Metropolitan') { var ChapmanCode = 'FXX';
+ } else if (location == 'French Guiana') { var ChapmanCode = 'GUF';
+ } else if (location == 'French Polynesia') { var ChapmanCode = 'PYF';
+ } else if (location == 'French Southern Territories') { var ChapmanCode = 'ATF';
+ } else if (location == 'Gabon') { var ChapmanCode = 'GAB';
+ } else if (location == 'Gambia') { var ChapmanCode = 'GMB';
+ } else if (location == 'Georgia') { var ChapmanCode = 'GEO';
+ } else if (location == 'Germany') { var ChapmanCode = 'DEU';
+ } else if (location == 'Ghana') { var ChapmanCode = 'GHA';
+ } else if (location == 'Gibraltar') { var ChapmanCode = 'GIB';
+ } else if (location == 'Great Britain') { var ChapmanCode = 'GBR';
+ } else if (location == 'Greece') { var ChapmanCode = 'GRC';
+ } else if (location == 'Greenland') { var ChapmanCode = 'GRL';
+ } else if (location == 'Grenada') { var ChapmanCode = 'GRD';
+ } else if (location == 'Guadeloupe') { var ChapmanCode = 'GLP';
+ } else if (location == 'Guam') { var ChapmanCode = 'GUM';
+ } else if (location == 'Guatemala') { var ChapmanCode = 'GTM';
+ } else if (location == 'Guinea') { var ChapmanCode = 'GIN';
+ } else if (location == 'Guinea-Bissau') { var ChapmanCode = 'GNB';
+ } else if (location == 'Guyana') { var ChapmanCode = 'GUY';
+ } else if (location == 'Haiti') { var ChapmanCode = 'HTI';
+ } else if (location == 'Heard Island & McDonald Islands') { var ChapmanCode = 'HMD';
+ } else if (location == 'Holland') { var ChapmanCode = 'HOL';
+ } else if (location == 'Honduras') { var ChapmanCode = 'HND';
+ } else if (location == 'Hong Kong') { var ChapmanCode = 'HKG';
+ } else if (location == 'Hungary') { var ChapmanCode = 'HUN';
+ } else if (location == 'Iceland') { var ChapmanCode = 'ISL';
+ } else if (location == 'India') { var ChapmanCode = 'IND';
+ } else if (location == 'Indonesia') { var ChapmanCode = 'IDN';
+ } else if (location == 'Iran') { var ChapmanCode = 'IRN';
+ } else if (location == 'Islamic Republic of Iran') { var ChapmanCode = 'IRN';
+ } else if (location == 'Iraq') { var ChapmanCode = 'IRQ';
+ } else if (location == 'Ireland') { var ChapmanCode = 'IRL';
+ } else if (location == 'Israel') { var ChapmanCode = 'ISR';
+ } else if (location == 'Italy') { var ChapmanCode = 'ITA';
+ } else if (location == 'Jamaica') { var ChapmanCode = 'JAM';
+ } else if (location == 'Japan') { var ChapmanCode = 'JPN';
+ } else if (location == 'Jordan') { var ChapmanCode = 'JOR';
+ } else if (location == 'Kazakhstan') { var ChapmanCode = 'KAZ';
+ } else if (location == 'Kenya') { var ChapmanCode = 'KEN';
+ } else if (location == 'Kiribati') { var ChapmanCode = 'KIR';
+ } else if (location == 'North Korea') { var ChapmanCode = 'PRK';
+ } else if (location == 'Korea, Democratic People\'s Republic of') { var ChapmanCode = 'PRK';
+ } else if (location == 'South Korea') { var ChapmanCode = 'KOR';
+ } else if (location == 'Korea, Republic of') { var ChapmanCode = 'KOR';
+ } else if (location == 'Kuwait') { var ChapmanCode = 'KWT';
+ } else if (location == 'Kyrgyzstan') { var ChapmanCode = 'KGZ';
+ } else if (location == 'Laos') { var ChapmanCode = 'LAO';
+ } else if (location == 'Lao People\'s Democratic Republic') { var ChapmanCode = 'LAO';
+ } else if (location == 'Latvia') { var ChapmanCode = 'LVA';
+ } else if (location == 'Lebanon') { var ChapmanCode = 'LBN';
+ } else if (location == 'Lesotho') { var ChapmanCode = 'LSO';
+ } else if (location == 'Liberia') { var ChapmanCode = 'LBR';
+ } else if (location == 'Libya') { var ChapmanCode = 'LBY';
+ } else if (location == 'Libyan Arab Jamahiriya') { var ChapmanCode = 'LBY';
+ } else if (location == 'Liechtenstein') { var ChapmanCode = 'LIE';
+ } else if (location == 'Lithuania') { var ChapmanCode = 'LTU';
+ } else if (location == 'Luxembourg') { var ChapmanCode = 'LUX';
+ } else if (location == 'Macau') { var ChapmanCode = 'MAC';
+ } else if (location == 'Macedonia') { var ChapmanCode = 'MKD';
+ } else if (location == 'Madagascar') { var ChapmanCode = 'MDG';
+ } else if (location == 'Malawi') { var ChapmanCode = 'MWI';
+ } else if (location == 'Malaysia') { var ChapmanCode = 'MYS';
+ } else if (location == 'Maldives') { var ChapmanCode = 'MDV';
+ } else if (location == 'Mali') { var ChapmanCode = 'MLI';
+ } else if (location == 'Malta') { var ChapmanCode = 'MLT';
+ } else if (location == 'Marshall Islands') { var ChapmanCode = 'MHL';
+ } else if (location == 'Martinique') { var ChapmanCode = 'MTQ';
+ } else if (location == 'Mauritania') { var ChapmanCode = 'MRT';
+ } else if (location == 'Mauritius') { var ChapmanCode = 'MUS';
+ } else if (location == 'Mayotte') { var ChapmanCode = 'MYT';
+ } else if (location == 'Mexico') { var ChapmanCode = 'MEX';
+ } else if (location == 'Micronesia') { var ChapmanCode = 'FSM';
+ } else if (location == 'Micronesia, Federated States of') { var ChapmanCode = 'FSM';
+ } else if (location == 'Moldova') { var ChapmanCode = 'MDA';
+ } else if (location == 'Moldova, Republic of') { var ChapmanCode = 'MDA';
+ } else if (location == 'Monaco') { var ChapmanCode = 'MCO';
+ } else if (location == 'Mongolia') { var ChapmanCode = 'MNG';
+ } else if (location == 'Montserrat') { var ChapmanCode = 'MSR';
+ } else if (location == 'Morocco') { var ChapmanCode = 'MAR';
+ } else if (location == 'Mozambique') { var ChapmanCode = 'MOZ';
+ } else if (location == 'Myanmar') { var ChapmanCode = 'MMR';
+ } else if (location == 'Namibia') { var ChapmanCode = 'NAM';
+ } else if (location == 'Nauru') { var ChapmanCode = 'NRU';
+ } else if (location == 'Nepal') { var ChapmanCode = 'NPL';
+ } else if (location == 'Nederland') { var ChapmanCode = 'NLD';
+ } else if (location == 'Netherlands') { var ChapmanCode = 'NLD';
+ } else if (location == 'Netherlands Antilles') { var ChapmanCode = 'ANT';
+ } else if (location == 'New Caledonia') { var ChapmanCode = 'NCL';
+ } else if (location == 'New Zealand') { var ChapmanCode = 'NZL';
+ } else if (location == 'Nicaragua') { var ChapmanCode = 'NIC';
+ } else if (location == 'Niger') { var ChapmanCode = 'NER';
+ } else if (location == 'Nigeria') { var ChapmanCode = 'NGA';
+ } else if (location == 'Niue') { var ChapmanCode = 'NIU';
+ } else if (location == 'Norfolk Island') { var ChapmanCode = 'NFK';
+ } else if (location == 'Northern Ireland') { var ChapmanCode = 'NIR';
+ } else if (location == 'Northern Mariana Islands') { var ChapmanCode = 'MNP';
+ } else if (location == 'Norway') { var ChapmanCode = 'NOR';
+ } else if (location == 'Oman') { var ChapmanCode = 'OMN';
+ } else if (location == 'Pakistan') { var ChapmanCode = 'PAK';
+ } else if (location == 'Palau') { var ChapmanCode = 'PLW';
+ } else if (location == 'Panama') { var ChapmanCode = 'PAN';
+ } else if (location == 'Panama Canal Zone') { var ChapmanCode = 'PCZ';
+ } else if (location == 'Papua New Guinea') { var ChapmanCode = 'PNG';
+ } else if (location == 'Paraguay') { var ChapmanCode = 'PRY';
+ } else if (location == 'Peru') { var ChapmanCode = 'PER';
+ } else if (location == 'Philippines') { var ChapmanCode = 'PHL';
+ } else if (location == 'Pitcairn') { var ChapmanCode = 'PCN';
+ } else if (location == 'Poland') { var ChapmanCode = 'POL';
+ } else if (location == 'Portugal') { var ChapmanCode = 'PRT';
+ } else if (location == 'Puerto Rico') { var ChapmanCode = 'PRI';
+ } else if (location == 'Qatar') { var ChapmanCode = 'QAT';
+ } else if (location == 'Reunion') { var ChapmanCode = 'REU';
+ } else if (location == 'Romania') { var ChapmanCode = 'ROU';
+ } else if (location == 'Russia') { var ChapmanCode = 'RUS';
+ } else if (location == 'Russian Federation') { var ChapmanCode = 'RUS';
+ } else if (location == 'Rwanda') { var ChapmanCode = 'RWA';
+ } else if (location == 'Saint Kitts and Nevis') { var ChapmanCode = 'KNA';
+ } else if (location == 'Saint Lucia') { var ChapmanCode = 'LCA';
+ } else if (location == 'Saint Vincent and the Grenadines') { var ChapmanCode = 'VCT';
+ } else if (location == 'Samoa') { var ChapmanCode = 'WSM';
+ } else if (location == 'San Marino') { var ChapmanCode = 'SMR';
+ } else if (location == 'Sao Tome and Principe') { var ChapmanCode = 'STP';
+ } else if (location == 'Saudi Arabia') { var ChapmanCode = 'SAU';
+ } else if (location == 'Scotland') { var ChapmanCode = 'SCT';
+ } else if (location == 'Senegal') { var ChapmanCode = 'SEN';
+ } else if (location == 'Seychelles') { var ChapmanCode = 'SYC';
+ } else if (location == 'Sicily') { var ChapmanCode = 'SIC';
+ } else if (location == 'Sierra Leone') { var ChapmanCode = 'SLE';
+ } else if (location == 'Singapore') { var ChapmanCode = 'SGP';
+ } else if (location == 'Slovakia') { var ChapmanCode = 'SVK';
+ } else if (location == 'Slovak Republic') { var ChapmanCode = 'SVK';
+ } else if (location == 'Slovenia') { var ChapmanCode = 'SVN';
+ } else if (location == 'Solomon Islands') { var ChapmanCode = 'SLB';
+ } else if (location == 'Somalia') { var ChapmanCode = 'SOM';
+ } else if (location == 'South Africa') { var ChapmanCode = 'ZAF';
+ } else if (location == 'Zuid Afrika') { var ChapmanCode = 'ZAF';
+ } else if (location == 'South America') { var ChapmanCode = 'SAM';
+ } else if (location == 'Spain') { var ChapmanCode = 'ESP';
+ } else if (location == 'Espana') { var ChapmanCode = 'ESP';
+ } else if (location == 'Sri Lanka') { var ChapmanCode = 'LKA';
+ } else if (location == 'Saint Helena') { var ChapmanCode = 'SHN';
+ } else if (location == 'Saint Pierre and Miquelon') { var ChapmanCode = 'SPM';
+ } else if (location == 'Sudan') { var ChapmanCode = 'SDN';
+ } else if (location == 'Suriname') { var ChapmanCode = 'SUR';
+ } else if (location == 'Svalbard and Jan Mayen Islands') { var ChapmanCode = 'SJM';
+ } else if (location == 'Swaziland') { var ChapmanCode = 'SWZ';
+ } else if (location == 'Sweden') { var ChapmanCode = 'SWE';
+ } else if (location == 'Switzerland') { var ChapmanCode = 'CHE';
+ } else if (location == 'Syria') { var ChapmanCode = 'SYR';
+ } else if (location == 'Syrian Arab Republic') { var ChapmanCode = 'SYR';
+ } else if (location == 'Taiwan') { var ChapmanCode = 'TWN';
+ } else if (location == 'Taiwan, Province of China') { var ChapmanCode = 'TWN';
+ } else if (location == 'Tajikistan') { var ChapmanCode = 'TJK';
+ } else if (location == 'Tanzania') { var ChapmanCode = 'TZA';
+ } else if (location == 'Tanzania, United Republic of') { var ChapmanCode = 'TZA';
+ } else if (location == 'United Republic of Tanzania') { var ChapmanCode = 'TZA';
+ } else if (location == 'Thailand') { var ChapmanCode = 'THA';
+ } else if (location == 'Togo') { var ChapmanCode = 'TGO';
+ } else if (location == 'Tokelau') { var ChapmanCode = 'TKL';
+ } else if (location == 'Tonga') { var ChapmanCode = 'TON';
+ } else if (location == 'Trinidad and Tobago') { var ChapmanCode = 'TTO';
+ } else if (location == 'Tunisia') { var ChapmanCode = 'TUN';
+ } else if (location == 'Turkey') { var ChapmanCode = 'TUR';
+ } else if (location == 'Turkmenistan') { var ChapmanCode = 'TKM';
+ } else if (location == 'Turks and Caicos Islands') { var ChapmanCode = 'TCA';
+ } else if (location == 'Tuvalu') { var ChapmanCode = 'TUV';
+ } else if (location == 'Uganda') { var ChapmanCode = 'UGA';
+ } else if (location == 'Ukraine') { var ChapmanCode = 'UKR';
+ } else if (location == 'United Arab Emirates') { var ChapmanCode = 'ARE';
+ } else if (location == 'Arab Emirates') { var ChapmanCode = 'ARE';
+ } else if (location == 'United Kingdom') { var ChapmanCode = 'GBR';
+ } else if (location == 'United States Of America') { var ChapmanCode = 'USA';
+ } else if (location == 'United States') { var ChapmanCode = 'USA';
+ } else if (location == 'United States, Minor Outlying Islands') { var ChapmanCode = 'UMI';
+ } else if (location == 'Uruguay') { var ChapmanCode = 'URY';
+ } else if (location == 'Uzbekistan') { var ChapmanCode = 'UZB';
+ } else if (location == 'Vanuatu') { var ChapmanCode = 'VUT';
+ } else if (location == 'Vatican City State') { var ChapmanCode = 'VAT';
+ } else if (location == 'Venezuela') { var ChapmanCode = 'VEN';
+ } else if (location == 'Viet Nam') { var ChapmanCode = 'VNM';
+ } else if (location == 'Virgin Islands (British)') { var ChapmanCode = 'VGB';
+ } else if (location == 'Virgin Islands (U.S.)') { var ChapmanCode = 'VIR';
+ } else if (location == 'Wales') { var ChapmanCode = 'WLS';
+ } else if (location == 'Wallis and Futuna Islands') { var ChapmanCode = 'WLF';
+ } else if (location == 'West Africa') { var ChapmanCode = 'WAF';
+ } else if (location == 'West Indies') { var ChapmanCode = 'BWI';
+ } else if (location == 'West Indies, British') { var ChapmanCode = 'BWI';
+ } else if (location == 'Western Sahara') { var ChapmanCode = 'ESH';
+ } else if (location == 'Yemen') { var ChapmanCode = 'YEM';
+ } else if (location == 'Yugoslavia') { var ChapmanCode = 'YUG';
+ } else if (location == 'Zaire') { var ChapmanCode = 'ZAR';
+ } else if (location == 'Zambia') { var ChapmanCode = 'ZMB';
+ } else if (location == 'Zimbabwe') { var ChapmanCode = 'ZWE';
+
+ // USA States
+ } else if (location == 'AL' || location == 'Alabama') { var ChapmanCode = 'AL';
+ } else if (location == 'AK' || location == 'Alaska') { var ChapmanCode = 'AK';
+ } else if (location == 'AZ' || location == 'Arizona') { var ChapmanCode = 'AZ';
+ } else if (location == 'AR' || location == 'Arkansas') { var ChapmanCode = 'AR';
+ } else if (location == 'CA' || location == 'California') { var ChapmanCode = 'CA';
+ } else if (location == 'CO' || location == 'Colorado') { var ChapmanCode = 'CO';
+ } else if (location == 'CT' || location == 'Connecticut') { var ChapmanCode = 'CT';
+ } else if (location == 'DE' || location == 'Delaware') { var ChapmanCode = 'DE';
+ } else if (location == 'DC' || location == 'District of Columbia') { var ChapmanCode = 'DC';
+ } else if (location == 'FL' || location == 'Florida') { var ChapmanCode = 'FL';
+ } else if (location == 'GA' || location == 'Georgia') { var ChapmanCode = 'GA';
+ } else if (location == 'HI' || location == 'Hawaii') { var ChapmanCode = 'HI';
+ } else if (location == 'ID' || location == 'Idaho') { var ChapmanCode = 'ID';
+ } else if (location == 'IL' || location == 'Illinois') { var ChapmanCode = 'IL';
+ } else if (location == 'IN' || location == 'Indiana') { var ChapmanCode = 'IN';
+ } else if (location == 'IA' || location == 'Iowa') { var ChapmanCode = 'IA';
+ } else if (location == 'KS' || location == 'Kansas') { var ChapmanCode = 'KS';
+ } else if (location == 'KY' || location == 'Kentucky') { var ChapmanCode = 'KY';
+ } else if (location == 'LA' || location == 'Louisiana') { var ChapmanCode = 'LA';
+ } else if (location == 'ME' || location == 'Maine') { var ChapmanCode = 'ME';
+ } else if (location == 'MD' || location == 'Maryland') { var ChapmanCode = 'MD';
+ } else if (location == 'MA' || location == 'Massachusetts') { var ChapmanCode = 'MA';
+ } else if (location == 'MI' || location == 'Michigan') { var ChapmanCode = 'MI';
+ } else if (location == 'MN' || location == 'Minnesota') { var ChapmanCode = 'MN';
+ } else if (location == 'MS' || location == 'Mississippi') { var ChapmanCode = 'MS';
+ } else if (location == 'MO' || location == 'Missouri') { var ChapmanCode = 'MO';
+ } else if (location == 'MT' || location == 'Montana') { var ChapmanCode = 'MT';
+ } else if (location == 'NE' || location == 'Nebraska') { var ChapmanCode = 'NE';
+ } else if (location == 'NV' || location == 'Nevada') { var ChapmanCode = 'NV';
+ } else if (location == 'NH' || location == 'New Hampshire') { var ChapmanCode = 'NH';
+ } else if (location == 'NJ' || location == 'New Jersey') { var ChapmanCode = 'NJ';
+ } else if (location == 'NM' || location == 'New Mexico') { var ChapmanCode = 'NM';
+ } else if (location == 'NY' || location == 'New York') { var ChapmanCode = 'NY';
+ } else if (location == 'NC' || location == 'North Carolina') { var ChapmanCode = 'NC';
+ } else if (location == 'ND' || location == 'North Dakota') { var ChapmanCode = 'ND';
+ } else if (location == 'OH' || location == 'Ohio') { var ChapmanCode = 'OH';
+ } else if (location == 'OK' || location == 'Oklahoma') { var ChapmanCode = 'OK';
+ } else if (location == 'OR' || location == 'Oregon') { var ChapmanCode = 'OR';
+ } else if (location == 'PA' || location == 'Pennsylvania') { var ChapmanCode = 'PA';
+ } else if (location == 'PR' || location == '(Puerto Rico)') { var ChapmanCode = 'PR';
+ } else if (location == 'RI' || location == 'Rhode Island') { var ChapmanCode = 'RI';
+ } else if (location == 'SC' || location == 'South Carolina') { var ChapmanCode = 'SC';
+ } else if (location == 'SD' || location == 'South Dakota') { var ChapmanCode = 'SD';
+ } else if (location == 'TN' || location == 'Tennessee') { var ChapmanCode = 'TN';
+ } else if (location == 'TX' || location == 'Texas') { var ChapmanCode = 'TX';
+ } else if (location == 'UT' || location == 'Utah') { var ChapmanCode = 'UT';
+ } else if (location == 'VT' || location == 'Vermont') { var ChapmanCode = 'VT';
+ } else if (location == 'VA' || location == 'Virginia') { var ChapmanCode = 'VA';
+ } else if (location == 'VI' || location == '(Virgin Islands)') { var ChapmanCode = 'VI';
+ } else if (location == 'WA' || location == 'Washington') { var ChapmanCode = 'WA';
+ } else if (location == 'WV' || location == 'West Virginia') { var ChapmanCode = 'WV';
+ } else if (location == 'WI' || location == 'Wisconsin') { var ChapmanCode = 'WI';
+ } else if (location == 'WY' || location == 'Wyoming') { var ChapmanCode = 'WY';
+
+ // Canadian Provinces
+ } else if (location == 'AB' || location == 'Alberta') { var ChapmanCode = 'AB';
+ } else if (location == 'BC' || location == 'British Columbia') { var ChapmanCode = 'BC';
+ } else if (location == 'NL' || location == 'Labrador') { var ChapmanCode = 'NL';
+ } else if (location == 'MB' || location == 'Manitoba') { var ChapmanCode = 'MB';
+ } else if (location == 'NB' || location == 'New Brunswick') { var ChapmanCode = 'NB';
+ } else if (location == 'NL' || location == 'Newfoundland') { var ChapmanCode = 'NL';
+ } else if (location == 'NL' || location == 'Newfoundland and Labrador') { var ChapmanCode = 'NL';
+ } else if (location == 'NT' || location == 'Northwest Territories') { var ChapmanCode = 'NT';
+ } else if (location == 'NS' || location == 'Nova Scotia') { var ChapmanCode = 'NS';
+ } else if (location == 'NU' || location == 'Nunavut') { var ChapmanCode = 'NU';
+ } else if (location == 'ON' || location == 'Ontario') { var ChapmanCode = 'ON';
+ } else if (location == 'PE' || location == 'Prince Edward Island') { var ChapmanCode = 'PE';
+ } else if (location == 'QC' || location == 'Quebec') { var ChapmanCode = 'QC';
+ } else if (location == 'SK' || location == 'Saskatchewan') { var ChapmanCode = 'SK';
+ } else if (location == 'YT' || location == 'Yukon') { var ChapmanCode = 'YT';
+
+ // Default ChapmanCode
+ } else {
+ var ChapmanCode = '?NA';
+ }
+ return ChapmanCode;
+}
diff --git a/modules/GEDFact_assistant/_CENS/js/date.js b/modules/GEDFact_assistant/_CENS/js/date.js
new file mode 100644
index 0000000000..acaf5c02b7
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/js/date.js
@@ -0,0 +1,503 @@
+/**
+ * Copyright (c)2005-2009 Matt Kruse (javascripttoolbox.com)
+ *
+ * Dual licensed under the MIT and GPL licenses.
+ * This basically means you can use this code however you want for
+ * free, but don't claim to have written it yourself!
+ * Donations always accepted: http://www.JavascriptToolbox.com/donate/
+ *
+ * Please do not link to the .js files on javascripttoolbox.com from
+ * your site. Copy the files locally to your server instead.
+ *
+
+Date functions
+
+These functions are used to parse, format, and manipulate Date objects.
+See documentation and examples at http://www.JavascriptToolbox.com/lib/date/
+
+*/
+Date.$VERSION = 1.02;
+
+/**
+ * Census Assistant Control module for phpGedView
+ *
+ * Census information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2010 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Census Assistant
+ * @version $Id$
+*/
+
+// Utility function to append a 0 to single-digit numbers
+Date.LZ = function(x) {return(x<0||x>9?"":"0")+x};
+// Full month names. Change this for local month names
+Date.monthNames = new Array('January','February','March','April','May','June','July','August','September','October','November','December');
+// Month abbreviations. Change this for local month names
+Date.monthAbbreviations = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
+// Full day names. Change this for local month names
+Date.dayNames = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
+// Day abbreviations. Change this for local month names
+Date.dayAbbreviations = new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
+// Used for parsing ambiguous dates like 1/2/2000 - default to preferring 'American' format meaning Jan 2.
+// Set to false to prefer 'European' format meaning Feb 1
+Date.preferAmericanFormat = true;
+
+// If the getFullYear() method is not defined, create it
+if (!Date.prototype.getFullYear) {
+ Date.prototype.getFullYear = function() { var yy=this.getYear(); return (yy<1900?yy+1900:yy); } ;
+}
+
+// Parse a string and convert it to a Date object.
+// If no format is passed, try a list of common formats.
+// If string cannot be parsed, return null.
+// Avoids regular expressions to be more portable.
+Date.parseString = function(val, format) {
+ // If no format is specified, try a few common formats
+ if (typeof(format)=="undefined" || format==null || format=="") {
+ var generalFormats=new Array('y-M-d','MMM d, y','MMM d,y','y-MMM-d','d-MMM-y','MMM d','MMM-d','d-MMM');
+ var monthFirst=new Array('M/d/y','M-d-y','M.d.y','M/d','M-d');
+ var dateFirst =new Array('d/M/y','d-M-y','d.M.y','d/M','d-M');
+ var checkList=new Array(generalFormats,Date.preferAmericanFormat?monthFirst:dateFirst,Date.preferAmericanFormat?dateFirst:monthFirst);
+ for (var i=0; i<checkList.length; i++) {
+ var l=checkList[i];
+ for (var j=0; j<l.length; j++) {
+ var d=Date.parseString(val,l[j]);
+ if (d!=null) {
+ return d;
+ }
+ }
+ }
+ return null;
+ };
+
+ this.isInteger = function(val) {
+ for (var i=0; i < val.length; i++) {
+ if ("1234567890".indexOf(val.charAt(i))==-1) {
+ return false;
+ }
+ }
+ return true;
+ };
+ this.getInt = function(str,i,minlength,maxlength) {
+ for (var x=maxlength; x>=minlength; x--) {
+ var token=str.substring(i,i+x);
+ if (token.length < minlength) {
+ return null;
+ }
+ if (this.isInteger(token)) {
+ return token;
+ }
+ }
+ return null;
+ };
+ val=val+"";
+ format=format+"";
+ var i_val=0;
+ var i_format=0;
+ var c="";
+ var token="";
+ var token2="";
+ var x,y;
+ var year=new Date().getFullYear();
+ var month=1;
+ var date=1;
+ var hh=0;
+ var mm=0;
+ var ss=0;
+ var ampm="";
+ while (i_format < format.length) {
+ // Get next token from format string
+ c=format.charAt(i_format);
+ token="";
+ while ((format.charAt(i_format)==c) && (i_format < format.length)) {
+ token += format.charAt(i_format++);
+ }
+ // Extract contents of value based on format token
+ if (token=="yyyy" || token=="yy" || token=="y") {
+ if (token=="yyyy") {
+ x=4;y=4;
+ }
+ if (token=="yy") {
+ x=2;y=2;
+ }
+ if (token=="y") {
+ x=2;y=4;
+ }
+ year=this.getInt(val,i_val,x,y);
+ if (year==null) {
+ return null;
+ }
+ i_val += year.length;
+ if (year.length==2) {
+ if (year > 70) {
+ year=1900+(year-0);
+ }
+ else {
+ year=2000+(year-0);
+ }
+ }
+ }
+ else if (token=="MMM" || token=="NNN"){
+ month=0;
+ var names = (token=="MMM"?(Date.monthNames.concat(Date.monthAbbreviations)):Date.monthAbbreviations);
+ for (var i=0; i<names.length; i++) {
+ var month_name=names[i];
+ if (val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()) {
+ month=(i%12)+1;
+ i_val += month_name.length;
+ break;
+ }
+ }
+ if ((month < 1)||(month>12)){
+ return null;
+ }
+ }
+ else if (token=="EE"||token=="E"){
+ var names = (token=="EE"?Date.dayNames:Date.dayAbbreviations);
+ for (var i=0; i<names.length; i++) {
+ var day_name=names[i];
+ if (val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()) {
+ i_val += day_name.length;
+ break;
+ }
+ }
+ }
+ else if (token=="MM"||token=="M") {
+ month=this.getInt(val,i_val,token.length,2);
+ if(month==null||(month<1)||(month>12)){
+ return null;
+ }
+ i_val+=month.length;
+ }
+ else if (token=="dd"||token=="d") {
+ date=this.getInt(val,i_val,token.length,2);
+ if(date==null||(date<1)||(date>31)){
+ return null;
+ }
+ i_val+=date.length;
+ }
+ else if (token=="hh"||token=="h") {
+ hh=this.getInt(val,i_val,token.length,2);
+ if(hh==null||(hh<1)||(hh>12)){
+ return null;
+ }
+ i_val+=hh.length;
+ }
+ else if (token=="HH"||token=="H") {
+ hh=this.getInt(val,i_val,token.length,2);
+ if(hh==null||(hh<0)||(hh>23)){
+ return null;
+ }
+ i_val+=hh.length;
+ }
+ else if (token=="KK"||token=="K") {
+ hh=this.getInt(val,i_val,token.length,2);
+ if(hh==null||(hh<0)||(hh>11)){
+ return null;
+ }
+ i_val+=hh.length;
+ hh++;
+ }
+ else if (token=="kk"||token=="k") {
+ hh=this.getInt(val,i_val,token.length,2);
+ if(hh==null||(hh<1)||(hh>24)){
+ return null;
+ }
+ i_val+=hh.length;
+ hh--;
+ }
+ else if (token=="mm"||token=="m") {
+ mm=this.getInt(val,i_val,token.length,2);
+ if(mm==null||(mm<0)||(mm>59)){
+ return null;
+ }
+ i_val+=mm.length;
+ }
+ else if (token=="ss"||token=="s") {
+ ss=this.getInt(val,i_val,token.length,2);
+ if(ss==null||(ss<0)||(ss>59)){
+ return null;
+ }
+ i_val+=ss.length;
+ }
+ else if (token=="a") {
+ if (val.substring(i_val,i_val+2).toLowerCase()=="am") {
+ ampm="AM";
+ }
+ else if (val.substring(i_val,i_val+2).toLowerCase()=="pm") {
+ ampm="PM";
+ }
+ else {
+ return null;
+ }
+ i_val+=2;
+ }
+ else {
+ if (val.substring(i_val,i_val+token.length)!=token) {
+ return null;
+ }
+ else {
+ i_val+=token.length;
+ }
+ }
+ }
+ // If there are any trailing characters left in the value, it doesn't match
+ if (i_val != val.length) {
+ return null;
+ }
+ // Is date valid for month?
+ if (month==2) {
+ // Check for leap year
+ if ( ( (year%4==0)&&(year%100 != 0) ) || (year%400==0) ) { // leap year
+ if (date > 29){
+ return null;
+ }
+ }
+ else {
+ if (date > 28) {
+ return null;
+ }
+ }
+ }
+ if ((month==4)||(month==6)||(month==9)||(month==11)) {
+ if (date > 30) {
+ return null;
+ }
+ }
+ // Correct hours value
+ if (hh<12 && ampm=="PM") {
+ hh=hh-0+12;
+ }
+ else if (hh>11 && ampm=="AM") {
+ hh-=12;
+ }
+ return new Date(year,month-1,date,hh,mm,ss);
+};
+
+// Check if a date string is valid
+Date.isValid = function(val,format) {
+ return (Date.parseString(val,format) != null);
+};
+
+// Check if a date object is before another date object
+Date.prototype.isBefore = function(date2) {
+ if (date2==null) {
+ return false;
+ }
+ return (this.getTime()<date2.getTime());
+};
+
+// Check if a date object is after another date object
+Date.prototype.isAfter = function(date2) {
+ if (date2==null) {
+ return false;
+ }
+ return (this.getTime()>date2.getTime());
+};
+
+// Check if two date objects have equal dates and times
+Date.prototype.equals = function(date2) {
+ if (date2==null) {
+ return false;
+ }
+ return (this.getTime()==date2.getTime());
+};
+
+// Check if two date objects have equal dates, disregarding times
+Date.prototype.equalsIgnoreTime = function(date2) {
+ if (date2==null) {
+ return false;
+ }
+ var d1 = new Date(this.getTime()).clearTime();
+ var d2 = new Date(date2.getTime()).clearTime();
+ return (d1.getTime()==d2.getTime());
+};
+
+// Format a date into a string using a given format string
+Date.prototype.format = function(format) {
+ format=format+"";
+ var result="";
+ var i_format=0;
+ var c="";
+ var token="";
+ var y=this.getYear()+"";
+ var M=this.getMonth()+1;
+ var d=this.getDate();
+ var E=this.getDay();
+ var H=this.getHours();
+ var m=this.getMinutes();
+ var s=this.getSeconds();
+ var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;
+ // Convert real date parts into formatted versions
+ var value=new Object();
+ if (y.length < 4) {
+ y=""+(+y+1900);
+ }
+ value["y"]=""+y;
+ value["yyyy"]=y;
+ value["yy"]=y.substring(2,4);
+ value["M"]=M;
+ value["MM"]=Date.LZ(M);
+ value["MMM"]=Date.monthNames[M-1];
+ value["NNN"]=Date.monthAbbreviations[M-1];
+ value["d"]=d;
+ value["dd"]=Date.LZ(d);
+ value["E"]=Date.dayAbbreviations[E];
+ value["EE"]=Date.dayNames[E];
+ value["H"]=H;
+ value["HH"]=Date.LZ(H);
+ if (H==0){
+ value["h"]=12;
+ }
+ else if (H>12){
+ value["h"]=H-12;
+ }
+ else {
+ value["h"]=H;
+ }
+ value["hh"]=Date.LZ(value["h"]);
+ value["K"]=value["h"]-1;
+ value["k"]=value["H"]+1;
+ value["KK"]=Date.LZ(value["K"]);
+ value["kk"]=Date.LZ(value["k"]);
+ if (H > 11) {
+ value["a"]="PM";
+ }
+ else {
+ value["a"]="AM";
+ }
+ value["m"]=m;
+ value["mm"]=Date.LZ(m);
+ value["s"]=s;
+ value["ss"]=Date.LZ(s);
+ while (i_format < format.length) {
+ c=format.charAt(i_format);
+ token="";
+ while ((format.charAt(i_format)==c) && (i_format < format.length)) {
+ token += format.charAt(i_format++);
+ }
+ if (typeof(value[token])!="undefined") {
+ result=result + value[token];
+ }
+ else {
+ result=result + token;
+ }
+ }
+ return result;
+};
+
+// Get the full name of the day for a date
+Date.prototype.getDayName = function() {
+ return Date.dayNames[this.getDay()];
+};
+
+// Get the abbreviation of the day for a date
+Date.prototype.getDayAbbreviation = function() {
+ return Date.dayAbbreviations[this.getDay()];
+};
+
+// Get the full name of the month for a date
+Date.prototype.getMonthName = function() {
+ return Date.monthNames[this.getMonth()];
+};
+
+// Get the abbreviation of the month for a date
+Date.prototype.getMonthAbbreviation = function() {
+ return Date.monthAbbreviations[this.getMonth()];
+};
+
+// Clear all time information in a date object
+Date.prototype.clearTime = function() {
+ this.setHours(0);
+ this.setMinutes(0);
+ this.setSeconds(0);
+ this.setMilliseconds(0);
+ return this;
+};
+
+// Add an amount of time to a date. Negative numbers can be passed to subtract time.
+Date.prototype.add = function(interval, number) {
+ if (typeof(interval)=="undefined" || interval==null || typeof(number)=="undefined" || number==null) {
+ return this;
+ }
+ number = +number;
+ if (interval=='y') { // year
+ this.setFullYear(this.getFullYear()+number);
+ }
+ else if (interval=='M') { // Month
+ this.setMonth(this.getMonth()+number);
+ }
+ else if (interval=='d') { // Day
+ this.setDate(this.getDate()+number);
+ }
+ else if (interval=='w') { // Weekday
+ var step = (number>0)?1:-1;
+ while (number!=0) {
+ this.add('d',step);
+ while(this.getDay()==0 || this.getDay()==6) {
+ this.add('d',step);
+ }
+ number -= step;
+ }
+ }
+ else if (interval=='h') { // Hour
+ this.setHours(this.getHours() + number);
+ }
+ else if (interval=='m') { // Minute
+ this.setMinutes(this.getMinutes() + number);
+ }
+ else if (interval=='s') { // Second
+ this.setSeconds(this.getSeconds() + number);
+ }
+ return this;
+};
+
+
+
+// Added by Brian Holland ============================================
+
+// Calculate Julian Date
+function calculateJD(calendarDate) {
+ cdDate = new Date(calendarDate)
+ year = cdDate.getYear() //added + 1900 10/03/2003
+ if (year < 1000 ) {year+=1900} // modified 10/03/2003
+ //year = 1900+cdDate.getYear()
+ month = cdDate.getMonth() + 1 //getMonth() returns 0-11
+ day = cdDate.getDate()
+ hour = cdDate.getHours()
+ min = cdDate.getMinutes()
+ sec = cdDate.getSeconds()
+ univTime = hour+(min/60)+(sec/3600)
+ if ((100*year+month-190002.5) >= 0) {sign = 1}
+ else {sign = -1}
+ with (Math) {
+ part1 = 367 * year
+ part2 = floor((7*(year+floor((month+9)/12)))/4)
+ part3 = day+floor((275*month)/9)
+ part4 = 1721013.5+(univTime/24)
+ part5 = 0.5*sign
+ jd = part1-part2+part3+part4-part5+0.5
+ }
+ return jd
+}
+
diff --git a/modules/GEDFact_assistant/_CENS/js/dynamicoptionlist.js b/modules/GEDFact_assistant/_CENS/js/dynamicoptionlist.js
new file mode 100644
index 0000000000..418583b588
--- /dev/null
+++ b/modules/GEDFact_assistant/_CENS/js/dynamicoptionlist.js
@@ -0,0 +1,473 @@
+/**
+ * Copyright (c)2005-2009 Matt Kruse (javascripttoolbox.com)
+ *
+ * Dual licensed under the MIT and GPL licenses.
+ * This basically means you can use this code however you want for
+ * free, but don't claim to have written it yourself!
+ * Donations always accepted: http://www.JavascriptToolbox.com/donate/
+ *
+ * Please do not link to the .js files on javascripttoolbox.com from
+ * your site. Copy the files locally to your server instead.
+ *
+ */
+// Global objects to keep track of DynamicOptionList objects created on the page
+var dynamicOptionListCount=0;
+var dynamicOptionListObjects = new Array();
+
+// Init call to setup lists after page load. One call to this function sets up all lists.
+function initDynamicOptionLists() {
+ // init each DynamicOptionList object
+ for (var i=0; i<dynamicOptionListObjects.length; i++) {
+ var dol = dynamicOptionListObjects[i];
+
+ // Find the form associated with this list
+ if (dol.formName!=null) {
+ dol.form = document.forms[dol.formName];
+ }
+ else if (dol.formIndex!=null) {
+ dol.form = document.forms[dol.formIndex];
+ }
+ else {
+ // Form wasn't set manually, so go find it!
+ // Search for the first form element name in the lists
+ var name = dol.fieldNames[0][0];
+ for (var f=0; f<document.forms.length; f++) {
+ if (typeof(document.forms[f][name])!="undefined") {
+ dol.form = document.forms[f];
+ break;
+ }
+ }
+ if (dol.form==null) {
+ alert("ERROR: Couldn't find form element "+name+" in any form on the page! Init aborted"); return;
+ }
+ }
+
+ // Form is found, now set the onchange attributes of each dependent select box
+ for (var j=0; j<dol.fieldNames.length; j++) {
+ // For each set of field names...
+ for (var k=0; k<dol.fieldNames[j].length-1; k++) {
+ // For each field in the set...
+ var selObj = dol.form[dol.fieldNames[j][k]];
+ if (typeof(selObj)=="undefined") { alert("Select box named "+dol.fieldNames[j][k]+" could not be found in the form. Init aborted"); return; }
+ // Map the HTML options in the first select into the options we created
+ if (k==0) {
+ if (selObj.options!=null) {
+ for (l=0; l<selObj.options.length; l++) {
+ var sopt = selObj.options[l];
+ var m = dol.findMatchingOptionInArray(dol.options,sopt.text,sopt.value,false);
+ if (m!=null) {
+ var reselectForNN6 = sopt.selected;
+ var m2 = new Option(sopt.text, sopt.value, sopt.defaultSelected, sopt.selected);
+ m2.selected = sopt.selected; // For some reason I need to do this to make NN4 happy
+ m2.defaultSelected = sopt.defaultSelected;
+ m2.DOLOption = m;
+ selObj.options[l] = m2;
+ selObj.options[l].selected = reselectForNN6; // Reselect this option for NN6 to be happy. Yuck.
+ }
+ }
+ }
+ }
+ if (selObj.onchange==null) {
+ // We only modify the onChange attribute if it's empty! Otherwise do it yourself in your source!
+ selObj.onchange = new Function("dynamicOptionListObjects["+dol.index+"].change(this)");
+ }
+ }
+ }
+ }
+ // Set the preselectd options on page load
+ resetDynamicOptionLists();
+}
+
+// This function populates lists with the preselected values.
+// It's pulled out into a separate function so it can be hooked into a 'reset' button on a form
+// Optionally passed a form object which should be the only form reset
+function resetDynamicOptionLists(theform) {
+ // reset each DynamicOptionList object
+ for (var i=0; i<dynamicOptionListObjects.length; i++) {
+ var dol = dynamicOptionListObjects[i];
+ if (typeof(theform)=="undefined" || theform==null || theform==dol.form) {
+ for (var j=0; j<dol.fieldNames.length; j++) {
+ dol.change(dol.form[dol.fieldNames[j][0]],true); // Second argument says to use preselected values rather than default values
+ }
+ }
+ }
+}
+
+// An object to represent an Option() but just for data-holding
+function DOLOption(text,value,defaultSelected,selected) {
+ this.text = text;
+ this.value = value;
+ this.defaultSelected = defaultSelected;
+ this.selected = selected;
+ this.options = new Array(); // To hold sub-options
+ return this;
+}
+
+// DynamicOptionList CONSTRUCTOR
+function DynamicOptionList() {
+ this.form = null;// The form this list belongs to
+ this.options = new Array();// Holds the options of dependent lists
+ this.longestString = new Array();// Longest string that is currently a potential option (for Netscape)
+ this.numberOfOptions = new Array();// The total number of options that might be displayed, to build dummy options (for Netscape)
+ this.currentNode = null;// The current node that has been selected with forValue() or forText()
+ this.currentField = null;// The current field that is selected to be used for setValue()
+ this.currentNodeDepth = 0;// How far down the tree the currentNode is
+ this.fieldNames = new Array();// Lists of dependent fields which use this object
+ this.formIndex = null;// The index of the form to associate with this list
+ this.formName = null;// The name of the form to associate with this list
+ this.fieldListIndexes = new Object();// Hold the field lists index where fields exist
+ this.fieldIndexes = new Object();// Hold the index within the list where fields exist
+ this.selectFirstOption = true;// Whether or not to select the first option by default if no options are default or preselected, otherwise set the selectedIndex = -1
+ this.numberOfOptions = new Array();// Store the max number of options for a given option list
+ this.longestString = new Array();// Store the longest possible string
+ this.values = new Object(); // Will hold the preselected values for fields, by field name
+
+ // Method mappings
+ this.forValue = DOL_forValue;
+ this.forText = DOL_forText;
+ this.forField = DOL_forField;
+ this.forX = DOL_forX;
+ this.addOptions = DOL_addOptions;
+ this.addOptionsTextValue = DOL_addOptionsTextValue;
+ this.setDefaultOptions = DOL_setDefaultOptions;
+ this.setValues = DOL_setValues;
+ this.setValue = DOL_setValues;
+ this.setFormIndex = DOL_setFormIndex;
+ this.setFormName = DOL_setFormName;
+ this.printOptions = DOL_printOptions;
+ this.addDependentFields = DOL_addDependentFields;
+ this.change = DOL_change;
+ this.child = DOL_child;
+ this.selectChildOptions = DOL_selectChildOptions;
+ this.populateChild = DOL_populateChild;
+ this.change = DOL_change;
+ this.addNewOptionToList = DOL_addNewOptionToList;
+ this.findMatchingOptionInArray = DOL_findMatchingOptionInArray;
+
+ // Optionally pass in the dependent field names
+ if (arguments.length > 0) {
+ // Process arguments and add dependency groups
+ for (var i=0; i<arguments.length; i++) {
+ this.fieldListIndexes[arguments[i].toString()] = this.fieldNames.length;
+ this.fieldIndexes[arguments[i].toString()] = i;
+ }
+ this.fieldNames[this.fieldNames.length] = arguments;
+ }
+
+ // Add this object to the global array of dynamicoptionlist objects
+ this.index = window.dynamicOptionListCount++;
+ window["dynamicOptionListObjects"][this.index] = this;
+}
+
+// Given an array of Option objects, search for an existing option that matches value, text, or both
+function DOL_findMatchingOptionInArray(a,text,value,exactMatchRequired) {
+ if (a==null || typeof(a)=="undefined") { return null; }
+ var value_match = null; // Whether or not a value has been matched
+ var text_match = null; // Whether or not a text has been matched
+ for (var i=0; i<a.length; i++) {
+ var opt = a[i];
+ // If both value and text match, return it right away
+ if (opt.value==value && opt.text==text) { return opt; }
+ if (!exactMatchRequired) {
+ // If value matches, store it until we complete scanning the list
+ if (value_match==null && value!=null && opt.value==value) {
+ value_match = opt;
+ }
+ // If text matches, store it for later
+ if (text_match==null && text!=null && opt.text==text) {
+ text_match = opt;
+ }
+ }
+ }
+ return (value_match!=null)?value_match:text_match;
+}
+
+// Util function used by forValue and forText
+function DOL_forX(s,type) {
+ if (this.currentNode==null) { this.currentNodeDepth=0; }
+ var useNode = (this.currentNode==null)?this:this.currentNode;
+ var o = this.findMatchingOptionInArray(useNode["options"],(type=="text")?s:null,(type=="value")?s:null,false);
+ if (o==null) {
+ o = new DOLOption(null,null,false,false);
+ o[type] = s;
+ useNode.options[useNode.options.length] = o;
+ }
+ this.currentNode = o;
+ this.currentNodeDepth++;
+ return this;
+}
+
+// Set the portion of the list structure that is to be used by a later operation like addOptions
+function DOL_forValue(s) { return this.forX(s,"value"); }
+
+// Set the portion of the list structure that is to be used by a later operation like addOptions
+function DOL_forText(s) { return this.forX(s,"text"); }
+
+// Set the field to be used for setValue() calls
+function DOL_forField(f) { this.currentField = f; return this; }
+
+// Create and add an option to a list, avoiding duplicates
+function DOL_addNewOptionToList(a, text, value, defaultSelected) {
+ var o = new DOLOption(text,value,defaultSelected,false);
+ // Add the option to the array
+ if (a==null) { a = new Array(); }
+ for (var i=0; i<a.length; i++) {
+ if (a[i].text==o.text && a[i].value==o.value) {
+ if (o.selected) {
+ a[i].selected=true;
+ }
+ if (o.defaultSelected) {
+ a[i].defaultSelected = true;
+ }
+ return a;
+ }
+ }
+ a[a.length] = o;
+}
+
+// Add sub-options to the currently-selected node, with the same text and value for each option
+function DOL_addOptions() {
+ if (this.currentNode==null) { this.currentNode = this; }
+ if (this.currentNode["options"] == null) { this.currentNode["options"] = new Array(); }
+ for (var i=0; i<arguments.length; i++) {
+ var text = arguments[i];
+ this.addNewOptionToList(this.currentNode.options,text,text,false);
+ if (typeof(this.numberOfOptions[this.currentNodeDepth])=="undefined") {
+ this.numberOfOptions[this.currentNodeDepth]=0;
+ }
+ if (this.currentNode.options.length > this.numberOfOptions[this.currentNodeDepth]) {
+ this.numberOfOptions[this.currentNodeDepth] = this.currentNode.options.length;
+ }
+ if (typeof(this.longestString[this.currentNodeDepth])=="undefined" || (text.length > this.longestString[this.currentNodeDepth].length)) {
+ this.longestString[this.currentNodeDepth] = text;
+ }
+ }
+ this.currentNode = null;
+ this.currentNodeDepth = 0;
+}
+
+// Add sub-options to the currently-selected node, specifying separate text and values for each option
+function DOL_addOptionsTextValue() {
+ if (this.currentNode==null) { this.currentNode = this; }
+ if (this.currentNode["options"] == null) { this.currentNode["options"] = new Array(); }
+ for (var i=0; i<arguments.length; i++) {
+ var text = arguments[i++];
+ var value = arguments[i];
+ this.addNewOptionToList(this.currentNode.options,text,value,false);
+ if (typeof(this.numberOfOptions[this.currentNodeDepth])=="undefined") {
+ this.numberOfOptions[this.currentNodeDepth]=0;
+ }
+ if (this.currentNode.options.length > this.numberOfOptions[this.currentNodeDepth]) {
+ this.numberOfOptions[this.currentNodeDepth] = this.currentNode.options.length;
+ }
+ if (typeof(this.longestString[this.currentNodeDepth])=="undefined" || (text.length > this.longestString[this.currentNodeDepth].length)) {
+ this.longestString[this.currentNodeDepth] = text;
+ }
+ }
+ this.currentNode = null;
+ this.currentNodeDepth = 0;
+}
+
+// Find the first dependent list of a select box
+// If it's the last list in a chain, return null because there are no children
+function DOL_child(obj) {
+ var listIndex = this.fieldListIndexes[obj.name];
+ var index = this.fieldIndexes[obj.name];
+ if (index < (this.fieldNames[listIndex].length-1)) {
+ return this.form[this.fieldNames[listIndex][index+1]];
+ }
+ return null;
+}
+
+// Set the options which should be selected by default for a certain value in the parent
+function DOL_setDefaultOptions() {
+ if (this.currentNode==null) { this.currentNode = this; }
+ for (var i=0; i<arguments.length; i++) {
+ var o = this.findMatchingOptionInArray(this.currentNode.options,null,arguments[i],false);
+ if (o!=null) {
+ o.defaultSelected = true;
+ }
+ }
+ this.currentNode = null;
+}
+
+// Set the options which should be selected when the page loads. This is different than the default value and ONLY applies when the page LOADS
+function DOL_setValues() {
+ if (this.currentField==null) {
+ alert("Can't call setValues() without using forField() first!");
+ return;
+ }
+ if (typeof(this.values[this.currentField])=="undefined") {
+ this.values[this.currentField] = new Object();
+ }
+ for (var i=0; i<arguments.length; i++) {
+ this.values[this.currentField][arguments[i]] = true;
+ }
+ this.currentField = null;
+}
+
+// Manually set the form for the object using an index
+function DOL_setFormIndex(i) {
+ this.formIndex = i;
+}
+
+// Manually set the form for the object using a form name
+function DOL_setFormName(n) {
+ this.formName = n;
+}
+
+// Print blank <option> objects for Netscape4, since it refuses to grow or shrink select boxes for new options
+function DOL_printOptions(name) {
+ // Only need to write out "dummy" options for Netscape4
+ if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) <= 4)){
+ var index = this.fieldIndexes[name];
+ var ret = "";
+ if (typeof(this.numberOfOptions[index])!="undefined") {
+ for (var i=0; i<this.numberOfOptions[index]; i++) {
+ ret += "<OPTION>";
+ }
+ }
+ ret += "<OPTION>";
+ if (typeof(this.longestString[index])!="undefined") {
+ for (var i=0; i<this.longestString[index].length; i++) {
+ ret += "_";
+ }
+ }
+ document.writeln(ret);
+ }
+}
+
+// Add a list of field names which use this option-mapping object.
+// A single mapping object may be used by multiple sets of fields
+function DOL_addDependentFields() {
+ for (var i=0; i<arguments.length; i++) {
+ this.fieldListIndexes[arguments[i].toString()] = this.fieldNames.length;
+ this.fieldIndexes[arguments[i].toString()] = i;
+ }
+ this.fieldNames[this.fieldNames.length] = arguments;
+}
+
+// Called when a parent select box is changed. It populates its direct child, then calls change on the child object to continue the population.
+function DOL_change(obj, usePreselected) {
+ if (usePreselected==null || typeof(usePreselected)=="undefined") { usePreselected = false; }
+ var changedListIndex = this.fieldListIndexes[obj.name];
+ var changedIndex = this.fieldIndexes[obj.name];
+ var child = this.child(obj);
+ if (child == null) { return; } // No child, no need to continue
+ if (obj.type == "select-one") {
+ // Treat single-select differently so we don't have to scan the entire select list, which could potentially speed things up
+ if (child.options!=null) {
+ child.options.length=0; // Erase all the options from the child so we can re-populate
+ }
+ if (obj.options!=null && obj.options.length>0 && obj.selectedIndex>=0) {
+ var o = obj.options[obj.selectedIndex];
+ this.populateChild(o.DOLOption,child,usePreselected);
+ this.selectChildOptions(child,usePreselected);
+ }
+ }
+ else if (obj.type == "select-multiple") {
+ // For each selected value in the parent, find the options to fill in for this list
+ // Loop through the child list and keep track of options that are currently selected
+ var currentlySelectedOptions = new Array();
+ if (!usePreselected) {
+ for (var i=0; i<child.options.length; i++) {
+ var co = child.options[i];
+ if (co.selected) {
+ this.addNewOptionToList(currentlySelectedOptions, co.text, co.value, co.defaultSelected);
+ }
+ }
+ }
+ child.options.length=0;
+ if (obj.options!=null) {
+ var obj_o = obj.options;
+ // For each selected option in the parent...
+ for (var i=0; i<obj_o.length; i++) {
+ if (obj_o[i].selected) {
+ // if option is selected, add its children to the list
+ this.populateChild(obj_o[i].DOLOption,child,usePreselected);
+ }
+ }
+ // Now go through and re-select any options which were selected before
+ var atLeastOneSelected = false;
+ if (!usePreselected) {
+ for (var i=0; i<child.options.length; i++) {
+ var m = this.findMatchingOptionInArray(currentlySelectedOptions,child.options[i].text,child.options[i].value,true);
+ if (m!=null) {
+ child.options[i].selected = true;
+ atLeastOneSelected = true;
+ }
+ }
+ }
+ if (!atLeastOneSelected) {
+ this.selectChildOptions(child,usePreselected);
+ }
+ }
+ }
+ // Change all the way down the chain
+ this.change(child,usePreselected);
+}
+function DOL_populateChild(dolOption,childSelectObj,usePreselected) {
+ // If this opton has sub-options, populate the child list with them
+ if (dolOption!=null && dolOption.options!=null) {
+ for (var j=0; j<dolOption.options.length; j++) {
+ var srcOpt = dolOption.options[j];
+ if (childSelectObj.options==null) { childSelectObj.options = new Array(); }
+ // Put option into select list
+ var duplicate = false;
+ var preSelectedExists = false;
+ for (var k=0; k<childSelectObj.options.length; k++) {
+ var csi = childSelectObj.options[k];
+ if (csi.text==srcOpt.text && csi.value==srcOpt.value) {
+ duplicate = true;
+ break;
+ }
+ }
+ if (!duplicate) {
+ var newopt = new Option(srcOpt.text, srcOpt.value, false, false);
+ newopt.selected = false; // Again, we have to do these two statements for NN4 to work
+ newopt.defaultSelected = false;
+ newopt.DOLOption = srcOpt;
+ childSelectObj.options[childSelectObj.options.length] = newopt;
+ }
+ }
+ }
+}
+
+// Once a child select is populated, go back over it to select options which should be selected
+function DOL_selectChildOptions(obj,usePreselected) {
+ // Look to see if any options are preselected=true. If so, then set then selected if usePreselected=true, otherwise set defaults
+ var values = this.values[obj.name];
+ var preselectedExists = false;
+ if (usePreselected && values!=null && typeof(values)!="undefined") {
+ for (var i=0; i<obj.options.length; i++) {
+ var v = obj.options[i].value;
+ if (v!=null && values[v]!=null && typeof(values[v])!="undefined") {
+ preselectedExists = true;
+ break;
+ }
+ }
+ }
+ // Go back over all the options to do the selection
+ var atLeastOneSelected = false;
+ for (var i=0; i<obj.options.length; i++) {
+ var o = obj.options[i];
+ if (preselectedExists && o.value!=null && values[o.value]!=null && typeof(values[o.value])!="undefined") {
+ o.selected = true;
+ atLeastOneSelected = true;
+ }
+ else if (!preselectedExists && o.DOLOption!=null && o.DOLOption.defaultSelected) {
+ o.selected = true;
+ atLeastOneSelected = true;
+ }
+ else {
+ o.selected = false;
+ }
+ }
+ // If nothing else was selected, select the first one by default
+ if (this.selectFirstOption && !atLeastOneSelected && obj.options.length>0) {
+ obj.options[0].selected = true;
+ }
+ else if (!atLeastOneSelected && obj.type=="select-one") {
+ obj.selectedIndex = -1;
+ }
+}
diff --git a/modules/GEDFact_assistant/_MEDIA/media_0_inverselink.php b/modules/GEDFact_assistant/_MEDIA/media_0_inverselink.php
new file mode 100644
index 0000000000..6028bb0ecb
--- /dev/null
+++ b/modules/GEDFact_assistant/_MEDIA/media_0_inverselink.php
@@ -0,0 +1,284 @@
+<?php
+/**
+ * Media Link Assistant Control module for phpGedView
+ *
+ * Media Link information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage GEDFact_assistant
+ * @version $Id$
+*/
+
+// GEDFact Media assistant replacement code for inverselink.php: ===========================
+
+//-- extra page parameters and checking
+$more_links = safe_REQUEST($_REQUEST, 'more_links', WT_REGEX_UNSAFE);
+$exist_links = safe_REQUEST($_REQUEST, 'exist_links', WT_REGEX_UNSAFE);
+$gid = safe_GET_xref('gid');
+$update_CHAN = safe_REQUEST($_REQUEST, 'preserve_last_changed', WT_REGEX_UNSAFE);
+
+
+if (empty($linktoid) || empty($linkto)) {
+ $paramok = false;
+ $toitems = "";
+} else {
+ switch ($linkto) {
+ case 'person':
+ $toitems = i18n::translate('To Person');
+ break;
+ case 'family':
+ $toitems = i18n::translate('To Family');
+ break;
+ case 'source':
+ $toitems = i18n::translate('To Source');
+ break;
+ }
+}
+if (WT_USER_IS_ADMIN) {
+ print_simple_header(i18n::translate('Link Media')." ".$toitems);
+}else{
+ print_simple_header(i18n::translate('Admin'));
+ echo i18n::translate('Unable to authenticate user.');
+}
+
+if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm';
+
+
+//-- check for admin
+//$paramok = WT_USER_CAN_EDIT;
+$paramok = WT_USER_GEDCOM_ADMIN;
+if (!empty($linktoid)) $paramok = displayDetailsById($linktoid);
+
+if ($action == "choose" && $paramok) {
+
+ ?>
+ <script language="JavaScript" type="text/javascript">
+ <!--
+ // Javascript variables
+ var id_empty = "<?php echo i18n::translate('When adding a Link, the ID field cannot be empty.'); ?>";
+
+ var pastefield;
+ var language_filter, magnify;
+ language_filter = "";
+ magnify = "";
+
+ function openerpasteid(id) {
+ window.opener.paste_id(id);
+ window.close();
+ }
+
+ function paste_id(value) {
+ pastefield.value = value;
+ }
+
+ function paste_char(value, lang, mag) {
+ pastefield.value += value;
+ language_filter = lang;
+ magnify = mag;
+ }
+
+ function blankwin() {
+ if (document.getElementById('gid').value == "" || document.getElementById('gid').value.length<=1) {
+ alert(id_empty);
+ }else{
+ var iid = document.getElementById('gid').value;
+ var winblank = window.open('module.php?mod=GEDFact_assistant&pgvaction=_MEDIA/media_query_3a&iid='+iid, 'winblank', 'top=100, left=200, width=400, height=20, toolbar=0, directories=0, location=0, status=0, menubar=0, resizable=1, scrollbars=1');
+ }
+ }
+
+ var GEDFact_assist = "installed";
+//-->
+ </script>
+ <script src="webtrees.js" language="JavaScript" type="text/javascript"></script>
+ <link href ="modules/GEDFact_assistant/css/media_0_inverselink.css" rel="stylesheet" type="text/css" media="screen" />
+
+ <?php
+ echo '<form name="link" method="get" action="inverselink.php">';
+ // echo '<input type="hidden" name="action" value="choose" />';
+ echo '<input type="hidden" name="action" value="update" />';
+ if (!empty($mediaid)) {
+ echo '<input type="hidden" name="mediaid" value="', $mediaid, '" />';
+ }
+ if (!empty($linktoid)) {
+ echo '<input type="hidden" name="linktoid" value="', $linktoid, '" />';
+ }
+ echo '<input type="hidden" name="linkto" value="', $linkto, '" />';
+ echo '<input type="hidden" name="ged" value="', $GEDCOM, '" />';
+ echo '<table class="facts_table center ', $TEXT_DIRECTION, '">';
+ echo '<tr><td class="topbottombar" colspan="2">';
+ echo i18n::translate('Link Media'), ' ', $toitems, help_link('add_media_linkid');
+ echo '</td></tr><tr><td class="descriptionbox width20 wrap">', i18n::translate('Media ID'), '</td>';
+ echo '<td class="optionbox wrap">';
+ if (!empty($mediaid)) {
+ //-- Get the title of this existing Media item
+ $title=
+ WT_DB::prepare("SELECT m_titl FROM {$TBLPREFIX}media where m_media=? AND m_gedfile=?")
+ ->execute(array($mediaid, WT_GED_ID))
+ ->fetchOne();
+ if ($title) {
+ echo '<b>', PrintReady($title), '</b>&nbsp;&nbsp;&nbsp;';
+ if ($TEXT_DIRECTION=="rtl") echo getRLM();
+ echo '(', $mediaid, ')';
+ if ($TEXT_DIRECTION=="rtl") echo getRLM();
+ } else {
+ echo '<b>', $mediaid, '</b>';
+ }
+ echo '<table><tr><td>';
+ //-- Get the filename of this existing Media item
+ $filename=
+ WT_DB::prepare("SELECT m_file FROM {$TBLPREFIX}media where m_media=? AND m_gedfile=?")
+ ->execute(array($mediaid, WT_GED_ID))
+ ->fetchOne();
+ $filename = str_replace(" ", "%20", $filename);
+ $thumbnail = thumbnail_file($filename, false, false);
+ echo '<img src = ', $thumbnail, ' class="thumbheight" />';
+ echo '</td></tr></table>';
+ echo '</td></tr>';
+ echo '<tr><td class="descriptionbox width20 wrap">', i18n::translate('Links'), '</td>';
+ echo '<td class="optionbox wrap">';
+ require 'modules/GEDFact_assistant/_MEDIA/media_query_1a.php';
+ echo '</td></tr>';
+ }
+
+ if (!isset($linktoid)) { $linktoid = ""; }
+
+ echo '<tr><td class="descriptionbox wrap">';
+ echo i18n::translate('Add links');
+ echo '<td class="optionbox wrap ">';
+ if ($linktoid=="") {
+ // ----
+ } else {
+ $record=Person::getInstance($linktoid);
+ echo '<b>', PrintReady($record->getFullName()), '</b>&nbsp;&nbsp;&nbsp;';
+ if ($TEXT_DIRECTION=="rtl") print getRLM();
+ echo '(', $linktoid, ')';
+ if ($TEXT_DIRECTION=="rtl") print getRLM();
+ }
+ echo '<table><tr><td>';
+ print "<input type=\"text\" name=\"gid\" id=\"gid\" size=\"6\" value=\"\" />";
+ // echo ' Enter Name or ID &nbsp; &nbsp; &nbsp; <b>OR</b> &nbsp; &nbsp; &nbsp;Search for ID ';
+ echo '</td><td style=" padding-bottom:2px; vertical-align:middle">';
+ echo '&nbsp;';
+ if (isset($WT_IMAGES["add"]["other"])) {
+ echo '<a href="#"><img style="border-style:none;" src="', $WT_IMAGE_DIR, '/', $WT_IMAGES["add"]["other"], '" alt="', i18n::translate('Add'), ' "title="', i18n::translate('Add'), '" align="middle" name="addLink" value="" onClick="javascript:blankwin(); return false;" />';
+ } else {
+ echo '<button name="addLink" value="" type="button" onClick="javascript:blankwin(); return false;">', i18n::translate('Add'), '</button>';
+ }
+ echo '&nbsp;&nbsp;&nbsp;&nbsp;';
+ print_findindi_link("gid", "");
+ echo '&nbsp;';
+ print_findfamily_link("gid");
+ echo '&nbsp;';
+ print_findsource_link("gid");
+ echo '</td></tr></table>';
+ print "<sub>" . i18n::translate('Enter or search for the ID of the person, family, or source to which this media item should be linked.') . "</sub>";
+
+
+ echo '<br /><br />';
+ echo '<input type="hidden" name="idName" id="idName" size="36" value="Name of ID" />';
+ require 'modules/GEDFact_assistant/_MEDIA/media_query_2a.php';
+ echo '</td></tr>';
+ // Admin Option CHAN log update override =======================
+ if (WT_USER_IS_ADMIN) {
+ echo "<tr><td class=\"descriptionbox ", $TEXT_DIRECTION, " wrap width25\">";
+ echo i18n::translate('Admin Option'), "</td><td class=\"optionbox wrap\">\n";
+ echo "<input type=\"checkbox\" name=\"preserve_last_changed\" value=\"no_change\"/ >\n";
+ echo i18n::translate('Do not update the CHAN (Last Change) records'), help_link('no_update_CHAN'), '<br /><br />';
+ echo "</td></tr>\n";
+ }
+ echo '</tr>';
+ echo '<input type="hidden" name="more_links" value="No_Values" />';
+ echo '<input type="hidden" name="exist_links" value="No_Values" />';
+ echo '<tr><td colspan="2">';
+ echo '</td></tr>';
+ echo '<tr><td class="topbottombar" colspan="2">';
+ echo '<center><input type="submit" value="', i18n::translate('Save'), '" onclick="javascript:shiftlinks();" />';
+ echo '</center></td></tr>';
+ require 'modules/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php';
+ echo '</table>';
+ echo '</form>';
+ echo '<br/><br/><center><a href="javascript:;" onclick="if (window.opener.showchanges) window.opener.showchanges(); window.close(); winNav.close(); ">', i18n::translate('Close Window'), '</a><br /></center>';
+ // print_simple_footer();
+
+} elseif ($action == "update" && $paramok) {
+
+ echo "<b>", $mediaid, "</b><br/><br />";
+
+ // Unlink records indicated by radio button =========
+ if (isset($exist_links) && $exist_links!="No_Values") {
+ $exist_links = substr($exist_links, 0, -1);
+ $rem_exist_links = (explode(", ", $exist_links));
+ foreach ($rem_exist_links as $remLinkId) {
+ global $linkToId;
+ $linkToId = PrintReady($remLinkId);
+ echo i18n::translate('Link to %s deleted', $remLinkId);
+ echo '<br />';
+ if ($update_CHAN=='no_change') {
+ unlinkMedia($remLinkId, 'OBJE', $mediaid, 1, false);
+ } else {
+ unlinkMedia($remLinkId, 'OBJE', $mediaid, 1, true);
+ }
+ }
+ echo '<br />';
+ }else{
+ // echo nothing and do nothing
+ }
+
+ // Add new Links ====================================
+ if (isset($more_links) && $more_links!="No_Values" && $more_links!=",") {
+ $more_links = substr($more_links, 0, -1);
+ $add_more_links = (explode(", ", $more_links));
+ foreach ($add_more_links as $addLinkId) {
+ global $unlinkFromId;
+ $$unlinkFromId = PrintReady($addLinkId);
+ echo i18n::translate('Link to %s added', $addLinkId);
+ if ($update_CHAN=='no_change') {
+ linkMedia($mediaid, $addLinkId, 1, false);
+ } else {
+ linkMedia($mediaid, $addLinkId, 1, true);
+ }
+ echo '<br />';
+ }
+ echo '<br />';
+ }else if ($more_links==",") {
+ // echo nothing and do nothing
+ }else{
+ // echo $mediaid, $pgv_lang["media_now_linked to"], '(', $gid, ')<br />';
+ // linkMedia($mediaid, $gid);
+ }
+
+ if ($update_CHAN=='no_change') {
+ echo i18n::translate('No CHAN (Last Change) records were updated');
+ echo '<br />';
+ }
+
+ echo '<br/><br/><center><a href="javascript:;" onclick="if (window.opener.showchanges) window.opener.showchanges(); window.close(); winNav.close(); ">', i18n::translate('Close Window'), '</a><br /></center>';
+ print_simple_footer();
+
+} else {
+ // echo '<center>You must be logged in as an Administrator<center>';
+ echo '<br/><br/><center><a href="javascript:;" onclick="if (window.opener.showchanges) window.opener.showchanges(); window.close(); winNav.close();">', i18n::translate('Close Window'), '</a><br /></center>';
+ //print_simple_footer();
+}
+
+?>
diff --git a/modules/GEDFact_assistant/_MEDIA/media_1_ctrl.php b/modules/GEDFact_assistant/_MEDIA/media_1_ctrl.php
new file mode 100644
index 0000000000..7d4bc4e89e
--- /dev/null
+++ b/modules/GEDFact_assistant/_MEDIA/media_1_ctrl.php
@@ -0,0 +1,90 @@
+<?php
+/**
+ * Media Link Assistant Control module for phpGedView
+ *
+ * Media Link information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2008 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Census Assistant
+ * @version $Id$
+ */
+
+ if (!defined('WT_WEBTREES')) {
+ header('HTTP/1.0 403 Forbidden');
+ exit;
+}
+
+global $summary, $theme_name, $TEXT_DIRECTION, $censyear, $censdate;
+
+$pid = safe_get('pid');
+
+// echo $pid;
+
+$year = "1901";
+$censevent = new Event("1 CENS\n2 DATE 03 MAR".$year."");
+$censdate = $censevent->getDate();
+$censyear = $censdate->date1->y;
+$ctry = "UK";
+// $married = GedcomDate::Compare($censdate, $marrdate);
+$married=-1;
+
+
+// Test to see if Base pid is filled in ============================
+if ($pid=="") {
+ echo "<br /><br />";
+ echo "<b><font color=\"red\">YOU MUST enter a Base individual ID to be able to \"ADD\" Individual Links</font></b>";
+ echo "<br /><br />";
+}else{
+
+ $person=Person::getInstance($pid);
+ // var_dump($person->getAllNames());
+ $nam = $person->getAllNames();
+ if (PrintReady($person->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($person->getDeathYear()); }
+ if (PrintReady($person->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($person->getBirthYear()); }
+ if ($married>=0 && isset($nam[1])){
+ $wholename = rtrim($nam[1]['fullNN']);
+ } else {
+ $wholename = rtrim($nam[0]['fullNN']);
+ }
+ $currpid=$pid;
+
+ echo '<table width=400 class="facts_table center ', $TEXT_DIRECTION, '">';
+ echo '<tr><td class="topbottombar" colspan="1">';
+ echo '<b>', i18n::translate('Family Navigator'), '</b>';
+ echo '</td></tr>';
+ echo '<tr>';
+// echo '<td class="optionbox wrap" valign="top" align="left" width="50%" >';
+// echo i18n::translate('Add Family, and Search links');
+// echo '</td>';
+ echo '<td valign="top" width=400>';
+ //-- Search and Add Family Members Area =========================================
+ include('modules/GEDFact_assistant/_MEDIA/media_3_search_add.php');
+ echo '</td>';
+ echo '</tr>';
+ echo '</table>';
+
+} // End IF test for Base pid
+
+?>
+
+
diff --git a/modules/GEDFact_assistant/_MEDIA/media_3_find.php b/modules/GEDFact_assistant/_MEDIA/media_3_find.php
new file mode 100644
index 0000000000..0bfb64e15c
--- /dev/null
+++ b/modules/GEDFact_assistant/_MEDIA/media_3_find.php
@@ -0,0 +1,807 @@
+<?php
+/**
+ * Media Link Assistant Control module for phpGedView
+ *
+ * Media Link information about an individual
+ *
+ * Popup window that will allow a user to search for a family id, person id
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Display
+ * @version $Id$
+ */
+
+require WT_ROOT.'includes/functions/functions_print_lists.php';
+
+$type =safe_GET('type', WT_REGEX_ALPHA, 'indi');
+$filter =safe_GET('filter');
+$action =safe_GET('action');
+$callback =safe_GET('callback', WT_REGEX_NOSCRIPT, 'paste_id');
+$create =safe_GET('create');
+$media =safe_GET('media');
+$external_links =safe_GET('external_links');
+$directory =safe_GET('directory', WT_REGEX_NOSCRIPT, $MEDIA_DIRECTORY);
+$multiple =safe_GET_bool('multiple');
+$showthumb =safe_GET_bool('showthumb');
+$all =safe_GET_bool('all');
+$subclick =safe_GET('subclick');
+$choose =safe_GET('choose', WT_REGEX_NOSCRIPT, '0all');
+$level =safe_GET('level', WT_REGEX_INTEGER, 0);
+$language_filter=safe_GET('language_filter');
+$magnify =safe_GET_bool('magnify');
+
+if ($showthumb) {
+ $thumbget='&showthumb=true';
+} else {
+ $thumbget='';
+}
+
+if ($subclick=='all') {
+ $all=true;
+}
+
+$embed = substr($choose, 0, 1)=="1";
+$chooseType = substr($choose, 1);
+if ($chooseType!="media" && $chooseType!="0file") {
+ $chooseType = "all";
+}
+
+//-- force the thumbnail directory to have the same layout as the media directory
+//-- Dots and slashes should be escaped for the preg_replace
+$srch = "/".addcslashes($MEDIA_DIRECTORY, '/.')."/";
+$repl = addcslashes($MEDIA_DIRECTORY."thumbs/", '/.');
+$thumbdir = stripcslashes(preg_replace($srch, $repl, $directory));
+
+//-- prevent script from accessing an area outside of the media directory
+//-- and keep level consistency
+if (($level < 0) || ($level > $MEDIA_DIRECTORY_LEVELS)){
+ $directory = $MEDIA_DIRECTORY;
+ $level = 0;
+} elseif (preg_match("'^$MEDIA_DIRECTORY'", $directory)==0){
+ $directory = $MEDIA_DIRECTORY;
+ $level = 0;
+}
+// End variables for find media
+
+// Variables for Find Special Character
+if (empty($language_filter)) {
+ if (!empty($_SESSION["language_filter"])) {
+ $language_filter=$_SESSION["language_filter"];
+ } else {
+ $language_filter=WT_LOCALE;
+ }
+}
+require WT_ROOT.'includes/specialchars.php';
+// End variables for Find Special Character
+
+switch ($type) {
+case "indi":
+ print_simple_header(i18n::translate('Find Individual ID'));
+ break;
+case "fam":
+ print_simple_header(i18n::translate('Find Family List'));
+ break;
+case "media":
+ print_simple_header(i18n::translate('Find Media'));
+ $action="filter";
+ break;
+case "place":
+ print_simple_header(i18n::translate('Find Place'));
+ $action="filter";
+ break;
+case "repo":
+ print_simple_header(i18n::translate('Repositories'));
+ $action="filter";
+ break;
+case "note":
+ print_simple_header(i18n::translate('Find Shared Note'));
+ $action="filter";
+ break;
+case "source":
+ print_simple_header(i18n::translate('Find Source'));
+ $action="filter";
+ break;
+case "specialchar":
+ print_simple_header(i18n::translate('Find Special Characters'));
+ $action="filter";
+ break;
+}
+
+echo WT_JS_START;
+?>
+
+ function pasterow(id, name, gend, yob, age, bpl) {
+ window.opener.opener.insertRowToTable(id, name, '', gend, '', yob, age, 'Y', '', bpl);
+ <?php // if (!$multiple) print "window.close();"; ?>
+ }
+
+ function pasteid(id, name, thumb) {
+ if(thumb) {
+ window.opener.<?php echo $callback; ?>(id, name, thumb);
+ <?php if (!$multiple) echo "window.close();"; ?>
+ } else {
+ // GEDFact_assistant ========================
+ if (window.opener.document.getElementById('addlinkQueue')) {
+ window.opener.insertRowToTable(id, name);
+ // Check if Indi, Fam or source ===================
+ /*
+ if (id.match("I")=="I") {
+ var win01 = window.opener.window.open('edit_interface.php?action=addmedia_links&noteid=newnote&pid='+id, 'win01', 'top=50, left=600, width=420, height=650, resizable=1, scrollbars=1');
+ if (window.focus) {win01.focus();}
+ }else if (id.match("F")=="F") {
+ // TODO --- alert('Opening Navigator with family id entered will come later');
+ }
+ */
+ }
+ window.opener.<?php echo $callback; ?>(id);
+ if (window.opener.pastename) window.opener.pastename(name);
+ <?php if (!$multiple) echo "window.close();"; ?>
+ }
+ }
+ var language_filter;
+ function paste_char(selected_char, language_filter, magnify) {
+ window.opener.paste_char(selected_char, language_filter, magnify);
+ return false;
+ }
+ function setMagnify() {
+ document.filterspecialchar.magnify.value = '<?php echo !$magnify; ?>';
+ document.filterspecialchar.submit();
+ }
+ function checknames(frm) {
+ if (document.forms[0].subclick) button = document.forms[0].subclick.value;
+ else button = "";
+ if (frm.filter.value.length<2&button!="all") {
+ alert("<?php echo i18n::translate('Please enter more than one character'); ?>");
+ frm.filter.focus();
+ return false;
+ }
+ if (button=="all") {
+ frm.filter.value = "";
+ }
+ return true;
+ }
+<?php
+echo WT_JS_END;
+
+$options = array();
+$options["option"][]= "findindi";
+$options["option"][]= "findfam";
+$options["option"][]= "findmedia";
+$options["option"][]= "findplace";
+$options["option"][]= "findrepo";
+$options["option"][]= "findnote";
+$options["option"][]= "findsource";
+$options["option"][]= "findspecialchar";
+$options["form"][]= "formindi";
+$options["form"][]= "formfam";
+$options["form"][]= "formmedia";
+$options["form"][]= "formplace";
+$options["form"][]= "formrepo";
+$options["form"][]= "formnote";
+$options["form"][]= "formsource";
+$options["form"][]= "formspecialchar";
+
+echo "<div align=\"center\">";
+echo "<table class=\"list_table $TEXT_DIRECTION width90\" border=\"0\">";
+echo "<tr><td style=\"padding: 10px;\" valign=\"top\" class=\"facts_label03 width90\">"; // start column for find text header
+
+switch ($type) {
+case "indi":
+ echo i18n::translate('Find Individual ID');
+ break;
+case "fam":
+ echo i18n::translate('Find Family List');
+ break;
+case "media":
+ echo i18n::translate('Find Media');
+ break;
+case "place":
+ echo i18n::translate('Find Place');
+ break;
+case "repo":
+ echo i18n::translate('Repositories');
+ break;
+case "note":
+ echo i18n::translate('Find Shared Note');
+ break;
+case "source":
+ echo i18n::translate('Find Source');
+ break;
+case "specialchar":
+ echo i18n::translate('Find Special Characters');
+ break;
+}
+
+echo "</td>"; // close column for find text header
+
+// start column for find options
+echo "</tr><tr><td class=\"list_value\" style=\"padding: 0px;\">";
+
+// Show indi and hide the rest
+if ($type == "indi") {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filterindi\" method=\"get\" onsubmit=\"return checknames(this);\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"$callback\" />";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"indi\" />";
+ echo "<input type=\"hidden\" name=\"multiple\" value=\"$multiple\" />";
+/*
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo i18n::translate('Name contains:'), " <input type=\"text\" name=\"filter\" value=\"";
+ if ($filter) echo $filter;
+ echo "\" />";
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo "<input type=\"submit\" value=\"", i18n::translate('Filter'), "\" /><br />";
+ echo "</td></tr></table>";
+*/
+ echo "</form></div>";
+}
+
+// Show fam and hide the rest
+if ($type == "fam") {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filterfam\" method=\"get\" onsubmit=\"return checknames(this);\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"fam\" />";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"$callback\" />";
+ echo "<input type=\"hidden\" name=\"multiple\" value=\"$multiple\" />";
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo i18n::translate('Name contains:'), " <input type=\"text\" name=\"filter\" value=\"";
+ if ($filter) echo $filter;
+ echo "\" />";
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo "<input type=\"submit\" value=\"", i18n::translate('Filter'), "\" /><br />";
+ echo "</td></tr></table>";
+ echo "</form></div>";
+}
+
+// Show media and hide the rest
+if ($type == "media" && $MULTI_MEDIA) {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filtermedia\" method=\"get\" onsubmit=\"return checknames(this);\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"choose\" value=\"", $choose, "\" />";
+ echo "<input type=\"hidden\" name=\"directory\" value=\"", $directory, "\" />";
+ echo "<input type=\"hidden\" name=\"thumbdir\" value=\"", $thumbdir, "\" />";
+ echo "<input type=\"hidden\" name=\"level\" value=\"", $level, "\" />";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"media\" />";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"$callback\" />";
+ echo "<input type=\"hidden\" name=\"subclick\">"; // This is for passing the name of which submit button was clicked
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo i18n::translate('Media contains:'), " <input type=\"text\" name=\"filter\" value=\"";
+ if ($filter) echo $filter;
+ echo "\" />";
+ echo help_link('simple_filter');
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" wstyle=\"padding: 5px;\">";
+ echo "<input type=\"checkbox\" name=\"showthumb\" value=\"true\"";
+ if( $showthumb) echo "checked=\"checked\"";
+ echo "onclick=\"javascript: this.form.submit();\" />", i18n::translate('Show thumbnails');
+ echo help_link('show_thumb');
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo "<input type=\"submit\" name=\"search\" value=\"", i18n::translate('Filter'), "\" onclick=\"this.form.subclick.value=this.name\" />&nbsp;";
+ echo "<input type=\"submit\" name=\"all\" value=\"", i18n::translate('Display all'), "\" onclick=\"this.form.subclick.value=this.name\" />";
+ echo "</td></tr></table>";
+ echo "</form></div>";
+}
+
+// Show place and hide the rest
+if ($type == "place") {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filterplace\" method=\"get\" onsubmit=\"return checknames(this);\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"place\" />";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"$callback\" />";
+ echo "<input type=\"hidden\" name=\"subclick\">"; // This is for passing the name of which submit button was clicked
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo i18n::translate('Place contains:'), " <input type=\"text\" name=\"filter\" value=\"";
+ if ($filter) echo $filter;
+ echo "\" />";
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo "<input type=\"submit\" name=\"search\" value=\"", i18n::translate('Filter'), "\" onclick=\"this.form.subclick.value=this.name\" />&nbsp;";
+ echo "<input type=\"submit\" name=\"all\" value=\"", i18n::translate('Display all'), "\" onclick=\"this.form.subclick.value=this.name\" />";
+ echo "</td></tr></table>";
+ echo "</form></div>";
+}
+
+// Show repo and hide the rest
+if ($type == "repo" && $SHOW_SOURCES>=WT_USER_ACCESS_LEVEL) {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filterrepo\" method=\"get\" onsubmit=\"return checknames(this);\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"repo\" />";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"$callback\" />";
+ echo "<input type=\"hidden\" name=\"subclick\">"; // This is for passing the name of which submit button was clicked
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo i18n::translate('Repository contains:'), " <input type=\"text\" name=\"filter\" value=\"";
+ if ($filter) echo $filter;
+ echo "\" />";
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo "<input type=\"submit\" name=\"search\" value=\"", i18n::translate('Filter'), "\" onclick=\"this.form.subclick.value=this.name\" />&nbsp;";
+ echo "<input type=\"submit\" name=\"all\" value=\"", i18n::translate('Display all'), "\" onclick=\"this.form.subclick.value=this.name\" />";
+ echo "</td></tr></table>";
+ echo "</form></div>";
+}
+
+// Show Shared Notes and hide the rest
+if ($type == "note") {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filternote\" method=\"get\" onsubmit=\"return checknames(this);\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"note\" />";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"$callback\" />";
+ echo "<input type=\"hidden\" name=\"subclick\">"; // This is for passing the name of which submit button was clicked
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo i18n::translate('Shared Note contains:'), " <input type=\"text\" name=\"filter\" value=\"";
+ if ($filter) echo $filter;
+ echo "\" />";
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo "<input type=\"submit\" name=\"search\" value=\"", i18n::translate('Filter'), "\" onclick=\"this.form.subclick.value=this.name\" />&nbsp;";
+ echo "<input type=\"submit\" name=\"all\" value=\"", i18n::translate('Display all'), "\" onclick=\"this.form.subclick.value=this.name\" />";
+ echo "</td></tr></table>";
+ echo "</form></div>";
+}
+
+// Show source and hide the rest
+if ($type == "source" && $SHOW_SOURCES>=WT_USER_ACCESS_LEVEL) {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filtersource\" method=\"get\" onsubmit=\"return checknames(this);\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"source\" />";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"$callback\" />";
+ echo "<input type=\"hidden\" name=\"subclick\">"; // This is for passing the name of which submit button was clicked
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo i18n::translate('Source contains:'), " <input type=\"text\" name=\"filter\" value=\"";
+ if ($filter) echo $filter;
+ echo "\" />";
+ echo "</td></tr>";
+ echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">";
+ echo "<input type=\"submit\" name=\"search\" value=\"", i18n::translate('Filter'), "\" onclick=\"this.form.subclick.value=this.name\" />&nbsp;";
+ echo "<input type=\"submit\" name=\"all\" value=\"", i18n::translate('Display all'), "\" onclick=\"this.form.subclick.value=this.name\" />";
+ echo "</td></tr></table>";
+ echo "</form></div>";
+}
+
+// Show specialchar and hide the rest
+if ($type == "specialchar") {
+ echo "<div align=\"center\">";
+ echo "<form name=\"filterspecialchar\" method=\"get\" action=\"find.php\">";
+ echo "<input type=\"hidden\" name=\"action\" value=\"filter\" />";
+ echo "<input type=\"hidden\" name=\"type\" value=\"specialchar\" />";
+ echo "<input type=\"hidden\" name=\"callback\" value=\"", $callback, "\" />";
+ echo "<input type=\"hidden\" name=\"magnify\" value=\"", $magnify, "\" />";
+ echo "<table class=\"list_table $TEXT_DIRECTION width100\" border=\"0\">";
+ echo "<tr><td class=\"list_label\" style=\"padding: 5px;\">";
+ echo "<select id=\"language_filter\" name=\"language_filter\" onchange=\"submit();\">";
+ echo "<option value=\"\">", i18n::translate('Change Language'), "</option>";
+ $language_options = "";
+ foreach($specialchar_languages as $key=>$value) {
+ $language_options.= "<option value=\"$key\">$value</option>";
+ }
+ $language_options = str_replace("\"$language_filter\"", "\"$language_filter\" selected", $language_options);
+ echo $language_options;
+ echo "</select><br /><a href=\"javascript:;\" onclick=\"setMagnify()\">", i18n::translate('Magnify'), "</a>";
+ echo "</td></tr></table>";
+ echo "</form></div>";
+}
+// end column for find options
+echo "</td></tr>";
+echo "</table>"; // Close table with find options
+
+echo "<br />";
+echo "<a href=\"javascript:;\" onclick=\"if (window.opener.showchanges) window.opener.showchanges(); window.close();\">", i18n::translate('Close Window'), "</a><br />";
+echo "<br />";
+
+if ($action=="filter") {
+ $filter = trim($filter);
+ $filter_array=explode(' ', preg_replace('/ {2,}/', ' ', $filter));
+
+ // Output Individual
+ if ($type == "indi") {
+ echo "<table class=\"tabs_table $TEXT_DIRECTION width90\"><tr>";
+ $myindilist=search_indis_names($filter_array, array(WT_GED_ID), 'AND');
+ if ($myindilist) {
+ echo "<td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>";
+ usort($myindilist, array('GedcomRecord', 'Compare'));
+ foreach($myindilist as $indi) {
+// echo $indi->format_list('li', true);
+ $nam = htmlspecialchars($indi->getFullName());
+ echo "<li><a href=\"javascript:;\" onclick=\"pasterow(
+ '".$indi->getXref()."' ,
+ '".$nam."' ,
+ '".$indi->getSex()."' ,
+ '".$indi->getbirthyear()."' ,
+ '".(1901-$indi->getbirthyear())."' ,
+ '".$indi->getbirthplace()."'); return false;\">
+ <b>".$indi->getFullName()."</b>&nbsp;&nbsp;&nbsp;";
+
+ if ($ABBREVIATE_CHART_LABELS) {
+ $born=i18n::fact_abbreviation('BIRT');
+ } else {
+ $born=i18n::translate('BIRT');
+ }
+
+
+ echo "</span><br><span class=\"list_item\">", $born, " ", $indi->getbirthyear(), "&nbsp;&nbsp;&nbsp;", $indi->getbirthplace(), "</span></a></li>";
+
+ echo "<hr />";
+ }
+ echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Total individuals'), ' ', count($myindilist), '</tr></td>';
+ } else {
+ echo "<td class=\"list_value_wrap\">";
+ echo i18n::translate('No results found.');
+ echo "</td></tr>";
+ }
+ echo "</table>";
+ }
+
+ // Output Family
+ if ($type == "fam") {
+ echo "<table class=\"tabs_table $TEXT_DIRECTION width90\"><tr>";
+ // Get the famrecs with hits on names from the family table
+ // Get the famrecs with hits in the gedcom record from the family table
+ $myfamlist = pgv_array_merge(
+ search_fams_names($filter_array, array(WT_GED_ID), 'AND'),
+ search_fams($filter_array, array(WT_GED_ID), 'AND', true)
+ );
+ if ($myfamlist) {
+ $curged = $GEDCOM;
+ echo "<td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>";
+ usort($myfamlist, array('GedcomRecord', 'Compare'));
+ foreach($myfamlist as $family) {
+ echo $family->format_list('li', true);
+ }
+ echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Total families'), ' ', count($myfamlist), '</tr></td>';
+ } else {
+ echo "<td class=\"list_value_wrap\">";
+ echo i18n::translate('No results found.');
+ echo "</td></tr>";
+ }
+ echo "</table>";
+ }
+
+ // Output Media
+ if ($type == "media") {
+ global $dirs;
+
+ $medialist = get_medialist(true, $directory);
+
+ echo "<table class=\"tabs_table $TEXT_DIRECTION width90\">";
+ // Show link to previous folder
+ if ($level>0) {
+ $levels = explode("/", $directory);
+ $pdir = "";
+ for($i=0; $i<count($levels)-2; $i++) $pdir.=$levels[$i]."/";
+ $levels = explode("/", $thumbdir);
+ $pthumb = "";
+ for($i=0; $i<count($levels)-2; $i++) $pthumb.=$levels[$i]."/";
+ $uplink = "<a href=\"".encode_url("find.php?directory={$pdir}&thumbdir={$pthumb}&level=".($level-1)."{$thumbget}&type=media&choose={$choose}")."\">&nbsp;&nbsp;&nbsp;&lt;-- <span dir=\"ltr\">".$pdir."</span>&nbsp;&nbsp;&nbsp;</a><br />";
+ }
+
+ // Start of media directory table
+ echo "<table class=\"list_table $TEXT_DIRECTION width90\">";
+
+ // Tell the user where he is
+ echo "<tr>";
+ echo "<td class=\"topbottombar\" colspan=\"2\">";
+ echo i18n::translate('Current directory');
+ echo "<br />";
+ echo substr($directory, 0, -1);
+ echo "</td>";
+ echo "</tr>";
+
+ // display the directory list
+ if (count($dirs) || $level) {
+ sort($dirs);
+ if ($level){
+ echo "<tr><td class=\"list_value $TEXT_DIRECTION\" colspan=\"2\">";
+ echo $uplink, "</td></tr>";
+ }
+ echo "<tr><td class=\"descriptionbox $TEXT_DIRECTION\" colspan=\"2\">";
+ echo "<a href=\"", encode_url("find.php?directory={$directory}&thumbdir=".str_replace($MEDIA_DIRECTORY, $MEDIA_DIRECTORY."thumbs/", $directory)."&level={$level}{$thumbget}&external_links=http&type=media&choose={$choose}"), "\">", i18n::translate('External objects'), "</a>";
+ echo "</td></tr>";
+ foreach ($dirs as $indexval => $dir) {
+ echo "<tr><td class=\"list_value $TEXT_DIRECTION\" colspan=\"2\">";
+ echo "<a href=\"", encode_url("find.php?directory={$directory}{$dir}/&thumbdir={$directory}{$dir}/&level=".($level+1)."{$thumbget}&type=media&choose={$choose}"), "\"><span dir=\"ltr\">", $dir, "</span></a>";
+ echo "</td></tr>";
+ }
+ }
+ echo "<tr><td class=\"descriptionbox $TEXT_DIRECTION\" colspan=\"2\"></td></tr>";
+
+ /**
+ * This action generates a thumbnail for the file
+ *
+ * @name $create->thumbnail
+ */
+ if ($create=="thumbnail") {
+ $filename = $_REQUEST["file"];
+ generate_thumbnail($directory.$filename, $thumbdir.$filename);
+ }
+
+ echo "<br />";
+
+ // display the images TODO x across if lots of files??
+ if (count($medialist) > 0) {
+ foreach ($medialist as $indexval => $media) {
+
+ // Check if the media belongs to the current folder
+ preg_match_all("/\//", $media["FILE"], $hits);
+ $ct = count($hits[0]);
+
+ if (($ct <= $level+1 && $external_links != "http" && !isFileExternal($media["FILE"])) || (isFileExternal($media["FILE"]) && $external_links == "http")) {
+ // simple filter to reduce the number of items to view
+ $isvalid = filterMedia($media, $filter, 'http');
+ if ($isvalid && $chooseType!="all") {
+ if ($chooseType=="0file" && !empty($media["XREF"])) $isvalid = false; // skip linked media files
+ if ($chooseType=="media" && empty($media["XREF"])) $isvalid = false; // skip unlinked media files
+ }
+ if ($isvalid) {
+ if ($media["EXISTS"] && media_filesize($media["FILE"]) != 0){
+ $imgsize = findImageSize($media["FILE"]);
+ $imgwidth = $imgsize[0]+40;
+ $imgheight = $imgsize[1]+150;
+ }
+ else {
+ $imgwidth = 0;
+ $imgheight = 0;
+ }
+
+ echo "<tr>";
+
+ //-- thumbnail field
+ if ($showthumb) {
+ echo "<td class=\"list_value $TEXT_DIRECTION width10\">";
+ if (isset($media["THUMB"])) echo "<a href=\"javascript:;\" onclick=\"return openImage('", rawurlencode($media["FILE"]), "', $imgwidth, $imgheight);\"><img src=\"", filename_decode($media["THUMB"]), "\" border=\"0\" width=\"50\" alt=\"\" /></a>";
+ else echo "&nbsp;";
+ }
+
+ //-- name and size field
+ echo "<td class=\"list_value $TEXT_DIRECTION\">";
+ if ($media["TITL"] != "") {
+ echo "<b>", PrintReady($media["TITL"]), "</b>&nbsp;&nbsp;";
+ if ($TEXT_DIRECTION=="rtl") echo getRLM();
+ echo "(", $media["XREF"], ")";
+ if ($TEXT_DIRECTION=="rtl") echo getRLM();
+ echo "<br />";
+ }
+ if (!$embed){
+ echo "<a href=\"javascript:;\" onclick=\"pasteid('", addslashes($media["FILE"]), "');\"><span dir=\"ltr\">", $media["FILE"], "</span></a> -- ";
+ }
+ else echo "<a href=\"javascript:;\" onclick=\"pasteid('", $media["XREF"], "','", addslashes($media["TITL"]), "','", addslashes($media["THUMB"]), "');\"><span dir=\"ltr\">", $media["FILE"], "</span></a> -- ";
+ echo "<a href=\"javascript:;\" onclick=\"return openImage('", rawurlencode($media["FILE"]), "', $imgwidth, $imgheight);\">", i18n::translate('View'), "</a><br />";
+ if (!$media["EXISTS"] && !isFileExternal($media["FILE"])) echo $media["FILE"], "<br /><span class=\"error\">", i18n::translate('The filename entered does not exist.'), "</span><br />";
+ else if (!isFileExternal($media["FILE"]) && !empty($imgsize[0])) {
+ echo "<br /><sub>&nbsp;&nbsp;", i18n::translate('Image Dimensions'), " -- ", $imgsize[0], "x", $imgsize[1], "</sub><br />";
+ }
+ if ($media["LINKED"]) {
+ echo i18n::translate('This media object is linked to the following:'), "<br />";
+ foreach ($media["LINKS"] as $indi => $type_record) {
+ if ($type_record!='INDI' && $type_record!='FAM' && $type_record!='SOUR' && $type_record!='OBJE') continue;
+ $record=GedcomRecord::getInstance($indi);
+ echo '<br /><a href="', encode_url($record->getLinkUrl()), '">';
+ switch($type_record) {
+ case 'INDI':
+ echo i18n::translate('View Person'), ' - ';
+ break;
+ case 'FAM':
+ echo i18n::translate('View Family'), ' - ';
+ break;
+ case 'SOUR':
+ echo i18n::translate('View Source'), ' - ';
+ break;
+ case 'OBJE':
+ echo i18n::translate('View Object'), ' - ';
+ break;
+ }
+ echo PrintReady($record->getFullName()), '</a>';
+ }
+ } else {
+ echo i18n::translate('This media object is not linked to any GEDCOM record.');
+ }
+ echo "</td>";
+ }
+ }
+ }
+ }
+ else {
+ echo "<tr><td class=\"list_value_wrap\">";
+ echo i18n::translate('No results found.');
+ echo "</td></tr>";
+ }
+ echo "</table>";
+ }
+
+ // Output Places
+ if ($type == "place") {
+ echo "<table class=\"tabs_table $TEXT_DIRECTION width90\"><tr>";
+ $placelist = array();
+ if ($all || $filter) {
+ $placelist=find_place_list($filter);
+ $ctplace = count($placelist);
+ if ($ctplace>0) {
+ $revplacelist = array();
+ foreach ($placelist as $indexval => $place) {
+ $levels = explode(',', $place); // -- split the place into comma seperated values
+ $levels = array_reverse($levels); // -- reverse the array so that we get the top level first
+ $placetext = "";
+ $j=0;
+ foreach($levels as $indexval => $level) {
+ if ($j>0) $placetext .= ", ";
+ $placetext .= trim($level);
+ $j++;
+ }
+ $revplacelist[] = $placetext;
+ }
+ uasort($revplacelist, "utf8_strcasecmp");
+ echo "<td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>";
+ foreach($revplacelist as $place) {
+ echo "<li><a href=\"javascript:;\" onclick=\"pasteid('", str_replace(array("'", '"'), array("\'", '&quot;'), $place), "');\">", PrintReady($place), "</a></li>";
+ }
+ echo "</ul></td></tr>";
+ echo "<tr><td class=\"list_label\">", i18n::translate('Places found'), " ", $ctplace;
+ echo "</td></tr>";
+ }
+ else {
+ echo "<tr><td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>";
+ echo i18n::translate('No results found.');
+ echo "</td></tr>";
+ }
+ }
+ echo "</table>";
+ }
+
+ // Output Repositories
+ if ($type == "repo") {
+ echo "<table class=\"tabs_table $TEXT_DIRECTION width90\"><tr>";
+ $repo_list = get_repo_list(WT_GED_ID);
+ if ($repo_list) {
+ echo "<td class=\"list_value_wrap\"><ul>";
+ foreach ($repo_list as $repo) {
+ echo "<li><a href=\"javascript:;\" onclick=\"pasteid('", $repo->getXref(), "');\"><span class=\"list_item\">", $repo->getListName(), "&nbsp;&nbsp;&nbsp;";
+ echo WT_LPARENS.$repo->getXref().WT_RPARENS;
+ echo "</span></a></li>";
+ }
+ echo "</ul></td></tr>";
+ echo "<tr><td class=\"list_label\">", i18n::translate('Repositories found'), " ", count($repo_list);
+ echo "</td></tr>";
+ }
+ else {
+ echo "<tr><td class=\"list_value_wrap\">";
+ echo i18n::translate('No results found.');
+ echo "</td></tr>";
+ }
+ echo "</table>";
+ }
+
+ // Output Shared Notes
+ if ($type=="note") {
+ echo '<table class="tabs_table ', $TEXT_DIRECTION, ' width90">';
+ if ($filter) {
+ $mynotelist = search_notes($filter_array, array(WT_GED_ID), 'AND', true);
+ } else {
+ $mynotelist = get_note_list(WT_GED_ID);
+ }
+ if ($mynotelist) {
+ usort($mynotelist, array('GedcomRecord', 'Compare'));
+ echo '<tr><td class="list_value_wrap"><ul>';
+ foreach ($mynotelist as $note) {
+ echo '<li><a href="javascript:;" onclick="pasteid(\'', $note->getXref(), "', '", preg_replace("/(['\"])/", "\\$1", PrintReady($note->getListName())), '\'); return false;"><span class="list_item">', PrintReady($note->getListName()), '</span></a></li>';
+ }
+ echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Shared Notes found'), ' ', count($mynotelist), '</td></tr>';
+ }
+ else {
+ echo '<tr><td class="list_value_wrap">', i18n::translate('No results found.'), '</td></tr>';
+ }
+ echo '</table>';
+ }
+
+ // Output Sources
+ if ($type=="source") {
+ echo '<table class="tabs_table ', $TEXT_DIRECTION, ' width90">';
+ if ($filter) {
+ $mysourcelist = search_sources($filter_array, array(WT_GED_ID), 'AND', true);
+ } else {
+ $mysourcelist = get_source_list(WT_GED_ID);
+ }
+ if ($mysourcelist) {
+ usort($mysourcelist, array('GedcomRecord', 'Compare'));
+ echo '<tr><td class="list_value_wrap"><ul>';
+ foreach ($mysourcelist as $source) {
+ echo '<li><a href="javascript:;" onclick="pasteid(\'', $source->getXref(), "', '", preg_replace("/(['\"])/", "\\$1", PrintReady($source->getFullName())), '\'); return false;"><span class="list_item">', PrintReady($source->getFullName()), '</span></a></li>';
+ }
+ echo '</ul></td></tr><tr><td class="list_label">', i18n::translate('Total Sources'), ' ', count($mysourcelist), '</td></tr>';
+ }
+ else {
+ echo '<tr><td class="list_value_wrap">', i18n::translate('No results found.'), '</td></tr>';
+ }
+ echo '</table>';
+ }
+
+ // Output Special Characters
+ if ($type == "specialchar") {
+ echo "<table class=\"tabs_table $TEXT_DIRECTION width90\"><tr><td class=\"list_value center wrap\" dir=\"$TEXT_DIRECTION\"><br/>";
+ // lower case special characters
+ if ($magnify) {
+ echo '<span class="largechars">';
+ }
+ foreach($lcspecialchars as $key=>$value) {
+ $value = str_replace("'", "\'", $value);
+ echo "<a href=\"javascript:;\" onclick=\"return paste_char('$value', '$language_filter', '$magnify');\">";
+ echo $key;
+ echo "</span></a> ";
+ }
+ if ($magnify) {
+ echo '<span class="largechars">';
+ }
+ echo '<br/><br/>';
+ //upper case special characters
+ if ($magnify) {
+ echo '<span class="largechars">';
+ }
+ foreach($ucspecialchars as $key=>$value) {
+ $value = str_replace("'", "\'", $value);
+ echo "<a href=\"javascript:;\" onclick=\"return paste_char('$value', '$language_filter', '$magnify');\">";
+ echo $key;
+ echo "</span></a> ";
+ }
+ if ($magnify) {
+ echo '<span class="largechars">';
+ }
+ echo '<br/><br/>';
+ // other special characters (not letters)
+ if ($magnify) {
+ echo '<span class="largechars">';
+ }
+ foreach($otherspecialchars as $key=>$value) {
+ $value = str_replace("'", "\'", $value);
+ echo "<a href=\"javascript:;\" onclick=\"return paste_char('$value', '$language_filter', '$magnify');\">";
+ echo $key;
+ echo "</span></a> ";
+ }
+ if ($magnify) {
+ echo '<span class="largechars">';
+ }
+ echo '<br/><br/></td></tr></table>';
+ }
+}
+echo "</div>"; // Close div that centers table
+
+// Set focus to the input field
+echo WT_JS_START, 'document.filter', $type, '.filter.focus();', WT_JS_END;
+
+print_simple_footer();
+
+?>
diff --git a/modules/GEDFact_assistant/_MEDIA/media_3_search_add.php b/modules/GEDFact_assistant/_MEDIA/media_3_search_add.php
new file mode 100644
index 0000000000..cb34cf4302
--- /dev/null
+++ b/modules/GEDFact_assistant/_MEDIA/media_3_search_add.php
@@ -0,0 +1,1485 @@
+<?php
+/**
+ * Media Link Assistant Control module for phpGedView
+ *
+ * Media Link information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2007 to 2008 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Module
+ * @version $Id$
+ * @author Brian Holland
+*/
+
+if (!defined('WT_WEBTREES')) {
+ header('HTTP/1.0 403 Forbidden');
+ exit;
+}
+?>
+<table class="outer_nav center">
+ <?php
+
+ //-- Search Function ------------------------------------------------------------
+ ?>
+ <tr>
+ <td class="descriptionbox font9 center"><?php echo i18n::translate('Search for People to add to Add Links list.');?></td>
+ </tr>
+ <tr>
+ <td id="srch" class="optionbox center">
+ <script>
+ var enter_name = "<?php echo i18n::translate('You must enter a name'); ?>";
+ function findindi(persid) {
+ var findInput = document.getElementById('personid');
+ txt = findInput.value;
+ if (txt=="") {
+ alert(enter_name);
+ }else{
+ var win02 = window.open(
+ "module.php?mod=GEDFact_assistant&pgvaction=_MEDIA/media_3_find&callback=paste_id&action=filter&type=indi&multiple=&filter="+txt, "win02", "resizable=1, menubar=0, scrollbars=1, top=180, left=600, HEIGHT=600, WIDTH=450 ");
+ if (window.focus) {
+ win02.focus();
+ }
+ }
+ }
+ </script>
+ <?php
+ echo '<input id="personid" type="text" value="" />';
+ echo '<a href="javascript: onclick=findindi()">' ;
+ echo '&nbsp;<font size="2">&nbsp;', i18n::translate('Search'), '</font>';
+ echo '</a>';
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td class="transparent;">
+ <br />
+ </td>
+ </tr>
+
+ <?php
+ //-- Add Family Members to Census -------------------------------------------
+ global $SHOW_ID_NUMBERS, $WT_IMAGE_DIR, $WT_IMAGES, $WT_MENUS_AS_LISTS;
+ global $spouselinks, $parentlinks, $DeathYr, $BirthYr;
+ global $TEXT_DIRECTION, $GEDCOM, $censyear, $censdate;
+ // echo "CENS = " . $censyear;
+ ?>
+ <tr>
+ <td align="center"class="transparent;">
+ <table width="100%" class="fact_table" cellspacing="0" border="0">
+ <tr>
+ <td align="center" colspan=3 class="descriptionbox wrap font9">
+ <?php
+ // Header text with "Head" button =================================================
+ if (isset($WT_IMAGES["head"]["button"])) {
+ $headImg = "<img class=\"headimg vmiddle\" src=\"".$WT_IMAGE_DIR."/".$WT_IMAGES["head"]["button"]."\" />";
+ $headImg2 = "<img class=\"headimg2 vmiddle\" src=\"".$WT_IMAGE_DIR."/".$WT_IMAGES["head"]["button"]."\" alt=\"".i18n::translate('Click to choose person as Head of family.')."\" title=\"".i18n::translate('Click to choose person as Head of family.')."\" />";
+ } else {
+ $headImg = "<img class=\"headimg vmiddle\" src=\"images/buttons/head.gif\" />";
+ $headImg2 = "<img class=\"headimg2 vmiddle\" src=\"images/buttons/head.gif\" alt=\"".i18n::translate('Click to choose person as Head of family.')."\" title=\"".i18n::translate('Click to choose person as Head of family.')."\" />";
+ }
+ global $tempStringHead;
+ echo i18n::translate('Click %s to choose person as Head of family.', $headImg);
+ ?>
+ <br /><br />
+ <?php echo i18n::translate('Click Name to add person to Add Links List.'); ?>
+ </td>
+ </tr>
+
+ <tr>
+ <td class="font9">
+ <br />
+ </td>
+ </tr>
+
+ <?php
+ //-- Build Parent Family ---------------------------------------------------
+ $personcount=0;
+ $families = $this->indi->getChildFamilies();
+ foreach($families as $famid=>$family) {
+ $label = $this->indi->getChildFamilyLabel($family);
+ $people = $this->buildFamilyList($family, "parents");
+ $marrdate = $family->getMarriageDate();
+
+ // Husband -------------------
+ $styleadd = "";
+ if (isset($people["husb"])) {
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $people["husb"]->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+ $menu = new Menu("&nbsp;" . $people["husb"]->getLabel() . "&nbsp;". "\n");
+ // $menu->addClass("", "", "submenu");
+ $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $currpid, $censyear);
+ $slabel .= $parentlinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu);
+
+
+ echo '<tr>';
+ // Define width of Left (Label) column -------
+ ?>
+ <td width=75 align="left" class="optionbox">
+ <font size=1>
+ <?php if ($WT_MENUS_AS_LISTS) echo "<ul>\n";
+ $menu->printMenu();
+ if ($WT_MENUS_AS_LISTS) echo "</ul>\n";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value" >
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}")."\">";
+ echo $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ if ( ($people["husb"]->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:opener.insertRowToTable("<?php
+ print PrintReady($people["husb"]->getXref()) ; // pid = PID
+ ?>", "<?php
+ // print PrintReady($people["husb"]->getFullName()); // nam = Name
+ echo PrintReady($fulln);
+ ?>", "<?php
+ print PrintReady($people["husb"]->getLabel()); // label = Relationship
+ ?>", "<?php
+ print PrintReady($people["husb"]->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>=0){
+ echo "M"; // cond = Condition (Married)
+ }else{
+ echo "S"; // cond = Condition (Single)
+ }
+ ?>", "<?php
+ print PrintReady($people["husb"]->getbirthyear()); // yob = Year of Birth
+ ?>", "<?php
+ print PrintReady($censyear-$people["husb"]->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ print "Y"; // YMD
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($people["husb"]->getcensbirthplace()); // birthpl = Census Place of Birth
+ ?>");'><?php
+ print PrintReady($people["husb"]->getFullName()); // Name
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ </tr>
+ <?php
+ }
+
+ if (isset($people["wife"])) {
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $people["wife"]->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }else{
+ $fulmn = $fulln;
+ $marn = $surn;
+ }
+
+ $menu = new Menu("&nbsp;" . $people["wife"]->getLabel() . "&nbsp;". "\n");
+ //$menu->addClass("", "", "submenu");
+ $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $currpid, $censyear);
+ $slabel .= $parentlinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu);
+ ?>
+ <tr>
+ <td width=75 align="left" class="optionbox">
+ <font size=1>
+ <?php if ($WT_MENUS_AS_LISTS) echo "<ul>\n";
+ $menu->printMenu();
+ if ($WT_MENUS_AS_LISTS) echo "</ul>\n";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}")."\">";
+ echo $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ if ( ($people["wife"]->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:opener.insertRowToTable("<?php
+ print $people["wife"]->getXref() ; // pid = PID
+ ?>", "<?php
+ // if ($married>=0 && isset($nam[1])){
+ // echo PrintReady($fulmn); // nam = Married Name
+ // }else{
+ //print PrintReady($people["wife"]->getFullName()); // nam = Name
+ echo PrintReady($fulln);
+ // }
+ ?>", "<?php
+ print PrintReady($people["wife"]->getLabel()); // label = Relationship
+ ?>", "<?php
+ print PrintReady($people["wife"]->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>=0 && isset($nam[1])){
+ echo "M"; // cond = Condition (Married)
+ }else{
+ echo "S"; // cond = Condition (Single)
+ }
+ ?>", "<?php
+ print PrintReady($people["wife"]->getbirthyear()); // yob = Year of Birth
+ ?>", "<?php
+ print PrintReady($censyear-$people["wife"]->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ print "Y"; // YMD
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($people["wife"]->getcensbirthplace()); // birthpl = Census Place of Birth
+ ?>");'>
+ <?php
+ //if ($married>=0 && isset($nam[1])){
+ // print PrintReady($fulmn); // Full Married Name
+ //} else {
+ print PrintReady($people["wife"]->getFullName()); // Full Name
+ //}
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ </tr>
+ <?php
+ }
+
+ if (isset($people["children"])) {
+ $elderdate = $family->getMarriageDate();
+ foreach($people["children"] as $key=>$child) {
+ // Get child's marriage status
+ $married="";
+ foreach ($child->getSpouseFamilies() as $childfamily) {
+ $tmp=$childfamily->getMarriageDate();
+ $married = GedcomDate::Compare($censdate, $tmp);
+ }
+ $nam = $child->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+
+ $menu = new Menu("&nbsp;" . $child->getLabel() . "&nbsp;". "\n");
+ //$menu->addClass("", "", "submenu");
+ $slabel = print_pedigree_person_nav2($child->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $currpid, $censyear);
+ $slabel .= $spouselinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu);
+
+ if ($child->getXref()==$pid) {
+ //Only print Head of Family in Immediate Family Block
+ } else {
+ ?>
+ <tr>
+ <td width=75 align="left" class="optionbox">
+ <font size=1>
+ <?php
+ if ($child->getXref()==$pid) {
+ print $child->getLabel();
+ }else{
+ if ($WT_MENUS_AS_LISTS) echo "<ul>\n";
+ $menu->printMenu();
+ if ($WT_MENUS_AS_LISTS) echo "</ul>\n";
+ }
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}")."\">";
+ echo $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ if ( ($child->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:opener.insertRowToTable("<?php
+ print $child->getXref() ; // pid = PID
+ ?>", "<?php
+ //if ($married>=0 && isset($nam[1])){
+ // echo PrintReady($fulmn); // nam = Married Name
+ //}else{
+ //print PrintReady($child->getFullName()); // nam = Full Name
+ echo PrintReady($fulln);
+ //}
+ ?>", "<?php
+ if ($child->getXref()==$pid) {
+ print "Head"; // label = Head
+ }else{
+ print PrintReady($child->getLabel()); // label = Relationship
+ }
+ ?>", "<?php
+ print PrintReady($child->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>0) {
+ echo "M"; // cond = Condition (Married)
+ } else if ($married<0 || ($married=="0") ) {
+ echo "S"; // cond = Condition (Single)
+ } else {
+ echo ""; // cond = Condition (Not Known)
+ }
+ ?>", "<?php
+ print PrintReady($child->getbirthyear()); // yob = Year of Birth
+ ?>", "<?php
+ print PrintReady($censyear-$child->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ print "Y"; // YMD
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($child->getcensbirthplace()); // birthpl = Census Place of Birth
+ ?>");'><?php
+ // if ($married>=0 && isset($nam[1])){
+ // print PrintReady($fulmn); // Full Married Name
+ // } else {
+ print PrintReady($child->getFullName()); // Full Name
+ // }
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ </tr>
+ <?php
+ }
+ }
+ $elderdate = $child->getBirthDate(false);
+ }
+ }
+
+ //-- Build step families ----------------------------------------------------------------
+ foreach($this->indi->getStepFamilies() as $famid=>$family) {
+ $label = $this->indi->getStepFamilyLabel($family);
+ $people = $this->buildFamilyList($family, "step");
+ if ($people){
+ echo "<tr><td><br /></td><td></td></tr>";
+ }
+ $marrdate = $family->getMarriageDate();
+
+ // Husband -----------------------------
+ $styleadd = "";
+ $elderdate = "";
+ if (isset($people["husb"]) ) {
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $people["husb"]->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+ $menu = new Menu();
+ if ($people["husb"]->getLabel() == ".") {
+ $menu->addLabel("&nbsp;" . i18n::translate('Step-Father') . "&nbsp;". "\n");
+ }else{
+ $menu->addLabel("&nbsp;" . $people["husb"]->getLabel() . "&nbsp;". "\n");
+ }
+ //$menu->addClass("", "", "submenu");
+ $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $currpid, $censyear);
+ $slabel .= $parentlinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu);
+ if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["husb"]->getDeathYear()); }
+ if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["husb"]->getBirthYear()); }
+ ?>
+ <tr>
+ <td width=75 align="left" class="optionbox">
+ <font size=1>
+ <?php if ($WT_MENUS_AS_LISTS) echo "<ul>\n";
+ $menu->printMenu();
+ if ($WT_MENUS_AS_LISTS) echo "</ul>\n";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}")."\">";
+ echo $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ if ( ($people["husb"]->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:opener.insertRowToTable("<?php
+ print PrintReady($people["husb"]->getXref()) ; // pid = PID
+ ?>", "<?php
+ //print PrintReady($people["husb"]->getFullName()); // nam = Name
+ echo PrintReady($fulln);
+ ?>", "<?php
+ if ($people["husb"]->getLabel() == ".") {
+ print PrintReady(i18n::translate('Step-Father')); // label = Relationship
+ }else{
+ print PrintReady($people["husb"]->getLabel()); // label = Relationship
+ }
+ ?>", "<?php
+ print PrintReady($people["husb"]->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>=0){
+ echo "M"; // cond = Condition (Married)
+ }else{
+ echo "S"; // cond = Condition (Single)
+ }
+ ?>", "<?php
+ print PrintReady($people["husb"]->getbirthyear()); // yob = Year of Birth
+ ?>", "<?php
+ print PrintReady($censyear-$people["husb"]->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ print "Y"; // YMD
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($people["husb"]->getcensbirthplace()); // birthpl = Census Place of Birth
+ ?>");'>
+ <?php print PrintReady($people["husb"]->getFullName()); // Name
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ </tr>
+ <?php
+ $elderdate = $people["husb"]->getBirthDate(false);
+ }
+
+ // Wife -------------------
+ $styleadd = "";
+ if (isset($people["wife"]) ) {
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $people["wife"]->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+ $menu = new Menu();
+ if ($people["husb"]->getLabel() == ".") {
+ $menu->addLabel("&nbsp;" . i18n::translate('Step-Mother') . "&nbsp;". "\n");
+ }else{
+ $menu->addLabel("&nbsp;" . $people["wife"]->getLabel() . "&nbsp;". "\n");
+ }
+ //$menu->addClass("", "", "submenu");
+ $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $currpid, $censyear);
+ $slabel .= $parentlinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu);
+ if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["wife"]->getDeathYear()); }
+ if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["wife"]->getBirthYear()); }
+ ?>
+ <tr>
+ <td width=75 align="left" class="optionbox">
+ <font size=1>
+ <?php if ($WT_MENUS_AS_LISTS) echo "<ul>\n";
+ $menu->printMenu();
+ if ($WT_MENUS_AS_LISTS) echo "</ul>\n";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}")."\">";
+ echo $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ if ( ($people["wife"]->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:opener.insertRowToTable("<?php
+ print PrintReady($people["wife"]->getXref()) ; // pid = PID
+ ?>", "<?php
+ // if ($married>=0 && isset($nam[1])){
+ // echo PrintReady($fulmn); // nam = Married Name
+ // }else{
+ //print PrintReady($people["wife"]->getFullName()); // nam = Full Name
+ echo PrintReady($fulln);
+ // }
+ ?>", "<?php
+ if ($people["wife"]->getLabel() == ".") {
+ print PrintReady(i18n::translate('Step-Mother')); // label = Relationship
+ }else{
+ print PrintReady($people["wife"]->getLabel()); // label = Relationship
+ }
+ ?>", "<?php
+ print PrintReady($people["wife"]->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>=0 && isset($nam[1])){
+ echo "M"; // cond = Condition (Married)
+ }else{
+ echo "S"; // cond = Condition (Single)
+ }
+ ?>", "<?php
+ print PrintReady($people["wife"]->getbirthyear()); // yob = Year of Birth
+ ?>", "<?php
+ print PrintReady($censyear-$people["wife"]->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ print "Y"; // YMD
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($people["wife"]->getcensbirthplace()); // birthpl = Census Place of Birth
+ ?>");'>
+ <?php
+ //if ($married>=0 && isset($nam[1])){
+ // print PrintReady($fulmn); // Full Married Name
+ //} else {
+ print PrintReady($people["wife"]->getFullName()); // Full Name
+ //}
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ </tr>
+ <?php
+ }
+
+ // Children ---------------------
+ $styleadd = "";
+ if (isset($people["children"])) {
+ $elderdate = $family->getMarriageDate();
+ foreach($people["children"] as $key=>$child) {
+ $nam = $child->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+ $menu = new Menu("&nbsp;" . $child->getLabel() . "\n");
+ //$menu->addClass("", "", "submenu");
+ $slabel = print_pedigree_person_nav2($child->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $currpid, $censyear);
+ $slabel .= $spouselinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu); if (PrintReady($child->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($child->getDeathYear()); }
+ if (PrintReady($child->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($child->getBirthYear()); }
+ ?>
+ <tr>
+ <td width=75 align="left" class="optionbox">
+ <font size=1>
+ <?php if ($WT_MENUS_AS_LISTS) echo "<ul>\n";
+ $menu->printMenu();
+ if ($WT_MENUS_AS_LISTS) echo "</ul>\n";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value" >
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}")."\">";
+ echo $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ if ( ($child->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:opener.insertRowToTable("<?php
+ print PrintReady($child->getXref()) ; // pid = PID
+ ?>", "<?php
+ //print PrintReady($child->getFullName()); // nam = Name
+ echo PrintReady($fulln);
+ ?>", "<?php
+ print PrintReady($child->getLabel()); // label = Relationship
+ ?>", "<?php
+ print PrintReady($child->getSex()); // gend = Gender
+ ?>", "<?php
+ print ""; // cond = Condition (Married or Single)
+ ?>", "<?php
+ print PrintReady($child->getbirthyear()); // yob = Year of Birth
+ ?>", "<?php
+ print PrintReady($censyear-$child->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ print "Y"; // YMD
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($child->getcensbirthplace()); // birthpl = Census Place of Birth
+ ?>");'>
+ <?php print PrintReady($child->getFullName()); // Name
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ </tr>
+ <?php
+ //$elderdate = $child->getBirthDate(false);
+ }
+ }
+ }
+
+ print "<tr><td><font size=1><br /></font></td></tr>";
+
+ //-- Build Spouse Family ---------------------------------------------------
+ $families = $this->indi->getSpouseFamilies();
+ //$personcount = 0;
+ foreach($families as $famid=>$family) {
+ $people = $this->buildFamilyList($family, "spouse");
+ if ($this->indi->equals($people["husb"])) {
+ $spousetag = 'WIFE';
+ }else{
+ $spousetag = 'HUSB';
+ }
+ $marrdate = $family->getMarriageDate();
+
+ // Husband -------------------
+ if ( isset($people["husb"])) {
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $people["husb"]->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+ $menu = new Menu("&nbsp;" . $people["husb"]->getLabel() . "&nbsp;". "\n");
+ //$menu->addClass("", "", "submenu");
+ $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $currpid, $censyear);
+ $slabel .= $parentlinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu);
+ if (PrintReady($people["husb"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["husb"]->getDeathYear()); }
+ if (PrintReady($people["husb"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["husb"]->getBirthYear()); }
+ ?>
+ <tr class="fact_value">
+ <td width=75 align="left" class="optionbox">
+ <font size=1>
+ <?php
+ if ($people["husb"]->getXref()==$pid) {
+ print "&nbsp" .($people["husb"]->getLabel())." ".i18n::translate('Head of Household:');
+ }else{
+ if ($WT_MENUS_AS_LISTS) echo "<ul>\n";
+ $menu->printMenu();
+ if ($WT_MENUS_AS_LISTS) echo "</ul>\n";
+ }
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value" >
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom={$GEDCOM}")."\">";
+ echo $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value" >
+ <font size=1>
+ <?php
+ if ( ($people["husb"]->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:opener.insertRowToTable("<?php
+ print $people["husb"]->getXref() ; // pid = PID
+ ?>", "<?php
+ //print PrintReady($people["husb"]->getFullName()); // nam = Name
+ echo PrintReady($fulln);
+ ?>", "<?php
+ if ($people["husb"]->getXref()==$pid) {
+ print "Head"; // label = Relationship
+ }else{
+ print $people["husb"]->getLabel(); // label = Relationship
+ }
+ ?>", "<?php
+ print PrintReady($people["husb"]->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>=0){
+ echo "M"; // cond = Condition (Married)
+ }else{
+ echo "S"; // cond = Condition (Single)
+ }
+ ?>", "<?php
+ print PrintReady($people["husb"]->getbirthyear()); // yob = Year of Birth
+ ?>", "<?php
+ print PrintReady($censyear-$people["husb"]->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ print "Y"; // YMD
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($people["husb"]->getcensbirthplace()); // birthpl = Census Place of Birth
+ ?>");'>
+ <?php
+ print PrintReady($people["husb"]->getFullName()); // Name
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ <tr>
+ <?php
+ }
+
+
+ // Wife -------------------
+ //if ( isset($people["wife"]) && $spousetag == 'WIFE') {
+ if (isset($people["wife"])) {
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $people["wife"]->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }else{
+ $fulmn = $fulln;
+ $marn = $surn;
+ }
+ $menu = new Menu("&nbsp;" . $people["wife"]->getLabel() . "&nbsp;". "\n");
+ //$menu->addClass("", "", "submenu");
+ $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $currpid, $censyear);
+ $slabel .= $parentlinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubMenu($submenu);
+ if (PrintReady($people["wife"]->getDeathYear()) == 0) { $DeathYr = ""; }else{ $DeathYr = PrintReady($people["wife"]->getDeathYear()); }
+ if (PrintReady($people["wife"]->getBirthYear()) == 0) { $BirthYr = ""; }else{ $BirthYr = PrintReady($people["wife"]->getBirthYear()); }
+ ?>
+ <tr>
+ <td width=75 align="left" class="optionbox">
+ <font size=1>
+ <?php
+ if ($people["wife"]->getXref()==$pid) {
+ print "&nbsp" .($people["wife"]->getLabel())." ".i18n::translate('Head of Household:');
+ }else{
+ if ($WT_MENUS_AS_LISTS) echo "<ul>\n";
+ $menu->printMenu();
+ if ($WT_MENUS_AS_LISTS) echo "</ul>\n";
+ }
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom={$GEDCOM}")."\">";
+ echo $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ if ( ($people["wife"]->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:opener.insertRowToTable("<?php
+ print $people["wife"]->getXref() ; // pid = PID
+ ?>", "<?php
+ // if ($married>=0 && isset($nam[1])){
+ // echo PrintReady($fulmn); // nam = Full Married Name
+ // }else{
+ //print PrintReady($people["wife"]->getFullName()); // nam = Full Name
+ echo PrintReady($fulln);
+ // }
+ ?>", "<?php
+ if ($people["wife"]->getXref()==$pid) {
+ print "Head"; // label = Head
+ }else{
+ print PrintReady($people["wife"]->getLabel()); // label = Relationship
+ }
+ ?>", "<?php
+ print PrintReady($people["wife"]->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>=0 && isset($nam[1])){
+ echo "M"; // cond = Condition (Married)
+ }else{
+ echo "S"; // cond = Condition (Single)
+ }
+ ?>", "<?php
+ print PrintReady($people["wife"]->getbirthyear()); // yob = Year of Birth
+ ?>", "<?php
+ print PrintReady($censyear-$people["wife"]->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ print "Y"; // YMD
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($people["wife"]->getcensbirthplace()); // birthpl = Census Place of Birth
+ ?>");'>
+ <?php
+ //if ($married>=0 && isset($nam[1])){
+ // print PrintReady($fulmn); // Full Married Name
+ //} else {
+ print PrintReady($people["wife"]->getFullName()); // Full Name
+ //}
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ <tr> <?php
+ }
+
+ // Children
+ foreach($people["children"] as $key=>$child) {
+ // Get child's marriage status
+ $married="";
+ foreach ($child->getSpouseFamilies() as $childfamily) {
+ $tmp=$childfamily->getMarriageDate();
+ $married = GedcomDate::Compare($censdate, $tmp);
+ }
+ $nam = $child->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }else{
+ $fulmn = $fulln;
+ $marn = $surn;
+ }
+ $menu = new Menu("&nbsp;" . $child->getLabel() . "&nbsp;". "\n");
+ //$menu->addClass("", "", "submenu");
+ $slabel = print_pedigree_person_nav2($child->getXref(), 2, !$this->isPrintPreview(), 0, $personcount++, $child->getLabel(), $censyear);
+ $slabel .= $spouselinks;
+ $submenu = new Menu($slabel);
+ $menu->addSubmenu($submenu);
+ ?>
+ <tr>
+ <td width=75 align="left" class="optionbox" >
+ <font size=1>
+ <?php if ($WT_MENUS_AS_LISTS) echo "<ul>\n";
+ $menu->printMenu();
+ if ($WT_MENUS_AS_LISTS) echo "</ul>\n";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ print "<a href=\"".encode_url("edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$child->getXref()."&gedcom={$GEDCOM}")."\">";
+ echo $headImg2;
+ print "</a>";
+ ?>
+ </font>
+ </td>
+ <td align="left" class="facts_value">
+ <font size=1>
+ <?php
+ if ( ($child->canDisplayDetails()) ) {
+ ?>
+ <a href='javaScript:opener.insertRowToTable("<?php
+ print $child->getXref() ; // pid = PID
+ ?>", "<?php
+ // if ($married>0 && isset($nam[1])){
+ // echo PrintReady($fulmn); // nam = Full Married Name
+ // }else{
+ // print PrintReady($child->getFullName()); // nam = Full Name
+ echo PrintReady($fulln); // nam = Full Name
+ // }
+ ?>", "<?php
+ print PrintReady($child->getLabel()); // label = Relationship
+ ?>", "<?php
+ print PrintReady($child->getSex()); // gend = Gender
+ ?>", "<?php
+ if ($married>0) {
+ echo "M"; // cond = Condition (Married)
+ } else if ($married<0 || ($married=="0") ) {
+ echo "S"; // cond = Condition (Single)
+ } else {
+ echo ""; // cond = Condition (Not Known)
+ }
+ ?>", "<?php
+ print PrintReady($child->getbirthyear()); // yob = Year of Birth
+ ?>", "<?php
+ print PrintReady($censyear-$child->getbirthyear()); // age = Census Date minus YOB
+ ?>", "<?php
+ print "Y"; // YMD
+ ?>", "<?php
+ print ""; // occu = Occupation
+ ?>", "<?php
+ print PrintReady($child->getcensbirthplace()); // birthpl = Census Place of Birth
+ ?>");'>
+ <?php
+ // if ($married>=0 && isset($nam[1])){
+ // print PrintReady($fulmn); // Full Married Name
+ // } else {
+ print PrintReady($child->getFullName()); // Full Name
+ // }
+ ?>
+ </a>
+ <?php print "\n" ;
+ }else{
+ print i18n::translate('Private');
+ }
+ ?>
+ </font>
+ </td>
+ </tr>
+ <?php
+ }
+ print "<tr><td><font size=1><br /></font></td></tr>";
+ }
+ ?>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<?php
+// ==================================================================
+require_once WT_ROOT.'includes/functions/functions_charts.php';
+/**
+ * print the information for an individual chart box
+ *
+ * find and print a given individuals information for a pedigree chart
+ * @param string $pid the Gedcom Xref ID of the to print
+ * @param int $style the style to print the box in, 1 for smaller boxes, 2 for larger boxes
+ * @param boolean $show_famlink set to true to show the icons for the popup links and the zoomboxes
+ * @param int $count on some charts it is important to keep a count of how many boxes were printed
+ */
+function print_pedigree_person_nav2($pid, $style=1, $show_famlink=true, $count=0, $personcount="1", $currpid, $censyear) {
+ global $HIDE_LIVE_PEOPLE, $SHOW_LIVING_NAMES, $ZOOM_BOXES, $LINK_ICONS, $GEDCOM;
+ global $MULTI_MEDIA, $SHOW_HIGHLIGHT_IMAGES, $bwidth, $bheight, $PEDIGREE_FULL_DETAILS, $SHOW_ID_NUMBERS, $SHOW_PEDIGREE_PLACES;
+ global $CONTACT_EMAIL, $CONTACT_METHOD, $TEXT_DIRECTION, $DEFAULT_PEDIGREE_GENERATIONS, $OLD_PGENS, $talloffset, $PEDIGREE_LAYOUT, $MEDIA_DIRECTORY;
+ global $WT_IMAGE_DIR, $WT_IMAGES, $ABBREVIATE_CHART_LABELS, $USE_MEDIA_VIEWER;
+ global $chart_style, $box_width, $generations, $show_spouse, $show_full;
+ global $CHART_BOX_TAGS, $SHOW_LDS_AT_GLANCE, $PEDIGREE_SHOW_GENDER;
+ global $SEARCH_SPIDER;
+
+ global $spouselinks, $parentlinks, $step_parentlinks, $persons, $person_step, $person_parent, $tabno, $theme_name, $spousetag;
+ global $natdad, $natmom, $censyear, $censdate;
+
+ if ($style != 2) $style=1;
+ if (empty($show_full)) $show_full = 0;
+ if (empty($PEDIGREE_FULL_DETAILS)) $PEDIGREE_FULL_DETAILS = 0;
+
+ if (!isset($OLD_PGENS)) $OLD_PGENS = $DEFAULT_PEDIGREE_GENERATIONS;
+ if (!isset($talloffset)) $talloffset = $PEDIGREE_LAYOUT;
+
+ $person=Person::getInstance($pid);
+ if ($pid==false || empty($person)) {
+ $spouselinks = false;
+ $parentlinks = false;
+ $step_parentlinks = false;
+ }
+
+ $tmp=array('M'=>'','F'=>'F', 'U'=>'NN');
+ $isF=$tmp[$person->getSex()];
+ $spouselinks = "";
+ $parentlinks = "";
+ $step_parentlinks = "";
+ $disp=$person->canDisplayDetails();
+
+ if ($person->canDisplayName()) {
+ if ($show_famlink && (empty($SEARCH_SPIDER))) {
+ if ($LINK_ICONS!="disabled") {
+ //-- draw a box for the family popup
+ if ($TEXT_DIRECTION=="rtl") {
+ $spouselinks .= "\n\t\t\t<table id=\"flyoutFamRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">";
+ $spouselinks .= "<b>" . i18n::translate('Family') . "</b> (" .$person->getFullName(). ")<br />";
+ $parentlinks .= "\n\t\t\t<table id=\"flyoutParRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">";
+ $parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />";
+ $step_parentlinks .= "\n\t\t\t<table id=\"flyoutStepRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">";
+ $step_parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />";
+ }else{
+ $spouselinks .= "\n\t\t\t<table id=\"flyoutFam\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">";
+ $spouselinks .= "<b>" . i18n::translate('Family') . "</b> (" .$person->getFullName(). ")<br />";
+ $parentlinks .= "\n\t\t\t<table id=\"flyoutPar\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">";
+ $parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />";
+ $step_parentlinks .= "\n\t\t\t<table id=\"flyoutStep\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">";
+ $step_parentlinks .= "<b>" . i18n::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />";
+ }
+ $persons = "";
+ $person_parent = "";
+ $person_step = "";
+
+ //-- parent families --------------------------------------
+ $fams = $person->getChildFamilies();
+ foreach($fams as $famid=>$family) {
+
+ if (!is_null($family)) {
+ $husb = $family->getHusband($person);
+ $wife = $family->getWife($person);
+ // $spouse = $family->getSpouse($person);
+ $children = $family->getChildren();
+ $num = count($children);
+ $marrdate = $family->getMarriageDate();
+
+ // Husband ------------------------------
+ if ($husb || $num>0) {
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Family Book Chart').": ".$famid;
+ }else{
+ $title = $famid." :".i18n::translate('Family Book Chart');
+ }
+ if ($husb) {
+ $person_parent="Yes";
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Individual Information').": ".$husb->getXref();
+ }else{
+ $title = $husb->getXref()." :".i18n::translate('Individual Information');
+ }
+ $tmp=$husb->getXref();
+ if ($husb->canDisplayName()) {
+ $nam = $husb->getAllNames();
+ // $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surn'];
+ $fulln = $husb->getFullName();
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surn'];
+ if (isset($nam[1]) ) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surn'];
+ $marn = $nam[1]['surn'];
+ }
+ $parentlinks .= "<a href=\"javascript:opener.insertRowToTable(";
+ $parentlinks .= "'".PrintReady($husb->getXref())."', "; // pid = PID
+ $parentlinks .= "'".PrintReady($fulln)."', "; // nam = Name
+ if ($currpid=="Wife" || $currpid=="Husband") {
+ $parentlinks .= "'Father in Law', "; // label = 1st Gen Male Relationship
+ }else{
+ $parentlinks .= "'Grand-Father', "; // label = 2st Gen Male Relationship
+ }
+ $parentlinks .= "'".PrintReady($husb->getSex())."', "; // sex = Gender
+ $parentlinks .= "''".", "; // cond = Condition (Married etc)
+ $parentlinks .= "'".PrintReady($husb->getbirthyear())."', "; // yob = Year of Birth
+ if ($husb->getbirthyear()>=1) {
+ $parentlinks .= "'".PrintReady($censyear-$husb->getbirthyear())."', "; // age = Census Year - Year of Birth
+ }else{
+ $parentlinks .= "''".", "; // age = Undefined
+ }
+ $parentlinks .= "'Y'".", "; // Y/M/D = Age in Years/Months/Days
+ $parentlinks .= "''".", "; // occu = Occupation
+ $parentlinks .= "'".PrintReady($husb->getcensbirthplace())."'"; // birthpl = Birthplace
+ $parentlinks .= ");\">";
+ $parentlinks .= PrintReady($husb->getFullName());
+ $parentlinks .= "</a>";
+
+ }else{
+ $parentlinks .= i18n::translate('Private');
+ }
+ $parentlinks .= "\n";
+ $natdad = "yes";
+ }
+ }
+
+ // Wife ------------------------------
+ if ($wife || $num>0) {
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Family Book Chart').": ".$famid;
+ }else{
+ $title = $famid." :".i18n::translate('Family Book Chart');
+ }
+ if ($wife) {
+ $person_parent="Yes";
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Individual Information').": ".$wife->getXref();
+ }else{
+ $title = $wife->getXref()." :".i18n::translate('Individual Information');
+ }
+ $tmp=$wife->getXref();
+ if ($wife->canDisplayName()) {
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $wife->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ //$fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $fulmn = $nam[1]['fullNN'];
+ $marn = $nam[1]['surname'];
+ }
+ $parentlinks .= "<a href=\"javascript:opener.insertRowToTable(";
+ $parentlinks .= "'".PrintReady($wife->getXref())."',"; // pid = PID
+ // $parentlinks .= "'".PrintReady($fulln)."',"; // nam = Name
+
+ //if ($married>=0 && isset($nam[1])){
+ // $parentlinks .= "'".PrintReady($fulmn)."',"; // nam = Full Married Name
+ //} else {
+ $parentlinks .= "'".PrintReady($fulln)."',"; // nam = Full Name
+ //}
+
+ if ($currpid=="Wife" || $currpid=="Husband") {
+ $parentlinks .= "'Mother in Law',"; // label = 1st Gen Female Relationship
+ }else{
+ $parentlinks .= "'Grand-Mother',"; // label = 2st Gen Female Relationship
+ }
+ $parentlinks .= "'".PrintReady($wife->getSex())."',"; // sex = Gender
+ $parentlinks .= "''".","; // cond = Condition (Married etc)
+ $parentlinks .= "'".PrintReady($wife->getbirthyear())."',"; // yob = Year of Birth
+ if ($wife->getbirthyear()>=1) {
+ $parentlinks .= "'".PrintReady($censyear-$wife->getbirthyear())."',"; // age = Census Year - Year of Birth
+ }else{
+ $parentlinks .= "''".","; // age = Undefined
+ }
+ $parentlinks .= "'Y'".","; // Y/M/D = Age in Years/Months/Days
+ $parentlinks .= "''".","; // occu = Occupation
+ $parentlinks .= "'".PrintReady($wife->getcensbirthplace())."'"; // birthpl = Birthplace
+ //$parentlinks .= ");\"><div id='wifePar'>";
+ $parentlinks .= ");\">";
+ //if ($married>=0 && isset($nam[1])){
+ // $parentlinks .= $fulmn; // Full Married Name
+ //} else {
+ $parentlinks .= PrintReady($wife->getFullName()); // Full Name
+ //}
+ // $parentlinks .= "</div></a>";
+ $parentlinks .= "</a>";
+ }else{
+ $parentlinks .= i18n::translate('Private');
+ }
+ $parentlinks .= "<br />\n";
+ $natmom = "yes";
+ }
+ }
+ }
+ }
+
+ //-- step families -----------------------------------------
+ $fams = $person->getStepFamilies();
+ foreach($fams as $famid=>$family) {
+ if (!is_null($family)) {
+ $husb = $family->getHusband($person);
+ $wife = $family->getWife($person);
+ // $spouse = $family->getSpouse($person);
+ $children = $family->getChildren();
+ $num = count($children);
+ $marrdate = $family->getMarriageDate();
+
+ if ($natdad == "yes") {
+ }else{
+ // Husband -----------------------
+ if ( ($husb || $num>0) && $husb->getLabel() != "." ) {
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Family Book Chart').": ".$famid;
+ }else{
+ $title = $famid." :".i18n::translate('Family Book Chart');
+ }
+ if ($husb) {
+ $person_step="Yes";
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Individual Information').": ".$husb->getXref();
+ }else{
+ $title = $husb->getXref()." :".i18n::translate('Individual Information');
+ }
+ $tmp=$husb->getXref();
+ if ($husb->canDisplayName()) {
+ $nam = $husb->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ //$fulln = $husb->getFullName();
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+
+ $parentlinks .= "<a href=\"".encode_url("individual.php?pid={$tmp}&amp;tab={$tabno}&amp;gedcom={$GEDCOM}")."\">";
+ $parentlinks .= PrintReady($husb->getFullName());
+ $parentlinks .= "</a>";
+ }else{
+ $parentlinks .= i18n::translate('Private');
+ }
+ $parentlinks .= "<br />\n";
+ }
+ }
+ }
+
+ if ($natmom == "yes") {
+ }else{
+ // Wife ----------------------------
+ if ($wife || $num>0) {
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Family Book Chart').": ".$famid;
+ }else{
+ $title = $famid." :".i18n::translate('Family Book Chart');
+ }
+ if ($wife) {
+ $person_step="Yes";
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Individual Information').": ".$wife->getXref();
+ }else{
+ $title = $wife->getXref()." :".i18n::translate('Individual Information');
+ }
+ $tmp=$wife->getXref();
+ if ($wife->canDisplayName()) {
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $wife->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+ $parentlinks .= "<a href=\"".encode_url("individual.php?pid={$tmp}&amp;tab={$tabno}&amp;gedcom={$GEDCOM}")."\">";
+ $parentlinks .= PrintReady($wife->getFullName());
+ $parentlinks .= "</a>";
+ }else{
+ $parentlinks .= i18n::translate('Private');
+ }
+ $parentlinks .= "<br />\n";
+ }
+ }
+ }
+ }
+ }
+
+ // Spouse Families -------------------------------------- @var $family Family
+ $fams = $person->getSpouseFamilies();
+ foreach($fams as $famid=>$family) {
+ if (!is_null($family)) {
+ $spouse = $family->getSpouse($person);
+ $children = $family->getChildren();
+ $num = count($children);
+ $marrdate = $family->getMarriageDate();
+
+ // Spouse ------------------------------
+ if ($spouse || $num>0) {
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Family Book Chart').": ".$famid;
+ }else{
+ $title = $famid." :".i18n::translate('Family Book Chart');
+ }
+ if ($spouse) {
+ if ($TEXT_DIRECTION=="ltr") {
+ $title = i18n::translate('Individual Information').": ".$spouse->getXref();
+ }else{
+ $title = $spouse->getXref()." :".i18n::translate('Individual Information');
+ }
+ $tmp=$spouse->getXref();
+ if ($spouse->canDisplayName()) {
+ $married = GedcomDate::Compare($censdate, $marrdate);
+ $nam = $spouse->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+ $spouselinks .= "<a href=\"javascript:opener.insertRowToTable(";
+ $spouselinks .= "'".PrintReady($spouse->getXref())."',"; // pid = PID
+ //$spouselinks .= "'".PrintReady($fulln)."',"; // nam = Name
+ //if ($married>=0 && isset($nam[1])){
+ // $spouselinks .= "'".PrintReady($fulmn)."',"; // Full Married Name
+ //} else {
+ $spouselinks .= "'".PrintReady($spouse->getFullName())."',"; // Full Name
+ //}
+ if ($currpid=="Son" || $currpid=="Daughter") {
+ if ($spouse->getSex()=="M") {
+ $spouselinks .= "'Son in Law',"; // label = Male Relationship
+ }else{
+ $spouselinks .= "'Daughter in Law',"; // label = Female Relationship
+ }
+ }else{
+ if ($spouse->getSex()=="M") {
+ $spouselinks .= "'Brother in Law',"; // label = Male Relationship
+ }else{
+ $spouselinks .= "'Sister in Law',"; // label = Female Relationship
+ }
+ }
+ $spouselinks .= "'".PrintReady($spouse->getSex())."',"; // sex = Gender
+ $spouselinks .= "''".","; // cond = Condition (Married etc)
+ $spouselinks .= "'".PrintReady($spouse->getbirthyear())."',"; // yob = Year of Birth
+ if ($spouse->getbirthyear()>=1) {
+ $spouselinks .= "'".PrintReady($censyear-$spouse->getbirthyear())."',"; // age = Census Year - Year of Birth
+ }else{
+ $spouselinks .= "''".","; // age = Undefined
+ }
+ $spouselinks .= "'Y'".","; // Y/M/D = Age in Years/Months/Days
+ $spouselinks .= "''".","; // occu = Occupation
+ $spouselinks .= "'".PrintReady($spouse->getcensbirthplace())."'"; // birthpl = Birthplace
+ $spouselinks .= ");\">";
+ // $spouselinks .= PrintReady($fulln);
+ //if ($married>=0 && isset($nam[1])){
+ // $spouselinks .= "'".PrintReady($fulmn)."',"; // Full Married Name
+ //} else {
+ $spouselinks .= PrintReady($spouse->getFullName()); // Full Name
+ //}
+ $spouselinks .= "</a>";
+ }else{
+ $spouselinks .= i18n::translate('Private');
+ }
+ $spouselinks .= "</a>";
+ if ($spouse->getFullName() != "") {
+ $persons = "Yes";
+ }
+ }
+ }
+
+ // Children ------------------------------ @var $child Person
+ $spouselinks .= "<div id='spouseFam'>";
+ $spouselinks .= "<ul class=\"clist ".$TEXT_DIRECTION."\">\n";
+ foreach($children as $c=>$child) {
+ $cpid = $child->getXref();
+ if ($child) {
+ $persons="Yes";
+ $title = i18n::translate('Individual Information').": ".$cpid;
+ if ($child->canDisplayName()) {
+ $nam = $child->getAllNames();
+ $fulln = rtrim($nam[0]['givn'],'*')."&nbsp;".$nam[0]['surname'];
+ $givn = rtrim($nam[0]['givn'],'*');
+ $surn = $nam[0]['surname'];
+ if (isset($nam[1])) {
+ $fulmn = rtrim($nam[1]['givn'],'*')."&nbsp;".$nam[1]['surname'];
+ $marn = $nam[1]['surname'];
+ }
+ $spouselinks .= "<li>";
+ $spouselinks .= "<a href=\"javascript:opener.insertRowToTable(";
+ $spouselinks .= "'".PrintReady($child->getXref())."',"; // pid = PID
+ //$spouselinks .= "'".PrintReady($child->getFullName())."',"; // nam = Name
+ $spouselinks .= "'".PrintReady($fulln)."',"; // nam = Name
+ if ($currpid=="Son" || $currpid=="Daughter") {
+ if ($child->getSex()=="M") {
+ $spouselinks .= "'Grand-Son',"; // label = Male Relationship
+ }else{
+ $spouselinks .= "'Grand-Daughter',"; // label = Female Relationship
+ }
+ }else{
+ if ($child->getSex()=="M") {
+ $spouselinks .= "'Nephew',"; // label = Male Relationship
+ }else{
+ $spouselinks .= "'Niece',"; // label = Female Relationship
+ }
+ }
+ $spouselinks .= "'".PrintReady($child->getSex())."',"; // sex = Gender
+ $spouselinks .= "''".","; // cond = Condition (Married etc)
+ $spouselinks .= "'".PrintReady($child->getbirthyear())."',"; // yob = Year of Birth
+ if ($child->getbirthyear()>=1) {
+ $spouselinks .= "'".PrintReady($censyear-$child->getbirthyear())."',"; // age = Census Year - Year of Birth
+ }else{
+ $spouselinks .= "''".","; // age = Undefined
+ }
+ $spouselinks .= "'Y'".","; // Y/M/D = Age in Years/Months/Days
+ $spouselinks .= "''".","; // occu = Occupation
+ $spouselinks .= "'".PrintReady($child->getcensbirthplace())."'"; // birthpl = Birthplace
+ $spouselinks .= ");\">";
+ $spouselinks .= PrintReady($child->getFullName()); // Full Name
+ $spouselinks .= "</a>";
+ }else{
+ $spouselinks .= i18n::translate('Private');
+ }
+ $spouselinks .= "</li>\n";
+ }
+ }
+ $spouselinks .= "</ul>\n";
+ $spouselinks .= "</div>";
+ }
+ }
+
+ if ($persons != "Yes") {
+ $spouselinks .= "(" . i18n::translate('None') . ")</td></tr></table>\n\t\t";
+ }else{
+ $spouselinks .= "</td></tr></table>\n\t\t";
+ }
+
+ if ($person_parent != "Yes") {
+ $parentlinks .= "(" . i18n::translate('unknown') . ")</td></tr></table>\n\t\t";
+ }else{
+ $parentlinks .= "</td></tr></table>\n\t\t";
+ }
+
+ if ($person_step != "Yes") {
+ $step_parentlinks .= "(" . i18n::translate('unknown') . ")</td></tr></table>\n\t\t";
+ }else{
+ $step_parentlinks .= "</td></tr></table>\n\t\t";
+ }
+ }
+ }
+ }
+}
+// ==============================================================
+?>
diff --git a/modules/GEDFact_assistant/_MEDIA/media_5_input.js b/modules/GEDFact_assistant/_MEDIA/media_5_input.js
new file mode 100644
index 0000000000..81d4a11cf8
--- /dev/null
+++ b/modules/GEDFact_assistant/_MEDIA/media_5_input.js
@@ -0,0 +1,340 @@
+/**
+ * Media Link Assistant Control module for phpGedView
+ *
+ * Media Link information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2008 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Census Assistant
+ * @version $Id$
+*/
+
+var INPUT_NAME_PREFIX = 'InputCell_'; // this is being set via script
+var RADIO_NAME = "totallyrad"; // this is being set via script
+var TABLE_NAME = 'addlinkQueue'; // this should be named in the HTML
+var ROW_BASE = 1; // first number (for display)
+var hasLoaded = false;
+
+window.onload=fillInRows;
+
+function fillInRows()
+{
+ hasLoaded = true;
+ //insertRowToTable();
+ //addRowToTable();
+}
+
+// CONFIG:
+// myRowObject is an object for storing information about the table rows
+//function myRowObject(zero, one, two, three, four, five, six, seven, eight, nine, ten, cb, ra)
+function myRowObject(zero, one, two, cb, ra)
+{
+ this.zero = zero; // text object
+ this.one = one; // input text object
+ this.two = two; // input text object
+
+ this.cb = cb; // input checkbox object
+ this.ra = ra; // input radio object
+}
+
+/*
+ * insertRowToTable
+ * Insert and reorder
+ */
+//function insertRowToTable(pid, nam, label, gend, cond, yob, age, YMD, occu, birthpl)
+function insertRowToTable(pid, nam, head)
+{
+ if (hasLoaded) {
+
+ var tbl = document.getElementById(TABLE_NAME);
+ var rowToInsertAt = "";
+
+ // Get links list ====================================
+ var links = document.getElementById('existLinkTbl');
+ var numrows = links.rows.length;
+ var strRow = '';
+ for (var i=1; i<numrows; i++) {
+ if (IE) {
+ strRow += (strRow==''?'':', ') + links.rows[i].cells[1].innerText;
+ }else{
+ strRow += (strRow==''?'':', ') + links.rows[i].cells[1].textContent;
+ }
+ }
+ strRow += (strRow==''?'':', ');
+
+ //Check if id exists in Links list =================================
+ if (strRow.match(pid+',')!= pid+',') {
+ // alert('NO MATCH');
+ }else{
+ rowToInsertAt = 'EXIST' ;
+ }
+
+ // Check if id exists in "Add links" list ==========================
+ for (var i=0; i<tbl.tBodies[0].rows.length; i++) {
+ if (tbl.tBodies[0].rows[i].myRow.one.textContent==pid) {
+ rowToInsertAt = 'EXIST' ;
+ }else
+ if (tbl.tBodies[0].rows[i].myRow && tbl.tBodies[0].rows[i].myRow.ra.getAttribute('type') == 'radio' && tbl.tBodies[0].rows[i].myRow.ra.checked) {
+ rowToInsertAt = i;
+ break;
+ }
+ }
+
+ // If Link does not exist then add it, or show alert ===============
+ if (rowToInsertAt!='EXIST') {
+ rowToInsertAt = i;
+ //addRowToTable(rowToInsertAt, pid, nam, label, gend, cond, yob, age, YMD, occu, birthpl);
+ addRowToTable(rowToInsertAt, pid, nam, head);
+ reorderRows(tbl, rowToInsertAt);
+ }else{
+ alert(nam+' ('+pid+') - '+linkExists);
+ }
+
+ }
+}
+
+function removeHTMLTags(htmlString)
+{
+ if(htmlString) {
+ var mydiv = document.createElement("div");
+ mydiv.innerHTML = htmlString;
+ if (document.all) // IE Stuff
+ {
+ return mydiv.innerText;
+ }
+ else // Mozilla does not work with innerText
+ {
+ return mydiv.textContent;
+ }
+ }
+}
+
+/*
+ * addRowToTable
+ * Inserts at row 'num', or appends to the end if no arguments are passed in. Don't pass in empty strings.
+ */
+// function addRowToTable(num, pid, nam, label, gend, cond, yob, age, YMD, occu, birthpl)
+function addRowToTable(num, pid, nam, head)
+{
+ if (hasLoaded) {
+ var tbl = document.getElementById(TABLE_NAME);
+ var nextRow = tbl.tBodies[0].rows.length;
+ var iteration = nextRow + ROW_BASE;
+ // var txtcolor = "#888888";
+
+ if (num == null) {
+ num = nextRow;
+ } else {
+ iteration = num + ROW_BASE;
+ }
+
+ // add the row
+ var row = tbl.tBodies[0].insertRow(num);
+
+ // CONFIG: requires classe
+ row.className = 'descriptionbox';
+
+ // CONFIG: This whole section can be configured
+
+ // cell 0 - Count
+ var cell0 = row.insertCell(0);
+ cell0.style.fontSize="11px";
+ var textNode = document.createTextNode(iteration);
+ cell0.appendChild(textNode);
+
+ // cell 1 - ID:
+ var cell1 = row.insertCell(1);
+ // cell1.setAttribute('align', 'left');
+ if ( pid == ''){
+ var txtInp1 = document.createElement('div');
+ txtInp1.setAttribute('type', 'checkbox');
+ if (txtInp1.checked!=''){
+ txtInp1.setAttribute('value', 'no');
+ }else{
+ txtInp1.setAttribute('value', 'add');
+ }
+ }else{
+ var txtInp1 = document.createElement('div');
+ txtInp1.setAttribute('type', 'text');
+ txtInp1.innerHTML = pid; // Required for IE
+ txtInp1.textContent = pid;
+ }
+ txtInp1.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_1');
+ txtInp1.style.color=txtcolor;
+ txtInp1.style.background='transparent';
+ txtInp1.style.border='0px';
+ txtInp1.style.fontSize="11px";
+ cell1.appendChild(txtInp1);
+
+ // cell 2 - Name
+ var cell2 = row.insertCell(2);
+ // cell2.setAttribute('align', 'left');
+ var txtInp2 = document.createElement('div');
+ txtInp2.setAttribute('type', 'text');
+ txtInp2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_2');
+ txtInp2.style.color=txtcolor;
+ txtInp2.style.background='transparent';
+ txtInp2.style.border='0px';
+ txtInp2.style.fontSize="11px";
+ txtInp2.innerHTML = unescape(removeHTMLTags(nam)); //Required for IE
+ txtInp2.textContent = unescape(removeHTMLTags(nam));
+ cell2.appendChild(txtInp2);
+
+ // cell btn - remove img button
+ var cellbtn = row.insertCell(3);
+ cellbtn.setAttribute('align', 'center');
+ var btnEl = document.createElement('img');
+ btnEl.setAttribute('type', 'img');
+ btnEl.setAttribute('src', imageDir+'/remove.gif');
+ btnEl.setAttribute('alt', remove);
+ btnEl.setAttribute('title', remove);
+ btnEl.setAttribute('height', '13px');
+ btnEl.onclick = function () {deleteCurrentRow(this)};
+ cellbtn.appendChild(btnEl);
+
+ // cell btn - family img button
+ var cellbtn2 = row.insertCell(4);
+ cellbtn2.setAttribute('align', 'center');
+ if (pid.match("I")=="I" || pid.match("i")=="i") {
+ var btn2El = document.createElement('img');
+ btn2El.setAttribute('type', 'img');
+ btn2El.setAttribute('src', imageDir+'/buttons/family.gif');
+ btn2El.setAttribute('alt', ifamily);
+ btn2El.setAttribute('title', ifamily);
+ btn2El.onclick = function () {openFamNav(pid)};
+ cellbtn2.appendChild(btn2El);
+ }else if (pid.match("F")=="F" || pid.match("f")=="f") {
+ var btn2El = document.createElement('img');
+ btn2El.setAttribute('type', 'img');
+ btn2El.setAttribute('src', imageDir+'/buttons/family.gif');
+ btn2El.setAttribute('alt', ifamily);
+ btn2El.setAttribute('title', ifamily);
+ btn2El.onclick = function () {openFamNav(head)};
+ cellbtn2.appendChild(btn2El);
+ }else{
+ // Show No Icon
+ }
+
+ // cell cb - input checkbox
+ var cbEl = document.createElement('input');
+ cbEl.type = "hidden";
+
+ // cell ra - input radio
+ //var cellra = row.insertCell(5);
+ var cellra = document.createElement('input');
+ cellra.type = "hidden";
+
+ // Pass in the elements you want to reference later
+ // Store the myRow object in each row
+ row.myRow = new myRowObject(textNode, txtInp1, txtInp2, cbEl, cellra);
+ }
+}
+
+// CONFIG: this entire function is affected by myRowObject settings
+// If there isn't a checkbox in your row, then this function can't be used.
+function deleteChecked()
+{
+ if (hasLoaded) {
+ var checkedObjArray = new Array();
+ var cCount = 0;
+
+ var tbl = document.getElementById(TABLE_NAME);
+ for (var i=0; i<tbl.tBodies[0].rows.length; i++) {
+ if (tbl.tBodies[0].rows[i].myRow && tbl.tBodies[0].rows[i].myRow.cb.getAttribute('type') == 'checkbox' && tbl.tBodies[0].rows[i].myRow.cb.checked) {
+ checkedObjArray[cCount] = tbl.tBodies[0].rows[i];
+ cCount++;
+ }
+ }
+ if (checkedObjArray.length > 0) {
+ var rIndex = checkedObjArray[0].sectionRowIndex;
+ deleteRows(checkedObjArray);
+ reorderRows(tbl, rIndex);
+ }
+ }
+}
+
+// If there isn't an element with an onclick event in your row, then this function can't be used.
+function deleteCurrentRow(obj)
+{
+ if (hasLoaded) {
+ var delRow = obj.parentNode.parentNode;
+ var tbl = delRow.parentNode.parentNode;
+ var rIndex = delRow.sectionRowIndex;
+ var rowArray = new Array(delRow);
+ deleteRows(rowArray);
+ reorderRows(tbl, rIndex);
+ }
+}
+
+function reorderRows(tbl, startingIndex)
+{
+ if (hasLoaded) {
+ if (tbl.tBodies[0].rows[startingIndex]) {
+ var count = startingIndex + ROW_BASE;
+ for (var i=startingIndex; i<tbl.tBodies[0].rows.length; i++) {
+
+ // CONFIG: next line is affected by myRowObject settings
+ tbl.tBodies[0].rows[i].myRow.zero.data = count; // text
+
+ tbl.tBodies[0].rows[i].myRow.one.id = INPUT_NAME_PREFIX + count + '_1'; // input text
+ tbl.tBodies[0].rows[i].myRow.two.id = INPUT_NAME_PREFIX + count + '_2'; // input text
+
+ tbl.tBodies[0].rows[i].myRow.one.name = INPUT_NAME_PREFIX + count + '_1'; // input text
+ tbl.tBodies[0].rows[i].myRow.two.name = INPUT_NAME_PREFIX + count + '_2'; // input text
+
+ // tbl.tBodies[0].rows[i].myRow.cb.value = count; // input checkbox
+ tbl.tBodies[0].rows[i].myRow.ra.value = count; // input radio
+
+ // CONFIG: requires class named classy0 and classy1
+ tbl.tBodies[0].rows[i].className = 'classy' + (count % 2);
+
+ count++;
+ }
+ }
+ }
+}
+
+function deleteRows(rowObjArray)
+{
+ if (hasLoaded) {
+ for (var i=0; i<rowObjArray.length; i++) {
+ var rIndex = rowObjArray[i].sectionRowIndex;
+ rowObjArray[i].parentNode.deleteRow(rIndex);
+ }
+ }
+}
+
+function openInNewWindow(frm)
+{
+ // open a blank window
+ var aWindow = window.open('', 'TableAddRow2NewWindow',
+ 'scrollbars=yes,menubar=yes,resizable=yes,location=no,toolbar=no,width=550,height=700');
+ aWindow.focus();
+
+ // set the target to the blank window
+ frm.target = 'TableAddRow2NewWindow';
+
+ // submit
+ frm.submit();
+}
+
+
diff --git a/modules/GEDFact_assistant/_MEDIA/media_5_input.php b/modules/GEDFact_assistant/_MEDIA/media_5_input.php
new file mode 100644
index 0000000000..b3745e402f
--- /dev/null
+++ b/modules/GEDFact_assistant/_MEDIA/media_5_input.php
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Media Link Assistant Control module for phpGedView
+ *
+ * Media Link information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2008 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Census Assistant
+ * @version $Id$
+ */
+
+?>
+<?php if ($THEME_DIR=="themes/simplygreen/" || $THEME_DIR=="themes/simplyred/" || $THEME_DIR=="themes/simplyblue/") { ?>
+ <script>
+ var txtcolor="#ffffff";
+ </script>
+<?php }else{ ?>
+ <script>
+ var txtcolor="#000000";
+ </script>
+<?php } ?>
+
+<?php if ($THEME_DIR=="themes/simplygreen/" || $THEME_DIR=="themes/simplyred/" || $THEME_DIR=="themes/simplyblue/") { ?>
+ <style type="text/css">
+ <!--
+ #addlinkQueue td, th { padding: 0.2em; }
+ .classy0 { font-family: Verdana, Arial, Helvetica, sans-serif; background-color: transparent; color: #ffffff; font-size: 10px; }
+ .classy1 { font-family: Verdana, Arial, Helvetica, sans-serif; background-color: transparent; color: #ffffff; font-size: 10px; }
+ -->
+ </style>
+<?php }else{ ?>
+ <style type="text/css">
+ <!--
+ #addlinkQueue td, th { padding: 0.2em; }
+ .classy0 { font-family: Verdana, Arial, Helvetica, sans-serif; background-color: transparent; color: #000000; font-size: 10px; }
+ .classy1 { font-family: Verdana, Arial, Helvetica, sans-serif; background-color: transparent; color: #000000; font-size: 10px; }
+ -->
+ </style>
+<?php }
+
+// Various JavaScript variables required --------------------------------- ?>
+<script language="javascript" type="text/javascript">
+ var ifamily = "<?php echo i18n::translate('Open Family Navigator'); ?>";
+ var remove = "<?php echo i18n::translate('Remove'); ?>";
+ var linkExists = "<?php echo i18n::translate('This link already exists'); ?>";
+ var imageDir = "<?php echo $WT_IMAGE_DIR; ?>";
+</script>
+
+<?php
+echo '<script src="modules/GEDFact_assistant/_MEDIA/media_5_input.js" type="text/javascript"></script>';
+?>
+
+ <table width="430" border="0" cellspacing="1" id="addlinkQueue">
+ <thead>
+ <tr>
+ <th class="topbottombar" width="10" style="font-weight:100;" align="left">#</th>
+ <th class="topbottombar" width="55" style="font-weight:100;" align="left">ID:</th>
+ <th class="topbottombar" width="370" style="font-weight:100;" align="left"><?php echo i18n::translate('Name');?></th>
+ <th class="topbottombar" width="20" style="font-weight:100;" align="left"><?php echo i18n::translate('Remove');?></th>
+ <th class="topbottombar" width="20" style="font-weight:100;" align="left"><?php echo i18n::translate('Navigator');?></th>
+ </tr>
+ </thead>
+ <tbody></tbody>
+ <tr><td></td></tr>
+ </table>
+
+
diff --git a/modules/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php b/modules/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php
new file mode 100644
index 0000000000..fa53c7fa14
--- /dev/null
+++ b/modules/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php
@@ -0,0 +1,116 @@
+<?php
+/**
+ * Media Link Assistant Control module for phpGedView
+ *
+ * Media Link information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2008 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Census Assistant
+ * @version $Id$
+ */
+?>
+
+<script>
+function parseAddLinks() {
+ str = "";
+ var tbl = document.getElementById('addlinkQueue');
+ for(var i=1; i<tbl.rows.length; i++){ // start at i=1 because we need to avoid header
+ var tr = tbl.rows[i];
+ var strRow = '';
+ for(var j=1; j<tr.cells.length; j++){ // Start at col 1 (j=1)
+ if (j>=2) {
+ // dont show col 0 index
+ // SHOW col 1 id
+ // miss out col 2 name
+ // miss out col 3 relationship
+ // miss out col 4 delete button
+ continue;
+ }else{
+ if (IE) {
+ strRow += (strRow==''?'':'') + tr.cells[j].childNodes[0].innerHTML;
+ }else{
+ strRow += (strRow==''?'':'') + tr.cells[j].childNodes[0].textContent;
+ }
+ }
+ }
+ str += (str==''?'':', ') + strRow;
+ }
+ // str += (str==''?'':'' '); // Adds just final single quote at end of string (\')
+}
+
+function parseRemLinks() {
+ remstr = "";
+ var tbl = document.getElementById('existLinkTbl');
+ for(var i=1; i<tbl.rows.length; i++){ // start at i=1 because we need to avoid header
+ var remtr = tbl.rows[i];
+ var remstrRow = '';
+ for(var j=1; j<remtr.cells.length; j++){ // Start at col 1 (j=1)
+ if (j!=4 ) {
+ // dont show col 0 index
+ // miss out col 2 name
+ // miss out col 3 keep radio button
+ // choose col 4 remove radio button
+ continue;
+ }else{
+ if (remtr.cells[j].childNodes[0].checked) {
+ remstrRow += (remstrRow==''?'':'') + remtr.cells[j].childNodes[0].name + ', ';
+ }
+ }
+ }
+ remstr += (remstr==''?'':'') + remstrRow;
+ }
+ // remstr += (remstr==''?'':','); // Adds just final comma at end of string (\')
+}
+
+function preview() {
+ parseAddLinks();
+ alert (str);
+}
+
+function shiftlinks() {
+
+ parseRemLinks();
+ // alert('remstring = '+ remstr);
+ if (remstr) {
+ document.link.exist_links.value = remstr;
+ }
+
+ parseAddLinks();
+ // alert('string = '+ str);
+ if (str) {
+ document.link.more_links.value = str;
+ }else{
+ // leave hidden input morelinks as "No Values"
+ var inputField = document.getElementById('gid');
+ // alert(inputField.value)
+ if (inputField) {
+ document.link.more_links.value = inputField.value+',';
+ }
+ }
+ if (winNav) {
+ winNav.close();
+ }
+}
+
+
+</script> \ No newline at end of file
diff --git a/modules/GEDFact_assistant/_MEDIA/media_query_1a.php b/modules/GEDFact_assistant/_MEDIA/media_query_1a.php
new file mode 100644
index 0000000000..b1011c77c8
--- /dev/null
+++ b/modules/GEDFact_assistant/_MEDIA/media_query_1a.php
@@ -0,0 +1,112 @@
+<?php
+/**
+ * Media Link Assistant Control module for phpGedView
+ *
+ * Media Link information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage GEDFact_assistant
+ * @version $Id$
+*/
+
+if (stristr($_SERVER["SCRIPT_NAME"], basename(__FILE__))!==false) {
+ print "You cannot access an include file directly.";
+ exit;
+}
+?>
+
+<html <?php echo i18n::html_markup(); ?>>
+<head>
+</head>
+<body>
+<?php
+
+ $links = get_media_relations($mediaid);
+ // var_dump($links);
+ echo "<table><tr><td>";
+ echo "<table id=\"existLinkTbl\" width=\"430\" cellspacing=\"1\" >";
+ echo "<tr>";
+ echo '<td class="topbottombar" width="15" style="font-weight:100;" >#</td>';
+ echo '<td class="topbottombar" width="50" style="font-weight:100;" >ID:</td>';
+ echo '<td class="topbottombar" width="340" style="font-weight:100;" >', i18n::translate('Name'), '</td>';
+ echo '<td class="topbottombar" width="20" style="font-weight:100;" >', i18n::translate('Keep'), '</td>';
+ echo '<td class="topbottombar" width="20" style="font-weight:100;" >', i18n::translate('Remove'), '</td>';
+ echo '<td class="topbottombar" width="20" style="font-weight:100;" >', i18n::translate('Navigator'), '</td>';
+ echo "</tr>";
+
+ $keys = array_keys($links);
+ $values = array_values($links);
+ $i=1;
+ foreach ($keys as $link) {
+ $record=GedcomRecord::getInstance($link);
+ echo "<tr ><td>";
+ echo $i;
+ echo "</td><td id=\"existId_", $i, "\" class=\"row2\">";
+ echo $link;
+ echo "</td><td>";
+ if ($record->getType()=='INDI') {
+ $idrecord=Person::getInstance($link);
+ } elseif ($record->getType()=='FAM') {
+ $idrecord=Family::getInstance($link);
+ if ($idrecord->getHusbId()) {
+ $head=$idrecord->getHusbId();
+ }else{
+ $head=$idrecord->getWifeId();
+ }
+ } elseif ($record->getType()=='SOUR') {
+ $idrecord=Source::getInstance($link);
+ } else {
+
+ }
+
+ $nam = $idrecord->getFullName();
+ echo $nam;
+ echo "</td>";
+ echo "<td align='center'><input alt='", i18n::translate('Keep Link in list'), "', title='", i18n::translate('Keep Link in list'), "' type='radio' id='", $link, "_off' name='", $link, "' checked /></td>";
+ echo "<td align='center'><input alt='", i18n::translate('Remove Link from list'), "', title='", i18n::translate('Remove Link from list'), "' type='radio' id='", $link, "_on' name='", $link, "' /></td>";
+
+ if ($record->getType()=='INDI') {
+ ?>
+ <td align="center"><a href="#"><img style="border-style:none; margin-top:5px;" src="<?php echo $WT_IMAGE_DIR;?>/buttons/family.gif" alt="<?php echo i18n::translate('Open Family Navigator'); ?>" title="<?php echo i18n::translate('Open Family Navigator'); ?>" name="family_'<?php echo $link; ?>'" onclick="javascript:openFamNav('<?php echo $link; ?>');" /></a></td>
+ <?php
+ } elseif ($record->getType()=='FAM') {
+ ?>
+ <td align="center"><a href="#"><img style="border-style:none; margin-top:5px;" src="<?php echo $WT_IMAGE_DIR;?>/buttons/family.gif" alt="<?php echo i18n::translate('Open Family Navigator'); ?>" title="<?php echo i18n::translate('Open Family Navigator'); ?>" name="family_'<?php echo $link; ?>'" onclick="javascript:openFamNav('<?php echo $head; ?>');" /></a></td>
+ <?php
+ } else {
+ echo '<td></td>';
+ }
+ echo '</tr>';
+ $i= $i+1;
+ }
+
+ echo "</table>";
+ echo "</td></tr></table>";
+ echo "<br />";
+?>
+
+</body>
+</html>
+
+
+
diff --git a/modules/GEDFact_assistant/_MEDIA/media_query_2a.php b/modules/GEDFact_assistant/_MEDIA/media_query_2a.php
new file mode 100644
index 0000000000..a472fc160e
--- /dev/null
+++ b/modules/GEDFact_assistant/_MEDIA/media_query_2a.php
@@ -0,0 +1,81 @@
+<?php
+/**
+ * Media Link Assistant Control module for phpGedView
+ *
+ * Media Link information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage GEDFact_assistant
+ * @version $Id$
+*/
+
+if (stristr($_SERVER["SCRIPT_NAME"], basename(__FILE__))!==false) {
+ print "You cannot access an include file directly.";
+ exit;
+}
+?>
+
+<html <?php echo i18n::html_markup(); ?>>
+<head>
+<script language="javascript">
+
+
+ function addlinks(iname) {
+ // iid=document.getElementById('gid').value;
+ if (document.getElementById('gid').value == "") {
+ alert(id_empty);
+ }else{
+ addmedia_links(document.getElementById('gid'), document.getElementById('gid').value, iname );
+ return false;
+ }
+ }
+
+ function openFamNav(id) {
+ //id=document.getElementById('gid').value;
+ if (id.match("I")=="I" || id.match("i")=="i") {
+ id = id.toUpperCase();
+ winNav = window.open('edit_interface.php?action=addmedia_links&noteid=newnote&pid='+id, 'winNav', 'top=50,left=640,width=300,height=630,resizable=1,scrollbars=1');
+ if (window.focus) {winNav.focus();}
+ }else if (id.match("F")=="F") {
+ id = id.toUpperCase();
+ // TODO --- alert('Opening Navigator with family id entered will come later');
+ }
+ }
+
+</script>
+</head>
+
+
+<table border="0" cellpadding="1" cellspacing="2" >
+<tr>
+<td width="350" class="row2">
+<?php
+ require 'modules/GEDFact_assistant/_MEDIA/media_5_input.php';
+?>
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/modules/GEDFact_assistant/_MEDIA/media_query_3a.php b/modules/GEDFact_assistant/_MEDIA/media_query_3a.php
new file mode 100644
index 0000000000..cac7d144c2
--- /dev/null
+++ b/modules/GEDFact_assistant/_MEDIA/media_query_3a.php
@@ -0,0 +1,73 @@
+<?php
+/**
+ * Media Link Assistant Control module for phpGedView
+ *
+ * Media Link information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2008 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Census Assistant
+ * @version $Id$
+ */
+
+$iid2 = safe_GET('iid');
+
+print_simple_header(i18n::translate('Link Media'));
+
+$record=GedcomRecord::getInstance($iid2);
+$headjs="";
+if ($record) {
+ if ($record->getType()=='FAM') {
+ $idrecord=Family::getInstance($iid2);
+ if ($idrecord->getHusbId()) {
+ $headjs=$idrecord->getHusbId();
+ }else{
+ $headjs=$idrecord->getWifeId();
+ }
+ }
+ ?>
+ <script language="JavaScript" type="text/javascript">
+ function insertId() {
+ if (window.opener.document.getElementById('addlinkQueue')) {
+ // alert('Please move this alert window and examine the contents of the pop-up window, then click OK')
+ window.opener.insertRowToTable("<?php echo $record->getXref(); ?>", "<?php echo htmlSpecialChars($record->getFullName()); ?>", "<?php echo $headjs;?>");
+ window.close();
+ }
+ }
+ </script>
+ <?php
+
+} else {
+ ?>
+ <script language="JavaScript" type="text/javascript">
+ function insertId() {
+ window.opener.alert('<?php echo strtoupper($iid2); ?> - <?php echo i18n::translate('Not a valid Individual, Family or Source ID') ?>');
+ window.close();
+ }
+ </script>
+ <?php
+}
+?>
+
+<script language="JavaScript" type="text/javascript">
+ window.onLoad = insertId();
+</script>
diff --git a/modules/GEDFact_assistant/css/gf_styles.css b/modules/GEDFact_assistant/css/gf_styles.css
new file mode 100644
index 0000000000..17bf6d36bd
--- /dev/null
+++ b/modules/GEDFact_assistant/css/gf_styles.css
@@ -0,0 +1,100 @@
+/**
+ * Media Link Assistant Control module for phpGedView
+ *
+ * Media Link information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+ * Copyright (C) 2002 to 2007 John Finlay and Others
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Modules
+ * @version $Id$
+ */
+
+/* --------- Styles used in /_MEDIA/media_3_search.php ---*/
+
+/* Outer border around nav elements */
+.outer_nav {
+ width:270px;
+ border:3px #808080 outset;
+ }
+
+/* Transparent cell border */
+.transparent {
+border: 0px solid transparent;
+}
+
+/* top Search box */
+input[type='text'] {
+ background: #FFFFFF;
+ color: #000000;
+ border: 1px solid #000000;
+ width: 120px;
+}
+
+/* "Head" button images */
+.headimg {
+margin-top:-4px;
+border:0;
+}
+.headimg2 {
+height:17px;
+border-style:none;
+margin:-3px;
+margin-left:0px;
+}
+
+/* Creates clickable <td> for fly-outs */
+td a {
+ display: block;
+ text-decoration: none;
+}
+
+ /* Prevents clickable td for Search <td> */
+td #srch a {
+ display: inline;
+}
+
+/* Flyouts <td> */
+#flyoutFam, #flyoutPar, #flyoutStep {
+ position: absolute;
+ top: -15px;
+ left: 80px;
+ width: 150px;
+}
+#flyoutFamRTL, #flyoutParRTL, #flyoutStepRTL {
+ position: absolute;
+ top: -15px;
+ right: 35px;
+}
+#flyoutFam td, #flyoutPar td, #flyoutStep td, #flyoutFamRTL td, #flyoutParRTL td, #flyoutStepRTL td {
+ white-space: nowrap;
+ font-size:10px;
+ font-weight:normal;
+ text-decoration: none;
+}
+
+div #spouseFam {
+ margin-left:13px;
+ margin-top:0px;
+}
+
+/*-------------------------------------------------*/
+
diff --git a/modules/GEDFact_assistant/css/media_0_inverselink.css b/modules/GEDFact_assistant/css/media_0_inverselink.css
new file mode 100644
index 0000000000..e0f436eeb4
--- /dev/null
+++ b/modules/GEDFact_assistant/css/media_0_inverselink.css
@@ -0,0 +1,36 @@
+/**
+ * Media Link Assistant Control module for phpGedView
+ *
+ * Media Link information about an individual
+ *
+ * webtrees: Web based Family History software
+ * Copyright (C) 2010 webtrees development team.
+ *
+ * Derived from PhpGedView
+* Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @package webtrees
+ * @subpackage Modules
+ * @version $Id$
+ */
+
+/* --------- Styles used in /_MEDIA/media_0_inverselink.php ---*/
+
+.thumbheight {
+ height: expression( this.scrollHeight > 69 ? "70px" : "auto" ); /* sets max-height for IE */
+ max-height: 70px; /* sets max-height value for all standards-compliant browsers */
+} \ No newline at end of file