Test Failed
Branch master (4a3c5b)
by Greg
12:31
created
app/SurnameTradition.php 1 patch
Switch Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -39,24 +39,24 @@
 block discarded – undo
39 39
 	 */
40 40
 	public static function create($name) {
41 41
 		switch ($name) {
42
-		case 'paternal':
43
-			return new PaternalSurnameTradition;
44
-		case 'patrilineal':
45
-			return new PatrilinealSurnameTradition;
46
-		case 'matrilineal':
47
-			return new MatrilinealSurnameTradition;
48
-		case 'portuguese':
49
-			return new PortugueseSurnameTradition;
50
-		case 'spanish':
51
-			return new SpanishSurnameTradition;
52
-		case 'polish':
53
-			return new PolishSurnameTradition;
54
-		case 'lithuanian':
55
-			return new LithuanianSurnameTradition;
56
-		case 'icelandic':
57
-			return new IcelandicSurnameTradition;
58
-		default:
59
-			return new DefaultSurnameTradition;
42
+			case 'paternal':
43
+				return new PaternalSurnameTradition;
44
+			case 'patrilineal':
45
+				return new PatrilinealSurnameTradition;
46
+			case 'matrilineal':
47
+				return new MatrilinealSurnameTradition;
48
+			case 'portuguese':
49
+				return new PortugueseSurnameTradition;
50
+			case 'spanish':
51
+				return new SpanishSurnameTradition;
52
+			case 'polish':
53
+				return new PolishSurnameTradition;
54
+			case 'lithuanian':
55
+				return new LithuanianSurnameTradition;
56
+			case 'icelandic':
57
+				return new IcelandicSurnameTradition;
58
+			default:
59
+				return new DefaultSurnameTradition;
60 60
 		}
61 61
 	}
62 62
 
Please login to merge, or discard this patch.
app/SurnameTradition/SpanishSurnameTradition.php 1 patch
Switch Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -62,16 +62,16 @@
 block discarded – undo
