diff options
| author | Greg Roach <fisharebest@gmail.com> | 2017-03-07 12:02:25 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2017-06-17 16:17:44 +0100 |
| commit | 15d603e7c7c15d20f055d3d9c38d6b133453c5be (patch) | |
| tree | 14cd348cd8d2cbb465626429334a9558c0bf5a43 /admin_site_merge.php | |
| parent | 95664b44addad5559917902d85518988a3ea7bc4 (diff) | |
| download | webtrees-15d603e7c7c15d20f055d3d9c38d6b133453c5be.tar.gz webtrees-15d603e7c7c15d20f055d3d9c38d6b133453c5be.tar.bz2 webtrees-15d603e7c7c15d20f055d3d9c38d6b133453c5be.zip | |
jQuery-3, Bootstrap-4, FontAwesome-4.7, Select2-4, remove popup windows
Diffstat (limited to 'admin_site_merge.php')
| -rw-r--r-- | admin_site_merge.php | 146 |
1 files changed, 63 insertions, 83 deletions
diff --git a/admin_site_merge.php b/admin_site_merge.php index 849ad5deef..377fb3939b 100644 --- a/admin_site_merge.php +++ b/admin_site_merge.php @@ -15,26 +15,18 @@ */ namespace Fisharebest\Webtrees; -/** - * Defined in session.php - * - * @global Tree $WT_TREE - */ -global $WT_TREE; - use Fisharebest\Webtrees\Controller\PageController; use Fisharebest\Webtrees\Functions\FunctionsDb; -use Fisharebest\Webtrees\Functions\FunctionsPrint; -define('WT_SCRIPT_NAME', 'admin_site_merge.php'); -require './includes/session.php'; +/** @global Tree $WT_TREE */ +global $WT_TREE; + +require 'includes/session.php'; $controller = new PageController; $controller ->restrictAccess(Auth::isManager($WT_TREE)) - ->setPageTitle(I18N::translate('Merge records') . ' — ' . $WT_TREE->getTitleHtml()) - ->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL) - ->addInlineJavascript('autocomplete();'); + ->setPageTitle(I18N::translate('Merge records') . ' — ' . $WT_TREE->getTitleHtml()); $gid1 = Filter::post('gid1', WT_REGEX_XREF, Filter::get('gid1', WT_REGEX_XREF)); $gid2 = Filter::post('gid2', WT_REGEX_XREF, Filter::get('gid2', WT_REGEX_XREF)); @@ -181,28 +173,28 @@ if ($rec1 && $rec2 && $rec1->getXref() !== $rec2->getXref() && $rec1::RECORD_TYP $controller->pageHeader(); +echo Bootstrap4::breadcrumbs([ + 'admin.php' => I18N::translate('Control panel'), + 'admin_trees_manage.php' => I18N::translate('Manage family trees'), +], $controller->getPageTitle()); ?> -<ol class="breadcrumb small"> - <li><a href="admin.php"><?php echo I18N::translate('Control panel'); ?></a></li> - <li><a href="admin_trees_manage.php"><?php echo I18N::translate('Manage family trees'); ?></a></li> - <li class="active"><?php echo $controller->getPageTitle(); ?></li> -</ol> -<h1><?php echo $controller->getPageTitle(); ?></h1> + +<h1><?= $controller->getPageTitle() ?></h1> <?php if ($rec1 && $rec2 && $rec1->getXref() !== $rec2->getXref() && $rec1::RECORD_TYPE === $rec2::RECORD_TYPE): ?> <form method="post"> <input type="hidden" name="action" value="merge"> - <input type="hidden" name="ged" value="<?php echo $WT_TREE->getNameHtml(); ?>"> - <input type="hidden" name="url" value="<?php echo Filter::get('url', 'admin_trees_duplicates\.php'); ?>"> - <?php echo Filter::getCsrf(); ?> + <input type="hidden" name="ged" value="<?= $WT_TREE->getNameHtml() ?>"> + <input type="hidden" name="url" value="<?= Filter::get('url', 'admin_trees_duplicates\.php') ?>"> + <?= Filter::getCsrf() ?> <p> - <?php echo I18N::translate('Select the facts and events to keep from both records.'); ?> + <?= I18N::translate('Select the facts and events to keep from both records.') ?> </p> <div class="panel panel-default"> <div class="panel-heading"> <h2 class="panel-title"> - <?php echo I18N::translate('The following facts and events were found in both records.'); ?> + <?= I18N::translate('The following facts and events were found in both records.') ?> </h2> </div> <div class="panel-body"> @@ -211,10 +203,10 @@ $controller->pageHeader(); <thead> <tr> <th> - <?php echo I18N::translate('Select'); ?> + <?= I18N::translate('Select') ?> </th> <th> - <?php echo I18N::translate('Details'); ?> + <?= I18N::translate('Details') ?> </th> </tr> </thead> @@ -222,25 +214,25 @@ $controller->pageHeader(); <?php foreach ($facts as $fact_id => $fact): ?> <tr> <td> - <input type="checkbox" name="keep1[]" value="<?php echo $fact->getFactId(); ?>" checked> + <input type="checkbox" name="keep1[]" value="<?= $fact->getFactId() ?>" checked> </td> <td> - <div class="gedcom-data" dir="ltr"><?php echo Filter::escapeHtml($fact->getGedcom()); ?></div> + <div class="gedcom-data" dir="ltr"><?= Filter::escapeHtml($fact->getGedcom()) ?></div> <?php if ($fact->getTarget()): ?> - <a href="<?php echo $fact->getTarget()->getHtmlUrl(); ?>"> - <?php echo $fact->getTarget()->getFullName(); ?> + <a href="<?= $fact->getTarget()->getHtmlUrl() ?>"> + <?= $fact->getTarget()->getFullName() ?> </a> - <?php endif; ?> + <?php endif ?> </td> </tr> - <?php endforeach; ?> + <?php endforeach ?> </tbody> </table> <?php else: ?> <p> - <?php echo I18N::translate('No matching facts found'); ?> + <?= I18N::translate('No matching facts found') ?> </p> - <?php endif; ?> + <?php endif ?> </div> </div> @@ -249,7 +241,7 @@ $controller->pageHeader(); <div class="panel panel-default"> <div class="panel-heading"> <h2 class="panel-title"> - <?php echo /* I18N: the name of an individual, source, etc. */ I18N::translate('The following facts and events were only found in the record of %s.', '<a href="' . $rec1->getHtmlUrl() . '">' . $rec1->getFullName()) . '</a>'; ?> + <?= /* I18N: the name of an individual, source, etc. */ I18N::translate('The following facts and events were only found in the record of %s.', '<a href="' . $rec1->getHtmlUrl() . '">' . $rec1->getFullName()) . '</a>' ?> </h2> </div> <div class="panel-body"> @@ -258,10 +250,10 @@ $controller->pageHeader(); <thead> <tr> <th> - <?php echo I18N::translate('Select'); ?> + <?= I18N::translate('Select') ?> </th> <th> - <?php echo I18N::translate('Details'); ?> + <?= I18N::translate('Details') ?> </th> </tr> </thead> @@ -269,25 +261,25 @@ $controller->pageHeader(); <?php foreach ($facts1 as $fact_id => $fact): ?> <tr> <td> - <input type="checkbox" name="keep1[]" value="<?php echo $fact->getFactId(); ?>" checked> + <input type="checkbox" name="keep1[]" value="<?= $fact->getFactId() ?>" checked> </td> <td> - <div class="gedcom-data" dir="ltr"><?php echo Filter::escapeHtml($fact->getGedcom()); ?></div> + <div class="gedcom-data" dir="ltr"><?= Filter::escapeHtml($fact->getGedcom()) ?></div> <?php if ($fact->getTarget()): ?> - <a href="<?php echo $fact->getTarget()->getHtmlUrl(); ?>"> - <?php echo $fact->getTarget()->getFullName(); ?> + <a href="<?= $fact->getTarget()->getHtmlUrl() ?>"> + <?= $fact->getTarget()->getFullName() ?> </a> - <?php endif; ?> + <?php endif ?> </td> </tr> - <?php endforeach; ?> + <?php endforeach ?> </tbody> </table> <?php else: ?> <p> - <?php echo I18N::translate('No matching facts found'); ?> + <?= I18N::translate('No matching facts found') ?> </p> - <?php endif; ?> + <?php endif ?> </div> </div> </div> @@ -295,7 +287,7 @@ $controller->pageHeader(); <div class="panel panel-default"> <div class="panel-heading"> <h2 class="panel-title"> - <?php echo /* I18N: the name of an individual, source, etc. */ I18N::translate('The following facts and events were only found in the record of %s.', '<a href="' . $rec2->getHtmlUrl() . '">' . $rec2->getFullName()) . '</a>'; ?> + <?= /* I18N: the name of an individual, source, etc. */ I18N::translate('The following facts and events were only found in the record of %s.', '<a href="' . $rec2->getHtmlUrl() . '">' . $rec2->getFullName()) . '</a>' ?> </h2> </div> <div class="panel-body"> @@ -304,10 +296,10 @@ $controller->pageHeader(); <thead> <tr> <th> - <?php echo I18N::translate('Select'); ?> + <?= I18N::translate('Select') ?> </th> <th> - <?php echo I18N::translate('Details'); ?> + <?= I18N::translate('Details') ?> </th> </tr> </thead> @@ -315,25 +307,25 @@ $controller->pageHeader(); <?php foreach ($facts2 as $fact_id => $fact): ?> <tr> <td> - <input type="checkbox" name="keep2[]" value="<?php echo $fact->getFactId(); ?>" checked> + <input type="checkbox" name="keep2[]" value="<?= $fact->getFactId() ?>" checked> </td> <td> - <div class="gedcom-data" dir="ltr"><?php echo Filter::escapeHtml($fact->getGedcom()); ?></div> + <div class="gedcom-data" dir="ltr"><?= Filter::escapeHtml($fact->getGedcom()) ?></div> <?php if ($fact->getTarget()): ?> - <a href="<?php echo $fact->getTarget()->getHtmlUrl(); ?>"> - <?php echo $fact->getTarget()->getFullName(); ?> + <a href="<?= $fact->getTarget()->getHtmlUrl() ?>"> + <?= $fact->getTarget()->getFullName() ?> </a> - <?php endif; ?> + <?php endif ?> </td> </tr> - <?php endforeach; ?> + <?php endforeach ?> </tbody> </table> <?php else: ?> <p> - <?php echo I18N::translate('No matching facts found'); ?> + <?= I18N::translate('No matching facts found') ?> </p> - <?php endif; ?> + <?php endif ?> </div> </div> </div> @@ -341,58 +333,46 @@ $controller->pageHeader(); <button type="submit" class="btn btn-primary"> <i class="fa fa-check"></i> - <?php echo I18N::translate('save'); ?> + <?= I18N::translate('save') ?> </button> </form> <?php else: ?> <form class="form form-horizontal"> - <input type="hidden" name="ged" value="<?php echo $WT_TREE->getNameHtml(); ?>"> - <p><?php echo /* I18N: Records are indviduals, sources, etc. */ I18N::translate('Select two records to merge.'); ?></p> + <input type="hidden" name="ged" value="<?= $WT_TREE->getNameHtml() ?>"> + <p><?= /* I18N: Records are indviduals, sources, etc. */ I18N::translate('Select two records to merge.') ?></p> - <div class="form-group"> - <div class="control-label col-sm-3"> + <div class="row form-group"> + <div class="col-sm-3 col-form-label"> <label for="gid1"> - <?php echo /* I18N: Record is an indvidual, source, etc. */ I18N::translate('First record'); ?> + <?= /* I18N: Record is an indvidual, source, etc. */ I18N::translate('First record') ?> </label> </div> <div class="col-sm-9"> - <input data-autocomplete-type="IFSRO" type="text" name="gid1" id="gid1" maxlength="20" value="<?php echo $gid1; ?>"> - <?php echo FunctionsPrint::printFindIndividualLink('gid1'); ?> - <?php echo FunctionsPrint::printFindFamilyLink('gid1'); ?> - <?php echo FunctionsPrint::printFindSourceLink('gid1'); ?> - <?php echo FunctionsPrint::printFindRepositoryLink('gid1'); ?> - <?php echo FunctionsPrint::printFindMediaLink('gid1'); ?> - <?php echo FunctionsPrint::printFindNoteLink('gid1'); ?> + <input data-autocomplete-type="IFSRO" type="text" name="gid1" id="gid1" maxlength="20" value="<?= $gid1 ?>"> </div> </div> - <div class="form-group"> - <div class="control-label col-sm-3"> + <div class="row form-group"> + <div class="col-sm-3 col-form-label"> <label for="gid2"> - <?php echo /* I18N: Record is an indvidual, source, etc. */ I18N::translate('Second record'); ?> + <?= /* I18N: Record is an indvidual, source, etc. */ I18N::translate('Second record') ?> </label> </div> <div class="col-sm-9"> - <input data-autocomplete-type="IFSRO" type="text" name="gid2" id="gid2" maxlength="20" value="<?php echo $gid2; ?>" > - <?php echo FunctionsPrint::printFindIndividualLink('gid2'); ?> - <?php echo FunctionsPrint::printFindFamilyLink('gid2'); ?> - <?php echo FunctionsPrint::printFindSourceLink('gid2'); ?> - <?php echo FunctionsPrint::printFindRepositoryLink('gid2'); ?> - <?php echo FunctionsPrint::printFindMediaLink('gid2'); ?> - <?php echo FunctionsPrint::printFindNoteLink('gid2'); ?> + <input data-autocomplete-type="IFSRO" type="text" name="gid2" id="gid2" maxlength="20" value="<?= $gid2 ?>" > </div> </div> - <div class="form-group"> - <div class="col-sm-offset-3 col-sm-9"> + <div class="row form-group"> + <div class="offset-sm-3 col-sm-9"> <button type="submit" class="btn btn-primary"> - <?php echo I18N::translate('continue'); ?> + <?= I18N::translate('continue') ?> </button> </div> </div> </form> -<?php endif; ?> +<?php endif ?> |
