Passed
Push — 1.7 ( 84fe41...8b143e )
by
unknown
07:20
created
expand_view.php 1 patch
Switch Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -38,38 +38,38 @@
 block discarded – undo
38 38
 
39 39
 foreach ($facts as $fact) {
40 40
 	switch ($fact->getTag()) {
41
-	case 'ADDR':
42
-	case 'ALIA':
43
-	case 'ASSO':
44
-	case 'CHAN':
45
-	case 'CHIL':
46
-	case 'EMAIL':
47
-	case 'FAMC':
48
-	case 'FAMS':
49
-	case 'HUSB':
50
-	case 'NAME':
51
-	case 'NOTE':
52
-	case 'OBJE':
53
-	case 'PHON':
54
-	case 'RESI':
55
-	case 'RESN':
56
-	case 'SEX':
57
-	case 'SOUR':
58
-	case 'SSN':
59
-	case 'SUBM':
60
-	case 'TITL':
61
-	case 'URL':
62
-	case 'WIFE':
63
-	case 'WWW':
64
-	case '_EMAIL':
65
-	case '_TODO':
66
-	case '_UID':
67
-	case '_WT_OBJE_SORT':
68
-		// Do not show these
69
-		break;
70
-	default:
71
-		// Simple version of FunctionsPrintFacts::print_fact()
72
-		echo $fact->summary();
73
-		break;
41
+		case 'ADDR':
42
+		case 'ALIA':
43
+		case 'ASSO':
44
+		case 'CHAN':
45
+		case 'CHIL':
46
+		case 'EMAIL':
47
+		case 'FAMC':
48
+		case 'FAMS':
49
+		case 'HUSB':
50
+		case 'NAME':
51
+		case 'NOTE':
52
+		case 'OBJE':
53
+		case 'PHON':
54
+		case 'RESI':
55
+		case 'RESN':
56
+		case 'SEX':
57
+		case 'SOUR':
58
+		case 'SSN':
59
+		case 'SUBM':
60
+		case 'TITL':
61
+		case 'URL':
62
+		case 'WIFE':
63
+		case 'WWW':
64
+		case '_EMAIL':
65
+		case '_TODO':
66
+		case '_UID':
67
+		case '_WT_OBJE_SORT':
68
+			// Do not show these
69
+			break;
70
+		default:
71
+			// Simple version of FunctionsPrintFacts::print_fact()
72
+			echo $fact->summary();
73
+			break;
74 74
 	}
75 75
 }
Please login to merge, or discard this patch.
admin_site_logs.php 1 patch
Switch Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -131,12 +131,12 @@
 block discarded – undo
131 131
 			// Datatables numbers columns 0, 1, 2
132 132
 			// MySQL numbers columns 1, 2, 3
133 133
 			switch ($value['dir']) {
134
-			case 'asc':
135
-				$order_by .= (1 + $value['column']) . " ASC ";
136
-				break;
137
-			case 'desc':
138
-				$order_by .= (1 + $value['column']) . " DESC ";
139
-				break;
134
+				case 'asc':
135
+					$order_by .= (1 + $value['column']) . " ASC ";
136
+					break;
137
+				case 'desc':
138
+					$order_by .= (1 + $value['column']) . " DESC ";
139
+					break;
140 140
 			}
141 141
 		}
