$options["option"][] = "findmedia"; $options["option"][] = "findplace"; $options["option"][] = "findrepo"; $options["option"][] = "findnote"; $options["option"][] = "findsource"; $options["option"][] = "findspecialchar"; $options["option"][] = "findfact"; $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 id="find-page"><h3>', $controller->getPageTitle(), '</h3>'; // Show indi and hide the rest if ($type == "indi") { echo '<div id="find-header"> <form name="filterindi" method="get" onsubmit="return checknames(this);" action="find.php"> <input type="hidden" name="callback" value="' . $callback . '"> <input type="hidden" name="action" value="filter"> <input type="hidden" name="type" value="indi"> <span>', WT_I18N::translate('Name contains:'), ' </span> <input type="text" name="filter" value="'; if ($filter) { echo $filter; } echo '" autofocus> <input type="submit" value="', WT_I18N::translate('Filter'), '"> </form></div>';
$controller = new WT_Controller_Simple(); $controller->restrictAccess(Auth::isEditor())->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('autocomplete();')->addInlineJavascript(' var locale_date_format="' . preg_replace('/[^DMY]/', '', str_replace(array('J', 'F'), array('D', 'M'), strtoupper($DATE_FORMAT))) . '"; '); switch ($action) { //////////////////////////////////////////////////////////////////////////////// case 'editraw': $xref = WT_Filter::get('xref', WT_REGEX_XREF); $record = WT_GedcomRecord::getInstance($xref); check_record_access($record); $controller->setPageTitle($record->getFullName() . ' - ' . WT_I18N::translate('Edit raw GEDCOM'))->pageHeader()->addInlineJavascript('jQuery("#raw-gedcom-list").sortable({opacity: 0.7, cursor: "move", axis: "y"});'); ?> <div id="edit_interface-page"> <h4> <?php echo $controller->getPageTitle(); ?> <?php echo help_link('edit_edit_raw'); ?> </h4> <pre> <?php echo '0 @' . $record->getXref() . '@ ' . $record::RECORD_TYPE; ?> </pre> <form method="post" action="edit_interface.php"> <input type="hidden" name="ged" value="<?php echo WT_Filter::escapeHtml(WT_GEDCOM); ?> "> <input type="hidden" name="action" value="updateraw">
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¬eid=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> "; $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>"; echo '</div>'; }
default: throw new Exception('Bad $action (' . $action . ') in addmedia.php'); } $controller->pageHeader(); echo '<div id="addmedia-page">'; //container for media edit pop-up echo '<form method="post" name="newmedia" action="addmedia.php" enctype="multipart/form-data">'; echo '<input type="hidden" name="action" value="', $action, '">'; echo '<input type="hidden" name="ged" value="', WT_GEDCOM, '">'; echo '<input type="hidden" name="pid" value="', $pid, '">'; if ($linktoid) { echo '<input type="hidden" name="linktoid" value="', $linktoid, '">'; } echo '<table class="facts_table">'; echo '<tr><td class="topbottombar" colspan="2">'; echo $controller->getPageTitle(), help_link('OBJE'); echo '</td></tr>'; if (!$linktoid && $action == 'create') { echo '<tr><td class="descriptionbox wrap width25">'; echo WT_I18N::translate('Enter an individual, family, or source ID'); echo '</td><td class="optionbox wrap"><input type="text" data-autocomplete-type="IFS" name="linktoid" id="linktoid" size="6" value="">'; echo ' ', print_findindi_link('linktoid'); echo ' ', print_findfamily_link('linktoid'); echo ' ', print_findsource_link('linktoid'); echo '<p class="sub">', WT_I18N::translate('Enter or search for the ID of the individual, family, or source to which this media item should be linked.'), '</p></td></tr>'; } $tmp = WT_Media::getInstance($pid); if ($tmp) { $gedrec = $tmp->getGedcom(); } else { $gedrec = '';