예제 #1
0
파일: find.php 프로젝트: sadr110/webtrees
		<tr><td>', WT_I18N::translate('Custom tags'), ':</td><td><input type="text" id="tbxCustom" value="', addslashes(implode(",", $preselCustom)), '"></td></tr>
	<td><td></tbody></table>

	<table id="tabAction"><tbody><tr>
		<td colspan="2"><button id="btnOk" disabled="disabled" onclick="if (!this.disabled) { DoOK(); }">', WT_I18N::translate('save'), '</button></td>
	<tr></tbody></table>
	</td></tr></table>
	</form></div>';
}
if ($action == "filter") {
    $filter = trim($filter);
    $filter_array = explode(' ', preg_replace('/ {2,}/', ' ', $filter));
    // Output Individual
    if ($type == "indi") {
        echo '<div id="find-output">';
        $myindilist = search_indis_names($filter_array, array(WT_GED_ID), 'AND');
        if ($myindilist) {
            echo '<ul>';
            usort($myindilist, array('WT_GedcomRecord', 'Compare'));
            foreach ($myindilist as $indi) {
                echo $indi->format_list('li', true);
            }
            echo '</ul>
			<p>', WT_I18N::translate('Total individuals: %s', count($myindilist)), '</p>';
        } else {
            echo '<p>', WT_I18N::translate('No results found.'), '</p>';
        }
        echo '</div>';
    }
    // Output Family
    if ($type == "fam") {
예제 #2
0
    private static function media_3_find()
    {
        $controller = new WT_Controller_Simple();
        $filter = WT_Filter::get('filter');
        $multiple = WT_Filter::getBool('multiple');
        $controller->setPageTitle(WT_I18N::translate('Find an individual'))->pageHeader();
        echo '<script>';
        ?>

			function pasterow(id, name, gend, yob, age, bpl) {
				window.opener.opener.insertRowToTable(id, name, '', gend, '', yob, age, 'Y', '', bpl);
			}

			function pasteid(id, name, thumb) {
				if (thumb) {
					window.opener.paste_id(id, name, thumb);
					<?php 
        if (!$multiple) {
            echo "window.close();";
        }
        ?>
				} else {
					// GEDFact_assistant ========================
					if (window.opener.document.getElementById('addlinkQueue')) {
						window.opener.insertRowToTable(id, name);
						// Check if Indi, Fam or source ===================
						/*
						if (id.match("I")=="I") {
							var win01 = window.opener.window.open('edit_interface.php?action=addmedia_links&noteid=newnote&pid='+id, 'win01', edit_window_specs);
							if (window.focus) {win01.focus();}
						} else if (id.match("F")=="F") {
							// TODO --- alert('Opening Navigator with family id entered will come later');
						}
						*/
					}
					window.opener.paste_id(id);
					if (window.opener.pastename) {
						window.opener.pastename(name);
					}
					<?php 
        if (!$multiple) {
            echo "window.close();";
        }
        ?>
				}
			}
			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 '</script>';
        echo "<div align=\"center\">";
        echo "<table class=\"list_table width90\" border=\"0\">";
        echo "<tr><td style=\"padding: 10px;\" valign=\"top\" class=\"facts_label03 width90\">";
        // start column for find text header
        echo $controller->getPageTitle();
        echo "</td>";
        echo "</tr>";
        echo "</table>";
        echo "<br>";
        echo '<button onclick="window.close();">', WT_I18N::translate('close'), '</button>';
        echo "<br>";
        $filter = trim($filter);
        $filter_array = explode(' ', preg_replace('/ {2,}/', ' ', $filter));
        echo "<table class=\"tabs_table width90\"><tr>";
        $myindilist = search_indis_names($filter_array, array(WT_GED_ID), 'AND');
        if ($myindilist) {
            echo "<td class=\"list_value_wrap\"><ul>";
            usort($myindilist, array('WT_GedcomRecord', 'compare'));
            foreach ($myindilist as $indi) {
                $nam = WT_Filter::escapeHtml($indi->getFullName());
                echo "<li><a href=\"#\" onclick=\"pasterow(\n\t\t\t\t\t'" . $indi->getXref() . "' ,\n\t\t\t\t\t'" . $nam . "' ,\n\t\t\t\t\t'" . $indi->getSex() . "' ,\n\t\t\t\t\t'" . $indi->getbirthyear() . "' ,\n\t\t\t\t\t'" . (1901 - $indi->getbirthyear()) . "' ,\n\t\t\t\t\t'" . $indi->getbirthplace() . "'); return false;\">\n\t\t\t\t\t<b>" . $indi->getFullName() . "</b>&nbsp;&nbsp;&nbsp;";
                $born = WT_Gedcom_Tag::getLabel('BIRT');
                echo "</span><br><span class=\"list_item\">", $born, " ", $indi->getbirthyear(), "&nbsp;&nbsp;&nbsp;", $indi->getbirthplace(), "</span></a></li>";
                echo "<hr>";
            }
            echo '</ul></td></tr><tr><td class="list_label">', 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>";
        echo '</div>';
    }