diff options
| author | Greg Roach <fisharebest@webtrees.net> | 2018-07-06 18:39:04 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@webtrees.net> | 2018-07-06 18:39:22 +0100 |
| commit | eaf6176917d65962efb940f4ca71c92d33ea9f35 (patch) | |
| tree | 9e5c258c4d4dd66cc18f8a286b36b806a7603f80 /resources/views/modules/GEDFact_assistant | |
| parent | 1ef93f16db4dd1521de3f5f0727918e36a2fccb4 (diff) | |
| download | webtrees-eaf6176917d65962efb940f4ca71c92d33ea9f35.tar.gz webtrees-eaf6176917d65962efb940f4ca71c92d33ea9f35.tar.bz2 webtrees-eaf6176917d65962efb940f4ca71c92d33ea9f35.zip | |
Convert census-assistant to view
Diffstat (limited to 'resources/views/modules/GEDFact_assistant')
| -rw-r--r-- | resources/views/modules/GEDFact_assistant/select-census.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/resources/views/modules/GEDFact_assistant/select-census.php b/resources/views/modules/GEDFact_assistant/select-census.php new file mode 100644 index 0000000000..9f95ad87f7 --- /dev/null +++ b/resources/views/modules/GEDFact_assistant/select-census.php @@ -0,0 +1,26 @@ +<?php use Fisharebest\Webtrees\Date; ?> +<?php use Fisharebest\Webtrees\I18N; ?> + +<script> + function selectCensus(el) { + var option = $(":selected", el); + + $("input[id^=DATE]", $(el).closest("form")).val(option.val()); + $("input[id^=PLAC]", $(el).closest("form")).val(option.data("place")); + $("input.census-class", $(el).closest("form")).val(option.data("census")); + } +</script> + +<select id="census-selector" class="form-control" onchange="selectCensus(this)"> + <option value=""><?= I18N::translate('Census date') ?></option> + + <?php foreach ($census_places as $census_place): ?> + <option value=""></option> + <?php foreach ($census_place->allCensusDates() as $census): ?> + <option value="<?= $census->censusDate() ?>" data-place="<?= $census->censusPlace() ?>" data-census="<?= get_class($census) ?>"> + <?= (explode(', ', $census->censusPlace()))[0] ?> + <?= (new Date($census->censusDate()))->minimumDate()->format('%Y') ?> + </option> + <?php endforeach ?> + <?php endforeach ?> +</select> |
