summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2021-02-14 07:15:28 +0000
committerGreg Roach <greg@subaqua.co.uk>2021-02-14 11:34:33 +0000
commit72ef38ed09ae951736be52b92bd0acb4ad24953a (patch)
treeac16548fb6ad768ae48e9c50698de1a6556c22a3 /app
parent663dd9d85326d3016550248671b2f0eba8949cb3 (diff)
downloadwebtrees-72ef38ed09ae951736be52b92bd0acb4ad24953a.tar.gz
webtrees-72ef38ed09ae951736be52b92bd0acb4ad24953a.tar.bz2
webtrees-72ef38ed09ae951736be52b92bd0acb4ad24953a.zip
Gedcom elements
Diffstat (limited to 'app')
-rw-r--r--app/Elements/GovIdType.php318
-rw-r--r--app/Elements/ResearchTask.php61
-rw-r--r--app/Factories/ElementFactory.php10
3 files changed, 386 insertions, 3 deletions
diff --git a/app/Elements/GovIdType.php b/app/Elements/GovIdType.php
new file mode 100644
index 0000000000..ed128c53a9
--- /dev/null
+++ b/app/Elements/GovIdType.php
@@ -0,0 +1,318 @@
+<?php
+
+/**
+ * webtrees: online genealogy
+ * Copyright (C) 2021 webtrees development team
+ * 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 3 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, see <https://www.gnu.org/licenses/>.
+ */
+
+declare(strict_types=1);
+
+namespace Fisharebest\Webtrees\Elements;
+
+use Fisharebest\Webtrees\I18N;
+
+/**
+ * GOV ID, for TYPE_OF_LOCATION
+ */
+class GovIdType extends AbstractElement
+{
+ /**
+ * A list of controlled values for this element
+ *
+ * @return array<int|string,string>
+ */
+ public function values(): array
+ {
+ $values = [
+ '' => '',
+ 1 => 'Amt',
+ 2 => 'Amtsbezirk',
+ 3 => 'Magistrates’ Court',
+ 4 => 'Bauerschaft',
+ 5 => 'district',
+ 6 => 'diocese',
+ 7 => 'federal state',
+ 8 => 'castle',
+ 9 => 'deanery',
+ 10 => 'Departement',
+ 11 => 'diocese',
+ 12 => 'Dompfarrei',
+ 13 => 'filial church',
+ 14 => 'Flecken',
+ 15 => 'field name',
+ 16 => 'free state',
+ 17 => 'building',
+ 18 => 'municipality',
+ 19 => 'Gerichtsbezirk',
+ 20 => 'countship',
+ 21 => 'manor (building)',
+ 22 => 'dominion',
+ 23 => 'duchy',
+ 24 => 'Farm',
+ 25 => 'canton',
+ 26 => 'church',
+ 27 => 'Kirchenkreis',
+ 28 => 'Kirchenprovinz',
+ 29 => 'parish',
+ 30 => 'monastery (building)',
+ 31 => 'kingdom',
+ 32 => 'county (generic)',
+ 33 => 'electorate',
+ 34 => 'state',
+ 35 => 'national church',
+ 36 => 'rural county (rural)',
+ 37 => 'Oberamt',
+ 38 => 'oblast',
+ 39 => 'place',
+ 40 => 'part of place',
+ 41 => 'Pfarr-Rektorat',
+ 42 => 'parish',
+ 43 => 'Pfarrkuratie',
+ 44 => 'Pfarrverband',
+ 45 => 'province',
+ 46 => 'administrative district',
+ 47 => 'historical region',
+ 48 => 'Samtgemeinde',
+ 49 => 'sprengel',
+ 50 => 'country',
+ 51 => 'town',
+ 52 => 'borough',
+ 53 => 'urban county (city)',
+ 54 => 'part of town',
+ 55 => 'village',
+ 56 => 'republic',
+ 57 => 'Amt',
+ 58 => 'union republic',
+ 59 => 'voivodship',
+ 60 => 'principality',
+ 61 => 'grand duchy',
+ 62 => 'margravate',
+ 63 => 'rayon',
+ 64 => 'Vorwerk',
+ 65 => 'Pfarrdorf',
+ 66 => 'village',
+ 67 => 'solitude',
+ 68 => 'Hauptort',
+ 69 => 'hamlet',
+ 70 => 'bailiwick',
+ 71 => 'confederation',
+ 72 => 'people’s republic',
+ 73 => 'Landdrostei',
+ 74 => 'deprecated',
+ 75 => 'Güterdistrikt',
+ 76 => 'Adeliges Gut',
+ 77 => 'Reichskreis',
+ 78 => 'Amt(administrative division)',
+ 79 => 'hundred',
+ 80 => 'Landschaft',
+ 81 => 'monastery',
+ 82 => 'Domkapitel',
+ 83 => 'Hanseatic city',
+ 84 => 'Kirchspielvogtei',
+ 85 => 'rural municipality',
+ 86 => 'part province',
+ 87 => 'mill',
+ 88 => 'Judet',
+ 89 => 'cemetery',
+ 90 => 'abandoned place',
+ 91 => 'Bistumsregion',
+ 92 => 'Kirchengemeinde',
+ 93 => 'Reichsstadt',
+ 94 => 'Verwaltungsgemeinschaft',
+ 95 => 'county - level city',
+ 96 => 'archbishopric',
+ 97 => 'Bürgermeisterei',
+ 98 => 'veraltet',
+ 99 => 'captaincy',
+ 100 => 'Kreishauptmannschaft',
+ 101 => 'Kreisdirektion',
+ 102 => 'forester’s house',
+ 103 => 'civil registry',
+ 104 => 'veraltet',
+ 105 => 'Landgericht',
+ 107 => 'island',
+ 108 => 'Gutsbezirk',
+ 109 => 'Forstgutsbezirk',
+ 110 => 'district office',
+ 111 => 'Schloss',
+ 112 => 'Gespanschaft',
+ 113 => 'comitatus',
+ 114 => 'Vest',
+ 115 => 'forestry',
+ 116 => 'Oberförsterei',
+ 117 => 'Unterförsterei',
+ 118 => 'train station',
+ 119 => 'stop station',
+ 120 => 'settlement',
+ 121 => 'colony',
+ 122 => 'Verbandsgemeinde',
+ 124 => 'Abbey',
+ 125 => 'imperial abbey',
+ 126 => 'Syssel',
+ 127 => 'Verwaltungsverband',
+ 128 => 'Landgrafschaft',
+ 129 => 'settlement',
+ 130 => 'state',
+ 131 => 'Weichbild',
+ 133 => 'region',
+ 134 => 'arrondissement',
+ 135 => 'canton',
+ 136 => 'commune',
+ 137 => 'region',
+ 138 => 'Oberlandratsbezirk',
+ 139 => 'Einschicht',
+ 140 => 'Einheitsgemeinde',
+ 142 => 'Reichsgau',
+ 143 => 'kommune',
+ 144 => 'Ortschaft',
+ 145 => 'Markt',
+ 146 => 'Bezirkshauptmannschaft',
+ 147 => 'veraltet',
+ 148 => 'Erfüllende Gemeinde',
+ 149 => 'Landratsamt',
+ 150 => 'Stadt',
+ 151 => 'Oberlandesgericht',
+ 152 => 'Landbürgermeisterei',
+ 153 => 'Kommissariat',
+ 154 => 'Honschaft',
+ 155 => 'region',
+ 156 => 'Gemeindebezirk',
+ 157 => 'Guberniya',
+ 158 => 'Gemeindeteil',
+ 159 => 'Khutor',
+ 160 => 'soviet republic',
+ 161 => 'Verwaltungsbezirk',
+ 162 => 'Stadt - und Landgemeinde',
+ 163 => 'Ortsgemeinde',
+ 164 => 'Ortsbezirk',
+ 165 => 'Gnotschaft',
+ 166 => 'ruins',
+ 167 => 'mandate territory',
+ 168 => 'Provinz',
+ 169 => 'Gemeinde',
+ 170 => 'district',
+ 171 => 'Stadthauptmannschaft',
+ 172 => 'Katastralgemeinde',
+ 173 => 'Reichskommissariat',
+ 174 => 'general district',
+ 175 => 'Kreisgebiet',
+ 176 => 'protectorate',
+ 177 => 'Reichsritterschaft',
+ 178 => 'Ritterkanton',
+ 179 => 'Ritterkreis',
+ 180 => 'Marktgemeinde',
+ 181 => 'Rotte',
+ 182 => 'Erzstift',
+ 183 => 'Hochstift',
+ 184 => 'Kammerschreiberei',
+ 185 => 'Klosteramt',
+ 186 => 'Rentkammer',
+ 187 => 'zu überprüfen',
+ 188 => 'Ritterorden',
+ 189 => 'Großpriorat',
+ 190 => 'Ballei',
+ 191 => 'Kommende',
+ 192 => 'zone of occupation',
+ 193 => 'Alm',
+ 194 => 'Distrikts - Amt',
+ 195 => 'veraltet',
+ 196 => 'veraltet',
+ 197 => '',
+ 198 => 'veraltet(früher: Bundesverwaltungsgericht)',
+ 199 => 'veraltet(früher: Landesverwaltungsgericht)',
+ 200 => 'veraltet(früher: Verwaltungsgericht)',
+ 201 => 'Landeskommissarbezirk',
+ 202 => 'Amtsgerichtsbezirk',
+ 203 => 'Domanialamt',
+ 204 => 'Ritterschaftliches Amt',
+ 205 => 'selsoviet',
+ 206 => 'Regionalkirchenamt',
+ 207 => 'Oberamtsbezirk',
+ 210 => 'Kirchenbund',
+ 211 => 'Landgebiet',
+ 212 => 'Landherrenschaft',
+ 213 => 'gorsoviet',
+ 214 => 'realm',
+ 215 => 'Reichshälfte',
+ 216 => 'Landesteil',
+ 217 => 'Direktionsbezirk',
+ 218 => 'Stadt',
+ 219 => 'Expositur',
+ 221 => 'Fylke',
+ 222 => 'Kreis',
+ 223 => 'Landgericht',
+ 224 => 'Pfleggericht',
+ 225 => 'Rentamt',
+ 226 => 'Obmannschaft',
+ 227 => 'Kirchspielslandgemeinde',
+ 228 => 'Gerichtsamt',
+ 229 => 'group of houses',
+ 230 => 'scattered settlement',
+ 231 => 'Höfe',
+ 232 => 'Randort',
+ 233 => 'Flecken',
+ 234 => 'borough',
+ 235 => 'unitary authority',
+ 236 => 'houses',
+ 237 => 'Siedlungsrat',
+ 238 => 'urban - type settlement',
+ 239 => 'Verwaltungsamt',
+ 240 => 'uyezd',
+ 241 => 'Volost',
+ 242 => 'Katasteramt',
+ 243 => 'Propstei',
+ 244 => 'Nebenkirche',
+ 245 => 'chapel',
+ 246 => 'Gromada',
+ 247 => 'Ortsteil',
+ 248 => 'Schulzenamt',
+ 249 => 'Erzbischöfliches Amt',
+ 250 => 'Apostolische Administratur',
+ 251 => 'autonome Gemeinschaft',
+ 252 => 'local government',
+ 253 => 'religious organization',
+ 254 => 'Okrug',
+ 255 => 'Stadtgut',
+ 256 => 'Landesbezirk',
+ 257 => 'Landgemeinde PL',
+ 258 => 'Stadtgemeinde',
+ 259 => 'Landvogteibezirk',
+ 260 => 'Delegaturbezirk',
+ 261 => 'Hofschaft',
+ 262 => 'Stadtteil',
+ 263 => 'Sprengel',
+ 264 => 'Mairie',
+ 265 => 'sultanate',
+ 266 => 'Landratsbezirk',
+ 267 => 'sognekommune',
+ 268 => 'Großgemeinde',
+ 269 => 'Kleingemeinde',
+ 270 => 'Bezirk',
+ 271 => 'Stadt mit Munizipium',
+ 272 => 'Königliche Freistadt',
+ 273 => 'Stadt mit geordnetem Magistrate',
+ 274 => 'unincorporated area',
+ 275 => 'Stadtgemeinde',
+ 276 => 'Hardesvogtei',
+ ];
+
+ array_walk($values, static function (string &$value, $key): void {
+ if (is_int($key)) {
+ $value .= ' — ' . I18N::number($key);
+ }
+ });
+
+
+ return $values;
+ }
+}
diff --git a/app/Elements/ResearchTask.php b/app/Elements/ResearchTask.php
new file mode 100644
index 0000000000..d6e30fafda
--- /dev/null
+++ b/app/Elements/ResearchTask.php
@@ -0,0 +1,61 @@
+<?php
+
+/**
+ * webtrees: online genealogy
+ * Copyright (C) 2021 webtrees development team
+ * 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 3 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, see <https://www.gnu.org/licenses/>.
+ */
+
+declare(strict_types=1);
+
+namespace Fisharebest\Webtrees\Elements;
+
+use Fisharebest\Webtrees\Tree;
+
+/**
+ * Something that needs to be researched at a later date.
+ */
+class ResearchTask extends AbstractElement
+{
+ protected const SUBTAGS = [
+ 'DATE' => '0:1',
+ '_WT_USER' => '0:1',
+ ];
+
+ /**
+ * Convert a value to a canonical form.
+ *
+ * @param string $value
+ *
+ * @return string
+ */
+ public function canonical(string $value): string
+ {
+ // Browsers use MS-DOS line endings in multi-line data.
+ return strtr($value, ["\r\n" => "\n", "\r" => "\n"]);
+ }
+
+ /**
+ * An edit control for this data.
+ *
+ * @param string $id
+ * @param string $name
+ * @param string $value
+ * @param Tree $tree
+ *
+ * @return string
+ */
+ public function edit(string $id, string $name, string $value, Tree $tree): string
+ {
+ return $this->editTextArea($id, $name, $value);
+ }
+}
diff --git a/app/Factories/ElementFactory.php b/app/Factories/ElementFactory.php
index 11ae45a4ae..4ecbd2af87 100644
--- a/app/Factories/ElementFactory.php
+++ b/app/Factories/ElementFactory.php
@@ -151,6 +151,7 @@ use Fisharebest\Webtrees\Elements\ReceivingSystemName;
use Fisharebest\Webtrees\Elements\RelationIsDescriptor;
use Fisharebest\Webtrees\Elements\ReligiousAffiliation;
use Fisharebest\Webtrees\Elements\RepositoryRecord;
+use Fisharebest\Webtrees\Elements\ResearchTask;
use Fisharebest\Webtrees\Elements\Residence;
use Fisharebest\Webtrees\Elements\ResponsibleAgency;
use Fisharebest\Webtrees\Elements\RestrictionNotice;
@@ -358,6 +359,9 @@ class ElementFactory implements ElementFactoryInterface
'FAM:SOUR:QUAY' => new CertaintyAssessment(I18N::translate('Quality of data')),
'FAM:SUBM' => new XrefSubmitter(I18N::translate('Submitter')),
'FAM:WIFE' => new XrefIndividual(I18N::translate('Wife')),
+ 'FAM:_TODO' => new ResearchTask(I18N::translate('Research task')), // *** webtrees
+ 'FAM:_TODO:DATE' => new TransmissionDate(I18N::translate('Date')), // *** webtrees
+ 'FAM:_TODO:_WT_USER' => new WebtreesUser(I18N::translate('User')), // *** webtrees
'FAM:_UID' => new PafUid(I18N::translate('Unique identifier')), // ***
'HEAD' => new HeaderRecord(I18N::translate('Header')),
'HEAD:CHAR' => new CharacterSet(I18N::translate('Character set')),
@@ -618,8 +622,8 @@ class ElementFactory implements ElementFactoryInterface
'INDI:SUBM' => new XrefSubmitter(I18N::translate('Submitter')),
'INDI:TITL' => new NobilityTypeTitle(I18N::translate('Title')),
'INDI:WILL' => new Will(I18N::translate('Will')),
- 'INDI:_TODO' => new UnknownElement(I18N::translate('Research task')), // *** webtrees
- 'INDI:_TODO:DATE' => new DateValue(I18N::translate('Date')), // *** webtrees
+ 'INDI:_TODO' => new ResearchTask(I18N::translate('Research task')), // *** webtrees
+ 'INDI:_TODO:DATE' => new TransmissionDate(I18N::translate('Date')), // *** webtrees
'INDI:_TODO:_WT_USER' => new WebtreesUser(I18N::translate('User')), // *** webtrees
'INDI:_UID' => new PafUid(I18N::translate('Unique identifier')), // ***
'INDI:_WT_OBJE_SORT' => new XrefMedia(I18N::translate('Re-order media')), // *** webtrees 1.7
@@ -767,7 +771,7 @@ class ElementFactory implements ElementFactoryInterface
'SUBN:SUBM' => new XrefSubmitter(I18N::translate('Submitter')),
'SUBN:TEMP' => new TempleCode(/* I18N: https://en.wikipedia.org/wiki/Temple_(LDS_Church)*/ I18N::translate('Temple')),
'SUBN:_UID' => new PafUid(I18N::translate('Unique identifier')), // ***
- 'TRLR' => new EmptyElement(I18N::translate('Trailer')), // Not used in webtrees
+ 'TRLR' => new EmptyElement(I18N::translate('Trailer')),
];
}