62 62
 	public function newParentNames($child_name, $parent_sex) {
63 63
 		if (preg_match(self::REGEX_SURNS, $child_name, $match)) {
64 64
 			switch ($parent_sex) {
65
-			case 'M':
66
-				return [
67
-					'NAME' => '/' . $match['SURN1'] . '/ //',
68
-					'SURN' => $match['SURN1'],
69
-				];
70
-			case 'F':
71
-				return [
72
-					'NAME' => '/' . $match['SURN2'] . '/ //',
73
-					'SURN' => $match['SURN2'],
74
-				];
65
+				case 'M':
66
+					return [
67
+						'NAME' => '/' . $match['SURN1'] . '/ //',
68
+						'SURN' => $match['SURN1'],
69
+					];
70
+				case 'F':
71
+					return [
72
+						'NAME' => '/' . $match['SURN2'] . '/ //',
73
+						'SURN' => $match['SURN2'],
74
+					];
75 75
 			}
76 76
 		}
77 77
 
Please login to merge, or discard this patch.
app/SurnameTradition/PortugueseSurnameTradition.php 1 patch
Switch Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -62,16 +62,16 @@
 block discarded – undo
62 62
 	public function newParentNames($child_name, $parent_sex) {
63 63
 		if (preg_match(self::REGEX_SURNS, $child_name, $match)) {
64 64
 			switch ($parent_sex) {
65
-			case 'M':
66
-				return [
67
-					'NAME' => '// /' . $match['SURN1'] . '/',
68
-					'SURN' => $match['SURN1'],
69
-				];
70
-			case 'F':
71
-				return [
72
-					'NAME' => '// /' . $match['SURN2'] . '/',
73
-					'SURN' => $match['SURN2'],
74
-				];
65
+				case 'M':
66
+					return [
67
+						'NAME' => '// /' . $match['SURN1'] . '/',
68
+						'SURN' => $match['SURN1'],
69
+					];
70
+				case 'F':
71
+					return [
72
+						'NAME' => '// /' . $match['SURN2'] . '/',
73
+						'SURN' => $match['SURN2'],
74
+					];
75 75
 			}
76 76
 		}
77 77
 
Please login to merge, or discard this patch.
app/SurnameTradition/PaternalSurnameTradition.php 1 patch
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -39,17 +39,17 @@
 block discarded – undo
39 39
 	public function newParentNames($child_name, $parent_sex) {
40 40
 		if (preg_match(self::REGEX_SPFX_SURN, $child_name, $match)) {
41 41
 			switch ($parent_sex) {
42
-			case 'M':
43
-				return array_filter([
44
-					'NAME' => $match['NAME'],
45
-					'SPFX' => $match['SPFX'],
46
-					'SURN' => $match['SURN'],
47
-				]);
48
-			case 'F':
49
-				return [
50
-					'NAME'   => '//',
51
-					'_MARNM' => '/' . trim($match['SPFX'] . ' ' . $match['SURN']) . '/',
52
-				];
42
+				case 'M':
43
+					return array_filter([
44
+						'NAME' => $match['NAME'],
45
+						'SPFX' => $match['SPFX'],
46
+						'SURN' => $match['SURN'],
47
+					]);
48
+				case 'F':
49
+					return [
50
+						'NAME'   => '//',
51
+						'_MARNM' => '/' . trim($match['SPFX'] . ' ' . $match['SURN']) . '/',
52
+					];
53 53
 			}
54 54
 		}
55 55
 
Please login to merge, or discard this patch.
app/SurnameTradition/IcelandicSurnameTradition.php 1 patch
Switch Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -43,14 +43,14 @@
 block discarded – undo
43 43
 	public function newChildNames($father_name, $mother_name, $child_sex) {
44 44
 		if (preg_match(self::REGEX_GIVN, $father_name, $father_match)) {
45 45
 			switch ($child_sex) {
46
-			case 'M':
47
-				return [
48
-					'NAME' => $father_match['GIVN'] . 'sson',
49
-				];
50
-			case 'F':
51
-				return [
52
-					'NAME' => $father_match['GIVN'] . 'sdottir',
53
-				];
46
+				case 'M':
47
+					return [
48
+						'NAME' => $father_match['GIVN'] . 'sson',
49
+					];
50
+				case 'F':
51
+					return [
52
+						'NAME' => $father_match['GIVN'] . 'sdottir',
53
+					];
54 54
 			}
55 55
 		}
56 56
 
Please login to merge, or discard this patch.
app/Module/FamilyTreeFavoritesModule.php 1 patch
Switch Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -84,43 +84,43 @@  discard block
 block discarded – undo
84 84
 
85 85
 		$action = Filter::get('action');
86 86
 		switch ($action) {
87
-		case 'deletefav':
88
-			$favorite_id = Filter::getInteger('favorite_id');
89
-			if ($favorite_id) {
90
-				self::deleteFavorite($favorite_id);
91
-			}
92
-			break;
93
-		case 'addfav':
94
-			$gid      = Filter::get('gid', WT_REGEX_XREF);
95
-			$favnote  = Filter::get('favnote');
96
-			$url      = Filter::getUrl('url');
97
-			$favtitle = Filter::get('favtitle');
87
+			case 'deletefav':
88
+				$favorite_id = Filter::getInteger('favorite_id');
89
+				if ($favorite_id) {
90
+					self::deleteFavorite($favorite_id);
91
+				}
92
+				break;
93
+			case 'addfav':
94
+				$gid      = Filter::get('gid', WT_REGEX_XREF);
95
+				$favnote  = Filter::get('favnote');
96
+				$url      = Filter::getUrl('url');
97
+				$favtitle = Filter::get('favtitle');
98 98
 
99
-			if ($gid) {
100
-				$record = GedcomRecord::getInstance($gid, $WT_TREE);
101
-				if ($record && $record->canShow()) {
99
+				if ($gid) {
100
+					$record = GedcomRecord::getInstance($gid, $WT_TREE);
101
+					if ($record && $record->canShow()) {
102
+						self::addFavorite([
103
+							'user_id'   => $ctype === 'user' ? Auth::id() : null,
104
+							'gedcom_id' => $WT_TREE->getTreeId(),
105
+							'gid'       => $record->getXref(),
106
+							'type'      => $record::RECORD_TYPE,
107
+							'url'       => null,
108
+							'note'      => $favnote,
109
+							'title'     => $favtitle,
110
+						]);
111
+					}
112
+				} elseif ($url) {
102 113
 					self::addFavorite([
103 114
 						'user_id'   => $ctype === 'user' ? Auth::id() : null,
104 115
 						'gedcom_id' => $WT_TREE->getTreeId(),
105
-						'gid'       => $record->getXref(),
106
-						'type'      => $record::RECORD_TYPE,
107
-						'url'       => null,
116
+						'gid'       => null,
117
+						'type'      => 'URL',
118
+						'url'       => $url,
108 119
 						'note'      => $favnote,
109
-						'title'     => $favtitle,
120
+						'title'     => $favtitle ? $favtitle : $url,
110 121
 					]);
111 122
 				}
112
-			} elseif ($url) {
113
-				self::addFavorite([
114
-					'user_id'   => $ctype === 'user' ? Auth::id() : null,
115
-					'gedcom_id' => $WT_TREE->getTreeId(),
116
-					'gid'       => null,
117
-					'type'      => 'URL',
118
-					'url'       => $url,
119
-					'note'      => $favnote,
120
-					'title'     => $favtitle ? $favtitle : $url,
121
-				]);
122
-			}
123
-			break;
123
+				break;
124 124
 		}
125 125
 
126 126
 		$userfavs = $this->getFavorites($ctype === 'user' ? Auth::id() : $WT_TREE->getTreeId());
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
 						if ($record instanceof Individual) {
150 150
 							$content .= '<div id="box' . $favorite['gid'] . '.0" class="person_box action_header';
151 151
 							switch ($record->getSex()) {
152
-							case 'M':
153
-								break;
154
-							case 'F':
155
-								$content .= 'F';
156
-								break;
157
-							default:
158
-								$content .= 'NN';
159
-								break;
152
+								case 'M':
153
+									break;
154
+								case 'F':
155
+									$content .= 'F';
156
+									break;
157
+								default:
158
+									$content .= 'NN';
159
+									break;
160 160
 							}
161 161
 							$content .= '">';
162 162
 							if ($ctype == 'user' || Auth::isManager($WT_TREE)) {
Please login to merge, or discard this patch.
app/Module/ChartsBlockModule.php 1 patch
Switch Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -77,57 +77,57 @@
 block discarded – undo
77 77
 		if ($person) {
78 78
 			$content = '';
79 79
 			switch ($type) {
80
-			case 'pedigree':
81
-				$title           = I18N::translate('Pedigree of %s', $person->getFullName());
82
-				$chartController = new HourglassController($person->getXref());
83
-				$controller->addInlineJavascript($chartController->setupJavascript());
84
-				$content .= '<table cellspacing="0" cellpadding="0" border="0"><tr>';
85
-				$content .= '<td class="myCharts">';
86
-				ob_start();
87
-				FunctionsPrint::printPedigreePerson($person);
88
-				$content .= ob_get_clean();
89
-				$content .= '</td>';
90
-				$content .= '<td>';
91
-				ob_start();
92
-				$chartController->printPersonPedigree($person, 1);
93
-				$content .= ob_get_clean();
94
-				$content .= '</td>';
95
-				$content .= '</tr></table>';
96
-				break;
97
-			case 'descendants':
98
-				$title           = I18N::translate('Descendants of %s', $person->getFullName());
99
-				$chartController = new HourglassController($person->getXref());
100
-				$controller->addInlineJavascript($chartController->setupJavascript());
101
-				ob_start();
102
-				$chartController->printDescendency($person, 1, false);
103
-				$content .= ob_get_clean();
104
-				break;
105
-			case 'hourglass':
106
-				$title           = I18N::translate('Hourglass chart of %s', $person->getFullName());
107
-				$chartController = new HourglassController($person->getXref());
108
-				$controller->addInlineJavascript($chartController->setupJavascript());
109
-				$content .= '<table cellspacing="0" cellpadding="0" border="0"><tr>';
110
-				$content .= '<td>';
111
-				ob_start();
112
-				$chartController->printDescendency($person, 1, false);
113
-				$content .= ob_get_clean();
114
-				$content .= '</td>';
115
-				$content .= '<td>';
116
-				ob_start();
117
-				$chartController->printPersonPedigree($person, 1);
118
-				$content .= ob_get_clean();
119
-				$content .= '</td>';
120
-				$content .= '</tr></table>';
121
-				break;
122
-			case 'treenav':
123
-				$title = I18N::translate('Interactive tree of %s', $person->getFullName());
124
-				$mod   = new InteractiveTreeModule(WT_MODULES_DIR . 'tree');
125
-				$tv    = new TreeView;
126
-				$content .= '<script>$("head").append(\'<link rel="stylesheet" href="' . $mod->css() . '" type="text/css" />\');</script>';
127
-				$content .= '<script src="' . $mod->js() . '"></script>';
128
-				list($html, $js) = $tv->drawViewport($person, 2);
129
-				$content .= $html . '<script>' . $js . '</script>';
130
-				break;
80
+				case 'pedigree':
81
+					$title           = I18N::translate('Pedigree of %s', $person->getFullName());
82
+					$chartController = new HourglassController($person->getXref());
83
+					$controller->addInlineJavascript($chartController->setupJavascript());
84
+					$content .= '<table cellspacing="0" cellpadding="0" border="0"><tr>';
85
+					$content .= '<td class="myCharts">';
86
+					ob_start();
87
+					FunctionsPrint::printPedigreePerson($person);
88
+					$content .= ob_get_clean();
89
+					$content .= '</td>';
90
+					$content .= '<td>';
91
+					ob_start();
92
+					$chartController->printPersonPedigree($person, 1);
93
+					$content .= ob_get_clean();
94
+					$content .= '</td>';
95
+					$content .= '</tr></table>';
96
+					break;
97
+				case 'descendants':
98
+					$title           = I18N::translate('Descendants of %s', $person->getFullName());
99
+					$chartController = new HourglassController($person->getXref());
100
+					$controller->addInlineJavascript($chartController->setupJavascript());
101
+					ob_start();
102
+					$chartController->printDescendency($person, 1, false);
103
+					$content .= ob_get_clean();
104
+					break;
105
+				case 'hourglass':
106
+					$title           = I18N::translate('Hourglass chart of %s', $person->getFullName());
107
+					$chartController = new HourglassController($person->getXref());
108
+					$controller->addInlineJavascript($chartController->setupJavascript());
109
+					$content .= '<table cellspacing="0" cellpadding="0" border="0"><tr>';
110
+					$content .= '<td>';
111
+					ob_start();
112
+					$chartController->printDescendency($person, 1, false);
113
+					$content .= ob_get_clean();
114
+					$content .= '</td>';
115
+					$content .= '<td>';
116
+					ob_start();
117
+					$chartController->printPersonPedigree($person, 1);
118
+					$content .= ob_get_clean();
119
+					$content .= '</td>';
120
+					$content .= '</tr></table>';
121
+					break;
122
+				case 'treenav':
123
+					$title = I18N::translate('Interactive tree of %s', $person->getFullName());
124
+					$mod   = new InteractiveTreeModule(WT_MODULES_DIR . 'tree');
125
+					$tv    = new TreeView;
126
+					$content .= '<script>$("head").append(\'<link rel="stylesheet" href="' . $mod->css() . '" type="text/css" />\');</script>';
127
+					$content .= '<script src="' . $mod->js() . '"></script>';
128
+					list($html, $js) = $tv->drawViewport($person, 2);
129
+					$content .= $html . '<script>' . $js . '</script>';
130
+					break;
131 131
 			}
132 132
 		} else {
133 133
 			$content = I18N::translate('You must select an individual and a chart type in the block preferences');
Please login to merge, or discard this patch.
app/Module/IndividualFactsTabModule.php 1 patch
Switch Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -59,19 +59,19 @@  discard block
 block discarded – undo
59 59
 		// The individual’s own facts
60 60
 		foreach ($controller->record->getFacts() as $fact) {
61 61
 			switch ($fact->getTag()) {
62
-			case 'SEX':
63
-			case 'NAME':
64
-			case 'SOUR':
65
-			case 'OBJE':
66
-			case 'NOTE':
67
-			case 'FAMC':
68
-			case 'FAMS':
69
-				break;
70
-			default:
71
-				if (!array_key_exists('extra_info', Module::getActiveSidebars($controller->record->getTree())) || !ExtraInformationModule::showFact($fact)) {
72
-					$indifacts[] = $fact;
73
-				}
74
-				break;
62
+				case 'SEX':
63
+				case 'NAME':
64
+				case 'SOUR':
65
+				case 'OBJE':
66
+				case 'NOTE':
67
+				case 'FAMC':
68
+				case 'FAMS':
69
+					break;
70
+				default:
71
+					if (!array_key_exists('extra_info', Module::getActiveSidebars($controller->record->getTree())) || !ExtraInformationModule::showFact($fact)) {
72
+						$indifacts[] = $fact;
73
+					}
74
+					break;
75 75
 			}
76 76
 		}
77 77
 
@@ -79,19 +79,19 @@  discard block
 block discarded – undo
79 79
 		foreach ($controller->record->getSpouseFamilies() as $family) {
80 80
 			foreach ($family->getFacts() as $fact) {
81 81
 				switch ($fact->getTag()) {
82
-				case 'SOUR':
83
-				case 'NOTE':
84
-				case 'OBJE':
85
-				case 'CHAN':
86
-				case '_UID':
87
-				case 'RIN':
88
-				case 'HUSB':
89
-				case 'WIFE':
90
-				case 'CHIL':
91
-					break;
92
-				default:
93
-					$indifacts[] = $fact;
94
-					break;
82
+					case 'SOUR':
83
+					case 'NOTE':
84
+					case 'OBJE':
85
+					case 'CHAN':
86
+					case '_UID':
87
+					case 'RIN':
88
+					case 'HUSB':
89
+					case 'WIFE':
90
+					case 'CHIL':
91
+						break;
92
+					default:
93
+						$indifacts[] = $fact;
94
+						break;
95 95
 				}
96 96
 			}
97 97
 			$spouse = $family->getSpouse($controller->record);
@@ -233,27 +233,27 @@  discard block
 block discarded – undo
233 233
 
234 234
 		// Deal with recursion.
235 235
 		switch ($option) {
236
-		case '_CHIL':
237
-			// Add grandchildren
238
-			foreach ($family->getChildren() as $child) {
239
-				foreach ($child->getSpouseFamilies() as $cfamily) {
240
-					switch ($child->getSex()) {
241
-					case 'M':
242
-						foreach (self::childFacts($person, $cfamily, '_GCHI', 'son') as $fact) {
243
-							$facts[] = $fact;
244
-						}
245
-						break;
246
-					case 'F':
247
-						foreach (self::childFacts($person, $cfamily, '_GCHI', 'dau') as $fact) {
248
-							$facts[] = $fact;
249
-						}
250
-						break;
251
-					default:
252
-						foreach (self::childFacts($person, $cfamily, '_GCHI', 'chi') as $fact) {
253
-							$facts[] = $fact;
236
+			case '_CHIL':
237
+				// Add grandchildren
238
+				foreach ($family->getChildren() as $child) {
239
+					foreach ($child->getSpouseFamilies() as $cfamily) {
240
+						switch ($child->getSex()) {
241
+							case 'M':
242
+								foreach (self::childFacts($person, $cfamily, '_GCHI', 'son') as $fact) {
243
+									$facts[] = $fact;
244
+								}
245
+								break;
246
+							case 'F':
247
+								foreach (self::childFacts($person, $cfamily, '_GCHI', 'dau') as $fact) {
248
+									$facts[] = $fact;
249
+								}
250
+								break;
251
+							default:
252
+								foreach (self::childFacts($person, $cfamily, '_GCHI', 'chi') as $fact) {
253
+									$facts[] = $fact;
254
+								}
255
+								break;
254 256
 						}
255
-						break;
256
-					}
257 257
 				}
258 258
 			}
259 259
 			break;
@@ -418,24 +418,24 @@  discard block
 block discarded – undo
418 418
 					foreach ($parent->getFacts(WT_EVENTS_DEAT) as $fact) {
419 419
 						if ($fact->getDate()->isOK() && Date::compare($birt_date, $fact->getDate()) <= 0 && Date::compare($fact->getDate(), $deat_date) <= 0) {
420 420
 							switch ($sosa) {
421
-							case 1:
422
-								// Convert the event to a close relatives event.
423
-								$rela_fact = clone($fact);
424
-								$rela_fact->setTag('_' . $fact->getTag() . '_PARE');
425
-								$facts[] = $rela_fact;
426
-								break;
427
-							case 2:
428
-								// Convert the event to a close relatives event
429
-								$rela_fact = clone($fact);
430
-								$rela_fact->setTag('_' . $fact->getTag() . '_GPA1');
431
-								$facts[] = $rela_fact;
432
-								break;
433
-							case 3:
434
-								// Convert the event to a close relatives event
435
-								$rela_fact = clone($fact);
436
-								$rela_fact->setTag('_' . $fact->getTag() . '_GPA2');
437
-								$facts[] = $rela_fact;
438
-								break;
421
+								case 1:
422
+									// Convert the event to a close relatives event.
423
+									$rela_fact = clone($fact);
424
+									$rela_fact->setTag('_' . $fact->getTag() . '_PARE');
425
+									$facts[] = $rela_fact;
426
+									break;
427
+								case 2:
428
+									// Convert the event to a close relatives event
429
+									$rela_fact = clone($fact);
430
+									$rela_fact->setTag('_' . $fact->getTag() . '_GPA1');
431
+									$facts[] = $rela_fact;
432
+									break;
433
+								case 3:
434
+									// Convert the event to a close relatives event
435
+									$rela_fact = clone($fact);
436
+									$rela_fact->setTag('_' . $fact->getTag() . '_GPA2');
437
+									$facts[] = $rela_fact;
438
+									break;
439 439
 							}
440 440
 						}
441 441
 					}
Please login to merge, or discard this patch.
app/Module/RecentChangesModule.php 1 patch
Switch Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
 			$content .= I18N::plural('There have been no changes within the last %s day.', 'There have been no changes within the last %s days.', $days, I18N::number($days));
76 76
 		} else {
77 77
 			switch ($infoStyle) {
78
-			case 'list':
79
-				$content .= $this->changesList($records, $sortStyle, $show_user);
80
-				break;
81
-			case 'table':
82
-				$content .= $this->changesTable($records, $sortStyle, $show_user);
83
-				break;
78
+				case 'list':
79
+					$content .= $this->changesList($records, $sortStyle, $show_user);
80
+					break;
81
+				case 'table':
82
+					$content .= $this->changesTable($records, $sortStyle, $show_user);
83
+					break;
84 84
 			}
85 85
 		}
86 86
 
@@ -206,15 +206,15 @@  discard block
 block discarded – undo
206 206
 	 */
207 207
 	private function changesList(array $records, $sort, $show_user) {
208 208
 		switch ($sort) {
209
-		case 'name':
210
-			uasort($records, ['self', 'sortByNameAndChangeDate']);
211
-			break;
212
-		case 'date_asc':
213
-			uasort($records, ['self', 'sortByChangeDateAndName']);
214
-			$records = array_reverse($records);
215
-			break;
216
-		case 'date_desc':
217
-			uasort($records, ['self', 'sortByChangeDateAndName']);
209
+			case 'name':
210
+				uasort($records, ['self', 'sortByNameAndChangeDate']);
211
+				break;
212
+			case 'date_asc':
213
+				uasort($records, ['self', 'sortByChangeDateAndName']);
214
+				$records = array_reverse($records);
215
+				break;
216
+			case 'date_desc':
217
+				uasort($records, ['self', 'sortByChangeDateAndName']);
218 218
 		}
219 219
 
220 220
 		$html = '';
@@ -259,16 +259,16 @@  discard block
 block discarded – undo
259 259
 		$table_id = 'table-chan-' . Uuid::uuid4(); // lists requires a unique ID in case there are multiple lists per page
260 260
 
261 261
 		switch ($sort) {
262
-		case 'name':
263
-		default:
264
-			$aaSorting = "[1,'asc'], [2,'desc']";
265
-			break;
266
-		case 'date_asc':
267
-			$aaSorting = "[2,'asc'], [1,'asc']";
268
-			break;
269
-		case 'date_desc':
270
-			$aaSorting = "[2,'desc'], [1,'asc']";
271
-			break;
262
+			case 'name':
263
+			default:
264
+				$aaSorting = "[1,'asc'], [2,'desc']";
265
+				break;
266
+			case 'date_asc':
267
+				$aaSorting = "[2,'asc'], [1,'asc']";
268
+				break;
269
+			case 'date_desc':
270
+				$aaSorting = "[2,'desc'], [1,'asc']";
271
+				break;
272 272
 		}
273 273
 
274 274
 		$html = '';
@@ -302,27 +302,27 @@  discard block
 block discarded – undo
302 302
 		foreach ($records as $record) {
303 303
 			$html .= '<tr><td>';
304 304
 			switch ($record::RECORD_TYPE) {
305
-			case 'INDI':
306
-				$html .= FontAwesome::semanticIcon('individual', I18N::translate('Individual'));
307
-				break;
308
-			case 'FAM':
309
-				$html .= FontAwesome::semanticicon('family', I18N::translate('Family'));
310
-				break;
311
-			case 'OBJE':
312
-				$html .= FontAwesome::semanticIcon('media', I18N::translate('Media'));
313
-				break;
314
-			case 'NOTE':
315
-				$html .= FontAwesome::semanticIcon('note', I18N::translate('Note'));
316
-				break;
317
-			case 'SOUR':
318
-				$html .= FontAwesome::semanticIcon('source', I18N::translate('Source'));
319
-				break;
320
-			case 'SUBM':
321
-				$html .= FontAwesome::semanticIcon('submitter', I18N::translate('Submitter'));
322
-				break;
323
-			case 'REPO':
324
-				$html .= FontAwesome::semanticIcon('repository', I18N::translate('Repository'));
325
-				break;
305
+				case 'INDI':
306
+					$html .= FontAwesome::semanticIcon('individual', I18N::translate('Individual'));
307
+					break;
308
+				case 'FAM':
309
+					$html .= FontAwesome::semanticicon('family', I18N::translate('Family'));
310
+					break;
311
+				case 'OBJE':
312
+					$html .= FontAwesome::semanticIcon('media', I18N::translate('Media'));
313
+					break;
314
+				case 'NOTE':
315
+					$html .= FontAwesome::semanticIcon('note', I18N::translate('Note'));
316
+					break;
317
+				case 'SOUR':
318
+					$html .= FontAwesome::semanticIcon('source', I18N::translate('Source'));
319
+					break;
320
+				case 'SUBM':
321
+					$html .= FontAwesome::semanticIcon('submitter', I18N::translate('Submitter'));
322
+					break;
323
+				case 'REPO':
324
+					$html .= FontAwesome::semanticIcon('repository', I18N::translate('Repository'));
325
+					break;
326 326
 			}
327 327
 			$html .= '</td>';
328 328
 			$html .= '<td data-sort="' . Html::escape($record->getSortName()) . '">';
Please login to merge, or discard this patch.