summaryrefslogtreecommitdiff
path: root/app/Functions
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2016-02-20 18:12:09 +0000
committerGreg Roach <fisharebest@gmail.com>2016-02-20 18:12:09 +0000
commitffff47b37bb4048338a168cbc4c6504b55b3f3e0 (patch)
tree192677fd2f42e85ab437c1284eaca854cfe60ada /app/Functions
parent05bf2a079ab5c7a21ee855e2ef16ff5d89b233ac (diff)
downloadwebtrees-ffff47b37bb4048338a168cbc4c6504b55b3f3e0.tar.gz
webtrees-ffff47b37bb4048338a168cbc4c6504b55b3f3e0.tar.bz2
webtrees-ffff47b37bb4048338a168cbc4c6504b55b3f3e0.zip
Duplicated code
Diffstat (limited to 'app/Functions')
-rw-r--r--app/Functions/FunctionsImport.php17
1 files changed, 2 insertions, 15 deletions
diff --git a/app/Functions/FunctionsImport.php b/app/Functions/FunctionsImport.php
index 34ab2236f0..6cc35afa16 100644
--- a/app/Functions/FunctionsImport.php
+++ b/app/Functions/FunctionsImport.php
@@ -741,29 +741,16 @@ class FunctionsImport {
self::updateLinks($xref, $tree_id, $gedrec);
self::updateNames($xref, $tree_id, $record);
break;
- case 'HEAD':
+ default: // HEAD, TRLR, SUBM, SUBN, and custom record types.
// Force HEAD records to have a creation date.
- if (!strpos($gedrec, "\n1 DATE ")) {
+ if ($type === 'head' && strpos($gedrec, "\n1 DATE ") === false) {
$gedrec .= "\n1 DATE " . date('j M Y');
}
- // No break;
- case 'TRLR':
- case 'SUBM':
- case 'SUBN':
- Database::prepare(
- "INSERT INTO `##other` (o_id, o_file, o_type, o_gedcom) VALUES (?, ?, ?, ?)"
- )->execute(array($xref, $tree_id, $type, $gedrec));
- // Update the cross-reference/index tables.
- self::updateLinks($xref, $tree_id, $gedrec);
- break;
- default:
- $record = new GedcomRecord($xref, $gedrec, null, $tree);
Database::prepare(
"INSERT INTO `##other` (o_id, o_file, o_type, o_gedcom) VALUES (?, ?, LEFT(?, 15), ?)"
)->execute(array($xref, $tree_id, $type, $gedrec));
// Update the cross-reference/index tables.
self::updateLinks($xref, $tree_id, $gedrec);
- self::updateNames($xref, $tree_id, $record);
break;
}
}