142 142
 	} else {
Please login to merge, or discard this patch.
action.php 1 patch
Switch Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -62,14 +62,14 @@
 block discarded – undo
62 62
 		foreach ($record->getFacts() as $fact) {
63 63
 			if ($fact->getFactId() == $fact_id) {
64 64
 				switch ($fact->getTag()) {
65
-				case 'NOTE':
66
-				case 'SOUR':
67
-				case 'OBJE':
68
-					$type = 'all'; // paste this anywhere
69
-					break;
70
-				default:
71
-					$type = $record::RECORD_TYPE; // paste only to the same record type
72
-					break;
65
+					case 'NOTE':
66
+					case 'SOUR':
67
+					case 'OBJE':
68
+						$type = 'all'; // paste this anywhere
69
+						break;
70
+					default:
71
+						$type = $record::RECORD_TYPE; // paste only to the same record type
72
+						break;
73 73
 				}
74 74
 				$clipboard = Session::get('clipboard');
75 75
 				if (!is_array($clipboard)) {
Please login to merge, or discard this patch.
app/Date/CalendarDate.php 1 patch
Switch Indentation   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -491,20 +491,20 @@  discard block
 block discarded – undo
491 491
 	 */
492 492
 	public function convertToCalendar($calendar) {
493 493
 		switch ($calendar) {
494
-		case 'gregorian':
495
-			return new GregorianDate($this);
496
-		case 'julian':
497
-			return new JulianDate($this);
498
-		case 'jewish':
499
-			return new JewishDate($this);
500
-		case 'french':
501
-			return new FrenchDate($this);
502
-		case 'hijri':
503
-			return new HijriDate($this);
504
-		case 'jalali':
505
-			return new JalaliDate($this);
506
-		default:
507
-			return $this;
494
+			case 'gregorian':
495
+				return new GregorianDate($this);
496
+			case 'julian':
497
+				return new JulianDate($this);
498
+			case 'jewish':
499
+				return new JewishDate($this);
500
+			case 'french':
501
+				return new FrenchDate($this);
502
+			case 'hijri':
503
+				return new HijriDate($this);
504
+			case 'jalali':
505
+				return new JalaliDate($this);
506
+			default:
507
+				return $this;
508 508
 		}
509 509
 	}
510 510
 
@@ -581,90 +581,90 @@  discard block
 block discarded – undo
581 581
 			$case = 'GENITIVE';
582 582
 		} else {
583 583
 			switch ($qualifier) {
584
-			case 'TO':
585
-			case 'ABT':
586
-			case 'FROM':
587
-				$case = 'GENITIVE';
588
-				break;
589
-			case 'AFT':
590
-				$case = 'LOCATIVE';
591
-				break;
592
-			case 'BEF':
593
-			case 'BET':
594
-			case 'AND':
595
-				$case = 'INSTRUMENTAL';
596
-				break;
597
-			case '':
598
-			case 'INT':
599
-			case 'EST':
600
-			case 'CAL':
601
-			default: // There shouldn't be any other options...
602
-				$case = 'NOMINATIVE';
603
-				break;
584
+				case 'TO':
585
+				case 'ABT':
586
+				case 'FROM':
587
+					$case = 'GENITIVE';
588
+					break;
589
+				case 'AFT':
590
+					$case = 'LOCATIVE';
591
+					break;
592
+				case 'BEF':
593
+				case 'BET':
594
+				case 'AND':
595
+					$case = 'INSTRUMENTAL';
596
+					break;
597
+				case '':
598
+				case 'INT':
599
+				case 'EST':
600
+				case 'CAL':
601
+				default: // There shouldn't be any other options...
602
+					$case = 'NOMINATIVE';
603
+					break;
604 604
 			}
605 605
 		}
606 606
 		// Build up the formatted date, character at a time
607 607
 		preg_match_all('/%[^%]/', $format, $matches);
608 608
 		foreach ($matches[0] as $match) {
609 609
 			switch ($match) {
610
-			case '%d':
611
-				$format = str_replace($match, $this->formatDayZeros(), $format);
612
-				break;
613
-			case '%j':
614
-				$format = str_replace($match, $this->formatDay(), $format);
615
-				break;
616
-			case '%l':
617
-				$format = str_replace($match, $this->formatLongWeekday(), $format);
618
-				break;
619
-			case '%D':
620
-				$format = str_replace($match, $this->formatShortWeekday(), $format);
621
-				break;
622
-			case '%N':
623
-				$format = str_replace($match, $this->formatIsoWeekday(), $format);
624
-				break;
625
-			case '%w':
626
-				$format = str_replace($match, $this->formatNumericWeekday(), $format);
627
-				break;
628
-			case '%z':
629
-				$format = str_replace($match, $this->formatDayOfYear(), $format);
630
-				break;
631
-			case '%F':
632
-				$format = str_replace($match, $this->formatLongMonth($case), $format);
633
-				break;
634
-			case '%m':
635
-				$format = str_replace($match, $this->formatMonthZeros(), $format);
636
-				break;
637
-			case '%M':
638
-				$format = str_replace($match, $this->formatShortMonth(), $format);
639
-				break;
640
-			case '%n':
641
-				$format = str_replace($match, $this->formatMonth(), $format);
642
-				break;
643
-			case '%t':
644
-				$format = str_replace($match, $this->daysInMonth(), $format);
645
-				break;
646
-			case '%L':
647
-				$format = str_replace($match, (int) $this->isLeapYear(), $format);
648
-				break;
649
-			case '%Y':
650
-				$format = str_replace($match, $this->formatLongYear(), $format);
651
-				break;
652
-			case '%y':
653
-				$format = str_replace($match, $this->formatShortYear(), $format);
654
-				break;
655
-				// These 4 extensions are useful for re-formatting gedcom dates.
656
-			case '%@':
657
-				$format = str_replace($match, $this->calendar->gedcomCalendarEscape(), $format);
658
-				break;
659
-			case '%A':
660
-				$format = str_replace($match, $this->formatGedcomDay(), $format);
661
-				break;
662
-			case '%O':
663
-				$format = str_replace($match, $this->formatGedcomMonth(), $format);
664
-				break;
665
-			case '%E':
666
-				$format = str_replace($match, $this->formatGedcomYear(), $format);
667
-				break;
610
+				case '%d':
611
+					$format = str_replace($match, $this->formatDayZeros(), $format);
612
+					break;
613
+				case '%j':
614
+					$format = str_replace($match, $this->formatDay(), $format);
615
+					break;
616
+				case '%l':
617
+					$format = str_replace($match, $this->formatLongWeekday(), $format);
618
+					break;
619
+				case '%D':
620
+					$format = str_replace($match, $this->formatShortWeekday(), $format);
621
+					break;
622
+				case '%N':
623
+					$format = str_replace($match, $this->formatIsoWeekday(), $format);
624
+					break;
625
+				case '%w':
626
+					$format = str_replace($match, $this->formatNumericWeekday(), $format);
627
+					break;
628
+				case '%z':
629
+					$format = str_replace($match, $this->formatDayOfYear(), $format);
630
+					break;
631
+				case '%F':
632
+					$format = str_replace($match, $this->formatLongMonth($case), $format);
633
+					break;
634
+				case '%m':
635
+					$format = str_replace($match, $this->formatMonthZeros(), $format);
636
+					break;
637
+				case '%M':
638
+					$format = str_replace($match, $this->formatShortMonth(), $format);
639
+					break;
640
+				case '%n':
641
+					$format = str_replace($match, $this->formatMonth(), $format);
642
+					break;
643
+				case '%t':
644
+					$format = str_replace($match, $this->daysInMonth(), $format);
645
+					break;
646
+				case '%L':
647
+					$format = str_replace($match, (int) $this->isLeapYear(), $format);
648
+					break;
649
+				case '%Y':
650
+					$format = str_replace($match, $this->formatLongYear(), $format);
651
+					break;
652
+				case '%y':
653
+					$format = str_replace($match, $this->formatShortYear(), $format);
654
+					break;
655
+					// These 4 extensions are useful for re-formatting gedcom dates.
656
+				case '%@':
657
+					$format = str_replace($match, $this->calendar->gedcomCalendarEscape(), $format);
658
+					break;
659
+				case '%A':
660
+					$format = str_replace($match, $this->formatGedcomDay(), $format);
661
+					break;
662
+				case '%O':
663
+					$format = str_replace($match, $this->formatGedcomMonth(), $format);
664
+					break;
665
+				case '%E':
666
+					$format = str_replace($match, $this->formatGedcomYear(), $format);
667
+					break;
668 668
 			}
669 669
 		}
670 670
 
@@ -769,16 +769,16 @@  discard block
 block discarded – undo
769 769
 	 */
770 770
 	protected function formatLongMonth($case = 'NOMINATIVE') {
771 771
 		switch ($case) {
772
-		case 'GENITIVE':
773
-			return $this->monthNameGenitiveCase($this->m, $this->isLeapYear());
774
-		case 'NOMINATIVE':
775
-			return $this->monthNameNominativeCase($this->m, $this->isLeapYear());
776
-		case 'LOCATIVE':
777
-			return $this->monthNameLocativeCase($this->m, $this->isLeapYear());
778
-		case 'INSTRUMENTAL':
779
-			return $this->monthNameInstrumentalCase($this->m, $this->isLeapYear());
780
-		default:
781
-			throw new \InvalidArgumentException($case);
772
+			case 'GENITIVE':
773
+				return $this->monthNameGenitiveCase($this->m, $this->isLeapYear());
774
+			case 'NOMINATIVE':
775
+				return $this->monthNameNominativeCase($this->m, $this->isLeapYear());
776
+			case 'LOCATIVE':
777
+				return $this->monthNameLocativeCase($this->m, $this->isLeapYear());
778
+			case 'INSTRUMENTAL':
779
+				return $this->monthNameInstrumentalCase($this->m, $this->isLeapYear());
780
+			default:
781
+				throw new \InvalidArgumentException($case);
782 782
 		}
783 783
 	}
784 784
 
Please login to merge, or discard this patch.
app/Statement.php 1 patch
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -64,18 +64,18 @@
 block discarded – undo
64 64
 				$key = ':' . $key;
65 65
 			}
66 66
 			switch (gettype($bind_variable)) {
67
-			case 'NULL':
68
-				$this->pdo_statement->bindValue($key, $bind_variable, PDO::PARAM_NULL);
69
-				break;
70
-			case 'boolean':
71
-				$this->pdo_statement->bindValue($key, (int) $bind_variable, PDO::PARAM_INT);
72
-				break;
73
-			case 'integer':
74
-				$this->pdo_statement->bindValue($key, $bind_variable, PDO::PARAM_INT);
75
-				break;
76
-			default:
77
-				$this->pdo_statement->bindValue($key, $bind_variable, PDO::PARAM_STR);
78
-				break;
67
+				case 'NULL':
68
+					$this->pdo_statement->bindValue($key, $bind_variable, PDO::PARAM_NULL);
69
+					break;
70
+				case 'boolean':
71
+					$this->pdo_statement->bindValue($key, (int) $bind_variable, PDO::PARAM_INT);
72
+					break;
73
+				case 'integer':
74
+					$this->pdo_statement->bindValue($key, $bind_variable, PDO::PARAM_INT);
75
+					break;
76
+				default:
77
+					$this->pdo_statement->bindValue($key, $bind_variable, PDO::PARAM_STR);
78
+					break;
79 79
 			}
80 80
 		}
81 81
 
Please login to merge, or discard this patch.
app/Functions/FunctionsExport.php 1 patch
Switch Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -183,18 +183,18 @@  discard block
 block discarded – undo
183 183
 	 */
184 184
 	public static function exportGedcom(Tree $tree, $gedout, $exportOptions) {
185 185
 		switch ($exportOptions['privatize']) {
186
-		case 'gedadmin':
187
-			$access_level = Auth::PRIV_NONE;
188
-			break;
189
-		case 'user':
190
-			$access_level = Auth::PRIV_USER;
191
-			break;
192
-		case 'visitor':
193
-			$access_level = Auth::PRIV_PRIVATE;
194
-			break;
195
-		case 'none':
196
-			$access_level = Auth::PRIV_HIDE;
197
-			break;
186
+			case 'gedadmin':
187
+				$access_level = Auth::PRIV_NONE;
188
+				break;
189
+			case 'user':
190
+				$access_level = Auth::PRIV_USER;
191
+				break;
192
+			case 'visitor':
193
+				$access_level = Auth::PRIV_PRIVATE;
194
+				break;
195
+			case 'none':
196
+				$access_level = Auth::PRIV_HIDE;
197
+				break;
198 198
 		}
199 199
 
200 200
 		$head = self::gedcomHeader($tree);
@@ -251,15 +251,15 @@  discard block
 block discarded – undo
251 251
 
252 252
 		foreach ($rows as $row) {
253 253
 			switch ($row->type) {
254
-			case 'NOTE':
255
-				$record = Note::getInstance($row->xref, $tree, $row->gedcom);
256
-				break;
257
-			case 'REPO':
258
-				$record = Repository::getInstance($row->xref, $tree, $row->gedcom);
259
-				break;
260
-			default:
261
-				$record = GedcomRecord::getInstance($row->xref, $tree, $row->gedcom);
262
-				break;
254
+				case 'NOTE':
255
+					$record = Note::getInstance($row->xref, $tree, $row->gedcom);
256
+					break;
257
+				case 'REPO':
258
+					$record = Repository::getInstance($row->xref, $tree, $row->gedcom);
259
+					break;
260
+				default:
261
+					$record = GedcomRecord::getInstance($row->xref, $tree, $row->gedcom);
262
+					break;
263 263
 			}
264 264
 
265 265
 			$rec = $record->privatizeGedcom($access_level);
Please login to merge, or discard this patch.
app/Functions/FunctionsMedia.php 1 patch
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -32,17 +32,17 @@
 block discarded – undo
32 32
 			$val = -1;
33 33
 		}
34 34
 		switch (substr($val, -1)) {
35
-		case 'g':
36
-		case 'G':
37
-			return (int) $val * 1024 * 1024 * 1024;
38
-		case 'm':
39
-		case 'M':
40
-			return (int) $val * 1024 * 1024;
41
-		case 'k':
42
-		case 'K':
43
-			return (int) $val * 1024;
44
-		default:
45
-			return (int) $val;
35
+			case 'g':
36
+			case 'G':
37
+				return (int) $val * 1024 * 1024 * 1024;
38
+			case 'm':
39
+			case 'M':
40
+				return (int) $val * 1024 * 1024;
41
+			case 'k':
42
+			case 'K':
43
+				return (int) $val * 1024;
44
+			default:
45
+				return (int) $val;
46 46
 		}
47 47
 	}
48 48
 
Please login to merge, or discard this patch.
app/Controller/AdvancedSearchController.php 1 patch
Switch Indentation   +187 added lines, -187 removed lines patch added patch discarded remove patch
@@ -373,108 +373,108 @@  discard block
 block discarded – undo
373 373
 			if ($parts[0] == 'NAME') {
374 374
 				// NAME:*
375 375
 				switch ($parts[1]) {
376
-				case 'GIVN':
377
-					switch ($parts[2]) {
378
-					case 'EXACT':
379
-						$sql .= " AND i_n.n_givn=?";
380
-						$bind[] = $value;
381
-						break;
382
-					case 'BEGINS':
383
-						$sql .= " AND i_n.n_givn LIKE CONCAT(?, '%')";
384
-						$bind[] = $value;
385
-						break;
386
-					case 'CONTAINS':
387
-						$sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
388
-						$bind[] = $value;
389
-						break;
390
-					case 'SDX_STD':
391
-						$sdx = Soundex::russell($value);
392
-						if ($sdx !== null) {
393
-							$sdx = explode(':', $sdx);
394
-							foreach ($sdx as $k => $v) {
395
-								$sdx[$k] = "i_n.n_soundex_givn_std LIKE CONCAT('%', ?, '%')";
396
-								$bind[]  = $v;
397
-							}
398
-							$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
399
-						} else {
400
-							// No phonetic content? Use a substring match
401
-							$sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
402
-							$bind[] = $value;
376
+					case 'GIVN':
377
+						switch ($parts[2]) {
378
+							case 'EXACT':
379
+								$sql .= " AND i_n.n_givn=?";
380
+								$bind[] = $value;
381
+								break;
382
+							case 'BEGINS':
383
+								$sql .= " AND i_n.n_givn LIKE CONCAT(?, '%')";
384
+								$bind[] = $value;
385
+								break;
386
+							case 'CONTAINS':
387
+								$sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
388
+								$bind[] = $value;
389
+								break;
390
+							case 'SDX_STD':
391
+								$sdx = Soundex::russell($value);
392
+								if ($sdx !== null) {
393
+									$sdx = explode(':', $sdx);
394
+									foreach ($sdx as $k => $v) {
395
+										$sdx[$k] = "i_n.n_soundex_givn_std LIKE CONCAT('%', ?, '%')";
396
+										$bind[]  = $v;
397
+									}
398
+									$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
399
+								} else {
400
+									// No phonetic content? Use a substring match
401
+									$sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
402
+									$bind[] = $value;
403
+								}
404
+								break;
405
+							case 'SDX': // SDX uses DM by default.
406
+							case 'SDX_DM':
407
+								$sdx = Soundex::daitchMokotoff($value);
408
+								if ($sdx !== null) {
409
+									$sdx = explode(':', $sdx);
410
+									foreach ($sdx as $k => $v) {
411
+										$sdx[$k] = "i_n.n_soundex_givn_dm LIKE CONCAT('%', ?, '%')";
412
+										$bind[]  = $v;
413
+									}
414
+									$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
415
+								} else {
416
+									// No phonetic content? Use a substring match
417
+									$sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
418
+									$bind[] = $value;
419
+								}
420
+								break;
403 421
 						}
404
-						break;
405
-					case 'SDX': // SDX uses DM by default.
406
-					case 'SDX_DM':
407
-						$sdx = Soundex::daitchMokotoff($value);
408
-						if ($sdx !== null) {
409
-							$sdx = explode(':', $sdx);
410
-							foreach ($sdx as $k => $v) {
411
-								$sdx[$k] = "i_n.n_soundex_givn_dm LIKE CONCAT('%', ?, '%')";
412
-								$bind[]  = $v;
413
-							}
414
-							$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
415
-						} else {
416
-							// No phonetic content? Use a substring match
417
-							$sql .= " AND i_n.n_givn LIKE CONCAT('%', ?, '%')";
418
-							$bind[] = $value;
422
+					break;
423
+					case 'SURN':
424
+						switch ($parts[2]) {
425
+							case 'EXACT':
426
+								$sql .= " AND i_n.n_surname=?";
427
+								$bind[] = $value;
428
+								break;
429
+							case 'BEGINS':
430
+								$sql .= " AND i_n.n_surname LIKE CONCAT(?, '%')";
431
+								$bind[] = $value;
432
+								break;
433
+							case 'CONTAINS':
434
+								$sql .= " AND i_n.n_surname LIKE CONCAT('%', ?, '%')";
435
+								$bind[] = $value;
436
+								break;
437
+							case 'SDX_STD':
438
+								$sdx = Soundex::russell($value);
439
+								if ($sdx !== null) {
440
+									$sdx = explode(':', $sdx);
441
+									foreach ($sdx as $k => $v) {
442
+										$sdx[$k] = "i_n.n_soundex_surn_std LIKE CONCAT('%', ?, '%')";
443
+										$bind[]  = $v;
444
+									}
445
+									$sql .= " AND (" . implode(' OR ', $sdx) . ")";
446
+								} else {
447
+									// No phonetic content? Use a substring match
448
+									$sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
449
+									$bind[] = $value;
450
+								}
451
+								break;
452
+							case 'SDX': // SDX uses DM by default.
453
+							case 'SDX_DM':
454
+								$sdx = Soundex::daitchMokotoff($value);
455
+								if ($sdx !== null) {
456
+									$sdx = explode(':', $sdx);
457
+									foreach ($sdx as $k => $v) {
458
+										$sdx[$k] = "i_n.n_soundex_surn_dm LIKE CONCAT('%', ?, '%')";
459
+										$bind[]  = $v;
460
+									}
461
+									$sql .= " AND (" . implode(' OR ', $sdx) . ")";
462
+									break;
463
+								} else {
464
+									// No phonetic content? Use a substring match
465
+									$sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
466
+									$bind[] = $value;
467
+								}
419 468
 						}
420
-						break;
421
-					}
422 469
 					break;
423
-				case 'SURN':
424
-					switch ($parts[2]) {
425
-					case 'EXACT':
426
-						$sql .= " AND i_n.n_surname=?";
470
+					case 'NICK':
471
+					case '_MARNM':
472
+					case '_HEB':
473
+					case '_AKA':
474
+						$sql .= " AND i_n.n_type=? AND i_n.n_full LIKE CONCAT('%', ?, '%')";
475
+						$bind[] = $parts[1];
427 476
 						$bind[] = $value;
428 477
 						break;
429
-					case 'BEGINS':
430
-						$sql .= " AND i_n.n_surname LIKE CONCAT(?, '%')";
431
-						$bind[] = $value;
432
-						break;
433
-					case 'CONTAINS':
434
-						$sql .= " AND i_n.n_surname LIKE CONCAT('%', ?, '%')";
435
-						$bind[] = $value;
436
-						break;
437
-					case 'SDX_STD':
438
-						$sdx = Soundex::russell($value);
439
-						if ($sdx !== null) {
440
-							$sdx = explode(':', $sdx);
441
-							foreach ($sdx as $k => $v) {
442
-								$sdx[$k] = "i_n.n_soundex_surn_std LIKE CONCAT('%', ?, '%')";
443
-								$bind[]  = $v;
444
-							}
445
-							$sql .= " AND (" . implode(' OR ', $sdx) . ")";
446
-						} else {
447
-							// No phonetic content? Use a substring match
448
-							$sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
449
-							$bind[] = $value;
450
-						}
451
-						break;
452
-					case 'SDX': // SDX uses DM by default.
453
-					case 'SDX_DM':
454
-						$sdx = Soundex::daitchMokotoff($value);
455
-						if ($sdx !== null) {
456
-							$sdx = explode(':', $sdx);
457
-							foreach ($sdx as $k => $v) {
458
-								$sdx[$k] = "i_n.n_soundex_surn_dm LIKE CONCAT('%', ?, '%')";
459
-								$bind[]  = $v;
460
-							}
461
-							$sql .= " AND (" . implode(' OR ', $sdx) . ")";
462
-							break;
463
-						} else {
464
-							// No phonetic content? Use a substring match
465
-							$sql .= " AND i_n.n_surn LIKE CONCAT('%', ?, '%')";
466
-							$bind[] = $value;
467
-						}
468
-					}
469
-					break;
470
-				case 'NICK':
471
-				case '_MARNM':
472
-				case '_HEB':
473
-				case '_AKA':
474
-					$sql .= " AND i_n.n_type=? AND i_n.n_full LIKE CONCAT('%', ?, '%')";
475
-					$bind[] = $parts[1];
476
-					$bind[] = $value;
477
-					break;
478 478
 				}
479 479
 			} elseif ($parts[1] == 'DATE') {
480 480
 				// *:DATE
@@ -522,99 +522,99 @@  discard block
 block discarded – undo
522 522
 				$table = $parts[1] == 'HUSB' ? 'f_n' : 'm_n';
523 523
 				// NAME:*
524 524
 				switch ($parts[3]) {
525
-				case 'GIVN':
526
-					switch ($parts[4]) {
527
-					case 'EXACT':
528
-						$sql .= " AND {$table}.n_givn=?";
529
-						$bind[] = $value;
530
-						break;
531
-					case 'BEGINS':
532
-						$sql .= " AND {$table}.n_givn LIKE CONCAT(?, '%')";
533
-						$bind[] = $value;
534
-						break;
535
-					case 'CONTAINS':
536
-						$sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')";
537
-						$bind[] = $value;
538
-						break;
539
-					case 'SDX_STD':
540
-						$sdx = Soundex::russell($value);
541
-						if ($sdx !== null) {
542
-							$sdx = explode(':', $sdx);
543
-							foreach ($sdx as $k => $v) {
544
-								$sdx[$k] = "{$table}.n_soundex_givn_std LIKE CONCAT('%', ?, '%')";
545
-								$bind[]  = $v;
546
-							}
547
-							$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
548
-						} else {
549
-							// No phonetic content? Use a substring match
550
-							$sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')";
551
-							$bind[] = $value;
525
+					case 'GIVN':
526
+						switch ($parts[4]) {
527
+							case 'EXACT':
528
+								$sql .= " AND {$table}.n_givn=?";
529
+								$bind[] = $value;
530
+								break;
531
+							case 'BEGINS':
532
+								$sql .= " AND {$table}.n_givn LIKE CONCAT(?, '%')";
533
+								$bind[] = $value;
534
+								break;
535
+							case 'CONTAINS':
536
+								$sql .= " AND {$table}.n_givn LIKE CONCAT('%', ?, '%')";
537
+								$bind[] = $value;
538
+								break;
539
+							case 'SDX_STD':
540
+								$sdx = Soundex::russell($value);
541
+								if ($sdx !== null) {
542
+									$sdx = explode(':', $sdx);
543
+									foreach ($sdx as $k => $v) {
544
+										$sdx[$k] = "{$table}.n_soundex_givn_std LIKE CONCAT('%', ?, '%')";
545
+										$bind[]  = $v;
546
+									}
547
+									$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
548
+								} else {
549
+									// No phonetic content? Use a substring match
550
+									$sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')";
551
+									$bind[] = $value;
552
+								}
553
+								break;
554
+							case 'SDX': // SDX uses DM by default.
555
+							case 'SDX_DM':
556
+								$sdx = Soundex::daitchMokotoff($value);
557
+								if ($sdx !== null) {
558
+									$sdx = explode(':', $sdx);
559
+									foreach ($sdx as $k => $v) {
560
+										$sdx[$k] = "{$table}.n_soundex_givn_dm LIKE CONCAT('%', ?, '%')";
561
+										$bind[]  = $v;
562
+									}
563
+									$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
564
+									break;
565
+								} else {
566
+									// No phonetic content? Use a substring match
567
+									$sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')";
568
+									$bind[] = $value;
569
+								}
552 570
 						}
553
-						break;
554
-					case 'SDX': // SDX uses DM by default.
555
-					case 'SDX_DM':
556
-						$sdx = Soundex::daitchMokotoff($value);
557
-						if ($sdx !== null) {
558
-							$sdx = explode(':', $sdx);
559
-							foreach ($sdx as $k => $v) {
560
-								$sdx[$k] = "{$table}.n_soundex_givn_dm LIKE CONCAT('%', ?, '%')";
561
-								$bind[]  = $v;
562
-							}
563
-							$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
564
-							break;
565
-						} else {
566
-							// No phonetic content? Use a substring match
567
-							$sql .= " AND {$table}.n_givn = LIKE CONCAT('%', ?, '%')";
568
-							$bind[] = $value;
569
-						}
570
-					}
571 571
 					break;
572
-				case 'SURN':
573
-					switch ($parts[4]) {
574
-					case 'EXACT':
575
-						$sql .= " AND {$table}.n_surname=?";
576
-						$bind[] = $value;
577
-						break;
578
-					case 'BEGINS':
579
-						$sql .= " AND {$table}.n_surname LIKE CONCAT(?, '%')";
580
-						$bind[] = $value;
581
-						break;
582
-					case 'CONTAINS':
583
-						$sql .= " AND {$table}.n_surname LIKE CONCAT('%', ?, '%')";
584
-						$bind[] = $value;
585
-						break;
586
-					case 'SDX_STD':
587
-						$sdx = Soundex::russell($value);
588
-						if ($sdx !== null) {
589
-							$sdx = explode(':', $sdx);
590
-							foreach ($sdx as $k => $v) {
591
-								$sdx[$k] = "{$table}.n_soundex_surn_std LIKE CONCAT('%', ?, '%')";
592
-								$bind[]  = $v;
593
-							}
594
-							$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
595
-						} else {
596
-							// No phonetic content? Use a substring match
597
-							$sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')";
598
-							$bind[] = $value;
599
-						}
600
-						break;
601
-					case 'SDX': // SDX uses DM by default.
602
-					case 'SDX_DM':
603
-						$sdx = Soundex::daitchMokotoff($value);
604
-						if ($sdx !== null) {
605
-							$sdx = explode(':', $sdx);
606
-							foreach ($sdx as $k => $v) {
607
-								$sdx[$k] = "{$table}.n_soundex_surn_dm LIKE CONCAT('%', ?, '%')";
608
-								$bind[]  = $v;
609
-							}
610
-							$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
611
-						} else {
612
-							// No phonetic content? Use a substring match
613
-							$sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')";
614
-							$bind[] = $value;
572
+					case 'SURN':
573
+						switch ($parts[4]) {
574
+							case 'EXACT':
575
+								$sql .= " AND {$table}.n_surname=?";
576
+								$bind[] = $value;
577
+								break;
578
+							case 'BEGINS':
579
+								$sql .= " AND {$table}.n_surname LIKE CONCAT(?, '%')";
580
+								$bind[] = $value;
581
+								break;
582
+							case 'CONTAINS':
583
+								$sql .= " AND {$table}.n_surname LIKE CONCAT('%', ?, '%')";
584
+								$bind[] = $value;
585
+								break;
586
+							case 'SDX_STD':
587
+								$sdx = Soundex::russell($value);
588
+								if ($sdx !== null) {
589
+									$sdx = explode(':', $sdx);
590
+									foreach ($sdx as $k => $v) {
591
+										$sdx[$k] = "{$table}.n_soundex_surn_std LIKE CONCAT('%', ?, '%')";
592
+										$bind[]  = $v;
593
+									}
594
+									$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
595
+								} else {
596
+									// No phonetic content? Use a substring match
597
+									$sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')";
598
+									$bind[] = $value;
599
+								}
600
+								break;
601
+							case 'SDX': // SDX uses DM by default.
602
+							case 'SDX_DM':
603
+								$sdx = Soundex::daitchMokotoff($value);
604
+								if ($sdx !== null) {
605
+									$sdx = explode(':', $sdx);
606
+									foreach ($sdx as $k => $v) {
607
+										$sdx[$k] = "{$table}.n_soundex_surn_dm LIKE CONCAT('%', ?, '%')";
608
+										$bind[]  = $v;
609
+									}
610
+									$sql .= ' AND (' . implode(' OR ', $sdx) . ')';
611
+								} else {
612
+									// No phonetic content? Use a substring match
613
+									$sql .= " AND {$table}.n_surn = LIKE CONCAT('%', ?, '%')";
614
+									$bind[] = $value;
615
+								}
616
+								break;
615 617
 						}
616
-						break;
617
-					}
618 618
 					break;
619 619
 				}
620 620
 			} elseif ($parts[0] === 'FAMS') {
Please login to merge, or discard this patch.
app/GedcomCode/GedcomCodePedi.php 1 patch
Switch Indentation   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -42,57 +42,57 @@  discard block
 block discarded – undo
42 42
 		}
43 43
 
44 44
 		switch ($type) {
45
-		case 'birth':
46
-			switch ($sex) {
47
-			case 'M':
48
-				return I18N::translateContext('Male pedigree', 'Birth');
49
-			case 'F':
50
-				return I18N::translateContext('Female pedigree', 'Birth');
51
-			default:
52
-				return I18N::translateContext('Pedigree', 'Birth');
53
-			}
54
-		case 'adopted':
55
-			switch ($sex) {
56
-			case 'M':
57
-				return I18N::translateContext('Male pedigree', 'Adopted');
58
-			case 'F':
59
-				return I18N::translateContext('Female pedigree', 'Adopted');
60
-			default:
61
-				return I18N::translateContext('Pedigree', 'Adopted');
62
-			}
63
-		case 'foster':
64
-			switch ($sex) {
65
-			case 'M':
66
-				return I18N::translateContext('Male pedigree', 'Foster');
67
-			case 'F':
68
-				return I18N::translateContext('Female pedigree', 'Foster');
69
-			default:
70
-				return I18N::translateContext('Pedigree', 'Foster');
71
-			}
72
-		case 'sealing':
73
-			switch ($sex) {
74
-			case 'M':
45
+			case 'birth':
46
+				switch ($sex) {
47
+					case 'M':
48
+						return I18N::translateContext('Male pedigree', 'Birth');
49
+					case 'F':
50
+						return I18N::translateContext('Female pedigree', 'Birth');
51
+					default:
52
+						return I18N::translateContext('Pedigree', 'Birth');
53
+				}
54
+			case 'adopted':
55
+				switch ($sex) {
56
+					case 'M':
57
+						return I18N::translateContext('Male pedigree', 'Adopted');
58
+					case 'F':
59
+						return I18N::translateContext('Female pedigree', 'Adopted');
60
+					default:
61
+						return I18N::translateContext('Pedigree', 'Adopted');
62
+				}
63
+			case 'foster':
64
+				switch ($sex) {
65
+					case 'M':
66
+						return I18N::translateContext('Male pedigree', 'Foster');
67
+					case 'F':
68
+						return I18N::translateContext('Female pedigree', 'Foster');
69
+					default:
70
+						return I18N::translateContext('Pedigree', 'Foster');
71
+				}
72
+			case 'sealing':
73
+				switch ($sex) {
74
+					case 'M':
75
+						return
76
+							/* I18N: “sealing” is a ceremony in the Mormon church. */
77
+							I18N::translateContext('Male pedigree', 'Sealing');
78
+					case 'F':
79
+						return
80
+							/* I18N: “sealing” is a ceremony in the Mormon church. */
81
+							I18N::translateContext('Female pedigree', 'Sealing');
82
+					default:
83
+						return
84
+							/* I18N: “sealing” is a ceremony in the Mormon church. */
85
+							I18N::translateContext('Pedigree', 'Sealing');
86
+				}
87
+			case 'rada':
88
+				// Not standard GEDCOM - a webtrees extension
89
+				// This is an arabic word which does not exist in other languages.
90
+				// So, it will not have any inflected forms.
75 91
 				return
76
-					/* I18N: “sealing” is a ceremony in the Mormon church. */
77
-					I18N::translateContext('Male pedigree', 'Sealing');
78
-			case 'F':
79
-				return
80
-					/* I18N: “sealing” is a ceremony in the Mormon church. */
81
-					I18N::translateContext('Female pedigree', 'Sealing');
92
+					/* I18N: This is an Arabic word, pronounced “ra DAH”. It is child-to-parent pedigree, established by wet-nursing. */
93
+					I18N::translate('Rada');
82 94
 			default:
83
-				return
84
-					/* I18N: “sealing” is a ceremony in the Mormon church. */
85
-					I18N::translateContext('Pedigree', 'Sealing');
86
-			}
87
-		case 'rada':
88
-			// Not standard GEDCOM - a webtrees extension
89
-			// This is an arabic word which does not exist in other languages.
90
-			// So, it will not have any inflected forms.
91
-			return
92
-				/* I18N: This is an Arabic word, pronounced “ra DAH”. It is child-to-parent pedigree, established by wet-nursing. */
93
-				I18N::translate('Rada');
94
-		default:
95
-			return $type;
95
+				return $type;
96 96
 		}
97 97
 	}
98 98
 
@@ -122,23 +122,23 @@  discard block
 block discarded – undo
122 122
 	 */
123 123
 	public static function getChildFamilyLabel($pedi) {
124 124
 		switch ($pedi) {
125
-		case '':
126
-		case 'birth':
127
-			return I18N::translate('Family with parents');
128
-		case 'adopted':
129
-			return I18N::translate('Family with adoptive parents');
130
-		case 'foster':
131
-			return I18N::translate('Family with foster parents');
132
-		case 'sealing':
133
-			return
134
-				/* I18N: “sealing” is a Mormon ceremony. */
135
-				I18N::translate('Family with sealing parents');
136
-		case 'rada':
137
-			return
138
-				/* I18N: “rada” is an Arabic word, pronounced “ra DAH”. It is child-to-parent pedigree, established by wet-nursing. */
139
-				I18N::translate('Family with rada parents');
140
-		default:
141
-			return I18N::translate('Family with parents') . ' - ' . $pedi;
125
+			case '':
126
+			case 'birth':
127
+				return I18N::translate('Family with parents');
128
+			case 'adopted':
129
+				return I18N::translate('Family with adoptive parents');
130
+			case 'foster':
131
+				return I18N::translate('Family with foster parents');
132
+			case 'sealing':
133
+				return
134
+					/* I18N: “sealing” is a Mormon ceremony. */
135
+					I18N::translate('Family with sealing parents');
136
+			case 'rada':
137
+				return
138
+					/* I18N: “rada” is an Arabic word, pronounced “ra DAH”. It is child-to-parent pedigree, established by wet-nursing. */
139
+					I18N::translate('Family with rada parents');
140
+			default:
141
+				return I18N::translate('Family with parents') . ' - ' . $pedi;
142 142
 		}
143 143
 	}
144 144
 
@@ -152,16 +152,16 @@  discard block
 block discarded – undo
152 152
 	 */
153 153
 	public static function createNewFamcPedi($pedi, $xref) {
154 154
 		switch ($pedi) {
155
-		case '':
156
-			return "1 FAMC @$xref@";
157
-		case 'adopted':
158
-			return "1 FAMC @$xref@\n2 PEDI $pedi\n1 ADOP\n2 FAMC @$xref@\n3 ADOP BOTH";
159
-		case 'sealing':
160
-			return "1 FAMC @$xref@\n2 PEDI $pedi\n1 SLGC\n2 FAMC @$xref@";
161
-		case 'foster':
162
-			return "1 FAMC @$xref@\n2 PEDI $pedi\n1 EVEN\n2 TYPE $pedi";
163
-		default:
164
-			return "1 FAMC @$xref@\n2 PEDI $pedi";
155
+			case '':
156
+				return "1 FAMC @$xref@";
157
+			case 'adopted':
158
+				return "1 FAMC @$xref@\n2 PEDI $pedi\n1 ADOP\n2 FAMC @$xref@\n3 ADOP BOTH";
159
+			case 'sealing':
160
+				return "1 FAMC @$xref@\n2 PEDI $pedi\n1 SLGC\n2 FAMC @$xref@";
161
+			case 'foster':
162
+				return "1 FAMC @$xref@\n2 PEDI $pedi\n1 EVEN\n2 TYPE $pedi";
163
+			default:
164
+				return "1 FAMC @$xref@\n2 PEDI $pedi";
165 165
 		}
166 166
 	}
167 167
 }
Please login to merge, or discard this patch.