diff options
| author | fisharebest <fisharebest@gmail.com> | 2011-08-29 22:09:31 +0000 |
|---|---|---|
| committer | fisharebest <fisharebest@gmail.com> | 2011-08-29 22:09:31 +0000 |
| commit | c1629cd8ad026076d4e9d45bc5a1846f36fc3715 (patch) | |
| tree | 5cfb73551387b45c85a301ce9f96768429409ec0 /modules_v3/GEDFact_assistant/_MEDIA | |
| parent | 40d444240d42795b54122c3cb47860ae58a88930 (diff) | |
| download | webtrees-c1629cd8ad026076d4e9d45bc5a1846f36fc3715.tar.gz webtrees-c1629cd8ad026076d4e9d45bc5a1846f36fc3715.tar.bz2 webtrees-c1629cd8ad026076d4e9d45bc5a1846f36fc3715.zip | |
#833909 - in manage media links, module dir name not being loaded
Diffstat (limited to 'modules_v3/GEDFact_assistant/_MEDIA')
10 files changed, 1874 insertions, 2977 deletions
diff --git a/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php b/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php index 27bc46e32c..e608c6c8bd 100644 --- a/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php +++ b/modules_v3/GEDFact_assistant/_MEDIA/media_0_inverselink.php @@ -98,8 +98,7 @@ if ($action == "choose" && $paramok) { alert(id_empty); } else { var iid = document.getElementById('gid').value; - //var winblank = window.open('module.php?mod=GEDFact_assistant&mod_action=_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 winblank = window.open(WT_MODULES_DIR+'GEDFact_assistant/_MEDIA/media_query_3a.php?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 winblank = window.open('module.php?mod=GEDFact_assistant&mod_action=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'); } } @@ -150,7 +149,55 @@ if ($action == "choose" && $paramok) { echo '</td></tr>'; echo '<tr><td class="descriptionbox width20 wrap">', WT_I18N::translate('Links'), '</td>'; echo '<td class="optionbox wrap">'; - require WT_ROOT.WT_MODULES_DIR.'GEDFact_assistant/_MEDIA/media_query_1a.php'; + $links = get_media_relations($mediaid); + 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;" >', WT_I18N::translate('Name'), '</td>'; + echo '<td class="topbottombar" width="20" style="font-weight:100;" >', WT_I18N::translate('Keep'), '</td>'; + echo '<td class="topbottombar" width="20" style="font-weight:100;" >', WT_I18N::translate('Remove'), '</td>'; + echo '<td class="topbottombar" width="20" style="font-weight:100;" >', WT_I18N::translate('Navigator'), '</td>'; + echo "</tr>"; + + $i=1; + foreach (array_keys($links) as $link) { + $record=WT_GedcomRecord::getInstance($link); + echo "<tr ><td>"; + echo $i++; + echo "</td><td id=\"existId_", $i, "\" class=\"row2\">"; + echo $link; + echo "</td><td>"; + echo $record->getFullName(); + echo "</td>"; + echo "<td align='center'><input alt='", WT_I18N::translate('Keep Link in list'), "', title='", WT_I18N::translate('Keep Link in list'), "' type='radio' id='", $link, "_off' name='", $link, "' checked /></td>"; + echo "<td align='center'><input alt='", WT_I18N::translate('Remove Link from list'), "', title='", WT_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_IMAGES['button_family']; ?>" alt="<?php echo WT_I18N::translate('Open Family Navigator'); ?>" title="<?php echo WT_I18N::translate('Open Family Navigator'); ?>" name="family_'<?php echo $link; ?>'" onclick="javascript:openFamNav('<?php echo $link; ?>');" /></a></td> + <?php + } elseif ($record->getType()=='FAM') { + if ($record->getHusband()) { + $head=$record->getHusband()->getXref(); + } elseif ($record->getWife()) { + $head=$record->getWife()->getXref(); + } else { + $head=''; + } + ?> + <td align="center"><a href="#"><img style="border-style:none; margin-top:5px;" src="<?php echo $WT_IMAGES['button_family']; ?>" alt="<?php echo WT_I18N::translate('Open Family Navigator'); ?>" title="<?php echo WT_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>'; + } + + echo "</table>"; + echo "</td></tr></table>"; + echo "<br />"; echo '</td></tr>'; } @@ -187,7 +234,376 @@ if ($action == "choose" && $paramok) { echo '<br /><br />'; echo '<input type="hidden" name="idName" id="idName" size="36" value="Name of ID" />'; - require WT_ROOT.WT_MODULES_DIR.'GEDFact_assistant/_MEDIA/media_query_2a.php'; +?> +<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¬eid=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> +<table border="0" cellpadding="1" cellspacing="2" > +<tr> +<td width="350" class="row2"> + <style type="text/css"> + <!-- + .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 WT_I18N::translate('Open Family Navigator'); ?>"; + var remove = "<?php echo WT_I18N::translate('Remove'); ?>"; + var linkExists = "<?php echo WT_I18N::translate('This link already exists'); ?>"; + /* ===icons === */ + var removeLinkIcon = "<?php echo $WT_IMAGES['remove']; ?>"; + var familyNavIcon = "<?php echo $WT_IMAGES['button_family']; ?>"; + + +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; + + if (num == null) { + num = nextRow; + } else { + iteration = num + ROW_BASE; + } + + // add the row + var row = tbl.tBodies[0].insertRow(num); + + // CONFIG: requires class + 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); + 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.background='transparent'; + txtInp1.style.border='0px'; + txtInp1.style.fontSize="11px"; + cell1.appendChild(txtInp1); + + // cell 2 - Name + var cell2 = row.insertCell(2); + var txtInp2 = document.createElement('div'); + txtInp2.setAttribute('type', 'text'); + txtInp2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_2'); + 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', removeLinkIcon); + btnEl.setAttribute('alt', remove); + btnEl.setAttribute('title', remove); + btnEl.setAttribute('height', '14px'); + 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', familyNavIcon); + 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', familyNavIcon); + 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(); +} + + +</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 WT_I18N::translate('Name'); ?></th> + <th class="topbottombar" width="20" style="font-weight:100;" align="left"><?php echo WT_I18N::translate('Remove'); ?></th> + <th class="topbottombar" width="20" style="font-weight:100;" align="left"><?php echo WT_I18N::translate('Navigator'); ?></th> + </tr> + </thead> + <tbody></tbody> + </table> +</td> +</tr> +</table> +<?php echo '</td></tr>'; // Admin Option CHAN log update override ======================= if (WT_USER_IS_ADMIN) { @@ -209,7 +625,77 @@ if ($action == "choose" && $paramok) { echo '<tr><td class="topbottombar" colspan="2">'; echo '<center><input type="submit" value="', WT_I18N::translate('Save'), '" onclick="javascript:shiftlinks();" />'; echo '</center></td></tr>'; - require WT_ROOT.WT_MODULES_DIR.'GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php'; +?> +<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]; + if (IE) { + str += (str==''?'':', ') + tr.cells[1].childNodes[0].innerHTML; + } else { + str += (str==''?'':', ') + tr.cells[1].childNodes[0].textContent; + } + } +} + +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> +<?php echo '</table>'; echo '</form>'; echo '<br/><br/><center><a href="javascript:;" onclick="if (window.opener.showchanges) window.opener.showchanges(); window.close(); winNav.close(); ">', WT_I18N::translate('Close Window'), '</a><br /></center>'; diff --git a/modules_v3/GEDFact_assistant/_MEDIA/media_1_ctrl.php b/modules_v3/GEDFact_assistant/_MEDIA/media_1_ctrl.php index b3caa583cd..e3dcaa93bc 100644 --- a/modules_v3/GEDFact_assistant/_MEDIA/media_1_ctrl.php +++ b/modules_v3/GEDFact_assistant/_MEDIA/media_1_ctrl.php @@ -1,39 +1,36 @@ <?php -/** - * Media Link Assistant Control module for webtrees - * - * Media Link information about an individual - * - * webtrees: Web based Family History software - * Copyright (C) 2011 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 GEDFact_assistant - * @version $Id$ - */ +// Media Link Assistant Control module for webtrees +// +// Media Link information about an individual +// +// webtrees: Web based Family History software +// Copyright (C) 2011 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 +// +// $Id$ - if (!defined('WT_WEBTREES')) { +if (!defined('WT_WEBTREES')) { header('HTTP/1.0 403 Forbidden'); exit; } +require_once WT_ROOT.'includes/functions/functions_charts.php'; global $summary, $TEXT_DIRECTION, $censyear, $censdate; $pid = safe_get('pid'); @@ -78,9 +75,1364 @@ if ($pid=="") { //echo '</td>'; echo '<td valign="top" width=400>'; //-- Search and Add Family Members Area ========================================= - require WT_MODULES_DIR.'GEDFact_assistant/_MEDIA/media_3_search_add.php'; + ?> + <table class="outer_nav center"> + <?php + + //-- Search Function ------------------------------------------------------------ + ?> + <tr> + <td class="descriptionbox font9 center"><?php echo WT_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 WT_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&mod_action=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 ' <font size="2"> ', WT_I18N::translate('Search'), '</font>'; + echo '</a>'; + ?> + </td> + </tr> + <tr> + <td class="transparent;"> + <br /> + </td> + </tr> + + <?php + //-- Add Family Members to Census ------------------------------------------- + global $WT_IMAGES, $spouselinks, $parentlinks, $DeathYr, $BirthYr, $TEXT_DIRECTION, $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 ================================================= + $headImg = "<img class=\"headimg vmiddle\" src=\"".$WT_IMAGES["button_head"]."\" />"; + $headImg2 = "<img class=\"headimg2 vmiddle\" src=\"".$WT_IMAGES["button_head"]."\" alt=\"".WT_I18N::translate('Click to choose person as Head of family.')."\" title=\"".WT_I18N::translate('Click to choose person as Head of family.')."\" />"; + global $tempStringHead; + echo WT_I18N::translate('Click %s to choose person as Head of family.', $headImg); + ?> + <br /><br /> + <?php echo WT_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 $family) { + $label = $this->indi->getChildFamilyLabel($family); + $people = $this->buildFamilyList($family, "parents"); + $marrdate = $family->getMarriageDate(); + + // Husband ------------------- + if (isset($people["husb"])) { + $married = WT_Date::Compare($censdate, $marrdate); + $nam = $people["husb"]->getAllNames(); + $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; + $givn = rtrim($nam[0]['givn'],'*'); + $surn = $nam[0]['surname']; + if (isset($nam[1])) { + $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; + $marn = $nam[1]['surname']; + } + $menu = new WT_Menu(" " . $people["husb"]->getLabel()); + // $menu->addClass("", "", "submenu"); + $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); + $slabel .= $parentlinks; + $submenu = new WT_Menu($slabel); + $menu->addSubMenu($submenu); + + + echo '<tr>'; + // Define width of Left (Label) column ------- + ?> + <td width=75 align="left" class="optionbox"> + <font size=1> + <?php echo $menu->getMenu(); ?> + </font> + </td> + <td align="left" class="facts_value" > + <font size=1> + <?php + echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom=".WT_GEDURL."\">"; + echo $headImg2; + echo "</a>"; + ?> + </font> + </td> + <td align="left" class="facts_value"> + <font size=1> + <?php + if (($people["husb"]->canDisplayDetails())) { + ?> + <a href='javaScript:opener.insertRowToTable("<?php + echo PrintReady($people["husb"]->getXref()) ; // pid = PID + ?>", "<?php + // echo PrintReady($people["husb"]->getFullName()); // nam = Name + echo PrintReady($fulln); + ?>", "<?php + echo PrintReady($people["husb"]->getLabel()); // label = Relationship + ?>", "<?php + echo PrintReady($people["husb"]->getSex()); // gend = Gender + ?>", "<?php + if ($married>=0) { + echo "M"; // cond = Condition (Married) + } else { + echo "S"; // cond = Condition (Single) + } + ?>", "<?php + echo PrintReady($people["husb"]->getbirthyear()); // yob = Year of Birth + ?>", "<?php + echo PrintReady($censyear-$people["husb"]->getbirthyear()); // age = Census Date minus YOB + ?>", "<?php + echo "Y"; // YMD + ?>", "<?php + echo ""; // occu = Occupation + ?>", "<?php + echo PrintReady($people["husb"]->getcensbirthplace()); // birthpl = Census Place of Birth + ?>");'><?php + echo PrintReady($people["husb"]->getFullName()); // Name + ?> + </a> + <?php + } else { + echo WT_I18N::translate('Private'); + } + ?> + </font> + </td> + </tr> + <?php + } + + if (isset($people["wife"])) { + $married = WT_Date::Compare($censdate, $marrdate); + $nam = $people["wife"]->getAllNames(); + $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; + $givn = rtrim($nam[0]['givn'],'*'); + $surn = $nam[0]['surname']; + if (isset($nam[1])) { + $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; + $marn = $nam[1]['surname']; + } else { + $fulmn = $fulln; + $marn = $surn; + } + + $menu = new WT_Menu(" " . $people["wife"]->getLabel()); + //$menu->addClass("", "", "submenu"); + $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); + $slabel .= $parentlinks; + $submenu = new WT_Menu($slabel); + $menu->addSubMenu($submenu); + ?> + <tr> + <td width=75 align="left" class="optionbox"> + <font size=1> + <?php echo $menu->getMenu(); ?> + </font> + </td> + <td align="left" class="facts_value"> + <font size=1> + <?php + echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom=".WT_GEDURL."\">"; + echo $headImg2; + echo "</a>"; + ?> + </font> + </td> + <td align="left" class="facts_value"> + <font size=1> + <?php + if (($people["wife"]->canDisplayDetails())) { + ?> + <a href='javaScript:opener.insertRowToTable("<?php + echo $people["wife"]->getXref() ; // pid = PID + ?>", "<?php + // if ($married>=0 && isset($nam[1])) { + // echo PrintReady($fulmn); // nam = Married Name + // } else { + //echo PrintReady($people["wife"]->getFullName()); // nam = Name + echo PrintReady($fulln); + // } + ?>", "<?php + echo PrintReady($people["wife"]->getLabel()); // label = Relationship + ?>", "<?php + echo 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 + echo PrintReady($people["wife"]->getbirthyear()); // yob = Year of Birth + ?>", "<?php + echo PrintReady($censyear-$people["wife"]->getbirthyear()); // age = Census Date minus YOB + ?>", "<?php + echo "Y"; // YMD + ?>", "<?php + echo ""; // occu = Occupation + ?>", "<?php + echo PrintReady($people["wife"]->getcensbirthplace()); // birthpl = Census Place of Birth + ?>");'> + <?php + //if ($married>=0 && isset($nam[1])) { + // echo PrintReady($fulmn); // Full Married Name + //} else { + echo PrintReady($people["wife"]->getFullName()); // Full Name + //} + ?> + </a> + <?php + } else { + echo WT_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 = WT_Date::Compare($censdate, $tmp); + } + $nam = $child->getAllNames(); + $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; + $givn = rtrim($nam[0]['givn'],'*'); + $surn = $nam[0]['surname']; + if (isset($nam[1])) { + $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; + $marn = $nam[1]['surname']; + } + + $menu = new WT_Menu(" " . $child->getLabel()); + //$menu->addClass("", "", "submenu"); + $slabel = print_pedigree_person_nav2($child->getXref(), 2, 0, $personcount++, $currpid, $censyear); + $slabel .= $spouselinks; + $submenu = new WT_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) { + echo $child->getLabel(); + } else { + echo $menu->getMenu(); + } + ?> + </font> + </td> + <td align="left" class="facts_value"> + <font size=1> + <?php + echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$child->getXref()."&gedcom=".WT_GEDURL."\">"; + echo $headImg2; + echo "</a>"; + ?> + </font> + </td> + <td align="left" class="facts_value"> + <font size=1> + <?php + if (($child->canDisplayDetails())) { + ?> + <a href='javaScript:opener.insertRowToTable("<?php + echo $child->getXref() ; // pid = PID + ?>", "<?php + //if ($married>=0 && isset($nam[1])) { + // echo PrintReady($fulmn); // nam = Married Name + //} else { + //echo PrintReady($child->getFullName()); // nam = Full Name + echo PrintReady($fulln); + //} + ?>", "<?php + if ($child->getXref()==$pid) { + echo "Head"; // label = Head + } else { + echo PrintReady($child->getLabel()); // label = Relationship + } + ?>", "<?php + echo 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 + echo PrintReady($child->getbirthyear()); // yob = Year of Birth + ?>", "<?php + echo PrintReady($censyear-$child->getbirthyear()); // age = Census Date minus YOB + ?>", "<?php + echo "Y"; // YMD + ?>", "<?php + echo ""; // occu = Occupation + ?>", "<?php + echo PrintReady($child->getcensbirthplace()); // birthpl = Census Place of Birth + ?>");'><?php + // if ($married>=0 && isset($nam[1])) { + // echo PrintReady($fulmn); // Full Married Name + // } else { + echo PrintReady($child->getFullName()); // Full Name + // } + ?> + </a> + <?php + } else { + echo WT_I18N::translate('Private'); + } + ?> + </font> + </td> + </tr> + <?php + } + } + $elderdate = $child->getBirthDate(false); + } + } + + //-- Build step families ---------------------------------------------------------------- + foreach ($this->indi->getChildStepFamilies() as $family) { + $label = $this->indi->getStepFamilyLabel($family); + $people = $this->buildFamilyList($family, "step-parents"); + if ($people) { + echo "<tr><td><br /></td><td></td></tr>"; + } + $marrdate = $family->getMarriageDate(); + + // Husband ----------------------------- + $elderdate = ""; + if (isset($people["husb"]) ) { + $married = WT_Date::Compare($censdate, $marrdate); + $nam = $people["husb"]->getAllNames(); + $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; + $givn = rtrim($nam[0]['givn'],'*'); + $surn = $nam[0]['surname']; + if (isset($nam[1])) { + $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; + $marn = $nam[1]['surname']; + } + $menu = new WT_Menu(); + if ($people["husb"]->getLabel() == ".") { + $menu->addLabel(" " . WT_I18N::translate('Step-Father')); + } else { + $menu->addLabel(" " . $people["husb"]->getLabel()); + } + //$menu->addClass("", "", "submenu"); + $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); + $slabel .= $parentlinks; + $submenu = new WT_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 echo $menu->getMenu(); ?> + </font> + </td> + <td align="left" class="facts_value"> + <font size=1> + <?php + echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom=".WT_GEDURL."\">"; + echo $headImg2; + echo "</a>"; + ?> + </font> + </td> + <td align="left" class="facts_value"> + <font size=1> + <?php + if (($people["husb"]->canDisplayDetails())) { + ?> + <a href='javaScript:opener.insertRowToTable("<?php + echo PrintReady($people["husb"]->getXref()) ; // pid = PID + ?>", "<?php + //echo PrintReady($people["husb"]->getFullName()); // nam = Name + echo PrintReady($fulln); + ?>", "<?php + if ($people["husb"]->getLabel() == ".") { + echo PrintReady(WT_I18N::translate('Step-Father')); // label = Relationship + } else { + echo PrintReady($people["husb"]->getLabel()); // label = Relationship + } + ?>", "<?php + echo PrintReady($people["husb"]->getSex()); // gend = Gender + ?>", "<?php + if ($married>=0) { + echo "M"; // cond = Condition (Married) + } else { + echo "S"; // cond = Condition (Single) + } + ?>", "<?php + echo PrintReady($people["husb"]->getbirthyear()); // yob = Year of Birth + ?>", "<?php + echo PrintReady($censyear-$people["husb"]->getbirthyear()); // age = Census Date minus YOB + ?>", "<?php + echo "Y"; // YMD + ?>", "<?php + echo ""; // occu = Occupation + ?>", "<?php + echo PrintReady($people["husb"]->getcensbirthplace()); // birthpl = Census Place of Birth + ?>");'> + <?php echo PrintReady($people["husb"]->getFullName()); // Name + ?> + </a> + <?php + } else { + echo WT_I18N::translate('Private'); + } + ?> + </font> + </td> + </tr> + <?php + $elderdate = $people["husb"]->getBirthDate(false); + } + + // Wife ------------------- + if (isset($people["wife"]) ) { + $married = WT_Date::Compare($censdate, $marrdate); + $nam = $people["wife"]->getAllNames(); + $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; + $givn = rtrim($nam[0]['givn'],'*'); + $surn = $nam[0]['surname']; + if (isset($nam[1])) { + $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; + $marn = $nam[1]['surname']; + } + $menu = new WT_Menu(); + if ($people["husb"]->getLabel() == ".") { + $menu->addLabel(" " . WT_I18N::translate('Step-Mother')); + } else { + $menu->addLabel(" " . $people["wife"]->getLabel()); + } + //$menu->addClass("", "", "submenu"); + $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); + $slabel .= $parentlinks; + $submenu = new WT_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 echo $menu->getMenu(); ?> + </font> + </td> + <td align="left" class="facts_value"> + <font size=1> + <?php + echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom=".WT_GEDURL."\">"; + echo $headImg2; + echo "</a>"; + ?> + </font> + </td> + <td align="left" class="facts_value"> + <font size=1> + <?php + if (($people["wife"]->canDisplayDetails())) { + ?> + <a href='javaScript:opener.insertRowToTable("<?php + echo PrintReady($people["wife"]->getXref()) ; // pid = PID + ?>", "<?php + // if ($married>=0 && isset($nam[1])) { + // echo PrintReady($fulmn); // nam = Married Name + // } else { + //echo PrintReady($people["wife"]->getFullName()); // nam = Full Name + echo PrintReady($fulln); + // } + ?>", "<?php + if ($people["wife"]->getLabel() == ".") { + echo PrintReady(WT_I18N::translate('Step-Mother')); // label = Relationship + } else { + echo PrintReady($people["wife"]->getLabel()); // label = Relationship + } + ?>", "<?php + echo 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 + echo PrintReady($people["wife"]->getbirthyear()); // yob = Year of Birth + ?>", "<?php + echo PrintReady($censyear-$people["wife"]->getbirthyear()); // age = Census Date minus YOB + ?>", "<?php + echo "Y"; // YMD + ?>", "<?php + echo ""; // occu = Occupation + ?>", "<?php + echo PrintReady($people["wife"]->getcensbirthplace()); // birthpl = Census Place of Birth + ?>");'> + <?php + //if ($married>=0 && isset($nam[1])) { + // echo PrintReady($fulmn); // Full Married Name + //} else { + echo PrintReady($people["wife"]->getFullName()); // Full Name + //} + ?> + </a> + <?php + } else { + echo WT_I18N::translate('Private'); + } + ?> + </font> + </td> + </tr> + <?php + } + + // Children --------------------- + if (isset($people["children"])) { + $elderdate = $family->getMarriageDate(); + foreach ($people["children"] as $key=>$child) { + $nam = $child->getAllNames(); + $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; + $givn = rtrim($nam[0]['givn'],'*'); + $surn = $nam[0]['surname']; + if (isset($nam[1])) { + $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; + $marn = $nam[1]['surname']; + } + $menu = new WT_Menu(" " . $child->getLabel()); + //$menu->addClass("", "", "submenu"); + $slabel = print_pedigree_person_nav2($child->getXref(), 2, 0, $personcount++, $currpid, $censyear); + $slabel .= $spouselinks; + $submenu = new WT_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 echo $menu->getMenu(); ?> + </font> + </td> + <td align="left" class="facts_value" > + <font size=1> + <?php + echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$child->getXref()."&gedcom=".WT_GEDURL."\">"; + echo $headImg2; + echo "</a>"; + ?> + </font> + </td> + <td align="left" class="facts_value"> + <font size=1> + <?php + if (($child->canDisplayDetails())) { + ?> + <a href='javaScript:opener.insertRowToTable("<?php + echo PrintReady($child->getXref()) ; // pid = PID + ?>", "<?php + //echo PrintReady($child->getFullName()); // nam = Name + echo PrintReady($fulln); + ?>", "<?php + echo PrintReady($child->getLabel()); // label = Relationship + ?>", "<?php + echo PrintReady($child->getSex()); // gend = Gender + ?>", "<?php + echo ""; // cond = Condition (Married or Single) + ?>", "<?php + echo PrintReady($child->getbirthyear()); // yob = Year of Birth + ?>", "<?php + echo PrintReady($censyear-$child->getbirthyear()); // age = Census Date minus YOB + ?>", "<?php + echo "Y"; // YMD + ?>", "<?php + echo ""; // occu = Occupation + ?>", "<?php + echo PrintReady($child->getcensbirthplace()); // birthpl = Census Place of Birth + ?>");'> + <?php echo PrintReady($child->getFullName()); // Name + ?> + </a> + <?php + } else { + echo WT_I18N::translate('Private'); + } + ?> + </font> + </td> + </tr> + <?php + //$elderdate = $child->getBirthDate(false); + } + } + } + + echo "<tr><td><font size=1><br /></font></td></tr>"; + + //-- Build Spouse Family --------------------------------------------------- + $families = $this->indi->getSpouseFamilies(); + //$personcount = 0; + foreach ($families as $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 = WT_Date::Compare($censdate, $marrdate); + $nam = $people["husb"]->getAllNames(); + $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; + $givn = rtrim($nam[0]['givn'],'*'); + $surn = $nam[0]['surname']; + if (isset($nam[1])) { + $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; + $marn = $nam[1]['surname']; + } + $menu = new WT_Menu(" " . $people["husb"]->getLabel()); + //$menu->addClass("", "", "submenu"); + $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); + $slabel .= $parentlinks; + $submenu = new WT_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) { + echo " " .($people["husb"]->getLabel())." ".WT_I18N::translate('Head of Household:'); + } else { + echo $menu->getMenu(); + } + ?> + </font> + </td> + <td align="left" class="facts_value" > + <font size=1> + <?php + echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom=".WT_GEDURL."\">"; + echo $headImg2; + echo "</a>"; + ?> + </font> + </td> + <td align="left" class="facts_value" > + <font size=1> + <?php + if (($people["husb"]->canDisplayDetails())) { + ?> + <a href='javaScript:opener.insertRowToTable("<?php + echo $people["husb"]->getXref() ; // pid = PID + ?>", "<?php + //echo PrintReady($people["husb"]->getFullName()); // nam = Name + echo PrintReady($fulln); + ?>", "<?php + if ($people["husb"]->getXref()==$pid) { + echo "Head"; // label = Relationship + } else { + echo $people["husb"]->getLabel(); // label = Relationship + } + ?>", "<?php + echo PrintReady($people["husb"]->getSex()); // gend = Gender + ?>", "<?php + if ($married>=0) { + echo "M"; // cond = Condition (Married) + } else { + echo "S"; // cond = Condition (Single) + } + ?>", "<?php + echo PrintReady($people["husb"]->getbirthyear()); // yob = Year of Birth + ?>", "<?php + echo PrintReady($censyear-$people["husb"]->getbirthyear()); // age = Census Date minus YOB + ?>", "<?php + echo "Y"; // YMD + ?>", "<?php + echo ""; // occu = Occupation + ?>", "<?php + echo PrintReady($people["husb"]->getcensbirthplace()); // birthpl = Census Place of Birth + ?>");'> + <?php + echo PrintReady($people["husb"]->getFullName()); // Name + ?> + </a> + <?php + } else { + echo WT_I18N::translate('Private'); + } + ?> + </font> + </td> + <tr> + <?php + } + + + // Wife ------------------- + //if (isset($people["wife"]) && $spousetag == 'WIFE') { + if (isset($people["wife"])) { + $married = WT_Date::Compare($censdate, $marrdate); + $nam = $people["wife"]->getAllNames(); + $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; + $givn = rtrim($nam[0]['givn'],'*'); + $surn = $nam[0]['surname']; + if (isset($nam[1])) { + $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; + $marn = $nam[1]['surname']; + } else { + $fulmn = $fulln; + $marn = $surn; + } + $menu = new WT_Menu(" " . $people["wife"]->getLabel()); + //$menu->addClass("", "", "submenu"); + $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); + $slabel .= $parentlinks; + $submenu = new WT_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) { + echo " " .($people["wife"]->getLabel())." ".WT_I18N::translate('Head of Household:'); + } else { + echo $menu->getMenu(); + } + ?> + </font> + </td> + <td align="left" class="facts_value"> + <font size=1> + <?php + echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom=".WT_GEDURL."\">"; + echo $headImg2; + echo "</a>"; + ?> + </font> + </td> + <td align="left" class="facts_value"> + <font size=1> + <?php + if (($people["wife"]->canDisplayDetails())) { + ?> + <a href='javaScript:opener.insertRowToTable("<?php + echo $people["wife"]->getXref() ; // pid = PID + ?>", "<?php + // if ($married>=0 && isset($nam[1])) { + // echo PrintReady($fulmn); // nam = Full Married Name + // } else { + //echo PrintReady($people["wife"]->getFullName()); // nam = Full Name + echo PrintReady($fulln); + // } + ?>", "<?php + if ($people["wife"]->getXref()==$pid) { + echo "Head"; // label = Head + } else { + echo PrintReady($people["wife"]->getLabel()); // label = Relationship + } + ?>", "<?php + echo 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 + echo PrintReady($people["wife"]->getbirthyear()); // yob = Year of Birth + ?>", "<?php + echo PrintReady($censyear-$people["wife"]->getbirthyear()); // age = Census Date minus YOB + ?>", "<?php + echo "Y"; // YMD + ?>", "<?php + echo ""; // occu = Occupation + ?>", "<?php + echo PrintReady($people["wife"]->getcensbirthplace()); // birthpl = Census Place of Birth + ?>");'> + <?php + //if ($married>=0 && isset($nam[1])) { + // echo PrintReady($fulmn); // Full Married Name + //} else { + echo PrintReady($people["wife"]->getFullName()); // Full Name + //} + ?> + </a> + <?php + } else { + echo WT_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 = WT_Date::Compare($censdate, $tmp); + } + $nam = $child->getAllNames(); + $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; + $givn = rtrim($nam[0]['givn'],'*'); + $surn = $nam[0]['surname']; + if (isset($nam[1])) { + $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; + $marn = $nam[1]['surname']; + } else { + $fulmn = $fulln; + $marn = $surn; + } + $menu = new WT_Menu(" " . $child->getLabel()); + //$menu->addClass("", "", "submenu"); + $slabel = print_pedigree_person_nav2($child->getXref(), 2, 0, $personcount++, $child->getLabel(), $censyear); + $slabel .= $spouselinks; + $submenu = new WT_Menu($slabel); + $menu->addSubmenu($submenu); + ?> + <tr> + <td width=75 align="left" class="optionbox" > + <font size=1> + <?php echo $menu->getMenu(); ?> + </font> + </td> + <td align="left" class="facts_value"> + <font size=1> + <?php + echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$child->getXref()."&gedcom=".WT_GEDURL."\">"; + echo $headImg2; + echo "</a>"; + ?> + </font> + </td> + <td align="left" class="facts_value"> + <font size=1> + <?php + if (($child->canDisplayDetails())) { + ?> + <a href='javaScript:opener.insertRowToTable("<?php + echo $child->getXref() ; // pid = PID + ?>", "<?php + // if ($married>0 && isset($nam[1])) { + // echo PrintReady($fulmn); // nam = Full Married Name + // } else { + // echo PrintReady($child->getFullName()); // nam = Full Name + echo PrintReady($fulln); // nam = Full Name + // } + ?>", "<?php + echo PrintReady($child->getLabel()); // label = Relationship + ?>", "<?php + echo 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 + echo PrintReady($child->getbirthyear()); // yob = Year of Birth + ?>", "<?php + echo PrintReady($censyear-$child->getbirthyear()); // age = Census Date minus YOB + ?>", "<?php + echo "Y"; // YMD + ?>", "<?php + echo ""; // occu = Occupation + ?>", "<?php + echo PrintReady($child->getcensbirthplace()); // birthpl = Census Place of Birth + ?>");'> + <?php + // if ($married>=0 && isset($nam[1])) { + // echo PrintReady($fulmn); // Full Married Name + // } else { + echo PrintReady($child->getFullName()); // Full Name + // } + ?> + </a> + <?php + } else { + echo WT_I18N::translate('Private'); + } + ?> + </font> + </td> + </tr> + <?php + } + echo "<tr><td><font size=1><br /></font></td></tr>"; + } + ?> + + </table> + </td> + </tr> + </table> + <?php echo '</td>'; echo '</tr>'; echo '</table>'; } // End IF test for Base pid + +/** + * 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 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, $count=0, $personcount="1", $currpid, $censyear) { + global $HIDE_LIVE_PEOPLE, $SHOW_LIVING_NAMES, $ZOOM_BOXES, $LINK_ICONS; + global $MULTI_MEDIA, $SHOW_HIGHLIGHT_IMAGES, $bwidth, $bheight, $PEDIGREE_FULL_DETAILS, $SHOW_PEDIGREE_PLACES; + global $TEXT_DIRECTION, $DEFAULT_PEDIGREE_GENERATIONS, $OLD_PGENS, $talloffset, $PEDIGREE_LAYOUT, $MEDIA_DIRECTORY; + global $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, $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=WT_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 (empty($SEARCH_SPIDER)) { + if ($LINK_ICONS!="disabled") { + //-- draw a box for the family popup + if ($TEXT_DIRECTION=="rtl") { + $spouselinks .= "<table id=\"flyoutFamRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">"; + $spouselinks .= "<b>" . WT_I18N::translate('Family') . "</b> (" .$person->getFullName(). ")<br />"; + $parentlinks .= "<table id=\"flyoutParRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">"; + $parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; + $step_parentlinks .= "<table id=\"flyoutStepRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">"; + $step_parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; + } else { + $spouselinks .= "<table id=\"flyoutFam\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">"; + $spouselinks .= "<b>" . WT_I18N::translate('Family') . "</b> (" .$person->getFullName(). ")<br />"; + $parentlinks .= "<table id=\"flyoutPar\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">"; + $parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; + $step_parentlinks .= "<table id=\"flyoutStep\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">"; + $step_parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; + } + $persons = ""; + $person_parent = ""; + $person_step = ""; + + //-- parent families -------------------------------------- + foreach ($person->getChildFamilies() as $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 ($husb) { + $person_parent="Yes"; + $tmp=$husb->getXref(); + if ($husb->canDisplayName()) { + $nam = $husb->getAllNames(); + // $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surn']; + $fulln = $husb->getFullName(); + $givn = rtrim($nam[0]['givn'],'*'); + $surn = $nam[0]['surn']; + if (isset($nam[1]) ) { + $fulmn = rtrim($nam[1]['givn'],'*')." ".$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 .= WT_I18N::translate('Private'); + } + $natdad = "yes"; + } + } + + // Wife ------------------------------ + if ($wife || $num>0) { + if ($wife) { + $person_parent="Yes"; + $tmp=$wife->getXref(); + if ($wife->canDisplayName()) { + $married = WT_Date::Compare($censdate, $marrdate); + $nam = $wife->getAllNames(); + $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; + $givn = rtrim($nam[0]['givn'],'*'); + $surn = $nam[0]['surname']; + if (isset($nam[1])) { + //$fulmn = rtrim($nam[1]['givn'],'*')." ".$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 .= WT_I18N::translate('Private'); + } + $parentlinks .= "<br />"; + $natmom = "yes"; + } + } + } + } + + //-- step families ----------------------------------------- + $fams = $person->getChildStepFamilies(); + foreach ($fams as $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 ($husb) { + $person_step="Yes"; + $tmp=$husb->getXref(); + if ($husb->canDisplayName()) { + $nam = $husb->getAllNames(); + $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; + //$fulln = $husb->getFullName(); + $givn = rtrim($nam[0]['givn'],'*'); + $surn = $nam[0]['surname']; + if (isset($nam[1])) { + $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; + $marn = $nam[1]['surname']; + } + + $parentlinks .= "<a href=\"individual.php?pid={$tmp}&tab={$tabno}&gedcom=".WT_GEDURL."\">"; + $parentlinks .= PrintReady($husb->getFullName()); + $parentlinks .= "</a>"; + } else { + $parentlinks .= WT_I18N::translate('Private'); + } + $parentlinks .= "<br />"; + } + } + } + + if ($natmom == "yes") { + } else { + // Wife ---------------------------- + if ($wife || $num>0) { + if ($wife) { + $person_step="Yes"; + $tmp=$wife->getXref(); + if ($wife->canDisplayName()) { + $married = WT_Date::Compare($censdate, $marrdate); + $nam = $wife->getAllNames(); + $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; + $givn = rtrim($nam[0]['givn'],'*'); + $surn = $nam[0]['surname']; + if (isset($nam[1])) { + $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; + $marn = $nam[1]['surname']; + } + $parentlinks .= "<a href=\"individual.php?pid={$tmp}&tab={$tabno}&gedcom=".WT_GEDURL."\">"; + $parentlinks .= PrintReady($wife->getFullName()); + $parentlinks .= "</a>"; + } else { + $parentlinks .= WT_I18N::translate('Private'); + } + $parentlinks .= "<br />"; + } + } + } + } + } + + // Spouse Families -------------------------------------- @var $family Family + foreach ($person->getSpouseFamilies() as $family) { + if (!is_null($family)) { + $spouse = $family->getSpouse($person); + $children = $family->getChildren(); + $num = count($children); + $marrdate = $family->getMarriageDate(); + + // Spouse ------------------------------ + if ($spouse || $num>0) { + if ($spouse) { + $tmp=$spouse->getXref(); + if ($spouse->canDisplayName()) { + $married = WT_Date::Compare($censdate, $marrdate); + $nam = $spouse->getAllNames(); + $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; + $givn = rtrim($nam[0]['givn'],'*'); + $surn = $nam[0]['surname']; + if (isset($nam[1])) { + $fulmn = rtrim($nam[1]['givn'],'*')." ".$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 .= WT_I18N::translate('Private'); + } + $spouselinks .= "</a>"; + if ($spouse->getFullName() != "") { + $persons = "Yes"; + } + } + } + + // Children ------------------------------ @var $child Person + $spouselinks .= "<div id='spouseFam'>"; + $spouselinks .= "<ul class=\"clist ".$TEXT_DIRECTION."\">"; + foreach ($children as $c=>$child) { + $cpid = $child->getXref(); + if ($child) { + $persons="Yes"; + if ($child->canDisplayName()) { + $nam = $child->getAllNames(); + $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; + $givn = rtrim($nam[0]['givn'],'*'); + $surn = $nam[0]['surname']; + if (isset($nam[1])) { + $fulmn = rtrim($nam[1]['givn'],'*')." ".$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 .= WT_I18N::translate('Private'); + } + $spouselinks .= "</li>"; + } + } + $spouselinks .= "</ul>"; + $spouselinks .= "</div>"; + } + } + + if ($persons != "Yes") { + $spouselinks .= "(" . WT_I18N::translate('none') . ")</td></tr></table>"; + } else { + $spouselinks .= "</td></tr></table>"; + } + + if ($person_parent != "Yes") { + $parentlinks .= "(" . WT_I18N::translate_c('unknown family', 'unknown') . ")</td></tr></table>"; + } else { + $parentlinks .= "</td></tr></table>"; + } + + if ($person_step != "Yes") { + $step_parentlinks .= "(" . WT_I18N::translate_c('unknown family', 'unknown') . ")</td></tr></table>"; + } else { + $step_parentlinks .= "</td></tr></table>"; + } + } + } + } +} diff --git a/modules_v3/GEDFact_assistant/_MEDIA/media_3_find.php b/modules_v3/GEDFact_assistant/_MEDIA/media_3_find.php deleted file mode 100644 index d82d66c8f6..0000000000 --- a/modules_v3/GEDFact_assistant/_MEDIA/media_3_find.php +++ /dev/null @@ -1,798 +0,0 @@ -<?php -// Media Link Assistant Control module for webtrees -// -// 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) 2011 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 -// -// $Id$ - -global $MEDIA_DIRECTORY, $MEDIA_DIRECTORY_LEVELS, $TEXT_DIRECTION, $ABBREVIATE_CHART_LABELS; - -$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(WT_I18N::translate('Find individual ID')); - break; -case "fam": - print_simple_header(WT_I18N::translate('Find Family List')); - break; -case "media": - print_simple_header(WT_I18N::translate('Find media')); - $action="filter"; - break; -case "place": - print_simple_header(WT_I18N::translate('Find Place')); - $action="filter"; - break; -case "repo": - print_simple_header(WT_I18N::translate('Repositories')); - $action="filter"; - break; -case "note": - print_simple_header(WT_I18N::translate('Find Shared Note')); - $action="filter"; - break; -case "source": - print_simple_header(WT_I18N::translate('Find Source')); - $action="filter"; - break; -case "specialchar": - print_simple_header(WT_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) echo "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¬eid=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 WT_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 WT_I18N::translate('Find individual ID'); - break; -case "fam": - echo WT_I18N::translate('Find Family List'); - break; -case "media": - echo WT_I18N::translate('Find media'); - break; -case "place": - echo WT_I18N::translate('Find Place'); - break; -case "repo": - echo WT_I18N::translate('Repositories'); - break; -case "note": - echo WT_I18N::translate('Find Shared Note'); - break; -case "source": - echo WT_I18N::translate('Find Source'); - break; -case "specialchar": - echo WT_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 WT_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=\"", WT_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 WT_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=\"", WT_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 WT_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();\" />", WT_I18N::translate('Show thumbnails'); - echo "</td></tr>"; - echo "<tr><td class=\"list_label width10\" style=\"padding: 5px;\">"; - echo "<input type=\"submit\" name=\"search\" value=\"", WT_I18N::translate('Filter'), "\" onclick=\"this.form.subclick.value=this.name\" /> "; - echo "<input type=\"submit\" name=\"all\" value=\"", WT_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 WT_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=\"", WT_I18N::translate('Filter'), "\" onclick=\"this.form.subclick.value=this.name\" /> "; - echo "<input type=\"submit\" name=\"all\" value=\"", WT_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") { - 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 WT_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=\"", WT_I18N::translate('Filter'), "\" onclick=\"this.form.subclick.value=this.name\" /> "; - echo "<input type=\"submit\" name=\"all\" value=\"", WT_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 WT_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=\"", WT_I18N::translate('Filter'), "\" onclick=\"this.form.subclick.value=this.name\" /> "; - echo "<input type=\"submit\" name=\"all\" value=\"", WT_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") { - 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 WT_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=\"", WT_I18N::translate('Filter'), "\" onclick=\"this.form.subclick.value=this.name\" /> "; - echo "<input type=\"submit\" name=\"all\" value=\"", WT_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=\"\">", WT_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()\">", WT_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();\">", WT_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('WT_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> "; - - if ($ABBREVIATE_CHART_LABELS) { - $born=WT_Gedcom_Tag::getAbbreviation('BIRT'); - } else { - $born=WT_Gedcom_Tag::getLabel('BIRT'); - } - - - echo "</span><br><span class=\"list_item\">", $born, " ", $indi->getbirthyear(), " ", $indi->getbirthplace(), "</span></a></li>"; - - echo "<hr />"; - } - echo '</ul></td></tr><tr><td class="list_label">', WT_I18N::translate('Total individuals: %s', count($myindilist)), '</tr></td>'; - } else { - echo "<td class=\"list_value_wrap\">"; - echo WT_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 = wt_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('WT_GedcomRecord', 'Compare')); - foreach ($myfamlist as $family) { - echo $family->format_list('li', true); - } - echo '</ul></td></tr><tr><td class="list_label">', WT_I18N::translate('Total families: %s', count($myfamlist)), '</tr></td>'; - } else { - echo "<td class=\"list_value_wrap\">"; - echo WT_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=\"find.php?directory=".rawurlencode($pdir)."&thumbdir=".rawurlencode($pthumb)."&level=".($level-1)."{$thumbget}&type=media&choose={$choose}\"> <-- <span dir=\"ltr\">".$pdir."</span> </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 WT_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=\"find.php?directory=".rawurlencode($directory)."&thumbdir=".str_replace($MEDIA_DIRECTORY, $MEDIA_DIRECTORY."thumbs/", $directory)."&level={$level}{$thumbget}&external_links=http&type=media&choose={$choose}\">", WT_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=\"find.php?directory=".rawurlencode($directory.$dir)."/&thumbdir=".rawurlencode($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 " "; - } - - //-- name and size field - echo "<td class=\"list_value $TEXT_DIRECTION\">"; - if ($media["TITL"] != "") { - echo "<b>", PrintReady($media["TITL"]), "</b> "; - 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);\">", WT_I18N::translate('View'), "</a><br />"; - if (!$media["EXISTS"] && !isFileExternal($media["FILE"])) echo $media["FILE"], "<br /><span class=\"error\">", WT_I18N::translate('The filename entered does not exist.'), "</span><br />"; - else if (!isFileExternal($media["FILE"]) && !empty($imgsize[0])) { - echo WT_Gedcom_Tag::getLabelValue('__IMAGE_SIZE__', $imgsize[0].' × '.$imgsize[1]); - } - if ($media["LINKED"]) { - echo WT_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=WT_GedcomRecord::getInstance($indi); - echo '<br /><a href="', $record->getHtmlUrl(), '">'; - switch($type_record) { - case 'INDI': - echo WT_I18N::translate('View Person'), ' - '; - break; - case 'FAM': - echo WT_I18N::translate('View Family'), ' - '; - break; - case 'SOUR': - echo WT_I18N::translate('View Source'), ' - '; - break; - case 'OBJE': - echo WT_I18N::translate('View Object'), ' - '; - break; - } - echo PrintReady($record->getFullName()), '</a>'; - } - } else { - echo WT_I18N::translate('This media object is not linked to any GEDCOM record.'); - } - echo "</td>"; - } - } - } - } - else { - echo "<tr><td class=\"list_value_wrap\">"; - echo WT_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("\'", '"'), $place), "');\">", PrintReady($place), "</a></li>"; - } - echo "</ul></td></tr>"; - echo "<tr><td class=\"list_label\">", WT_I18N::translate('Places found'), " ", $ctplace; - echo "</td></tr>"; - } - else { - echo "<tr><td class=\"list_value_wrap $TEXT_DIRECTION\"><ul>"; - echo WT_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="', $repo->getHtmlUrl(), '" onclick="pasteid(\'', $repo->getXref(), '\');"><span class="list_item">', $repo->getListName(),'</span></a></li>'; - } - echo "</ul></td></tr>"; - echo "<tr><td class=\"list_label\">", WT_I18N::translate('Repositories found'), " ", count($repo_list); - echo "</td></tr>"; - } - else { - echo "<tr><td class=\"list_value_wrap\">"; - echo WT_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('WT_GedcomRecord', 'Compare')); - echo '<tr><td class="list_value_wrap"><ul>'; - foreach ($mynotelist as $note) { - echo '<li><a href="', $note->getHtmlUrl(), '" onclick="pasteid(\'', $note->getXref(), '\');"><span class="list_item">', $note->getListName(),'</span></a></li>'; - } - echo '</ul></td></tr><tr><td class="list_label">', WT_I18N::translate('Shared Notes found'), ' ', count($mynotelist), '</td></tr>'; - } - else { - echo '<tr><td class="list_value_wrap">', WT_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('WT_GedcomRecord', 'Compare')); - echo '<tr><td class="list_value_wrap"><ul>'; - foreach ($mysourcelist as $source) { - echo '<li><a href="', $source->getHtmlUrl(), '" onclick="pasteid(\'', $source->getXref(), '\');"><span class="list_item">', $source->getListName(),'</span></a></li>'; - } - echo '</ul></td></tr><tr><td class="list_label">', WT_I18N::translate('Total sources: %s', count($mysourcelist)), '</td></tr>'; - } - else { - echo '<tr><td class="list_value_wrap">', WT_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_v3/GEDFact_assistant/_MEDIA/media_3_search_add.php b/modules_v3/GEDFact_assistant/_MEDIA/media_3_search_add.php deleted file mode 100644 index de15f769b0..0000000000 --- a/modules_v3/GEDFact_assistant/_MEDIA/media_3_search_add.php +++ /dev/null @@ -1,1388 +0,0 @@ -<?php -// Media Link Assistant Control module for webtrees -// -// Media Link information about an individual -// -// webtrees: Web based Family History software -// Copyright (C) 2011 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 -// -// $Id$ - -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 WT_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 WT_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&mod_action=_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 ' <font size="2"> ', WT_I18N::translate('Search'), '</font>'; - echo '</a>'; - ?> - </td> - </tr> - <tr> - <td class="transparent;"> - <br /> - </td> - </tr> - - <?php - //-- Add Family Members to Census ------------------------------------------- - global $WT_IMAGES, $spouselinks, $parentlinks, $DeathYr, $BirthYr, $TEXT_DIRECTION, $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 ================================================= - $headImg = "<img class=\"headimg vmiddle\" src=\"".$WT_IMAGES["button_head"]."\" />"; - $headImg2 = "<img class=\"headimg2 vmiddle\" src=\"".$WT_IMAGES["button_head"]."\" alt=\"".WT_I18N::translate('Click to choose person as Head of family.')."\" title=\"".WT_I18N::translate('Click to choose person as Head of family.')."\" />"; - global $tempStringHead; - echo WT_I18N::translate('Click %s to choose person as Head of family.', $headImg); - ?> - <br /><br /> - <?php echo WT_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 $family) { - $label = $this->indi->getChildFamilyLabel($family); - $people = $this->buildFamilyList($family, "parents"); - $marrdate = $family->getMarriageDate(); - - // Husband ------------------- - if (isset($people["husb"])) { - $married = WT_Date::Compare($censdate, $marrdate); - $nam = $people["husb"]->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; - $givn = rtrim($nam[0]['givn'],'*'); - $surn = $nam[0]['surname']; - if (isset($nam[1])) { - $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; - $marn = $nam[1]['surname']; - } - $menu = new WT_Menu(" " . $people["husb"]->getLabel()); - // $menu->addClass("", "", "submenu"); - $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); - $slabel .= $parentlinks; - $submenu = new WT_Menu($slabel); - $menu->addSubMenu($submenu); - - - echo '<tr>'; - // Define width of Left (Label) column ------- - ?> - <td width=75 align="left" class="optionbox"> - <font size=1> - <?php echo $menu->getMenu(); ?> - </font> - </td> - <td align="left" class="facts_value" > - <font size=1> - <?php - echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom=".WT_GEDURL."\">"; - echo $headImg2; - echo "</a>"; - ?> - </font> - </td> - <td align="left" class="facts_value"> - <font size=1> - <?php - if (($people["husb"]->canDisplayDetails())) { - ?> - <a href='javaScript:opener.insertRowToTable("<?php - echo PrintReady($people["husb"]->getXref()) ; // pid = PID - ?>", "<?php - // echo PrintReady($people["husb"]->getFullName()); // nam = Name - echo PrintReady($fulln); - ?>", "<?php - echo PrintReady($people["husb"]->getLabel()); // label = Relationship - ?>", "<?php - echo PrintReady($people["husb"]->getSex()); // gend = Gender - ?>", "<?php - if ($married>=0) { - echo "M"; // cond = Condition (Married) - } else { - echo "S"; // cond = Condition (Single) - } - ?>", "<?php - echo PrintReady($people["husb"]->getbirthyear()); // yob = Year of Birth - ?>", "<?php - echo PrintReady($censyear-$people["husb"]->getbirthyear()); // age = Census Date minus YOB - ?>", "<?php - echo "Y"; // YMD - ?>", "<?php - echo ""; // occu = Occupation - ?>", "<?php - echo PrintReady($people["husb"]->getcensbirthplace()); // birthpl = Census Place of Birth - ?>");'><?php - echo PrintReady($people["husb"]->getFullName()); // Name - ?> - </a> - <?php - } else { - echo WT_I18N::translate('Private'); - } - ?> - </font> - </td> - </tr> - <?php - } - - if (isset($people["wife"])) { - $married = WT_Date::Compare($censdate, $marrdate); - $nam = $people["wife"]->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; - $givn = rtrim($nam[0]['givn'],'*'); - $surn = $nam[0]['surname']; - if (isset($nam[1])) { - $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; - $marn = $nam[1]['surname']; - } else { - $fulmn = $fulln; - $marn = $surn; - } - - $menu = new WT_Menu(" " . $people["wife"]->getLabel()); - //$menu->addClass("", "", "submenu"); - $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); - $slabel .= $parentlinks; - $submenu = new WT_Menu($slabel); - $menu->addSubMenu($submenu); - ?> - <tr> - <td width=75 align="left" class="optionbox"> - <font size=1> - <?php echo $menu->getMenu(); ?> - </font> - </td> - <td align="left" class="facts_value"> - <font size=1> - <?php - echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom=".WT_GEDURL."\">"; - echo $headImg2; - echo "</a>"; - ?> - </font> - </td> - <td align="left" class="facts_value"> - <font size=1> - <?php - if (($people["wife"]->canDisplayDetails())) { - ?> - <a href='javaScript:opener.insertRowToTable("<?php - echo $people["wife"]->getXref() ; // pid = PID - ?>", "<?php - // if ($married>=0 && isset($nam[1])) { - // echo PrintReady($fulmn); // nam = Married Name - // } else { - //echo PrintReady($people["wife"]->getFullName()); // nam = Name - echo PrintReady($fulln); - // } - ?>", "<?php - echo PrintReady($people["wife"]->getLabel()); // label = Relationship - ?>", "<?php - echo 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 - echo PrintReady($people["wife"]->getbirthyear()); // yob = Year of Birth - ?>", "<?php - echo PrintReady($censyear-$people["wife"]->getbirthyear()); // age = Census Date minus YOB - ?>", "<?php - echo "Y"; // YMD - ?>", "<?php - echo ""; // occu = Occupation - ?>", "<?php - echo PrintReady($people["wife"]->getcensbirthplace()); // birthpl = Census Place of Birth - ?>");'> - <?php - //if ($married>=0 && isset($nam[1])) { - // echo PrintReady($fulmn); // Full Married Name - //} else { - echo PrintReady($people["wife"]->getFullName()); // Full Name - //} - ?> - </a> - <?php - } else { - echo WT_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 = WT_Date::Compare($censdate, $tmp); - } - $nam = $child->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; - $givn = rtrim($nam[0]['givn'],'*'); - $surn = $nam[0]['surname']; - if (isset($nam[1])) { - $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; - $marn = $nam[1]['surname']; - } - - $menu = new WT_Menu(" " . $child->getLabel()); - //$menu->addClass("", "", "submenu"); - $slabel = print_pedigree_person_nav2($child->getXref(), 2, 0, $personcount++, $currpid, $censyear); - $slabel .= $spouselinks; - $submenu = new WT_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) { - echo $child->getLabel(); - } else { - echo $menu->getMenu(); - } - ?> - </font> - </td> - <td align="left" class="facts_value"> - <font size=1> - <?php - echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$child->getXref()."&gedcom=".WT_GEDURL."\">"; - echo $headImg2; - echo "</a>"; - ?> - </font> - </td> - <td align="left" class="facts_value"> - <font size=1> - <?php - if (($child->canDisplayDetails())) { - ?> - <a href='javaScript:opener.insertRowToTable("<?php - echo $child->getXref() ; // pid = PID - ?>", "<?php - //if ($married>=0 && isset($nam[1])) { - // echo PrintReady($fulmn); // nam = Married Name - //} else { - //echo PrintReady($child->getFullName()); // nam = Full Name - echo PrintReady($fulln); - //} - ?>", "<?php - if ($child->getXref()==$pid) { - echo "Head"; // label = Head - } else { - echo PrintReady($child->getLabel()); // label = Relationship - } - ?>", "<?php - echo 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 - echo PrintReady($child->getbirthyear()); // yob = Year of Birth - ?>", "<?php - echo PrintReady($censyear-$child->getbirthyear()); // age = Census Date minus YOB - ?>", "<?php - echo "Y"; // YMD - ?>", "<?php - echo ""; // occu = Occupation - ?>", "<?php - echo PrintReady($child->getcensbirthplace()); // birthpl = Census Place of Birth - ?>");'><?php - // if ($married>=0 && isset($nam[1])) { - // echo PrintReady($fulmn); // Full Married Name - // } else { - echo PrintReady($child->getFullName()); // Full Name - // } - ?> - </a> - <?php - } else { - echo WT_I18N::translate('Private'); - } - ?> - </font> - </td> - </tr> - <?php - } - } - $elderdate = $child->getBirthDate(false); - } - } - - //-- Build step families ---------------------------------------------------------------- - foreach ($this->indi->getChildStepFamilies() as $family) { - $label = $this->indi->getStepFamilyLabel($family); - $people = $this->buildFamilyList($family, "step-parents"); - if ($people) { - echo "<tr><td><br /></td><td></td></tr>"; - } - $marrdate = $family->getMarriageDate(); - - // Husband ----------------------------- - $elderdate = ""; - if (isset($people["husb"]) ) { - $married = WT_Date::Compare($censdate, $marrdate); - $nam = $people["husb"]->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; - $givn = rtrim($nam[0]['givn'],'*'); - $surn = $nam[0]['surname']; - if (isset($nam[1])) { - $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; - $marn = $nam[1]['surname']; - } - $menu = new WT_Menu(); - if ($people["husb"]->getLabel() == ".") { - $menu->addLabel(" " . WT_I18N::translate('Step-Father')); - } else { - $menu->addLabel(" " . $people["husb"]->getLabel()); - } - //$menu->addClass("", "", "submenu"); - $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); - $slabel .= $parentlinks; - $submenu = new WT_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 echo $menu->getMenu(); ?> - </font> - </td> - <td align="left" class="facts_value"> - <font size=1> - <?php - echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom=".WT_GEDURL."\">"; - echo $headImg2; - echo "</a>"; - ?> - </font> - </td> - <td align="left" class="facts_value"> - <font size=1> - <?php - if (($people["husb"]->canDisplayDetails())) { - ?> - <a href='javaScript:opener.insertRowToTable("<?php - echo PrintReady($people["husb"]->getXref()) ; // pid = PID - ?>", "<?php - //echo PrintReady($people["husb"]->getFullName()); // nam = Name - echo PrintReady($fulln); - ?>", "<?php - if ($people["husb"]->getLabel() == ".") { - echo PrintReady(WT_I18N::translate('Step-Father')); // label = Relationship - } else { - echo PrintReady($people["husb"]->getLabel()); // label = Relationship - } - ?>", "<?php - echo PrintReady($people["husb"]->getSex()); // gend = Gender - ?>", "<?php - if ($married>=0) { - echo "M"; // cond = Condition (Married) - } else { - echo "S"; // cond = Condition (Single) - } - ?>", "<?php - echo PrintReady($people["husb"]->getbirthyear()); // yob = Year of Birth - ?>", "<?php - echo PrintReady($censyear-$people["husb"]->getbirthyear()); // age = Census Date minus YOB - ?>", "<?php - echo "Y"; // YMD - ?>", "<?php - echo ""; // occu = Occupation - ?>", "<?php - echo PrintReady($people["husb"]->getcensbirthplace()); // birthpl = Census Place of Birth - ?>");'> - <?php echo PrintReady($people["husb"]->getFullName()); // Name - ?> - </a> - <?php - } else { - echo WT_I18N::translate('Private'); - } - ?> - </font> - </td> - </tr> - <?php - $elderdate = $people["husb"]->getBirthDate(false); - } - - // Wife ------------------- - if (isset($people["wife"]) ) { - $married = WT_Date::Compare($censdate, $marrdate); - $nam = $people["wife"]->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; - $givn = rtrim($nam[0]['givn'],'*'); - $surn = $nam[0]['surname']; - if (isset($nam[1])) { - $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; - $marn = $nam[1]['surname']; - } - $menu = new WT_Menu(); - if ($people["husb"]->getLabel() == ".") { - $menu->addLabel(" " . WT_I18N::translate('Step-Mother')); - } else { - $menu->addLabel(" " . $people["wife"]->getLabel()); - } - //$menu->addClass("", "", "submenu"); - $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); - $slabel .= $parentlinks; - $submenu = new WT_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 echo $menu->getMenu(); ?> - </font> - </td> - <td align="left" class="facts_value"> - <font size=1> - <?php - echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom=".WT_GEDURL."\">"; - echo $headImg2; - echo "</a>"; - ?> - </font> - </td> - <td align="left" class="facts_value"> - <font size=1> - <?php - if (($people["wife"]->canDisplayDetails())) { - ?> - <a href='javaScript:opener.insertRowToTable("<?php - echo PrintReady($people["wife"]->getXref()) ; // pid = PID - ?>", "<?php - // if ($married>=0 && isset($nam[1])) { - // echo PrintReady($fulmn); // nam = Married Name - // } else { - //echo PrintReady($people["wife"]->getFullName()); // nam = Full Name - echo PrintReady($fulln); - // } - ?>", "<?php - if ($people["wife"]->getLabel() == ".") { - echo PrintReady(WT_I18N::translate('Step-Mother')); // label = Relationship - } else { - echo PrintReady($people["wife"]->getLabel()); // label = Relationship - } - ?>", "<?php - echo 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 - echo PrintReady($people["wife"]->getbirthyear()); // yob = Year of Birth - ?>", "<?php - echo PrintReady($censyear-$people["wife"]->getbirthyear()); // age = Census Date minus YOB - ?>", "<?php - echo "Y"; // YMD - ?>", "<?php - echo ""; // occu = Occupation - ?>", "<?php - echo PrintReady($people["wife"]->getcensbirthplace()); // birthpl = Census Place of Birth - ?>");'> - <?php - //if ($married>=0 && isset($nam[1])) { - // echo PrintReady($fulmn); // Full Married Name - //} else { - echo PrintReady($people["wife"]->getFullName()); // Full Name - //} - ?> - </a> - <?php - } else { - echo WT_I18N::translate('Private'); - } - ?> - </font> - </td> - </tr> - <?php - } - - // Children --------------------- - if (isset($people["children"])) { - $elderdate = $family->getMarriageDate(); - foreach ($people["children"] as $key=>$child) { - $nam = $child->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; - $givn = rtrim($nam[0]['givn'],'*'); - $surn = $nam[0]['surname']; - if (isset($nam[1])) { - $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; - $marn = $nam[1]['surname']; - } - $menu = new WT_Menu(" " . $child->getLabel()); - //$menu->addClass("", "", "submenu"); - $slabel = print_pedigree_person_nav2($child->getXref(), 2, 0, $personcount++, $currpid, $censyear); - $slabel .= $spouselinks; - $submenu = new WT_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 echo $menu->getMenu(); ?> - </font> - </td> - <td align="left" class="facts_value" > - <font size=1> - <?php - echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$child->getXref()."&gedcom=".WT_GEDURL."\">"; - echo $headImg2; - echo "</a>"; - ?> - </font> - </td> - <td align="left" class="facts_value"> - <font size=1> - <?php - if (($child->canDisplayDetails())) { - ?> - <a href='javaScript:opener.insertRowToTable("<?php - echo PrintReady($child->getXref()) ; // pid = PID - ?>", "<?php - //echo PrintReady($child->getFullName()); // nam = Name - echo PrintReady($fulln); - ?>", "<?php - echo PrintReady($child->getLabel()); // label = Relationship - ?>", "<?php - echo PrintReady($child->getSex()); // gend = Gender - ?>", "<?php - echo ""; // cond = Condition (Married or Single) - ?>", "<?php - echo PrintReady($child->getbirthyear()); // yob = Year of Birth - ?>", "<?php - echo PrintReady($censyear-$child->getbirthyear()); // age = Census Date minus YOB - ?>", "<?php - echo "Y"; // YMD - ?>", "<?php - echo ""; // occu = Occupation - ?>", "<?php - echo PrintReady($child->getcensbirthplace()); // birthpl = Census Place of Birth - ?>");'> - <?php echo PrintReady($child->getFullName()); // Name - ?> - </a> - <?php - } else { - echo WT_I18N::translate('Private'); - } - ?> - </font> - </td> - </tr> - <?php - //$elderdate = $child->getBirthDate(false); - } - } - } - - echo "<tr><td><font size=1><br /></font></td></tr>"; - - //-- Build Spouse Family --------------------------------------------------- - $families = $this->indi->getSpouseFamilies(); - //$personcount = 0; - foreach ($families as $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 = WT_Date::Compare($censdate, $marrdate); - $nam = $people["husb"]->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; - $givn = rtrim($nam[0]['givn'],'*'); - $surn = $nam[0]['surname']; - if (isset($nam[1])) { - $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; - $marn = $nam[1]['surname']; - } - $menu = new WT_Menu(" " . $people["husb"]->getLabel()); - //$menu->addClass("", "", "submenu"); - $slabel = print_pedigree_person_nav2($people["husb"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); - $slabel .= $parentlinks; - $submenu = new WT_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) { - echo " " .($people["husb"]->getLabel())." ".WT_I18N::translate('Head of Household:'); - } else { - echo $menu->getMenu(); - } - ?> - </font> - </td> - <td align="left" class="facts_value" > - <font size=1> - <?php - echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["husb"]->getXref()."&gedcom=".WT_GEDURL."\">"; - echo $headImg2; - echo "</a>"; - ?> - </font> - </td> - <td align="left" class="facts_value" > - <font size=1> - <?php - if (($people["husb"]->canDisplayDetails())) { - ?> - <a href='javaScript:opener.insertRowToTable("<?php - echo $people["husb"]->getXref() ; // pid = PID - ?>", "<?php - //echo PrintReady($people["husb"]->getFullName()); // nam = Name - echo PrintReady($fulln); - ?>", "<?php - if ($people["husb"]->getXref()==$pid) { - echo "Head"; // label = Relationship - } else { - echo $people["husb"]->getLabel(); // label = Relationship - } - ?>", "<?php - echo PrintReady($people["husb"]->getSex()); // gend = Gender - ?>", "<?php - if ($married>=0) { - echo "M"; // cond = Condition (Married) - } else { - echo "S"; // cond = Condition (Single) - } - ?>", "<?php - echo PrintReady($people["husb"]->getbirthyear()); // yob = Year of Birth - ?>", "<?php - echo PrintReady($censyear-$people["husb"]->getbirthyear()); // age = Census Date minus YOB - ?>", "<?php - echo "Y"; // YMD - ?>", "<?php - echo ""; // occu = Occupation - ?>", "<?php - echo PrintReady($people["husb"]->getcensbirthplace()); // birthpl = Census Place of Birth - ?>");'> - <?php - echo PrintReady($people["husb"]->getFullName()); // Name - ?> - </a> - <?php - } else { - echo WT_I18N::translate('Private'); - } - ?> - </font> - </td> - <tr> - <?php - } - - - // Wife ------------------- - //if (isset($people["wife"]) && $spousetag == 'WIFE') { - if (isset($people["wife"])) { - $married = WT_Date::Compare($censdate, $marrdate); - $nam = $people["wife"]->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; - $givn = rtrim($nam[0]['givn'],'*'); - $surn = $nam[0]['surname']; - if (isset($nam[1])) { - $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; - $marn = $nam[1]['surname']; - } else { - $fulmn = $fulln; - $marn = $surn; - } - $menu = new WT_Menu(" " . $people["wife"]->getLabel()); - //$menu->addClass("", "", "submenu"); - $slabel = print_pedigree_person_nav2($people["wife"]->getXref(), 2, 0, $personcount++, $currpid, $censyear); - $slabel .= $parentlinks; - $submenu = new WT_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) { - echo " " .($people["wife"]->getLabel())." ".WT_I18N::translate('Head of Household:'); - } else { - echo $menu->getMenu(); - } - ?> - </font> - </td> - <td align="left" class="facts_value"> - <font size=1> - <?php - echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$people["wife"]->getXref()."&gedcom=".WT_GEDURL."\">"; - echo $headImg2; - echo "</a>"; - ?> - </font> - </td> - <td align="left" class="facts_value"> - <font size=1> - <?php - if (($people["wife"]->canDisplayDetails())) { - ?> - <a href='javaScript:opener.insertRowToTable("<?php - echo $people["wife"]->getXref() ; // pid = PID - ?>", "<?php - // if ($married>=0 && isset($nam[1])) { - // echo PrintReady($fulmn); // nam = Full Married Name - // } else { - //echo PrintReady($people["wife"]->getFullName()); // nam = Full Name - echo PrintReady($fulln); - // } - ?>", "<?php - if ($people["wife"]->getXref()==$pid) { - echo "Head"; // label = Head - } else { - echo PrintReady($people["wife"]->getLabel()); // label = Relationship - } - ?>", "<?php - echo 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 - echo PrintReady($people["wife"]->getbirthyear()); // yob = Year of Birth - ?>", "<?php - echo PrintReady($censyear-$people["wife"]->getbirthyear()); // age = Census Date minus YOB - ?>", "<?php - echo "Y"; // YMD - ?>", "<?php - echo ""; // occu = Occupation - ?>", "<?php - echo PrintReady($people["wife"]->getcensbirthplace()); // birthpl = Census Place of Birth - ?>");'> - <?php - //if ($married>=0 && isset($nam[1])) { - // echo PrintReady($fulmn); // Full Married Name - //} else { - echo PrintReady($people["wife"]->getFullName()); // Full Name - //} - ?> - </a> - <?php - } else { - echo WT_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 = WT_Date::Compare($censdate, $tmp); - } - $nam = $child->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; - $givn = rtrim($nam[0]['givn'],'*'); - $surn = $nam[0]['surname']; - if (isset($nam[1])) { - $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; - $marn = $nam[1]['surname']; - } else { - $fulmn = $fulln; - $marn = $surn; - } - $menu = new WT_Menu(" " . $child->getLabel()); - //$menu->addClass("", "", "submenu"); - $slabel = print_pedigree_person_nav2($child->getXref(), 2, 0, $personcount++, $child->getLabel(), $censyear); - $slabel .= $spouselinks; - $submenu = new WT_Menu($slabel); - $menu->addSubmenu($submenu); - ?> - <tr> - <td width=75 align="left" class="optionbox" > - <font size=1> - <?php echo $menu->getMenu(); ?> - </font> - </td> - <td align="left" class="facts_value"> - <font size=1> - <?php - echo "<a href=\"edit_interface.php?action=addmedia_links&noteid=newnote&pid=".$child->getXref()."&gedcom=".WT_GEDURL."\">"; - echo $headImg2; - echo "</a>"; - ?> - </font> - </td> - <td align="left" class="facts_value"> - <font size=1> - <?php - if (($child->canDisplayDetails())) { - ?> - <a href='javaScript:opener.insertRowToTable("<?php - echo $child->getXref() ; // pid = PID - ?>", "<?php - // if ($married>0 && isset($nam[1])) { - // echo PrintReady($fulmn); // nam = Full Married Name - // } else { - // echo PrintReady($child->getFullName()); // nam = Full Name - echo PrintReady($fulln); // nam = Full Name - // } - ?>", "<?php - echo PrintReady($child->getLabel()); // label = Relationship - ?>", "<?php - echo 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 - echo PrintReady($child->getbirthyear()); // yob = Year of Birth - ?>", "<?php - echo PrintReady($censyear-$child->getbirthyear()); // age = Census Date minus YOB - ?>", "<?php - echo "Y"; // YMD - ?>", "<?php - echo ""; // occu = Occupation - ?>", "<?php - echo PrintReady($child->getcensbirthplace()); // birthpl = Census Place of Birth - ?>");'> - <?php - // if ($married>=0 && isset($nam[1])) { - // echo PrintReady($fulmn); // Full Married Name - // } else { - echo PrintReady($child->getFullName()); // Full Name - // } - ?> - </a> - <?php - } else { - echo WT_I18N::translate('Private'); - } - ?> - </font> - </td> - </tr> - <?php - } - echo "<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 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, $count=0, $personcount="1", $currpid, $censyear) { - global $HIDE_LIVE_PEOPLE, $SHOW_LIVING_NAMES, $ZOOM_BOXES, $LINK_ICONS; - global $MULTI_MEDIA, $SHOW_HIGHLIGHT_IMAGES, $bwidth, $bheight, $PEDIGREE_FULL_DETAILS, $SHOW_PEDIGREE_PLACES; - global $TEXT_DIRECTION, $DEFAULT_PEDIGREE_GENERATIONS, $OLD_PGENS, $talloffset, $PEDIGREE_LAYOUT, $MEDIA_DIRECTORY; - global $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, $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=WT_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 (empty($SEARCH_SPIDER)) { - if ($LINK_ICONS!="disabled") { - //-- draw a box for the family popup - if ($TEXT_DIRECTION=="rtl") { - $spouselinks .= "<table id=\"flyoutFamRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">"; - $spouselinks .= "<b>" . WT_I18N::translate('Family') . "</b> (" .$person->getFullName(). ")<br />"; - $parentlinks .= "<table id=\"flyoutParRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">"; - $parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; - $step_parentlinks .= "<table id=\"flyoutStepRTL\" class=\"person_box$isF\"><tr><td class=\"name2 font9 rtl\">"; - $step_parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; - } else { - $spouselinks .= "<table id=\"flyoutFam\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">"; - $spouselinks .= "<b>" . WT_I18N::translate('Family') . "</b> (" .$person->getFullName(). ")<br />"; - $parentlinks .= "<table id=\"flyoutPar\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">"; - $parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; - $step_parentlinks .= "<table id=\"flyoutStep\" class=\"person_box$isF\"><tr><td class=\"name2 font9 ltr\">"; - $step_parentlinks .= "<b>" . WT_I18N::translate('Parents') . "</b> (" .$person->getFullName(). ")<br />"; - } - $persons = ""; - $person_parent = ""; - $person_step = ""; - - //-- parent families -------------------------------------- - foreach ($person->getChildFamilies() as $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 ($husb) { - $person_parent="Yes"; - $tmp=$husb->getXref(); - if ($husb->canDisplayName()) { - $nam = $husb->getAllNames(); - // $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surn']; - $fulln = $husb->getFullName(); - $givn = rtrim($nam[0]['givn'],'*'); - $surn = $nam[0]['surn']; - if (isset($nam[1]) ) { - $fulmn = rtrim($nam[1]['givn'],'*')." ".$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 .= WT_I18N::translate('Private'); - } - $natdad = "yes"; - } - } - - // Wife ------------------------------ - if ($wife || $num>0) { - if ($wife) { - $person_parent="Yes"; - $tmp=$wife->getXref(); - if ($wife->canDisplayName()) { - $married = WT_Date::Compare($censdate, $marrdate); - $nam = $wife->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; - $givn = rtrim($nam[0]['givn'],'*'); - $surn = $nam[0]['surname']; - if (isset($nam[1])) { - //$fulmn = rtrim($nam[1]['givn'],'*')." ".$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 .= WT_I18N::translate('Private'); - } - $parentlinks .= "<br />"; - $natmom = "yes"; - } - } - } - } - - //-- step families ----------------------------------------- - $fams = $person->getChildStepFamilies(); - foreach ($fams as $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 ($husb) { - $person_step="Yes"; - $tmp=$husb->getXref(); - if ($husb->canDisplayName()) { - $nam = $husb->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; - //$fulln = $husb->getFullName(); - $givn = rtrim($nam[0]['givn'],'*'); - $surn = $nam[0]['surname']; - if (isset($nam[1])) { - $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; - $marn = $nam[1]['surname']; - } - - $parentlinks .= "<a href=\"individual.php?pid={$tmp}&tab={$tabno}&gedcom=".WT_GEDURL."\">"; - $parentlinks .= PrintReady($husb->getFullName()); - $parentlinks .= "</a>"; - } else { - $parentlinks .= WT_I18N::translate('Private'); - } - $parentlinks .= "<br />"; - } - } - } - - if ($natmom == "yes") { - } else { - // Wife ---------------------------- - if ($wife || $num>0) { - if ($wife) { - $person_step="Yes"; - $tmp=$wife->getXref(); - if ($wife->canDisplayName()) { - $married = WT_Date::Compare($censdate, $marrdate); - $nam = $wife->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; - $givn = rtrim($nam[0]['givn'],'*'); - $surn = $nam[0]['surname']; - if (isset($nam[1])) { - $fulmn = rtrim($nam[1]['givn'],'*')." ".$nam[1]['surname']; - $marn = $nam[1]['surname']; - } - $parentlinks .= "<a href=\"individual.php?pid={$tmp}&tab={$tabno}&gedcom=".WT_GEDURL."\">"; - $parentlinks .= PrintReady($wife->getFullName()); - $parentlinks .= "</a>"; - } else { - $parentlinks .= WT_I18N::translate('Private'); - } - $parentlinks .= "<br />"; - } - } - } - } - } - - // Spouse Families -------------------------------------- @var $family Family - foreach ($person->getSpouseFamilies() as $family) { - if (!is_null($family)) { - $spouse = $family->getSpouse($person); - $children = $family->getChildren(); - $num = count($children); - $marrdate = $family->getMarriageDate(); - - // Spouse ------------------------------ - if ($spouse || $num>0) { - if ($spouse) { - $tmp=$spouse->getXref(); - if ($spouse->canDisplayName()) { - $married = WT_Date::Compare($censdate, $marrdate); - $nam = $spouse->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; - $givn = rtrim($nam[0]['givn'],'*'); - $surn = $nam[0]['surname']; - if (isset($nam[1])) { - $fulmn = rtrim($nam[1]['givn'],'*')." ".$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 .= WT_I18N::translate('Private'); - } - $spouselinks .= "</a>"; - if ($spouse->getFullName() != "") { - $persons = "Yes"; - } - } - } - - // Children ------------------------------ @var $child Person - $spouselinks .= "<div id='spouseFam'>"; - $spouselinks .= "<ul class=\"clist ".$TEXT_DIRECTION."\">"; - foreach ($children as $c=>$child) { - $cpid = $child->getXref(); - if ($child) { - $persons="Yes"; - if ($child->canDisplayName()) { - $nam = $child->getAllNames(); - $fulln = rtrim($nam[0]['givn'],'*')." ".$nam[0]['surname']; - $givn = rtrim($nam[0]['givn'],'*'); - $surn = $nam[0]['surname']; - if (isset($nam[1])) { - $fulmn = rtrim($nam[1]['givn'],'*')." ".$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 .= WT_I18N::translate('Private'); - } - $spouselinks .= "</li>"; - } - } - $spouselinks .= "</ul>"; - $spouselinks .= "</div>"; - } - } - - if ($persons != "Yes") { - $spouselinks .= "(" . WT_I18N::translate('none') . ")</td></tr></table>"; - } else { - $spouselinks .= "</td></tr></table>"; - } - - if ($person_parent != "Yes") { - $parentlinks .= "(" . WT_I18N::translate_c('unknown family', 'unknown') . ")</td></tr></table>"; - } else { - $parentlinks .= "</td></tr></table>"; - } - - if ($person_step != "Yes") { - $step_parentlinks .= "(" . WT_I18N::translate_c('unknown family', 'unknown') . ")</td></tr></table>"; - } else { - $step_parentlinks .= "</td></tr></table>"; - } - } - } - } -} diff --git a/modules_v3/GEDFact_assistant/_MEDIA/media_5_input.js b/modules_v3/GEDFact_assistant/_MEDIA/media_5_input.js deleted file mode 100644 index d39280b710..0000000000 --- a/modules_v3/GEDFact_assistant/_MEDIA/media_5_input.js +++ /dev/null @@ -1,335 +0,0 @@ -/** - * Media Link Assistant Control module for webtrees - * - * Media Link information about an individual - * - * webtrees: Web based Family History software - * Copyright (C) 2011 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 GEDFact_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; - - if (num == null) { - num = nextRow; - } else { - iteration = num + ROW_BASE; - } - - // add the row - var row = tbl.tBodies[0].insertRow(num); - - // CONFIG: requires class - 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); - 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.background='transparent'; - txtInp1.style.border='0px'; - txtInp1.style.fontSize="11px"; - cell1.appendChild(txtInp1); - - // cell 2 - Name - var cell2 = row.insertCell(2); - var txtInp2 = document.createElement('div'); - txtInp2.setAttribute('type', 'text'); - txtInp2.setAttribute('id', INPUT_NAME_PREFIX + iteration + '_2'); - 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', removeLinkIcon); - btnEl.setAttribute('alt', remove); - btnEl.setAttribute('title', remove); - btnEl.setAttribute('height', '14px'); - 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', familyNavIcon); - 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', familyNavIcon); - 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_v3/GEDFact_assistant/_MEDIA/media_5_input.php b/modules_v3/GEDFact_assistant/_MEDIA/media_5_input.php deleted file mode 100644 index 82a6ec4900..0000000000 --- a/modules_v3/GEDFact_assistant/_MEDIA/media_5_input.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * Media Link Assistant Control module for webtrees - * - * Media Link information about an individual - * - * webtrees: Web based Family History software - * Copyright (C) 2011 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 GEDFact_assistant - * @version $Id$ - */ - -?> - - <style type="text/css"> - <!-- - .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 - -global $WT_IMAGES; - -// Various JavaScript variables required --------------------------------- ?> -<script language="javascript" type="text/javascript"> - var ifamily = "<?php echo WT_I18N::translate('Open Family Navigator'); ?>"; - var remove = "<?php echo WT_I18N::translate('Remove'); ?>"; - var linkExists = "<?php echo WT_I18N::translate('This link already exists'); ?>"; - /* ===icons === */ - var removeLinkIcon = "<?php echo $WT_IMAGES['remove']; ?>"; - var familyNavIcon = "<?php echo $WT_IMAGES['button_family']; ?>"; -</script> - -<?php -echo '<script src="', WT_MODULES_DIR, '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 WT_I18N::translate('Name'); ?></th> - <th class="topbottombar" width="20" style="font-weight:100;" align="left"><?php echo WT_I18N::translate('Remove'); ?></th> - <th class="topbottombar" width="20" style="font-weight:100;" align="left"><?php echo WT_I18N::translate('Navigator'); ?></th> - </tr> - </thead> - <tbody></tbody> - </table> diff --git a/modules_v3/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php b/modules_v3/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php deleted file mode 100644 index 250384e767..0000000000 --- a/modules_v3/GEDFact_assistant/_MEDIA/media_7_parse_addLinksTbl.php +++ /dev/null @@ -1,101 +0,0 @@ -<?php -/** - * Media Link Assistant Control module for webtrees - * - * Media Link information about an individual - * - * webtrees: Web based Family History software - * Copyright (C) 2011 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 GEDFact_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]; - if (IE) { - str += (str==''?'':', ') + tr.cells[1].childNodes[0].innerHTML; - } else { - str += (str==''?'':', ') + tr.cells[1].childNodes[0].textContent; - } - } -} - -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> diff --git a/modules_v3/GEDFact_assistant/_MEDIA/media_query_1a.php b/modules_v3/GEDFact_assistant/_MEDIA/media_query_1a.php deleted file mode 100644 index 17420dd3e1..0000000000 --- a/modules_v3/GEDFact_assistant/_MEDIA/media_query_1a.php +++ /dev/null @@ -1,96 +0,0 @@ -<?php -/** - * Media Link Assistant Control module for webtrees - * - * Media Link information about an individual - * - * webtrees: Web based Family History software - * Copyright (C) 2011 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) { - echo "You cannot access an include file directly."; - exit; -} -?> - -<html <?php echo WT_I18N::html_markup(); ?>> -<head> -</head> -<body> -<?php - - $links = get_media_relations($mediaid); - 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;" >', WT_I18N::translate('Name'), '</td>'; - echo '<td class="topbottombar" width="20" style="font-weight:100;" >', WT_I18N::translate('Keep'), '</td>'; - echo '<td class="topbottombar" width="20" style="font-weight:100;" >', WT_I18N::translate('Remove'), '</td>'; - echo '<td class="topbottombar" width="20" style="font-weight:100;" >', WT_I18N::translate('Navigator'), '</td>'; - echo "</tr>"; - - $i=1; - foreach (array_keys($links) as $link) { - $record=WT_GedcomRecord::getInstance($link); - echo "<tr ><td>"; - echo $i++; - echo "</td><td id=\"existId_", $i, "\" class=\"row2\">"; - echo $link; - echo "</td><td>"; - echo $record->getFullName(); - echo "</td>"; - echo "<td align='center'><input alt='", WT_I18N::translate('Keep Link in list'), "', title='", WT_I18N::translate('Keep Link in list'), "' type='radio' id='", $link, "_off' name='", $link, "' checked /></td>"; - echo "<td align='center'><input alt='", WT_I18N::translate('Remove Link from list'), "', title='", WT_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_IMAGES['button_family']; ?>" alt="<?php echo WT_I18N::translate('Open Family Navigator'); ?>" title="<?php echo WT_I18N::translate('Open Family Navigator'); ?>" name="family_'<?php echo $link; ?>'" onclick="javascript:openFamNav('<?php echo $link; ?>');" /></a></td> - <?php - } elseif ($record->getType()=='FAM') { - if ($record->getHusband()) { - $head=$record->getHusband()->getXref(); - } elseif ($record->getWife()) { - $head=$record->getWife()->getXref(); - } else { - $head=''; - } - ?> - <td align="center"><a href="#"><img style="border-style:none; margin-top:5px;" src="<?php echo $WT_IMAGES['button_family']; ?>" alt="<?php echo WT_I18N::translate('Open Family Navigator'); ?>" title="<?php echo WT_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>'; - } - - echo "</table>"; - echo "</td></tr></table>"; - echo "<br />"; -?> - -</body> -</html> diff --git a/modules_v3/GEDFact_assistant/_MEDIA/media_query_2a.php b/modules_v3/GEDFact_assistant/_MEDIA/media_query_2a.php deleted file mode 100644 index 9b31206ea3..0000000000 --- a/modules_v3/GEDFact_assistant/_MEDIA/media_query_2a.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php -/** - * Media Link Assistant Control module for webtrees - * - * Media Link information about an individual - * - * webtrees: Web based Family History software - * Copyright (C) 2011 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) { - echo "You cannot access an include file directly."; - exit; -} -?> - -<html <?php echo WT_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¬eid=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 WT_MODULES_DIR.'GEDFact_assistant/_MEDIA/media_5_input.php'; -?> -</td> -</tr> -</table> - -</body> -</html> diff --git a/modules_v3/GEDFact_assistant/_MEDIA/media_query_3a.php b/modules_v3/GEDFact_assistant/_MEDIA/media_query_3a.php deleted file mode 100644 index 80c7258048..0000000000 --- a/modules_v3/GEDFact_assistant/_MEDIA/media_query_3a.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php -// Media Link Assistant Control module for webtrees -// -// Media Link information about an individual -// -// webtrees: Web based Family History software -// Copyright (C) 2011 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 -// -// $Id$ - -// TODO: This module should be loaded via module.php. We should not load it directly. -define('WT_SCRIPT_NAME', WT_MODULES_DIR.'GEDFact_assistant/_MEDIA/media_query_3a.php'); -require '../../../includes/session.php'; - - -$iid2 = safe_GET('iid'); - -print_simple_header(WT_I18N::translate('Link media')); - -$record=WT_GedcomRecord::getInstance($iid2); -if ($record) { - $headjs=''; - if ($record->getType()=='FAM') { - if ($record->getHusband()) { - $headjs=$record->getHusband()->getXref(); - } elseif ($record->getWife()) { - $headjs=$record->getWife()->getXref(); - } - } - ?> - <script 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 type="text/javascript"> - function insertId() { - window.opener.alert('<?php echo strtoupper($iid2); ?> - <?php echo WT_I18N::translate('Not a valid Individual, Family or Source ID'); ?>'); - window.close(); - } - </script> - <?php -} -?> - -<script type="text/javascript"> - window.onLoad = insertId(); -</script> |
