init(); print_header($controller->name . " " . i18n::translate('Ancestry chart')); if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm'; // LightBox if (WT_USE_LIGHTBOX) { require WT_ROOT.'modules/lightbox/lb_defaultconfig.php'; require WT_ROOT.'modules/lightbox/functions/lb_call_js.php'; } echo '
'; echo '

', i18n::translate('Ancestry chart'), ':'; echo '
', PrintReady($controller->name); if ($controller->addname!="") { echo '
', PrintReady($controller->addname); } echo '

'; // -- print the form to change the number of displayed generations echo WT_JS_START, 'var pastefield; function paste_id(value) {pastefield.value=value;}', WT_JS_END; ?>
 
% chart_style=="0") { echo ' checked="checked"'; } echo ' onclick="statusDisable(\'cousins\');'; echo '" />', i18n::translate('List'); echo '
chart_style=="1") { echo ' checked="checked"'; } echo ' onclick="statusEnable(\'cousins\');'; echo '" />', i18n::translate('Booklet'); ?>
chart_style=="0") { echo 'disabled="disabled" '; } echo 'id="cousins" type="checkbox" value="'; if ($controller->show_cousins) { echo '1" checked="checked" onclick="document.people.show_cousins.value=\'0\';"'; } else { echo '0" onclick="document.people.show_cousins.value=\'1\';"'; } echo ' />'; echo i18n::translate('Show cousins'), help_link('show_cousins'); echo '
chart_style=="2") { echo ' checked="checked" '; } echo ' onclick="statusDisable(\'cousins\');"'; echo ' />', i18n::translate('Individuals'); echo '
chart_style=="3") { echo ' checked="checked" '; } echo ' />', i18n::translate('Families'); ?>
', i18n::translate('Click on any of the boxes to get more information about that person.'), '

'; } switch ($controller->chart_style) { case 0: // List $pidarr=array(); echo ''; echo '
'; break; case 1: // TODO: this should be a parameter to a function, not a global $show_cousins=$controller->show_cousins; // Booklet // first page : show indi facts print_pedigree_person($controller->rootid, 2, 1); // expand the layer echo WT_JS_START, 'expandbox("', $controller->rootid, '.1", 2);', WT_JS_END; // process the tree $treeid=ancestry_array($controller->rootid, $PEDIGREE_GENERATIONS-1); foreach ($treeid as $i=>$pid) { if ($pid) { $person=Person::getInstance($pid); if (!is_null($person)) { $famids=$person->getChildFamilies(); foreach ($famids as $famid=>$family) { $parents=find_parents_in_record($family->getGedcomRecord()); if ($parents) { print_sosa_family($famid, $pid, $i); } elseif ($i==1) { // show empty family only if it is the first and only one print_sosa_family('', $pid, $i); } } } } } break; case 2: // Individual list $treeid=ancestry_array($controller->rootid, $PEDIGREE_GENERATIONS); echo '
'; print_indi_table($treeid, i18n::translate('Ancestry chart').' : '.PrintReady($controller->name), 'sosa'); echo '
'; break; case 3: // Family list $treeid=ancestry_array($controller->rootid, $PEDIGREE_GENERATIONS-1); $famlist=array(); foreach ($treeid as $pid) { $person=Person::getInstance($pid); if (is_null($person)) { continue; } foreach ($person->getChildFamilies() as $famc) { $famlist[$famc->getXref()]=$famc; } } echo '
'; print_fam_table($famlist, i18n::translate('Ancestry chart').' : '.PrintReady($controller->name)); echo '
'; break; } print_footer();