From ffff47b37bb4048338a168cbc4c6504b55b3f3e0 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Sat, 20 Feb 2016 18:12:09 +0000 Subject: Duplicated code --- app/Functions/FunctionsImport.php | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'app/Functions') 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; } } -- cgit v1.3