Completed
Push — 1.7 ( 95b633...95fbf5 )
by
unknown
09:26
created
edituser.php 1 patch
Switch Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -53,52 +53,52 @@
 block discarded – undo
53 53
 // Respond to form action
54 54
 if ($form_action && Filter::checkCsrf()) {
55 55
 	switch ($form_action) {
56
-	case 'update':
57
-		if ($form_username !== Auth::user()->getUserName() && User::findByUserName($form_username)) {
58
-			FlashMessages::addMessage(I18N::translate('Duplicate username. A user with that username already exists. Please choose another username.'));
59
-		} elseif ($form_email !== Auth::user()->getEmail() && User::findByEmail($form_email)) {
60
-			FlashMessages::addMessage(I18N::translate('Duplicate email address. A user with that email already exists.'));
61
-		} else {
62
-			// Change username
63
-			if ($form_username !== Auth::user()->getUserName()) {
64
-				Log::addAuthenticationLog('User ' . Auth::user()->getUserName() . ' renamed to ' . $form_username);
65
-				Auth::user()->setUserName($form_username);
66
-			}
67
-
68
-			// Change password
69
-			if ($form_pass1 && $form_pass1 === $form_pass2) {
70
-				Auth::user()->setPassword($form_pass1);
71
-			}
72
-
73
-			// Change other settings
74
-			Auth::user()
75
-				->setRealName($form_realname)
76
-				->setEmail($form_email)
77
-				->setPreference('language', $form_language)
78
-				->setPreference('TIMEZONE', $form_timezone)
79
-				->setPreference('contactmethod', $form_contact_method)
80
-				->setPreference('visibleonline', $form_visible_online ? '1' : '0');
81
-
82
-			if ($form_theme === null) {
83
-				Auth::user()->deletePreference('theme');
56
+		case 'update':
57
+			if ($form_username !== Auth::user()->getUserName() && User::findByUserName($form_username)) {
58
+				FlashMessages::addMessage(I18N::translate('Duplicate username. A user with that username already exists. Please choose another username.'));
59
+			} elseif ($form_email !== Auth::user()->getEmail() && User::findByEmail($form_email)) {
60
+				FlashMessages::addMessage(I18N::translate('Duplicate email address. A user with that email already exists.'));
84 61
 			} else {
85
-				Auth::user()->setPreference('theme', $form_theme);
62
+				// Change username
63
+				if ($form_username !== Auth::user()->getUserName()) {
64
+					Log::addAuthenticationLog('User ' . Auth::user()->getUserName() . ' renamed to ' . $form_username);
65
+					Auth::user()->setUserName($form_username);
66
+				}
67
+
68
+				// Change password
69
+				if ($form_pass1 && $form_pass1 === $form_pass2) {
70
+					Auth::user()->setPassword($form_pass1);
71
+				}
72
+
73
+				// Change other settings
74
+				Auth::user()
75
+					->setRealName($form_realname)
76
+					->setEmail($form_email)
77
+					->setPreference('language', $form_language)
78
+					->setPreference('TIMEZONE', $form_timezone)
79
+					->setPreference('contactmethod', $form_contact_method)
80
+					->setPreference('visibleonline', $form_visible_online ? '1' : '0');
81
+
82
+				if ($form_theme === null) {
83
+					Auth::user()->deletePreference('theme');
84
+				} else {
85
+					Auth::user()->setPreference('theme', $form_theme);
86
+				}
87
+
88
+				$WT_TREE->setUserPreference(Auth::user(), 'rootid', $form_rootid);
86 89
 			}
87
-
88
-			$WT_TREE->setUserPreference(Auth::user(), 'rootid', $form_rootid);
89
-		}
90
-		break;
91
-
92
-	case 'delete':
93
-		// An administrator can only be deleted by another administrator
94
-		if (!Auth::user()->getPreference('canadmin')) {
95
-			// Keep a reference to the currently logged in user because after logging out this user,
96
-			// a call to Auth::user() will not return this user anymore
97
-			$currentUser = Auth::user();
98
-			Auth::logout();
99
-			$currentUser->delete();
100
-		}
101
-		break;
90
+			break;
91
+
92
+		case 'delete':
93
+			// An administrator can only be deleted by another administrator
94
+			if (!Auth::user()->getPreference('canadmin')) {
95
+				// Keep a reference to the currently logged in user because after logging out this user,
96
+				// a call to Auth::user() will not return this user anymore
97
+				$currentUser = Auth::user();
98
+				Auth::logout();
99
+				$currentUser->delete();
100
+			}
101
+			break;
102 102
 	}
103 103
 
104 104
 	header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
Please login to merge, or discard this patch.
descendancy.php 1 patch
Switch Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -96,25 +96,25 @@
 block discarded – undo
96 96
 	echo '<p class="ui-state-error">', $controller->error_message, '</p>';
97 97
 } else {
98 98
 	switch ($controller->chart_style) {
99
-	case 0: // List
100
-		echo '<ul id="descendancy_chart" class="chart_common">';
101
-		$controller->printChildDescendancy($controller->root, $controller->generations);
102
-		echo '</ul>';
103
-		break;
104
-	case 1: // Booklet
105
-		$show_cousins = true;
106
-		echo '<div id="descendancy_booklet">';
107
-		$controller->printChildFamily($controller->root, $controller->generations);
108
-		echo '</div>';
109
-		break;
110
-	case 2: // Individual list
111
-		$descendants = $controller->individualDescendancy($controller->root, $controller->generations, array());
112
-		echo '<div id="descendancy-list">', FunctionsPrintLists::individualTable($descendants), '</div>';
113
-		break;
114
-	case 3: // Family list
115
-		$descendants = $controller->familyDescendancy($controller->root, $controller->generations, array());
116
-		echo '<div id="descendancy-list">', FunctionsPrintLists::familyTable($descendants), '</div>';
117
-		break;
99
+		case 0: // List
100
+			echo '<ul id="descendancy_chart" class="chart_common">';
101
+			$controller->printChildDescendancy($controller->root, $controller->generations);
102
+			echo '</ul>';
103
+			break;
104
+		case 1: // Booklet
105
+			$show_cousins = true;
106
+			echo '<div id="descendancy_booklet">';
107
+			$controller->printChildFamily($controller->root, $controller->generations);
108
+			echo '</div>';
109
+			break;
110
+		case 2: // Individual list
111
+			$descendants = $controller->individualDescendancy($controller->root, $controller->generations, array());
112
+			echo '<div id="descendancy-list">', FunctionsPrintLists::individualTable($descendants), '</div>';
113
+			break;
114
+		case 3: // Family list
115
+			$descendants = $controller->familyDescendancy($controller->root, $controller->generations, array());
116
+			echo '<div id="descendancy-list">', FunctionsPrintLists::familyTable($descendants), '</div>';
117
+			break;
118 118
 	}
119 119
 }
120 120
 ?>
Please login to merge, or discard this patch.
placelist.php 1 patch
Switch Indentation   +142 added lines, -142 removed lines patch added patch discarded remove patch
@@ -51,170 +51,170 @@
 block discarded – undo
51 51
 echo '<div id="place-hierarchy">';
52 52
 
53 53
 switch ($display) {
54
-case 'list':
55
-	echo '<h2>', $controller->getPageTitle(), '</h2>';
56
-	$list_places = Place::allPlaces($WT_TREE);
57
-	$numfound    = count($list_places);
54
+	case 'list':
55
+		echo '<h2>', $controller->getPageTitle(), '</h2>';
56
+		$list_places = Place::allPlaces($WT_TREE);
57
+		$numfound    = count($list_places);
58 58
 
59
-	$divisor = $numfound > 20 ? 3 : 2;
59
+		$divisor = $numfound > 20 ? 3 : 2;
60 60
 
61
-	if ($numfound === 0) {
62
-		echo '<b>', I18N::translate('No results found.'), '</b><br>';
63
-	} else {
64
-		$columns = array_chunk($list_places, ceil($numfound / $divisor));
65
-
66
-		$html = '<table class="list_table"><thead>';
67
-		$html .= '<tr><th class="list_label" colspan="' . $divisor . '">';
68
-		$html .= '<i class="icon-place"></i> ' . I18N::translate('Place list');
69
-		$html .= '</th></tr></thead>';
70
-		$html .= '<tbody><tr>';
71
-		foreach ($columns as $column) {
72
-			$html .= '<td class="list_value_wrap"><ul>';
73
-			foreach ($column as $item) {
74
-				$html .= '<li><a href="' . $item->getURL() . '">' . $item->getReverseName() . '</a></li>';
61
+		if ($numfound === 0) {
62
+			echo '<b>', I18N::translate('No results found.'), '</b><br>';
63
+		} else {
64
+			$columns = array_chunk($list_places, ceil($numfound / $divisor));
65
+
66
+			$html = '<table class="list_table"><thead>';
67
+			$html .= '<tr><th class="list_label" colspan="' . $divisor . '">';
68
+			$html .= '<i class="icon-place"></i> ' . I18N::translate('Place list');
69
+			$html .= '</th></tr></thead>';
70
+			$html .= '<tbody><tr>';
71
+			foreach ($columns as $column) {
72
+				$html .= '<td class="list_value_wrap"><ul>';
73
+				foreach ($column as $item) {
74
+					$html .= '<li><a href="' . $item->getURL() . '">' . $item->getReverseName() . '</a></li>';
75
+				}
76
+				$html .= '</ul></td>';
75 77
 			}
76
-			$html .= '</ul></td>';
78
+			$html .= '</tr></tbody></table>';
79
+			echo $html;
77 80
 		}
78
-		$html .= '</tr></tbody></table>';
79
-		echo $html;
80
-	}
81
-	echo '<h4><a href="placelist.php?display=hierarchy">', I18N::translate('Show places in hierarchy'), '</a></h4>';
82
-	break;
83
-case 'hierarchy':
84
-	$gm_module = Module::getModuleByName('googlemap');
81
+		echo '<h4><a href="placelist.php?display=hierarchy">', I18N::translate('Show places in hierarchy'), '</a></h4>';
82
+		break;
83
+	case 'hierarchy':
84
+		$gm_module = Module::getModuleByName('googlemap');
85 85
 
86
-	// Find this place and its ID
87
-	$place    = new Place(implode(', ', array_reverse($parent)), $WT_TREE);
88
-	$place_id = $place->getPlaceId();
86
+		// Find this place and its ID
87
+		$place    = new Place(implode(', ', array_reverse($parent)), $WT_TREE);
88
+		$place_id = $place->getPlaceId();
89 89
 
90
-	$child_places = $place->getChildPlaces();
90
+		$child_places = $place->getChildPlaces();
91 91
 
92
-	$numfound = count($child_places);
92
+		$numfound = count($child_places);
93 93
 
94
-	//-- if the number of places found is 0 then automatically redirect to search page
95
-	if ($numfound === 0) {
96
-		$action = 'show';
97
-	}
98
-
99
-	echo '<h2>', $controller->getPageTitle();
100
-	// Breadcrumbs
101
-	if ($place_id) {
102
-		$parent_place = $place->getParentPlace();
103
-		while ($parent_place->getPlaceId()) {
104
-			echo ', <a href="', $parent_place->getURL(), '" dir="auto">', $parent_place->getPlaceName(), '</a>';
105
-			$parent_place = $parent_place->getParentPlace();
94
+		//-- if the number of places found is 0 then automatically redirect to search page
95
+		if ($numfound === 0) {
96
+			$action = 'show';
106 97
 		}
107
-		echo ', <a href="', WT_SCRIPT_NAME, '">', I18N::translate('Top level'), '</a>';
108
-	}
109
-	echo '</h2>';
110 98
 
111
-	if ($gm_module && $gm_module->getSetting('GM_PLACE_HIERARCHY')) {
112
-		$linklevels  = '';
113
-		$place_names = array();
114
-		for ($j = 0; $j < $level; $j++) {
115
-			$linklevels .= '&amp;parent[' . $j . ']=' . rawurlencode($parent[$j]);
99
+		echo '<h2>', $controller->getPageTitle();
100
+		// Breadcrumbs
101
+		if ($place_id) {
102
+			$parent_place = $place->getParentPlace();
103
+			while ($parent_place->getPlaceId()) {
104
+				echo ', <a href="', $parent_place->getURL(), '" dir="auto">', $parent_place->getPlaceName(), '</a>';
105
+				$parent_place = $parent_place->getParentPlace();
106
+			}
107
+			echo ', <a href="', WT_SCRIPT_NAME, '">', I18N::translate('Top level'), '</a>';
116 108
 		}
109
+		echo '</h2>';
117 110
 
118
-		$gm_module->createMap();
119
-	} elseif (Module::getModuleByName('places_assistant')) {
120
-		// Places Assistant is a custom/add-on module that was once part of the core code.
121
-		\PlacesAssistantModule::display_map($level, $parent);
122
-	}
111
+		if ($gm_module && $gm_module->getSetting('GM_PLACE_HIERARCHY')) {
112
+			$linklevels  = '';
113
+			$place_names = array();
114
+			for ($j = 0; $j < $level; $j++) {
115
+				$linklevels .= '&amp;parent[' . $j . ']=' . rawurlencode($parent[$j]);
116
+			}
123 117
 
124
-	if ($numfound > 0) {
125
-		if ($numfound > 20) {
126
-			$divisor = 3;
127
-		} elseif ($numfound > 4) {
128
-			$divisor = 2;
129
-		} else {
130
-			$divisor = 1;
118
+			$gm_module->createMap();
119
+		} elseif (Module::getModuleByName('places_assistant')) {
120
+			// Places Assistant is a custom/add-on module that was once part of the core code.
121
+			\PlacesAssistantModule::display_map($level, $parent);
131 122
 		}
132 123
 
133
-		$columns = array_chunk($child_places, ceil($numfound / $divisor));
134
-		$html    = '<table id="place_hierarchy" class="list_table"><thead><tr><th class="list_label" colspan="' . $divisor . '">';
135
-		$html .= '<i class="icon-place"></i> ';
136
-		if ($place_id) {
137
-			$html .= I18N::translate('Places in %s', $place->getPlaceName());
138
-		} else {
139
-			$html .= I18N::translate('Place hierarchy');
140
-		}
141
-		$html .= '</th></tr></thead>';
142
-		$html .= '<tbody><tr>';
143
-		foreach ($columns as $column) {
144
-			$html .= '<td class="list_value"><ul>';
145
-			foreach ($column as $item) {
146
-				$html .= '<li><a href="' . $item->getURL() . '" class="list_item">' . $item->getPlaceName() . '</a></li>';
147
-				if ($gm_module && $gm_module->getSetting('GM_PLACE_HIERARCHY')) {
148
-					list($tmp)     = explode(', ', $item->getGedcomName(), 2);
149
-					$place_names[] = $tmp;
124
+		if ($numfound > 0) {
125
+			if ($numfound > 20) {
126
+				$divisor = 3;
127
+			} elseif ($numfound > 4) {
128
+				$divisor = 2;
129
+			} else {
130
+				$divisor = 1;
131
+			}
132
+
133
+			$columns = array_chunk($child_places, ceil($numfound / $divisor));
134
+			$html    = '<table id="place_hierarchy" class="list_table"><thead><tr><th class="list_label" colspan="' . $divisor . '">';
135
+			$html .= '<i class="icon-place"></i> ';
136
+			if ($place_id) {
137
+				$html .= I18N::translate('Places in %s', $place->getPlaceName());
138
+			} else {
139
+				$html .= I18N::translate('Place hierarchy');
140
+			}
141
+			$html .= '</th></tr></thead>';
142
+			$html .= '<tbody><tr>';
143
+			foreach ($columns as $column) {
144
+				$html .= '<td class="list_value"><ul>';
145
+				foreach ($column as $item) {
146
+					$html .= '<li><a href="' . $item->getURL() . '" class="list_item">' . $item->getPlaceName() . '</a></li>';
147
+					if ($gm_module && $gm_module->getSetting('GM_PLACE_HIERARCHY')) {
148
+						list($tmp)     = explode(', ', $item->getGedcomName(), 2);
149
+						$place_names[] = $tmp;
150
+					}
150 151
 				}
152
+				$html .= '</ul></td>';
151 153
 			}
152
-			$html .= '</ul></td>';
153
-		}
154
-		$html .= '</tr></tbody>';
155
-		if ($numfound > 0 && $action == 'find' && $place_id) {
156
-			$html .= '<tfoot><tr><td class="list_label" colspan="' . $divisor . '">';
157
-			$html .= I18N::translate('View all records found in this place');
158
-			$html .= '</td></tr><tr><td class="list_value" colspan="' . $divisor . '" style="text-align: center;">';
159
-			$html .= '<a href="' . $place->getURL() . '&amp;action=show" class="formField">' . $place->getPlaceName() . '</a>';
160
-			$html .= '</td></tr></tfoot>';
154
+			$html .= '</tr></tbody>';
155
+			if ($numfound > 0 && $action == 'find' && $place_id) {
156
+				$html .= '<tfoot><tr><td class="list_label" colspan="' . $divisor . '">';
157
+				$html .= I18N::translate('View all records found in this place');
158
+				$html .= '</td></tr><tr><td class="list_value" colspan="' . $divisor . '" style="text-align: center;">';
159
+				$html .= '<a href="' . $place->getURL() . '&amp;action=show" class="formField">' . $place->getPlaceName() . '</a>';
160
+				$html .= '</td></tr></tfoot>';
161
+			}
162
+			$html .= '</table>';
163
+			// -- echo the array
164
+			echo $html;
161 165
 		}
162
-		$html .= '</table>';
163
-		// -- echo the array
164
-		echo $html;
165
-	}
166
-	if ($place_id && $action == 'show') {
167
-		// -- array of names
168
-		$myindilist = array();
169
-		$myfamlist  = array();
170
-
171
-		$positions =
172
-			Database::prepare("SELECT DISTINCT pl_gid FROM `##placelinks` WHERE pl_p_id=? AND pl_file=?")
173
-			->execute(array($place_id, $WT_TREE->getTreeId()))
174
-			->fetchOneColumn();
175
-
176
-		foreach ($positions as $position) {
177
-			$record = GedcomRecord::getInstance($position, $WT_TREE);
178
-			if ($record && $record->canShow()) {
179
-				if ($record instanceof Individual) {
180
-					$myindilist[] = $record;
181
-				}
182
-				if ($record instanceof Family) {
183
-					$myfamlist[] = $record;
166
+		if ($place_id && $action == 'show') {
167
+			// -- array of names
168
+			$myindilist = array();
169
+			$myfamlist  = array();
170
+
171
+			$positions =
172
+				Database::prepare("SELECT DISTINCT pl_gid FROM `##placelinks` WHERE pl_p_id=? AND pl_file=?")
173
+				->execute(array($place_id, $WT_TREE->getTreeId()))
174
+				->fetchOneColumn();
175
+
176
+			foreach ($positions as $position) {
177
+				$record = GedcomRecord::getInstance($position, $WT_TREE);
178
+				if ($record && $record->canShow()) {
179
+					if ($record instanceof Individual) {
180
+						$myindilist[] = $record;
181
+					}
182
+					if ($record instanceof Family) {
183
+						$myfamlist[] = $record;
184
+					}
184 185
 				}
185 186
 			}
187
+			echo '<br>';
188
+
189
+			//-- display results
190
+			$controller
191
+				->addInlineJavascript('jQuery("#places-tabs").tabs();')
192
+				->addInlineJavascript('jQuery("#places-tabs").css("visibility", "visible");')
193
+				->addInlineJavascript('jQuery(".loading-image").css("display", "none");');
194
+
195
+			echo '<div class="loading-image"></div>';
196
+			echo '<div id="places-tabs"><ul>';
197
+			if (!empty($myindilist)) {
198
+				echo '<li><a href="#places-indi"><span id="indisource">', I18N::translate('Individuals'), '</span></a></li>';
199
+			}
200
+			if (!empty($myfamlist)) {
201
+				echo '<li><a href="#places-fam"><span id="famsource">', I18N::translate('Families'), '</span></a></li>';
202
+			}
203
+			echo '</ul>';
204
+			if (!empty($myindilist)) {
205
+				echo '<div id="places-indi">', FunctionsPrintLists::individualTable($myindilist), '</div>';
206
+			}
207
+			if (!empty($myfamlist)) {
208
+				echo '<div id="places-fam">', FunctionsPrintLists::familyTable($myfamlist), '</div>';
209
+			}
210
+			echo '</div>'; // <div id="places-tabs">
186 211
 		}
187
-		echo '<br>';
188
-
189
-		//-- display results
190
-		$controller
191
-			->addInlineJavascript('jQuery("#places-tabs").tabs();')
192
-			->addInlineJavascript('jQuery("#places-tabs").css("visibility", "visible");')
193
-			->addInlineJavascript('jQuery(".loading-image").css("display", "none");');
194
-
195
-		echo '<div class="loading-image"></div>';
196
-		echo '<div id="places-tabs"><ul>';
197
-		if (!empty($myindilist)) {
198
-			echo '<li><a href="#places-indi"><span id="indisource">', I18N::translate('Individuals'), '</span></a></li>';
199
-		}
200
-		if (!empty($myfamlist)) {
201
-			echo '<li><a href="#places-fam"><span id="famsource">', I18N::translate('Families'), '</span></a></li>';
202
-		}
203
-		echo '</ul>';
204
-		if (!empty($myindilist)) {
205
-			echo '<div id="places-indi">', FunctionsPrintLists::individualTable($myindilist), '</div>';
206
-		}
207
-		if (!empty($myfamlist)) {
208
-			echo '<div id="places-fam">', FunctionsPrintLists::familyTable($myfamlist), '</div>';
209
-		}
210
-		echo '</div>'; // <div id="places-tabs">
211
-	}
212
-	echo '<h4><a href="placelist.php?display=list">', I18N::translate('Show all places in a list'), '</a></h4>';
212
+		echo '<h4><a href="placelist.php?display=list">', I18N::translate('Show all places in a list'), '</a></h4>';
213 213
 
214
-	if ($gm_module && $gm_module->getSetting('GM_PLACE_HIERARCHY')) {
215
-		$gm_module->mapScripts($numfound, $level, $parent, $linklevels, $place_names);
216
-	}
217
-	break;
214
+		if ($gm_module && $gm_module->getSetting('GM_PLACE_HIERARCHY')) {
215
+			$gm_module->mapScripts($numfound, $level, $parent, $linklevels, $place_names);
216
+		}
217
+		break;
218 218
 }
219 219
 
220 220
 echo '</div>'; // <div id="place-hierarchy">
Please login to merge, or discard this patch.
indilist.php 1 patch
Switch Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
 
47 47
 $show_marnm = Filter::get('show_marnm', 'no|yes');
48 48
 switch ($show_marnm) {
49
-case 'no':
50
-case 'yes':
51
-	Auth::user()->setPreference(WT_SCRIPT_NAME . '_show_marnm', $show_marnm);
52
-	break;
53
-default:
54
-	$show_marnm = Auth::user()->getPreference(WT_SCRIPT_NAME . '_show_marnm');
49
+	case 'no':
50
+	case 'yes':
51
+		Auth::user()->setPreference(WT_SCRIPT_NAME . '_show_marnm', $show_marnm);
52
+		break;
53
+	default:
54
+		$show_marnm = Auth::user()->getPreference(WT_SCRIPT_NAME . '_show_marnm');
55 55
 }
56 56
 
57 57
 // Make sure selections are consistent.
@@ -91,16 +91,16 @@  discard block
 block discarded – undo
91 91
 	}
92 92
 	$url = WT_SCRIPT_NAME . '?surname=' . rawurlencode($surname) . '&amp;ged=' . $WT_TREE->getNameUrl();
93 93
 	switch ($falpha) {
94
-	case '':
95
-		break;
96
-	case '@':
97
-		$legend .= ', ' . I18N::translateContext('Unknown given name', '…');
98
-		$url .= '&amp;falpha=' . rawurlencode($falpha) . '&amp;ged=' . $WT_TREE->getNameUrl();
99
-		break;
100
-	default:
101
-		$legend .= ', ' . Filter::escapeHtml($falpha) . '…';
102
-		$url .= '&amp;falpha=' . rawurlencode($falpha) . '&amp;ged=' . $WT_TREE->getNameUrl();
103
-		break;
94
+		case '':
95
+			break;
96
+		case '@':
97
+			$legend .= ', ' . I18N::translateContext('Unknown given name', '…');
98
+			$url .= '&amp;falpha=' . rawurlencode($falpha) . '&amp;ged=' . $WT_TREE->getNameUrl();
99
+			break;
100
+		default:
101
+			$legend .= ', ' . Filter::escapeHtml($falpha) . '…';
102
+			$url .= '&amp;falpha=' . rawurlencode($falpha) . '&amp;ged=' . $WT_TREE->getNameUrl();
103
+			break;
104 104
 	}
105 105
 	$show = 'indi'; // SURN list makes no sense here
106 106
 } elseif ($alpha === '@') {
@@ -136,15 +136,15 @@  discard block
 block discarded – undo
136 136
 $list = array();
137 137
 foreach (QueryName::surnameAlpha($WT_TREE, $show_marnm === 'yes', false) as $letter => $count) {
138 138
 	switch ($letter) {
139
-	case '@':
140
-		$html = I18N::translateContext('Unknown surname', '…');
141
-		break;
142
-	case ',':
143
-		$html = I18N::translate('None');
144
-		break;
145
-	default:
146
-		$html = Filter::escapeHtml($letter);
147
-		break;
139
+		case '@':
140
+			$html = I18N::translateContext('Unknown surname', '…');
141
+			break;
142
+		case ',':
143
+			$html = I18N::translate('None');
144
+			break;
145
+		default:
146
+			$html = Filter::escapeHtml($letter);
147
+			break;
148 148
 	}
149 149
 	if ($count) {
150 150
 		if ($letter == $alpha) {
@@ -194,16 +194,16 @@  discard block
 block discarded – undo
194 194
 	if ($show === 'surn') {
195 195
 		// Show the surname list
196 196
 		switch ($WT_TREE->getPreference('SURNAME_LIST_STYLE')) {
197
-		case 'style1':
198
-			echo FunctionsPrintLists::surnameList($surns, 3, true, WT_SCRIPT_NAME, $WT_TREE);
199
-			break;
200
-		case 'style3':
201
-			echo FunctionsPrintLists::surnameTagCloud($surns, WT_SCRIPT_NAME, true, $WT_TREE);
202
-			break;
203
-		case 'style2':
204
-		default:
205
-			echo FunctionsPrintLists::surnameTable($surns, WT_SCRIPT_NAME, $WT_TREE);
206
-			break;
197
+			case 'style1':
198
+				echo FunctionsPrintLists::surnameList($surns, 3, true, WT_SCRIPT_NAME, $WT_TREE);
199
+				break;
200
+			case 'style3':
201
+				echo FunctionsPrintLists::surnameTagCloud($surns, WT_SCRIPT_NAME, true, $WT_TREE);
202
+				break;
203
+			case 'style2':
204
+			default:
205
+				echo FunctionsPrintLists::surnameTable($surns, WT_SCRIPT_NAME, $WT_TREE);
206
+				break;
207 207
 		}
208 208
 	} else {
209 209
 		// Show the list
@@ -226,12 +226,12 @@  discard block
 block discarded – undo
226 226
 				$list = array();
227 227
 				foreach ($givn_initials as $givn_initial => $count) {
228 228
 					switch ($givn_initial) {
229
-					case '@':
230
-						$html = I18N::translateContext('Unknown given name', '…');
231
-						break;
232
-					default:
233
-						$html = Filter::escapeHtml($givn_initial);
234
-						break;
229
+						case '@':
230
+							$html = I18N::translateContext('Unknown given name', '…');
231
+							break;
232
+						default:
233
+							$html = Filter::escapeHtml($givn_initial);
234
+							break;
235 235
 					}
236 236
 					if ($count) {
237 237
 						if ($show === 'indi' && $givn_initial === $falpha && $show_all_firstnames === 'no') {
Please login to merge, or discard this patch.
find.php 1 patch
Switch Indentation   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -47,60 +47,60 @@
 block discarded – undo
47 47
 $embed = substr($choose, 0, 1) === '1';
48 48
 
49 49
 switch ($type) {
50
-case 'indi':
51
-	$controller->setPageTitle(I18N::translate('Find an individual'));
52
-	break;
53
-case 'fam':
54
-	$controller->setPageTitle(I18N::translate('Find a family'));
55
-	break;
56
-case 'media':
57
-	$controller->setPageTitle(I18N::translate('Find a media object'));
58
-	break;
59
-case 'place':
60
-	$controller->setPageTitle(I18N::translate('Find a place'));
61
-	break;
62
-case 'repo':
63
-	$controller->setPageTitle(I18N::translate('Find a repository'));
64
-	break;
65
-case 'note':
66
-	$controller->setPageTitle(I18N::translate('Find a shared note'));
67
-	break;
68
-case 'source':
69
-	$controller->setPageTitle(I18N::translate('Find a source'));
70
-	break;
71
-case 'specialchar':
72
-	$controller->setPageTitle(I18N::translate('Find a special character'));
73
-	break;
74
-case 'factINDI':
75
-	$controller
76
-		->setPageTitle(I18N::translate('Find a fact or event'))
77
-		->addInlineJavascript('initPickFact("INDI");');
78
-	break;
79
-case 'factFAM':
80
-	$controller
81
-		->setPageTitle(I18N::translate('Find a fact or event'))
82
-		->addInlineJavascript('initPickFact("FAM");');
83
-	break;
84
-case 'factSOUR':
85
-	$controller
86
-		->setPageTitle(I18N::translate('Find a fact or event'))
87
-		->addInlineJavascript('initPickFact("SOUR");');
88
-	break;
89
-case 'factREPO':
90
-	$controller
91
-		->setPageTitle(I18N::translate('Find a fact or event'))
92
-		->addInlineJavascript('initPickFact("REPO");');
93
-	break;
94
-case 'factNAME':
95
-	$controller
96
-		->setPageTitle(I18N::translate('Find a fact or event'))
97
-		->addInlineJavascript('initPickFact("NAME");');
98
-	break;
99
-case 'factPLAC':
100
-	$controller
101
-		->setPageTitle(I18N::translate('Find a fact or event'))
102
-		->addInlineJavascript('initPickFact("PLAC");');
103
-	break;
50
+	case 'indi':
51
+		$controller->setPageTitle(I18N::translate('Find an individual'));
52
+		break;
53
+	case 'fam':
54
+		$controller->setPageTitle(I18N::translate('Find a family'));
55
+		break;
56
+	case 'media':
57
+		$controller->setPageTitle(I18N::translate('Find a media object'));
58
+		break;
59
+	case 'place':
60
+		$controller->setPageTitle(I18N::translate('Find a place'));
61
+		break;
62
+	case 'repo':
63
+		$controller->setPageTitle(I18N::translate('Find a repository'));
64
+		break;
65
+	case 'note':
66
+		$controller->setPageTitle(I18N::translate('Find a shared note'));
67
+		break;
68
+	case 'source':
69
+		$controller->setPageTitle(I18N::translate('Find a source'));
70
+		break;
71
+	case 'specialchar':
72
+		$controller->setPageTitle(I18N::translate('Find a special character'));
73
+		break;
74
+	case 'factINDI':
75
+		$controller
76
+			->setPageTitle(I18N::translate('Find a fact or event'))
77
+			->addInlineJavascript('initPickFact("INDI");');
78
+		break;
79
+	case 'factFAM':
80
+		$controller
81
+			->setPageTitle(I18N::translate('Find a fact or event'))
82
+			->addInlineJavascript('initPickFact("FAM");');
83
+		break;
84
+	case 'factSOUR':
85
+		$controller
86
+			->setPageTitle(I18N::translate('Find a fact or event'))
87
+			->addInlineJavascript('initPickFact("SOUR");');
88
+		break;
89
+	case 'factREPO':
90
+		$controller
91
+			->setPageTitle(I18N::translate('Find a fact or event'))
92
+			->addInlineJavascript('initPickFact("REPO");');
93
+		break;
94
+	case 'factNAME':
95
+		$controller
96
+			->setPageTitle(I18N::translate('Find a fact or event'))
97
+			->addInlineJavascript('initPickFact("NAME");');
98
+		break;
99
+	case 'factPLAC':
100
+		$controller
101
+			->setPageTitle(I18N::translate('Find a fact or event'))
102
+			->addInlineJavascript('initPickFact("PLAC");');
103
+		break;
104 104
 }
105 105
 $controller->pageHeader();
106 106
 
Please login to merge, or discard this patch.
admin_users.php 1 patch
Switch Indentation   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -45,95 +45,95 @@  discard block
 block discarded – undo
45 45
 
46 46
 // Form actions
47 47
 switch (Filter::post('action')) {
48
-case 'save':
49
-	if (Filter::checkCsrf()) {
50
-		$user_id        = Filter::postInteger('user_id');
51
-		$user           = User::find($user_id);
52
-		$username       = Filter::post('username');
53
-		$real_name      = Filter::post('real_name');
54
-		$email          = Filter::postEmail('email');
55
-		$pass1          = Filter::post('pass1', WT_REGEX_PASSWORD);
56
-		$pass2          = Filter::post('pass2', WT_REGEX_PASSWORD);
57
-		$theme          = Filter::post('theme', implode('|', array_keys(Theme::themeNames())), '');
58
-		$language       = Filter::post('language');
59
-		$timezone       = Filter::post('timezone');
60
-		$contact_method = Filter::post('contact_method');
61
-		$comment        = Filter::post('comment');
62
-		$auto_accept    = Filter::postBool('auto_accept');
63
-		$canadmin       = Filter::postBool('canadmin');
64
-		$visible_online = Filter::postBool('visible_online');
65
-		$verified       = Filter::postBool('verified');
66
-		$approved       = Filter::postBool('approved');
67
-
68
-		if ($user_id === 0) {
69
-			// Create a new user
70
-			if (User::findByUserName($username)) {
71
-				FlashMessages::addMessage(I18N::translate('Duplicate username. A user with that username already exists. Please choose another username.'));
72
-			} elseif (User::findByEmail($email)) {
73
-				FlashMessages::addMessage(I18N::translate('Duplicate email address. A user with that email already exists.'));
74
-			} elseif ($pass1 !== $pass2) {
75
-				FlashMessages::addMessage(I18N::translate('The passwords do not match.'));
48
+	case 'save':
49
+		if (Filter::checkCsrf()) {
50
+			$user_id        = Filter::postInteger('user_id');
51
+			$user           = User::find($user_id);
52
+			$username       = Filter::post('username');
53
+			$real_name      = Filter::post('real_name');
54
+			$email          = Filter::postEmail('email');
55
+			$pass1          = Filter::post('pass1', WT_REGEX_PASSWORD);
56
+			$pass2          = Filter::post('pass2', WT_REGEX_PASSWORD);
57
+			$theme          = Filter::post('theme', implode('|', array_keys(Theme::themeNames())), '');
58
+			$language       = Filter::post('language');
59
+			$timezone       = Filter::post('timezone');
60
+			$contact_method = Filter::post('contact_method');
61
+			$comment        = Filter::post('comment');
62
+			$auto_accept    = Filter::postBool('auto_accept');
63
+			$canadmin       = Filter::postBool('canadmin');
64
+			$visible_online = Filter::postBool('visible_online');
65
+			$verified       = Filter::postBool('verified');
66
+			$approved       = Filter::postBool('approved');
67
+
68
+			if ($user_id === 0) {
69
+				// Create a new user
70
+				if (User::findByUserName($username)) {
71
+					FlashMessages::addMessage(I18N::translate('Duplicate username. A user with that username already exists. Please choose another username.'));
72
+				} elseif (User::findByEmail($email)) {
73
+					FlashMessages::addMessage(I18N::translate('Duplicate email address. A user with that email already exists.'));
74
+				} elseif ($pass1 !== $pass2) {
75
+					FlashMessages::addMessage(I18N::translate('The passwords do not match.'));
76
+				} else {
77
+					$user = User::create($username, $real_name, $email, $pass1);
78
+					$user->setPreference('reg_timestamp', date('U'))->setPreference('sessiontime', '0');
79
+					Log::addAuthenticationLog('User ->' . $username . '<- created');
80
+				}
76 81
 			} else {
77
-				$user = User::create($username, $real_name, $email, $pass1);
78
-				$user->setPreference('reg_timestamp', date('U'))->setPreference('sessiontime', '0');
79
-				Log::addAuthenticationLog('User ->' . $username . '<- created');
80
-			}
81
-		} else {
82
-			$user = User::find($user_id);
83
-			if ($user && $username && $real_name) {
84
-				$user->setEmail($email);
85
-				$user->setUserName($username);
86
-				$user->setRealName($real_name);
87
-				if ($pass1 !== null && $pass1 === $pass2) {
88
-					$user->setPassword($pass1);
82
+				$user = User::find($user_id);
83
+				if ($user && $username && $real_name) {
84
+					$user->setEmail($email);
85
+					$user->setUserName($username);
86
+					$user->setRealName($real_name);
87
+					if ($pass1 !== null && $pass1 === $pass2) {
88
+						$user->setPassword($pass1);
89
+					}
89 90
 				}
90 91
 			}
91
-		}
92 92
 
93
-		if ($user) {
94
-			// Approving for the first time? Send a confirmation email
95
-			if ($approved && !$user->getPreference('verified_by_admin') && $user->getPreference('sessiontime') == 0) {
96
-				I18N::init($user->getPreference('language'));
97
-				Mail::systemMessage(
98
-					$WT_TREE,
99
-					$user,
100
-					I18N::translate('Approval of account at %s', WT_BASE_URL),
101
-					I18N::translate('The administrator at the webtrees site %s has approved your application for an account. You may now sign in by accessing the following link: %s', WT_BASE_URL, WT_BASE_URL)
102
-				);
103
-			}
93
+			if ($user) {
94
+				// Approving for the first time? Send a confirmation email
95
+				if ($approved && !$user->getPreference('verified_by_admin') && $user->getPreference('sessiontime') == 0) {
96
+					I18N::init($user->getPreference('language'));
97
+					Mail::systemMessage(
98
+						$WT_TREE,
99
+						$user,
100
+						I18N::translate('Approval of account at %s', WT_BASE_URL),
101
+						I18N::translate('The administrator at the webtrees site %s has approved your application for an account. You may now sign in by accessing the following link: %s', WT_BASE_URL, WT_BASE_URL)
102
+					);
103
+				}
104 104
 
105
-			$user
106
-				->setPreference('theme', $theme)
107
-				->setPreference('language', $language)
108
-				->setPreference('TIMEZONE', $timezone)
109
-				->setPreference('contactmethod', $contact_method)
110
-				->setPreference('comment', $comment)
111
-				->setPreference('auto_accept', $auto_accept ? '1' : '0')
112
-				->setPreference('visibleonline', $visible_online ? '1' : '0')
113
-				->setPreference('verified', $verified ? '1' : '0')
114
-				->setPreference('verified_by_admin', $approved ? '1' : '0');
115
-
116
-			// We cannot change our own admin status. Another admin will need to do it.
117
-			if ($user->getUserId() !== Auth::id()) {
118
-				$user->setPreference('canadmin', $canadmin ? '1' : '0');
119
-			}
105
+				$user
106
+					->setPreference('theme', $theme)
107
+					->setPreference('language', $language)
108
+					->setPreference('TIMEZONE', $timezone)
109
+					->setPreference('contactmethod', $contact_method)
110
+					->setPreference('comment', $comment)
111
+					->setPreference('auto_accept', $auto_accept ? '1' : '0')
112
+					->setPreference('visibleonline', $visible_online ? '1' : '0')
113
+					->setPreference('verified', $verified ? '1' : '0')
114
+					->setPreference('verified_by_admin', $approved ? '1' : '0');
115
+
116
+				// We cannot change our own admin status. Another admin will need to do it.
117
+				if ($user->getUserId() !== Auth::id()) {
118
+					$user->setPreference('canadmin', $canadmin ? '1' : '0');
119
+				}
120 120
 
121
-			foreach (Tree::getAll() as $tree) {
122
-				$tree->setUserPreference($user, 'gedcomid', Filter::post('gedcomid' . $tree->getTreeId(), WT_REGEX_XREF));
123
-				$tree->setUserPreference($user, 'canedit', Filter::post('canedit' . $tree->getTreeId(), implode('|', array_keys($ALL_EDIT_OPTIONS))));
124
-				if (Filter::post('gedcomid' . $tree->getTreeId(), WT_REGEX_XREF)) {
125
-					$tree->setUserPreference($user, 'RELATIONSHIP_PATH_LENGTH', Filter::postInteger('RELATIONSHIP_PATH_LENGTH' . $tree->getTreeId(), 0, 10, 0));
126
-				} else {
127
-					// Do not allow a path length to be set if the individual ID is not
128
-					$tree->setUserPreference($user, 'RELATIONSHIP_PATH_LENGTH', null);
121
+				foreach (Tree::getAll() as $tree) {
122
+					$tree->setUserPreference($user, 'gedcomid', Filter::post('gedcomid' . $tree->getTreeId(), WT_REGEX_XREF));
123
+					$tree->setUserPreference($user, 'canedit', Filter::post('canedit' . $tree->getTreeId(), implode('|', array_keys($ALL_EDIT_OPTIONS))));
124
+					if (Filter::post('gedcomid' . $tree->getTreeId(), WT_REGEX_XREF)) {
125
+						$tree->setUserPreference($user, 'RELATIONSHIP_PATH_LENGTH', Filter::postInteger('RELATIONSHIP_PATH_LENGTH' . $tree->getTreeId(), 0, 10, 0));
126
+					} else {
127
+						// Do not allow a path length to be set if the individual ID is not
128
+						$tree->setUserPreference($user, 'RELATIONSHIP_PATH_LENGTH', null);
129
+					}
129 130
 				}
130 131
 			}
131 132
 		}
132
-	}
133 133
 
134
-	header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
134
+		header('Location: ' . WT_BASE_URL . WT_SCRIPT_NAME);
135 135
 
136
-	return;
136
+		return;
137 137
 }
138 138
 
139 139
 switch (Filter::get('action')) {
@@ -173,12 +173,12 @@  discard block
 block discarded – undo
173 173
 			// Datatables numbers columns 0, 1, 2
174 174
 			// MySQL numbers columns 1, 2, 3
175 175
 			switch ($value['dir']) {
176
-			case 'asc':
177
-				$sql_select .= (1 + $value['column']) . " ASC ";
178
-				break;
179
-			case 'desc':
180
-				$sql_select .= (1 + $value['column']) . " DESC ";
181
-				break;
176
+				case 'asc':
177
+					$sql_select .= (1 + $value['column']) . " ASC ";
178
+					break;
179
+				case 'desc':
180
+					$sql_select .= (1 + $value['column']) . " DESC ";
181
+					break;
182 182
 			}
183 183
 		}
184 184
 	} else {
Please login to merge, or discard this patch.
admin_trees_renumber.php 1 patch
Switch Indentation   +137 added lines, -137 removed lines patch added patch discarded remove patch
@@ -86,143 +86,143 @@
 block discarded – undo
86 86
 		);
87 87
 		$new_xref = $WT_TREE->getNewXref($type);
88 88
 		switch ($type) {
89
-		case 'INDI':
90
-			Database::prepare(
91
-				"UPDATE `##individuals` SET i_id = ?, i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_id = ? AND i_file = ?"
92
-			)->execute(array($new_xref, "0 @$old_xref@ INDI\n", "0 @$new_xref@ INDI\n", $old_xref, $WT_TREE->getTreeId()));
93
-			Database::prepare(
94
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'HUSB') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
95
-			)->execute(array($old_xref, " HUSB @$old_xref@", " HUSB @$new_xref@", $WT_TREE->getTreeId()));
96
-			Database::prepare(
97
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'WIFE') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
98
-			)->execute(array($old_xref, " WIFE @$old_xref@", " WIFE @$new_xref@", $WT_TREE->getTreeId()));
99
-			Database::prepare(
100
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'CHIL') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
101
-			)->execute(array($old_xref, " CHIL @$old_xref@", " CHIL @$new_xref@", $WT_TREE->getTreeId()));
102
-			Database::prepare(
103
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'ASSO') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
104
-			)->execute(array($old_xref, " ASSO @$old_xref@", " ASSO @$new_xref@", $WT_TREE->getTreeId()));
105
-			Database::prepare(
106
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = '_ASSO') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
107
-			)->execute(array($old_xref, " _ASSO @$old_xref@", " _ASSO @$new_xref@", $WT_TREE->getTreeId()));
108
-			Database::prepare(
109
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'ASSO') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
110
-			)->execute(array($old_xref, " ASSO @$old_xref@", " ASSO @$new_xref@", $WT_TREE->getTreeId()));
111
-			Database::prepare(
112
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = '_ASSO') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
113
-			)->execute(array($old_xref, " _ASSO @$old_xref@", " _ASSO @$new_xref@", $WT_TREE->getTreeId()));
114
-			Database::prepare(
115
-				"UPDATE `##placelinks` SET pl_gid = ? WHERE pl_gid = ? AND pl_file = ?"
116
-			)->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
117
-			Database::prepare(
118
-				"UPDATE `##dates` SET d_gid = ? WHERE d_gid = ? AND d_file = ?"
119
-			)->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
120
-			Database::prepare(
121
-				"UPDATE `##user_gedcom_setting` SET setting_value = ? WHERE setting_value = ? AND gedcom_id = ? AND setting_name IN ('gedcomid', 'rootid')"
122
-			)->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
123
-			break;
124
-		case 'FAM':
125
-			Database::prepare(
126
-				"UPDATE `##families` SET f_id = ?, f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_id = ? AND f_file = ?"
127
-			)->execute(array($new_xref, "0 @$old_xref@ FAM\n", "0 @$new_xref@ FAM\n", $old_xref, $WT_TREE->getTreeId()));
128
-			Database::prepare(
129
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'FAMC') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
130
-			)->execute(array($old_xref, " FAMC @$old_xref@", " FAMC @$new_xref@", $WT_TREE->getTreeId()));
131
-			Database::prepare(
132
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'FAMS') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
133
-			)->execute(array($old_xref, " FAMS @$old_xref@", " FAMS @$new_xref@", $WT_TREE->getTreeId()));
134
-			Database::prepare(
135
-				"UPDATE `##placelinks` SET pl_gid = ? WHERE pl_gid = ? AND pl_file = ?"
136
-			)->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
137
-			Database::prepare(
138
-				"UPDATE `##dates` SET d_gid = ? WHERE d_gid = ? AND d_file = ?"
139
-			)->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
140
-			break;
141
-		case 'SOUR':
142
-			Database::prepare(
143
-				"UPDATE `##sources` SET s_id = ?, s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_id = ? AND s_file = ?"
144
-			)->execute(array($new_xref, "0 @$old_xref@ SOUR\n", "0 @$new_xref@ SOUR\n", $old_xref, $WT_TREE->getTreeId()));
145
-			Database::prepare(
146
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'SOUR') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
147
-			)->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
148
-			Database::prepare(
149
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'SOUR') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
150
-			)->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
151
-			Database::prepare(
152
-				"UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ? AND l_type = 'SOUR') SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
153
-			)->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
154
-			Database::prepare(
155
-				"UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ? AND l_type = 'SOUR') SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
156
-			)->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
157
-			break;
158
-		case 'REPO':
159
-			Database::prepare(
160
-				"UPDATE `##other` SET o_id = ?, o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_id = ? AND o_file = ?"
161
-			)->execute(array($new_xref, "0 @$old_xref@ REPO\n", "0 @$new_xref@ REPO\n", $old_xref, $WT_TREE->getTreeId()));
162
-			Database::prepare(
163
-				"UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ? AND l_type = 'REPO') SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
164
-			)->execute(array($old_xref, " REPO @$old_xref@", " REPO @$new_xref@", $WT_TREE->getTreeId()));
165
-			break;
166
-		case 'NOTE':
167
-			Database::prepare(
168
-				"UPDATE `##other` SET o_id = ?, o_gedcom = REPLACE(REPLACE(o_gedcom, ?, ?), ?, ?) WHERE o_id = ? AND o_file = ?"
169
-			)->execute(array($new_xref, "0 @$old_xref@ NOTE\n", "0 @$new_xref@ NOTE\n", "0 @$old_xref@ NOTE ", "0 @$new_xref@ NOTE ", $old_xref, $WT_TREE->getTreeId()));
170
-			Database::prepare(
171
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'NOTE') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
172
-			)->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
173
-			Database::prepare(
174
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'NOTE') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
175
-			)->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
176
-			Database::prepare(
177
-				"UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ? AND l_type = 'NOTE') SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
178
-			)->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
179
-			Database::prepare(
180
-				"UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ? AND l_type = 'NOTE') SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
181
-			)->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
182
-			Database::prepare(
183
-				"UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ? AND l_type = 'NOTE') SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
184
-			)->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
185
-			break;
186
-		case 'OBJE':
187
-			Database::prepare(
188
-				"UPDATE `##media` SET m_id = ?, m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_id = ? AND m_file = ?"
189
-			)->execute(array($new_xref, "0 @$old_xref@ OBJE\n", "0 @$new_xref@ OBJE\n", $old_xref, $WT_TREE->getTreeId()));
190
-			Database::prepare(
191
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'OBJE') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
192
-			)->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
193
-			Database::prepare(
194
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'OBJE') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
195
-			)->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
196
-			Database::prepare(
197
-				"UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ? AND l_type = 'OBJE') SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
198
-			)->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
199
-			Database::prepare(
200
-				"UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ? AND l_type = 'OBJE') SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
201
-			)->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
202
-			Database::prepare(
203
-				"UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ? AND l_type = 'OBJE') SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
204
-			)->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
205
-			break;
206
-		default:
207
-			Database::prepare(
208
-				"UPDATE `##other` SET o_id = ?, o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_id = ? AND o_file = ?"
209
-			)->execute(array($new_xref, "0 @$old_xref@ $type\n", "0 @$new_xref@ $type\n", $old_xref, $WT_TREE->getTreeId()));
210
-			Database::prepare(
211
-				"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ?) SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
212
-			)->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
213
-			Database::prepare(
214
-				"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ?) SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
215
-			)->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
216
-			Database::prepare(
217
-				"UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ?) SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
218
-			)->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
219
-			Database::prepare(
220
-				"UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ?) SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
221
-			)->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
222
-			Database::prepare(
223
-				"UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ?) SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
224
-			)->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
225
-			break;
89
+			case 'INDI':
90
+				Database::prepare(
91
+					"UPDATE `##individuals` SET i_id = ?, i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_id = ? AND i_file = ?"
92
+				)->execute(array($new_xref, "0 @$old_xref@ INDI\n", "0 @$new_xref@ INDI\n", $old_xref, $WT_TREE->getTreeId()));
93
+				Database::prepare(
94
+					"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'HUSB') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
95
+				)->execute(array($old_xref, " HUSB @$old_xref@", " HUSB @$new_xref@", $WT_TREE->getTreeId()));
96
+				Database::prepare(
97
+					"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'WIFE') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
98
+				)->execute(array($old_xref, " WIFE @$old_xref@", " WIFE @$new_xref@", $WT_TREE->getTreeId()));
99
+				Database::prepare(
100
+					"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'CHIL') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
101
+				)->execute(array($old_xref, " CHIL @$old_xref@", " CHIL @$new_xref@", $WT_TREE->getTreeId()));
102
+				Database::prepare(
103
+					"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'ASSO') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
104
+				)->execute(array($old_xref, " ASSO @$old_xref@", " ASSO @$new_xref@", $WT_TREE->getTreeId()));
105
+				Database::prepare(
106
+					"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = '_ASSO') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
107
+				)->execute(array($old_xref, " _ASSO @$old_xref@", " _ASSO @$new_xref@", $WT_TREE->getTreeId()));
108
+				Database::prepare(
109
+					"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'ASSO') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
110
+				)->execute(array($old_xref, " ASSO @$old_xref@", " ASSO @$new_xref@", $WT_TREE->getTreeId()));
111
+				Database::prepare(
112
+					"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = '_ASSO') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
113
+				)->execute(array($old_xref, " _ASSO @$old_xref@", " _ASSO @$new_xref@", $WT_TREE->getTreeId()));
114
+				Database::prepare(
115
+					"UPDATE `##placelinks` SET pl_gid = ? WHERE pl_gid = ? AND pl_file = ?"
116
+				)->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
117
+				Database::prepare(
118
+					"UPDATE `##dates` SET d_gid = ? WHERE d_gid = ? AND d_file = ?"
119
+				)->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
120
+				Database::prepare(
121
+					"UPDATE `##user_gedcom_setting` SET setting_value = ? WHERE setting_value = ? AND gedcom_id = ? AND setting_name IN ('gedcomid', 'rootid')"
122
+				)->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
123
+				break;
124
+			case 'FAM':
125
+				Database::prepare(
126
+					"UPDATE `##families` SET f_id = ?, f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_id = ? AND f_file = ?"
127
+				)->execute(array($new_xref, "0 @$old_xref@ FAM\n", "0 @$new_xref@ FAM\n", $old_xref, $WT_TREE->getTreeId()));
128
+				Database::prepare(
129
+					"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'FAMC') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
130
+				)->execute(array($old_xref, " FAMC @$old_xref@", " FAMC @$new_xref@", $WT_TREE->getTreeId()));
131
+				Database::prepare(
132
+					"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'FAMS') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
133
+				)->execute(array($old_xref, " FAMS @$old_xref@", " FAMS @$new_xref@", $WT_TREE->getTreeId()));
134
+				Database::prepare(
135
+					"UPDATE `##placelinks` SET pl_gid = ? WHERE pl_gid = ? AND pl_file = ?"
136
+				)->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
137
+				Database::prepare(
138
+					"UPDATE `##dates` SET d_gid = ? WHERE d_gid = ? AND d_file = ?"
139
+				)->execute(array($new_xref, $old_xref, $WT_TREE->getTreeId()));
140
+				break;
141
+			case 'SOUR':
142
+				Database::prepare(
143
+					"UPDATE `##sources` SET s_id = ?, s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_id = ? AND s_file = ?"
144
+				)->execute(array($new_xref, "0 @$old_xref@ SOUR\n", "0 @$new_xref@ SOUR\n", $old_xref, $WT_TREE->getTreeId()));
145
+				Database::prepare(
146
+					"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'SOUR') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
147
+				)->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
148
+				Database::prepare(
149
+					"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'SOUR') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
150
+				)->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
151
+				Database::prepare(
152
+					"UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ? AND l_type = 'SOUR') SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
153
+				)->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
154
+				Database::prepare(
155
+					"UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ? AND l_type = 'SOUR') SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
156
+				)->execute(array($old_xref, " SOUR @$old_xref@", " SOUR @$new_xref@", $WT_TREE->getTreeId()));
157
+				break;
158
+			case 'REPO':
159
+				Database::prepare(
160
+					"UPDATE `##other` SET o_id = ?, o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_id = ? AND o_file = ?"
161
+				)->execute(array($new_xref, "0 @$old_xref@ REPO\n", "0 @$new_xref@ REPO\n", $old_xref, $WT_TREE->getTreeId()));
162
+				Database::prepare(
163
+					"UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ? AND l_type = 'REPO') SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
164
+				)->execute(array($old_xref, " REPO @$old_xref@", " REPO @$new_xref@", $WT_TREE->getTreeId()));
165
+				break;
166
+			case 'NOTE':
167
+				Database::prepare(
168
+					"UPDATE `##other` SET o_id = ?, o_gedcom = REPLACE(REPLACE(o_gedcom, ?, ?), ?, ?) WHERE o_id = ? AND o_file = ?"
169
+				)->execute(array($new_xref, "0 @$old_xref@ NOTE\n", "0 @$new_xref@ NOTE\n", "0 @$old_xref@ NOTE ", "0 @$new_xref@ NOTE ", $old_xref, $WT_TREE->getTreeId()));
170
+				Database::prepare(
171
+					"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'NOTE') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
172
+				)->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
173
+				Database::prepare(
174
+					"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'NOTE') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
175
+				)->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
176
+				Database::prepare(
177
+					"UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ? AND l_type = 'NOTE') SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
178
+				)->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
179
+				Database::prepare(
180
+					"UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ? AND l_type = 'NOTE') SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
181
+				)->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
182
+				Database::prepare(
183
+					"UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ? AND l_type = 'NOTE') SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
184
+				)->execute(array($old_xref, " NOTE @$old_xref@", " NOTE @$new_xref@", $WT_TREE->getTreeId()));
185
+				break;
186
+			case 'OBJE':
187
+				Database::prepare(
188
+					"UPDATE `##media` SET m_id = ?, m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_id = ? AND m_file = ?"
189
+				)->execute(array($new_xref, "0 @$old_xref@ OBJE\n", "0 @$new_xref@ OBJE\n", $old_xref, $WT_TREE->getTreeId()));
190
+				Database::prepare(
191
+					"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ? AND l_type = 'OBJE') SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
192
+				)->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
193
+				Database::prepare(
194
+					"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ? AND l_type = 'OBJE') SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
195
+				)->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
196
+				Database::prepare(
197
+					"UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ? AND l_type = 'OBJE') SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
198
+				)->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
199
+				Database::prepare(
200
+					"UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ? AND l_type = 'OBJE') SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
201
+				)->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
202
+				Database::prepare(
203
+					"UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ? AND l_type = 'OBJE') SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
204
+				)->execute(array($old_xref, " OBJE @$old_xref@", " OBJE @$new_xref@", $WT_TREE->getTreeId()));
205
+				break;
206
+			default:
207
+				Database::prepare(
208
+					"UPDATE `##other` SET o_id = ?, o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_id = ? AND o_file = ?"
209
+				)->execute(array($new_xref, "0 @$old_xref@ $type\n", "0 @$new_xref@ $type\n", $old_xref, $WT_TREE->getTreeId()));
210
+				Database::prepare(
211
+					"UPDATE `##individuals` JOIN `##link` ON (l_file = i_file AND l_to = ?) SET i_gedcom = REPLACE(i_gedcom, ?, ?) WHERE i_file = ?"
212
+				)->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
213
+				Database::prepare(
214
+					"UPDATE `##families` JOIN `##link` ON (l_file = f_file AND l_to = ?) SET f_gedcom = REPLACE(f_gedcom, ?, ?) WHERE f_file = ?"
215
+				)->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
216
+				Database::prepare(
217
+					"UPDATE `##media` JOIN `##link` ON (l_file = m_file AND l_to = ?) SET m_gedcom = REPLACE(m_gedcom, ?, ?) WHERE m_file = ?"
218
+				)->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
219
+				Database::prepare(
220
+					"UPDATE `##sources` JOIN `##link` ON (l_file = s_file AND l_to = ?) SET s_gedcom = REPLACE(s_gedcom, ?, ?) WHERE s_file = ?"
221
+				)->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
222
+				Database::prepare(
223
+					"UPDATE `##other` JOIN `##link` ON (l_file = o_file AND l_to = ?) SET o_gedcom = REPLACE(o_gedcom, ?, ?) WHERE o_file = ?"
224
+				)->execute(array($old_xref, " @$old_xref@", " @$new_xref@", $WT_TREE->getTreeId()));
225
+				break;
226 226
 		}
227 227
 		Database::prepare(
228 228
 			"UPDATE `##name` SET n_id = ? WHERE n_id = ? AND n_file = ?"
Please login to merge, or discard this patch.
import.php 1 patch
Switch Indentation   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -125,75 +125,75 @@
 block discarded – undo
125 125
 		// MySQL supports a wide range of collation conversions. These are ones that
126 126
 		// have been encountered "in the wild".
127 127
 		switch ($charset) {
128
-		case 'ASCII':
129
-			Database::prepare(
130
-				"UPDATE `##gedcom_chunk`" .
131
-				" SET chunk_data=CONVERT(CONVERT(chunk_data USING ascii) USING utf8)" .
132
-				" WHERE gedcom_id=?"
133
-			)->execute(array($gedcom_id));
134
-			break;
135
-		case 'IBMPC':   // IBMPC, IBM WINDOWS and MS-DOS could be anything. Mostly it means CP850.
136
-		case 'IBM WINDOWS':
137
-		case 'MS-DOS':
138
-		case 'CP437':
139
-		case 'CP850':
140
-			// CP850 has extra letters with diacritics to replace box-drawing chars in CP437.
141
-			Database::prepare(
142
-				"UPDATE `##gedcom_chunk`" .
143
-				" SET chunk_data=CONVERT(CONVERT(chunk_data USING cp850) USING utf8)" .
144
-				" WHERE gedcom_id=?"
145
-			)->execute(array($gedcom_id));
146
-			break;
147
-		case 'ANSI': // ANSI could be anything. Most applications seem to treat it as latin1.
148
-			$controller->addInlineJavascript(
149
-				'jQuery("#import' . $gedcom_id . '").parent().prepend("<div class=\"bg-info\">' . /* I18N: %1$s and %2$s are the names of character encodings, such as ISO-8859-1 or ASCII */
150
-					I18N::translate('This GEDCOM file is encoded using %1$s. Assume this to mean %2$s.', $charset, 'ISO-8859-1') . '</div>");'
151
-				);
152
-			// no break;
153
-		case 'WINDOWS':
154
-		case 'CP1252':
155
-		case 'ISO8859-1':
156
-		case 'ISO-8859-1':
157
-		case 'LATIN1':
158
-		case 'LATIN-1':
159
-			// Convert from ISO-8859-1 (western european) to UTF8.
160
-			Database::prepare(
161
-				"UPDATE `##gedcom_chunk`" .
162
-				" SET chunk_data=CONVERT(CONVERT(chunk_data USING latin1) USING utf8)" .
163
-				" WHERE gedcom_id=?"
164
-			)->execute(array($gedcom_id));
165
-			break;
166
-		case 'CP1250':
167
-		case 'ISO8859-2':
168
-		case 'ISO-8859-2':
169
-		case 'LATIN2':
170
-		case 'LATIN-2':
171
-			// Convert from ISO-8859-2 (eastern european) to UTF8.
172
-			Database::prepare(
173
-				"UPDATE `##gedcom_chunk`" .
174
-				" SET chunk_data=CONVERT(CONVERT(chunk_data USING latin2) USING utf8)" .
175
-				" WHERE gedcom_id=?"
176
-			)->execute(array($gedcom_id));
177
-			break;
178
-		case 'MACINTOSH':
179
-			// Convert from MAC Roman to UTF8.
180
-			Database::prepare(
181
-				"UPDATE `##gedcom_chunk`" .
182
-				" SET chunk_data=CONVERT(CONVERT(chunk_data USING macroman) USING utf8)" .
183
-				" WHERE gedcom_id=?"
184
-			)->execute(array($gedcom_id));
185
-			break;
186
-		case 'UTF8':
187
-		case 'UTF-8':
188
-			// Already UTF-8 so nothing to do!
189
-			break;
190
-		case 'ANSEL':
191
-		default:
192
-			Database::rollBack();
193
-			echo '<span class="error">', I18N::translate('Error: converting GEDCOM files from %s encoding to UTF-8 encoding not currently supported.', $charset), '</span>';
194
-			$controller->addInlineJavascript('jQuery("#actions' . $gedcom_id . '").removeClass("hidden");');
195
-
196
-			return;
128
+			case 'ASCII':
129
+				Database::prepare(
130
+					"UPDATE `##gedcom_chunk`" .
131
+					" SET chunk_data=CONVERT(CONVERT(chunk_data USING ascii) USING utf8)" .
132
+					" WHERE gedcom_id=?"
133
+				)->execute(array($gedcom_id));
134
+				break;
135
+			case 'IBMPC':   // IBMPC, IBM WINDOWS and MS-DOS could be anything. Mostly it means CP850.
136
+			case 'IBM WINDOWS':
137
+			case 'MS-DOS':
138
+			case 'CP437':
139
+			case 'CP850':
140
+				// CP850 has extra letters with diacritics to replace box-drawing chars in CP437.
141
+				Database::prepare(
142
+					"UPDATE `##gedcom_chunk`" .
143
+					" SET chunk_data=CONVERT(CONVERT(chunk_data USING cp850) USING utf8)" .
144
+					" WHERE gedcom_id=?"
145
+				)->execute(array($gedcom_id));
146
+				break;
147
+			case 'ANSI': // ANSI could be anything. Most applications seem to treat it as latin1.
148
+				$controller->addInlineJavascript(
149
+					'jQuery("#import' . $gedcom_id . '").parent().prepend("<div class=\"bg-info\">' . /* I18N: %1$s and %2$s are the names of character encodings, such as ISO-8859-1 or ASCII */
150
+						I18N::translate('This GEDCOM file is encoded using %1$s. Assume this to mean %2$s.', $charset, 'ISO-8859-1') . '</div>");'
151
+					);
152
+				// no break;
153
+			case 'WINDOWS':
154
+			case 'CP1252':
155
+			case 'ISO8859-1':
156
+			case 'ISO-8859-1':
157
+			case 'LATIN1':
158
+			case 'LATIN-1':
159
+				// Convert from ISO-8859-1 (western european) to UTF8.
160
+				Database::prepare(
161
+					"UPDATE `##gedcom_chunk`" .
162
+					" SET chunk_data=CONVERT(CONVERT(chunk_data USING latin1) USING utf8)" .
163
+					" WHERE gedcom_id=?"
164
+				)->execute(array($gedcom_id));
165
+				break;
166
+			case 'CP1250':
167
+			case 'ISO8859-2':
168
+			case 'ISO-8859-2':
169
+			case 'LATIN2':
170
+			case 'LATIN-2':
171
+				// Convert from ISO-8859-2 (eastern european) to UTF8.
172
+				Database::prepare(
173
+					"UPDATE `##gedcom_chunk`" .
174
+					" SET chunk_data=CONVERT(CONVERT(chunk_data USING latin2) USING utf8)" .
175
+					" WHERE gedcom_id=?"
176
+				)->execute(array($gedcom_id));
177
+				break;
178
+			case 'MACINTOSH':
179
+				// Convert from MAC Roman to UTF8.
180
+				Database::prepare(
181
+					"UPDATE `##gedcom_chunk`" .
182
+					" SET chunk_data=CONVERT(CONVERT(chunk_data USING macroman) USING utf8)" .
183
+					" WHERE gedcom_id=?"
184
+				)->execute(array($gedcom_id));
185
+				break;
186
+			case 'UTF8':
187
+			case 'UTF-8':
188
+				// Already UTF-8 so nothing to do!
189
+				break;
190
+			case 'ANSEL':
191
+			default:
192
+				Database::rollBack();
193
+				echo '<span class="error">', I18N::translate('Error: converting GEDCOM files from %s encoding to UTF-8 encoding not currently supported.', $charset), '</span>';
194
+				$controller->addInlineJavascript('jQuery("#actions' . $gedcom_id . '").removeClass("hidden");');
195
+
196
+				return;
197 197
 		}
198 198
 		$first_time = false;
199 199
 
Please login to merge, or discard this patch.
statisticsplot.php 1 patch
Switch Indentation   +501 added lines, -501 removed lines patch added patch discarded remove patch
@@ -852,528 +852,528 @@
 block discarded – undo
852 852
 echo '<div class="statistics_chart" title="', I18N::translate('Statistics chart'), '">';
853 853
 
854 854
 switch ($x_axis) {
855
-case '1':
856
-	echo $stats->chartDistribution(array(Filter::get('chart_shows'), Filter::get('chart_type'), Filter::get('SURN')));
857
-	break;
858
-case '2':
859
-	echo $stats->chartDistribution(array(Filter::get('chart_shows'), 'birth_distribution_chart'));
860
-	break;
861
-case '3':
862
-	echo $stats->chartDistribution(array(Filter::get('chart_shows'), 'death_distribution_chart'));
863
-	break;
864
-case '4':
865
-	echo $stats->chartDistribution(array(Filter::get('chart_shows'), 'marriage_distribution_chart'));
866
-	break;
867
-case '11':
868
-	$monthdata = array();
869
-	for ($i = 0; $i < 12; ++$i) {
870
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
871
-	}
872
-	$xgiven            = true;
873
-	$zgiven            = false;
874
-	$title             = I18N::translate('Month of birth');
875
-	$xtitle            = I18N::translate('month');
876
-	$ytitle            = I18N::translate('numbers');
877
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
878
-	$xdata             = $monthdata;
879
-	$xmax              = 12;
880
-	if ($z_axis !== 300 && $z_axis !== 301) {
881
-		calculate_legend($boundaries_z_axis);
882
-	}
883
-	$percentage = false;
884
-	if ($y_axis === 201) {
855
+	case '1':
856
+		echo $stats->chartDistribution(array(Filter::get('chart_shows'), Filter::get('chart_type'), Filter::get('SURN')));
857
+		break;
858
+	case '2':
859
+		echo $stats->chartDistribution(array(Filter::get('chart_shows'), 'birth_distribution_chart'));
860
+		break;
861
+	case '3':
862
+		echo $stats->chartDistribution(array(Filter::get('chart_shows'), 'death_distribution_chart'));
863
+		break;
864
+	case '4':
865
+		echo $stats->chartDistribution(array(Filter::get('chart_shows'), 'marriage_distribution_chart'));
866
+		break;
867
+	case '11':
868
+		$monthdata = array();
869
+		for ($i = 0; $i < 12; ++$i) {
870
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
871
+		}
872
+		$xgiven            = true;
873
+		$zgiven            = false;
874
+		$title             = I18N::translate('Month of birth');
875
+		$xtitle            = I18N::translate('month');
876
+		$ytitle            = I18N::translate('numbers');
877
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
878
+		$xdata             = $monthdata;
879
+		$xmax              = 12;
880
+		if ($z_axis !== 300 && $z_axis !== 301) {
881
+			calculate_legend($boundaries_z_axis);
882
+		}
885 883
 		$percentage = false;
886
-		$ytitle     = I18N::translate('Individuals');
887
-	} elseif ($y_axis === 202) {
888
-		$percentage = true;
889
-		$ytitle     = I18N::translate('percentage');
890
-	}
891
-	$male_female = false;
892
-	if ($z_axis === 300) {
893
-		$zgiven          = false;
894
-		$legend[0]       = 'all';
895
-		$zmax            = 1;
896
-		$z_boundaries[0] = 100000;
897
-	} elseif ($z_axis === 301) {
898
-		$male_female = true;
899
-		$zgiven      = true;
900
-		$legend[0]   = I18N::translate('Male');
901
-		$legend[1]   = I18N::translate('Female');
902
-		$zmax        = 2;
903
-		$xtitle      = $xtitle . I18N::translate(' per gender');
904
-	} elseif ($z_axis === 302) {
905
-		$xtitle = $xtitle . I18N::translate(' per time period');
906
-	}
907
-	//-- reset the data array
908
-	for ($i = 0; $i < $zmax; $i++) {
909
-		for ($j = 0; $j < $xmax; $j++) {
910
-			$ydata[$i][$j] = 0;
884
+		if ($y_axis === 201) {
885
+			$percentage = false;
886
+			$ytitle     = I18N::translate('Individuals');
887
+		} elseif ($y_axis === 202) {
888
+			$percentage = true;
889
+			$ytitle     = I18N::translate('percentage');
890
+		}
891
+		$male_female = false;
892
+		if ($z_axis === 300) {
893
+			$zgiven          = false;
894
+			$legend[0]       = 'all';
895
+			$zmax            = 1;
896
+			$z_boundaries[0] = 100000;
897
+		} elseif ($z_axis === 301) {
898
+			$male_female = true;
899
+			$zgiven      = true;
900
+			$legend[0]   = I18N::translate('Male');
901
+			$legend[1]   = I18N::translate('Female');
902
+			$zmax        = 2;
903
+			$xtitle      = $xtitle . I18N::translate(' per gender');
904
+		} elseif ($z_axis === 302) {
905
+			$xtitle = $xtitle . I18N::translate(' per time period');
906
+		}
907
+		//-- reset the data array
908
+		for ($i = 0; $i < $zmax; $i++) {
909
+			for ($j = 0; $j < $xmax; $j++) {
910
+				$ydata[$i][$j] = 0;
911
+			}
912
+		}
913
+		$total = month_of_birth($z_axis, $z_boundaries, $stats);
914
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
915
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
916
+		break;
917
+	case '12':
918
+		$monthdata = array();
919
+		for ($i = 0; $i < 12; ++$i) {
920
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
921
+		}
922
+		$xgiven            = true;
923
+		$zgiven            = false;
924
+		$title             = I18N::translate('Month of death');
925
+		$xtitle            = I18N::translate('month');
926
+		$ytitle            = I18N::translate('numbers');
927
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
928
+		$xdata             = $monthdata;
929
+		$xmax              = 12;
930
+		if ($z_axis !== 300 && $z_axis !== 301) {
931
+			calculate_legend($boundaries_z_axis);
911 932
 		}
912
-	}
913
-	$total = month_of_birth($z_axis, $z_boundaries, $stats);
914
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
915
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
916
-	break;
917
-case '12':
918
-	$monthdata = array();
919
-	for ($i = 0; $i < 12; ++$i) {
920
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
921
-	}
922
-	$xgiven            = true;
923
-	$zgiven            = false;
924
-	$title             = I18N::translate('Month of death');
925
-	$xtitle            = I18N::translate('month');
926
-	$ytitle            = I18N::translate('numbers');
927
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
928
-	$xdata             = $monthdata;
929
-	$xmax              = 12;
930
-	if ($z_axis !== 300 && $z_axis !== 301) {
931
-		calculate_legend($boundaries_z_axis);
932
-	}
933
-	$percentage = false;
934
-	if ($y_axis === 201) {
935 933
 		$percentage = false;
936
-		$ytitle     = I18N::translate('Individuals');
937
-	} elseif ($y_axis === 202) {
938
-		$percentage = true;
939
-		$ytitle     = I18N::translate('percentage');
940
-	}
941
-	$male_female = false;
942
-	if ($z_axis === 300) {
943
-		$zgiven          = false;
944
-		$legend[0]       = 'all';
945
-		$zmax            = 1;
946
-		$z_boundaries[0] = 100000;
947
-	} elseif ($z_axis === 301) {
948
-		$male_female = true;
949
-		$zgiven      = true;
950
-		$legend[0]   = I18N::translate('Male');
951
-		$legend[1]   = I18N::translate('Female');
952
-		$zmax        = 2;
953
-		$xtitle      = $xtitle . I18N::translate(' per gender');
954
-	} elseif ($z_axis === 302) {
955
-		$xtitle = $xtitle . I18N::translate(' per time period');
956
-	}
957
-	//-- reset the data array
958
-	for ($i = 0; $i < $zmax; $i++) {
959
-		for ($j = 0; $j < $xmax; $j++) {
960
-			$ydata[$i][$j] = 0;
934
+		if ($y_axis === 201) {
935
+			$percentage = false;
936
+			$ytitle     = I18N::translate('Individuals');
937
+		} elseif ($y_axis === 202) {
938
+			$percentage = true;
939
+			$ytitle     = I18N::translate('percentage');
940
+		}
941
+		$male_female = false;
942
+		if ($z_axis === 300) {
943
+			$zgiven          = false;
944
+			$legend[0]       = 'all';
945
+			$zmax            = 1;
946
+			$z_boundaries[0] = 100000;
947
+		} elseif ($z_axis === 301) {
948
+			$male_female = true;
949
+			$zgiven      = true;
950
+			$legend[0]   = I18N::translate('Male');
951
+			$legend[1]   = I18N::translate('Female');
952
+			$zmax        = 2;
953
+			$xtitle      = $xtitle . I18N::translate(' per gender');
954
+		} elseif ($z_axis === 302) {
955
+			$xtitle = $xtitle . I18N::translate(' per time period');
956
+		}
957
+		//-- reset the data array
958
+		for ($i = 0; $i < $zmax; $i++) {
959
+			for ($j = 0; $j < $xmax; $j++) {
960
+				$ydata[$i][$j] = 0;
961
+			}
962
+		}
963
+		$total = month_of_death($z_axis, $z_boundaries, $stats);
964
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
965
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
966
+		break;
967
+	case '13':
968
+		$monthdata = array();
969
+		for ($i = 0; $i < 12; ++$i) {
970
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
961 971
 		}
962
-	}
963
-	$total = month_of_death($z_axis, $z_boundaries, $stats);
964
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
965
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
966
-	break;
967
-case '13':
968
-	$monthdata = array();
969
-	for ($i = 0; $i < 12; ++$i) {
970
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
971
-	}
972 972
 
973
-	if ($z_axis === 301) {
974
-		$z_axis = 300;
975
-	}
976
-	$xgiven            = true;
977
-	$zgiven            = false;
978
-	$title             = I18N::translate('Month of marriage');
979
-	$xtitle            = I18N::translate('month');
980
-	$ytitle            = I18N::translate('numbers');
981
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
982
-	$xdata             = $monthdata;
983
-	$xmax              = 12;
984
-	if ($z_axis !== 300 && $z_axis !== 301) {
985
-		calculate_legend($boundaries_z_axis);
986
-	}
987
-	$percentage = false;
988
-	if ($y_axis === 201) {
973
+		if ($z_axis === 301) {
974
+			$z_axis = 300;
975
+		}
976
+		$xgiven            = true;
977
+		$zgiven            = false;
978
+		$title             = I18N::translate('Month of marriage');
979
+		$xtitle            = I18N::translate('month');
980
+		$ytitle            = I18N::translate('numbers');
981
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
982
+		$xdata             = $monthdata;
983
+		$xmax              = 12;
984
+		if ($z_axis !== 300 && $z_axis !== 301) {
985
+			calculate_legend($boundaries_z_axis);
986
+		}
989 987
 		$percentage = false;
990
-		$ytitle     = I18N::translate('Families');
991
-	} elseif ($y_axis === 202) {
992
-		$percentage = true;
993
-		$ytitle     = I18N::translate('percentage');
994
-	}
995
-	$male_female = false;
996
-	if ($z_axis === 300) {
997
-		$zgiven          = false;
998
-		$legend[0]       = 'all';
999
-		$zmax            = 1;
1000
-		$z_boundaries[0] = 100000;
1001
-	} elseif ($z_axis === 301) {
1002
-		$male_female = true;
1003
-		$zgiven      = true;
1004
-		$legend[0]   = I18N::translate('Male');
1005
-		$legend[1]   = I18N::translate('Female');
1006
-		$zmax        = 2;
1007
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1008
-	} elseif ($z_axis === 302) {
1009
-		$xtitle = $xtitle . I18N::translate(' per time period');
1010
-	}
1011
-	//-- reset the data array
1012
-	for ($i = 0; $i < $zmax; $i++) {
1013
-		for ($j = 0; $j < $xmax; $j++) {
1014
-			$ydata[$i][$j] = 0;
988
+		if ($y_axis === 201) {
989
+			$percentage = false;
990
+			$ytitle     = I18N::translate('Families');
991
+		} elseif ($y_axis === 202) {
992
+			$percentage = true;
993
+			$ytitle     = I18N::translate('percentage');
994
+		}
995
+		$male_female = false;
996
+		if ($z_axis === 300) {
997
+			$zgiven          = false;
998
+			$legend[0]       = 'all';
999
+			$zmax            = 1;
1000
+			$z_boundaries[0] = 100000;
1001
+		} elseif ($z_axis === 301) {
1002
+			$male_female = true;
1003
+			$zgiven      = true;
1004
+			$legend[0]   = I18N::translate('Male');
1005
+			$legend[1]   = I18N::translate('Female');
1006
+			$zmax        = 2;
1007
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1008
+		} elseif ($z_axis === 302) {
1009
+			$xtitle = $xtitle . I18N::translate(' per time period');
1010
+		}
1011
+		//-- reset the data array
1012
+		for ($i = 0; $i < $zmax; $i++) {
1013
+			for ($j = 0; $j < $xmax; $j++) {
1014
+				$ydata[$i][$j] = 0;
1015
+			}
1016
+		}
1017
+		$total = month_of_marriage($z_axis, $z_boundaries, $stats);
1018
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalFamilies();
1019
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1020
+		break;
1021
+	case '14':
1022
+		$monthdata = array();
1023
+		for ($i = 0; $i < 12; ++$i) {
1024
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1025
+		}
1026
+		$xgiven            = true;
1027
+		$zgiven            = false;
1028
+		$title             = I18N::translate('Month of birth of first child in a relation');
1029
+		$xtitle            = I18N::translate('month');
1030
+		$ytitle            = I18N::translate('numbers');
1031
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1032
+		$xdata             = $monthdata;
1033
+		$xmax              = 12;
1034
+		if ($z_axis !== 300 && $z_axis !== 301) {
1035
+			calculate_legend($boundaries_z_axis);
1015 1036
 		}
1016
-	}
1017
-	$total = month_of_marriage($z_axis, $z_boundaries, $stats);
1018
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalFamilies();
1019
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1020
-	break;
1021
-case '14':
1022
-	$monthdata = array();
1023
-	for ($i = 0; $i < 12; ++$i) {
1024
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1025
-	}
1026
-	$xgiven            = true;
1027
-	$zgiven            = false;
1028
-	$title             = I18N::translate('Month of birth of first child in a relation');
1029
-	$xtitle            = I18N::translate('month');
1030
-	$ytitle            = I18N::translate('numbers');
1031
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1032
-	$xdata             = $monthdata;
1033
-	$xmax              = 12;
1034
-	if ($z_axis !== 300 && $z_axis !== 301) {
1035
-		calculate_legend($boundaries_z_axis);
1036
-	}
1037
-	$percentage = false;
1038
-	if ($y_axis === 201) {
1039 1037
 		$percentage = false;
1040
-		$ytitle     = I18N::translate('Children');
1041
-	} elseif ($y_axis === 202) {
1042
-		$percentage = true;
1043
-		$ytitle     = I18N::translate('percentage');
1044
-	}
1045
-	$male_female = false;
1046
-	if ($z_axis === 300) {
1047
-		$zgiven          = false;
1048
-		$legend[0]       = 'all';
1049
-		$zmax            = 1;
1050
-		$z_boundaries[0] = 100000;
1051
-	} elseif ($z_axis === 301) {
1052
-		$male_female = true;
1053
-		$zgiven      = true;
1054
-		$legend[0]   = I18N::translate('Male');
1055
-		$legend[1]   = I18N::translate('Female');
1056
-		$zmax        = 2;
1057
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1058
-	} elseif ($z_axis === 302) {
1059
-		$xtitle = $xtitle . I18N::translate(' per time period');
1060
-	}
1061
-	//-- reset the data array
1062
-	for ($i = 0; $i < $zmax; $i++) {
1063
-		for ($j = 0; $j < $xmax; $j++) {
1064
-			$ydata[$i][$j] = 0;
1038
+		if ($y_axis === 201) {
1039
+			$percentage = false;
1040
+			$ytitle     = I18N::translate('Children');
1041
+		} elseif ($y_axis === 202) {
1042
+			$percentage = true;
1043
+			$ytitle     = I18N::translate('percentage');
1044
+		}
1045
+		$male_female = false;
1046
+		if ($z_axis === 300) {
1047
+			$zgiven          = false;
1048
+			$legend[0]       = 'all';
1049
+			$zmax            = 1;
1050
+			$z_boundaries[0] = 100000;
1051
+		} elseif ($z_axis === 301) {
1052
+			$male_female = true;
1053
+			$zgiven      = true;
1054
+			$legend[0]   = I18N::translate('Male');
1055
+			$legend[1]   = I18N::translate('Female');
1056
+			$zmax        = 2;
1057
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1058
+		} elseif ($z_axis === 302) {
1059
+			$xtitle = $xtitle . I18N::translate(' per time period');
1060
+		}
1061
+		//-- reset the data array
1062
+		for ($i = 0; $i < $zmax; $i++) {
1063
+			for ($j = 0; $j < $xmax; $j++) {
1064
+				$ydata[$i][$j] = 0;
1065
+			}
1066
+		}
1067
+		$total = month_of_birth_of_first_child($z_axis, $z_boundaries, $stats);
1068
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalFamilies();
1069
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1070
+		break;
1071
+	case '15':
1072
+		$monthdata = array();
1073
+		for ($i = 0; $i < 12; ++$i) {
1074
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1065 1075
 		}
1066
-	}
1067
-	$total = month_of_birth_of_first_child($z_axis, $z_boundaries, $stats);
1068
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalFamilies();
1069
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1070
-	break;
1071
-case '15':
1072
-	$monthdata = array();
1073
-	for ($i = 0; $i < 12; ++$i) {
1074
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1075
-	}
1076 1076
 
1077
-	if ($z_axis === 301) {
1078
-		$z_axis = 300;
1079
-	}
1080
-	$xgiven            = true;
1081
-	$zgiven            = false;
1082
-	$title             = I18N::translate('Month of first marriage');
1083
-	$xtitle            = I18N::translate('month');
1084
-	$ytitle            = I18N::translate('numbers');
1085
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1086
-	$xdata             = $monthdata;
1087
-	$xmax              = 12;
1088
-	if ($z_axis !== 300 && $z_axis !== 301) {
1089
-		calculate_legend($boundaries_z_axis);
1090
-	}
1091
-	$percentage = false;
1092
-	if ($y_axis === 201) {
1093
-		$percentage = false;
1094
-		$ytitle     = I18N::translate('Families');
1095
-	} elseif ($y_axis === 202) {
1096
-		$percentage = true;
1097
-		$ytitle     = I18N::translate('percentage');
1098
-	}
1099
-	$male_female = false;
1100
-	if ($z_axis === 300) {
1101
-		$zgiven          = false;
1102
-		$legend[0]       = 'all';
1103
-		$zmax            = 1;
1104
-		$z_boundaries[0] = 100000;
1105
-	} elseif ($z_axis === 301) {
1106
-		$male_female = true;
1107
-		$zgiven      = true;
1108
-		$legend[0]   = I18N::translate('Male');
1109
-		$legend[1]   = I18N::translate('Female');
1110
-		$zmax        = 2;
1111
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1112
-	} elseif ($z_axis === 302) {
1113
-		$xtitle = $xtitle . I18N::translate(' per time period');
1114
-	}
1115
-	//-- reset the data array
1116
-	for ($i = 0; $i < $zmax; $i++) {
1117
-		for ($j = 0; $j < $xmax; $j++) {
1118
-			$ydata[$i][$j] = 0;
1077
+		if ($z_axis === 301) {
1078
+			$z_axis = 300;
1079
+		}
1080
+		$xgiven            = true;
1081
+		$zgiven            = false;
1082
+		$title             = I18N::translate('Month of first marriage');
1083
+		$xtitle            = I18N::translate('month');
1084
+		$ytitle            = I18N::translate('numbers');
1085
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1086
+		$xdata             = $monthdata;
1087
+		$xmax              = 12;
1088
+		if ($z_axis !== 300 && $z_axis !== 301) {
1089
+			calculate_legend($boundaries_z_axis);
1119 1090
 		}
1120
-	}
1121
-	$total = month_of_first_marriage($z_axis, $z_boundaries, $stats);
1122
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalFamilies();
1123
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1124
-	break;
1125
-case '17':
1126
-	$monthdata = array();
1127
-	for ($i = 0; $i < 12; ++$i) {
1128
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1129
-	}
1130
-	$xgiven            = false;
1131
-	$zgiven            = false;
1132
-	$title             = I18N::translate('Age related to birth year');
1133
-	$xtitle            = I18N::translate('age');
1134
-	$ytitle            = I18N::translate('numbers');
1135
-	$boundaries_x_axis = Filter::get('x-axis-boundaries-ages');
1136
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1137
-	calculate_axis($boundaries_x_axis);
1138
-	if ($z_axis !== 300 && $z_axis !== 301) {
1139
-		calculate_legend($boundaries_z_axis);
1140
-	}
1141
-	$percentage = false;
1142
-	if ($y_axis === 201) {
1143 1091
 		$percentage = false;
1144
-		$ytitle     = I18N::translate('Individuals');
1145
-	} elseif ($y_axis === 202) {
1146
-		$percentage = true;
1147
-		$ytitle     = I18N::translate('percentage');
1148
-	}
1149
-	$male_female = false;
1150
-	if ($z_axis === 300) {
1151
-		$zgiven          = false;
1152
-		$legend[0]       = 'all';
1153
-		$zmax            = 1;
1154
-		$z_boundaries[0] = 100000;
1155
-	} elseif ($z_axis === 301) {
1156
-		$male_female = true;
1157
-		$zgiven      = true;
1158
-		$legend[0]   = I18N::translate('Male');
1159
-		$legend[1]   = I18N::translate('Female');
1160
-		$zmax        = 2;
1161
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1162
-	} elseif ($z_axis === 302) {
1163
-		$xtitle = $xtitle . I18N::translate(' per time period');
1164
-	}
1165
-	//-- reset the data array
1166
-	for ($i = 0; $i < $zmax; $i++) {
1167
-		for ($j = 0; $j < $xmax; $j++) {
1168
-			$ydata[$i][$j] = 0;
1092
+		if ($y_axis === 201) {
1093
+			$percentage = false;
1094
+			$ytitle     = I18N::translate('Families');
1095
+		} elseif ($y_axis === 202) {
1096
+			$percentage = true;
1097
+			$ytitle     = I18N::translate('percentage');
1098
+		}
1099
+		$male_female = false;
1100
+		if ($z_axis === 300) {
1101
+			$zgiven          = false;
1102
+			$legend[0]       = 'all';
1103
+			$zmax            = 1;
1104
+			$z_boundaries[0] = 100000;
1105
+		} elseif ($z_axis === 301) {
1106
+			$male_female = true;
1107
+			$zgiven      = true;
1108
+			$legend[0]   = I18N::translate('Male');
1109
+			$legend[1]   = I18N::translate('Female');
1110
+			$zmax        = 2;
1111
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1112
+		} elseif ($z_axis === 302) {
1113
+			$xtitle = $xtitle . I18N::translate(' per time period');
1114
+		}
1115
+		//-- reset the data array
1116
+		for ($i = 0; $i < $zmax; $i++) {
1117
+			for ($j = 0; $j < $xmax; $j++) {
1118
+				$ydata[$i][$j] = 0;
1119
+			}
1120
+		}
1121
+		$total = month_of_first_marriage($z_axis, $z_boundaries, $stats);
1122
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalFamilies();
1123
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1124
+		break;
1125
+	case '17':
1126
+		$monthdata = array();
1127
+		for ($i = 0; $i < 12; ++$i) {
1128
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1129
+		}
1130
+		$xgiven            = false;
1131
+		$zgiven            = false;
1132
+		$title             = I18N::translate('Age related to birth year');
1133
+		$xtitle            = I18N::translate('age');
1134
+		$ytitle            = I18N::translate('numbers');
1135
+		$boundaries_x_axis = Filter::get('x-axis-boundaries-ages');
1136
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1137
+		calculate_axis($boundaries_x_axis);
1138
+		if ($z_axis !== 300 && $z_axis !== 301) {
1139
+			calculate_legend($boundaries_z_axis);
1169 1140
 		}
1170
-	}
1171
-	$total = lifespan_by_birth_year($z_axis, $z_boundaries, $stats);
1172
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1173
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1174
-	break;
1175
-case '18':
1176
-	$monthdata = array();
1177
-	for ($i = 0; $i < 12; ++$i) {
1178
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1179
-	}
1180
-	$xgiven            = false;
1181
-	$zgiven            = false;
1182
-	$title             = I18N::translate('Age related to death year');
1183
-	$xtitle            = I18N::translate('age');
1184
-	$ytitle            = I18N::translate('numbers');
1185
-	$boundaries_x_axis = Filter::get('x-axis-boundaries-ages');
1186
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1187
-	calculate_axis($boundaries_x_axis);
1188
-	if ($z_axis !== 300 && $z_axis !== 301) {
1189
-		calculate_legend($boundaries_z_axis);
1190
-	}
1191
-	$percentage = false;
1192
-	if ($y_axis === 201) {
1193 1141
 		$percentage = false;
1194
-		$ytitle     = I18N::translate('Individuals');
1195
-	} elseif ($y_axis === 202) {
1196
-		$percentage = true;
1197
-		$ytitle     = I18N::translate('percentage');
1198
-	}
1199
-	$male_female = false;
1200
-	if ($z_axis === 300) {
1201
-		$zgiven          = false;
1202
-		$legend[0]       = 'all';
1203
-		$zmax            = 1;
1204
-		$z_boundaries[0] = 100000;
1205
-	} elseif ($z_axis === 301) {
1206
-		$male_female = true;
1207
-		$zgiven      = true;
1208
-		$legend[0]   = I18N::translate('Male');
1209
-		$legend[1]   = I18N::translate('Female');
1210
-		$zmax        = 2;
1211
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1212
-	} elseif ($z_axis === 302) {
1213
-		$xtitle = $xtitle . I18N::translate(' per time period');
1214
-	}
1215
-	//-- reset the data array
1216
-	for ($i = 0; $i < $zmax; $i++) {
1217
-		for ($j = 0; $j < $xmax; $j++) {
1218
-			$ydata[$i][$j] = 0;
1142
+		if ($y_axis === 201) {
1143
+			$percentage = false;
1144
+			$ytitle     = I18N::translate('Individuals');
1145
+		} elseif ($y_axis === 202) {
1146
+			$percentage = true;
1147
+			$ytitle     = I18N::translate('percentage');
1148
+		}
1149
+		$male_female = false;
1150
+		if ($z_axis === 300) {
1151
+			$zgiven          = false;
1152
+			$legend[0]       = 'all';
1153
+			$zmax            = 1;
1154
+			$z_boundaries[0] = 100000;
1155
+		} elseif ($z_axis === 301) {
1156
+			$male_female = true;
1157
+			$zgiven      = true;
1158
+			$legend[0]   = I18N::translate('Male');
1159
+			$legend[1]   = I18N::translate('Female');
1160
+			$zmax        = 2;
1161
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1162
+		} elseif ($z_axis === 302) {
1163
+			$xtitle = $xtitle . I18N::translate(' per time period');
1164
+		}
1165
+		//-- reset the data array
1166
+		for ($i = 0; $i < $zmax; $i++) {
1167
+			for ($j = 0; $j < $xmax; $j++) {
1168
+				$ydata[$i][$j] = 0;
1169
+			}
1170
+		}
1171
+		$total = lifespan_by_birth_year($z_axis, $z_boundaries, $stats);
1172
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1173
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1174
+		break;
1175
+	case '18':
1176
+		$monthdata = array();
1177
+		for ($i = 0; $i < 12; ++$i) {
1178
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1179
+		}
1180
+		$xgiven            = false;
1181
+		$zgiven            = false;
1182
+		$title             = I18N::translate('Age related to death year');
1183
+		$xtitle            = I18N::translate('age');
1184
+		$ytitle            = I18N::translate('numbers');
1185
+		$boundaries_x_axis = Filter::get('x-axis-boundaries-ages');
1186
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1187
+		calculate_axis($boundaries_x_axis);
1188
+		if ($z_axis !== 300 && $z_axis !== 301) {
1189
+			calculate_legend($boundaries_z_axis);
1219 1190
 		}
1220
-	}
1221
-	$total = lifespan_by_death_year($z_axis, $z_boundaries, $stats);
1222
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1223
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1224
-	break;
1225
-case '19':
1226
-	$monthdata = array();
1227
-	for ($i = 0; $i < 12; ++$i) {
1228
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1229
-	}
1230
-	$xgiven            = false;
1231
-	$zgiven            = false;
1232
-	$title             = I18N::translate('Age in year of marriage');
1233
-	$xtitle            = I18N::translate('age');
1234
-	$ytitle            = I18N::translate('numbers');
1235
-	$boundaries_x_axis = Filter::get('x-axis-boundaries-ages_m');
1236
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1237
-	calculate_axis($boundaries_x_axis);
1238
-	if ($z_axis !== 300 && $z_axis !== 301) {
1239
-		calculate_legend($boundaries_z_axis);
1240
-	}
1241
-	$percentage = false;
1242
-	if ($y_axis === 201) {
1243 1191
 		$percentage = false;
1244
-		$ytitle     = I18N::translate('Individuals');
1245
-	} elseif ($y_axis === 202) {
1246
-		$percentage = true;
1247
-		$ytitle     = I18N::translate('percentage');
1248
-	}
1249
-	$male_female     = false;
1250
-	$z_boundaries[0] = 100000;
1251
-	if ($z_axis === 300) {
1252
-		$zgiven          = false;
1253
-		$legend[0]       = 'all';
1254
-		$zmax            = 1;
1255
-	} elseif ($z_axis === 301) {
1256
-		$male_female = true;
1257
-		$zgiven      = true;
1258
-		$legend[0]   = I18N::translate('Male');
1259
-		$legend[1]   = I18N::translate('Female');
1260
-		$zmax        = 2;
1261
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1262
-	} elseif ($z_axis === 302) {
1263
-		$xtitle = $xtitle . I18N::translate(' per time period');
1264
-	}
1265
-	//-- reset the data array
1266
-	for ($i = 0; $i < $zmax; $i++) {
1267
-		for ($j = 0; $j < $xmax; $j++) {
1268
-			$ydata[$i][$j] = 0;
1192
+		if ($y_axis === 201) {
1193
+			$percentage = false;
1194
+			$ytitle     = I18N::translate('Individuals');
1195
+		} elseif ($y_axis === 202) {
1196
+			$percentage = true;
1197
+			$ytitle     = I18N::translate('percentage');
1198
+		}
1199
+		$male_female = false;
1200
+		if ($z_axis === 300) {
1201
+			$zgiven          = false;
1202
+			$legend[0]       = 'all';
1203
+			$zmax            = 1;
1204
+			$z_boundaries[0] = 100000;
1205
+		} elseif ($z_axis === 301) {
1206
+			$male_female = true;
1207
+			$zgiven      = true;
1208
+			$legend[0]   = I18N::translate('Male');
1209
+			$legend[1]   = I18N::translate('Female');
1210
+			$zmax        = 2;
1211
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1212
+		} elseif ($z_axis === 302) {
1213
+			$xtitle = $xtitle . I18N::translate(' per time period');
1214
+		}
1215
+		//-- reset the data array
1216
+		for ($i = 0; $i < $zmax; $i++) {
1217
+			for ($j = 0; $j < $xmax; $j++) {
1218
+				$ydata[$i][$j] = 0;
1219
+			}
1220
+		}
1221
+		$total = lifespan_by_death_year($z_axis, $z_boundaries, $stats);
1222
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1223
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1224
+		break;
1225
+	case '19':
1226
+		$monthdata = array();
1227
+		for ($i = 0; $i < 12; ++$i) {
1228
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1229
+		}
1230
+		$xgiven            = false;
1231
+		$zgiven            = false;
1232
+		$title             = I18N::translate('Age in year of marriage');
1233
+		$xtitle            = I18N::translate('age');
1234
+		$ytitle            = I18N::translate('numbers');
1235
+		$boundaries_x_axis = Filter::get('x-axis-boundaries-ages_m');
1236
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1237
+		calculate_axis($boundaries_x_axis);
1238
+		if ($z_axis !== 300 && $z_axis !== 301) {
1239
+			calculate_legend($boundaries_z_axis);
1269 1240
 		}
1270
-	}
1271
-	$total = age_at_marriage($z_axis, $z_boundaries, $stats);
1272
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1273
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1274
-	break;
1275
-case '20':
1276
-	$monthdata = array();
1277
-	for ($i = 0; $i < 12; ++$i) {
1278
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1279
-	}
1280
-	$xgiven            = false;
1281
-	$zgiven            = false;
1282
-	$title             = I18N::translate('Age in year of first marriage');
1283
-	$xtitle            = I18N::translate('age');
1284
-	$ytitle            = I18N::translate('numbers');
1285
-	$boundaries_x_axis = Filter::get('x-axis-boundaries-ages_m');
1286
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1287
-	calculate_axis($boundaries_x_axis);
1288
-	if ($z_axis !== 300 && $z_axis !== 301) {
1289
-		calculate_legend($boundaries_z_axis);
1290
-	}
1291
-	$percentage = false;
1292
-	if ($y_axis === 201) {
1293 1241
 		$percentage = false;
1294
-		$ytitle     = I18N::translate('Individuals');
1295
-	} elseif ($y_axis === 202) {
1296
-		$percentage = true;
1297
-		$ytitle     = I18N::translate('percentage');
1298
-	}
1299
-	$male_female = false;
1300
-	if ($z_axis === 300) {
1301
-		$zgiven          = false;
1302
-		$legend[0]       = 'all';
1303
-		$zmax            = 1;
1242
+		if ($y_axis === 201) {
1243
+			$percentage = false;
1244
+			$ytitle     = I18N::translate('Individuals');
1245
+		} elseif ($y_axis === 202) {
1246
+			$percentage = true;
1247
+			$ytitle     = I18N::translate('percentage');
1248
+		}
1249
+		$male_female     = false;
1304 1250
 		$z_boundaries[0] = 100000;
1305
-	} elseif ($z_axis === 301) {
1306
-		$male_female = true;
1307
-		$zgiven      = true;
1308
-		$legend[0]   = I18N::translate('Male');
1309
-		$legend[1]   = I18N::translate('Female');
1310
-		$zmax        = 2;
1311
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1312
-	} elseif ($z_axis === 302) {
1313
-		$xtitle = $xtitle . I18N::translate(' per time period');
1314
-	}
1315
-	//-- reset the data array
1316
-	for ($i = 0; $i < $zmax; $i++) {
1317
-		for ($j = 0; $j < $xmax; $j++) {
1318
-			$ydata[$i][$j] = 0;
1251
+		if ($z_axis === 300) {
1252
+			$zgiven          = false;
1253
+			$legend[0]       = 'all';
1254
+			$zmax            = 1;
1255
+		} elseif ($z_axis === 301) {
1256
+			$male_female = true;
1257
+			$zgiven      = true;
1258
+			$legend[0]   = I18N::translate('Male');
1259
+			$legend[1]   = I18N::translate('Female');
1260
+			$zmax        = 2;
1261
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1262
+		} elseif ($z_axis === 302) {
1263
+			$xtitle = $xtitle . I18N::translate(' per time period');
1264
+		}
1265
+		//-- reset the data array
1266
+		for ($i = 0; $i < $zmax; $i++) {
1267
+			for ($j = 0; $j < $xmax; $j++) {
1268
+				$ydata[$i][$j] = 0;
1269
+			}
1270
+		}
1271
+		$total = age_at_marriage($z_axis, $z_boundaries, $stats);
1272
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1273
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1274
+		break;
1275
+	case '20':
1276
+		$monthdata = array();
1277
+		for ($i = 0; $i < 12; ++$i) {
1278
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1279
+		}
1280
+		$xgiven            = false;
1281
+		$zgiven            = false;
1282
+		$title             = I18N::translate('Age in year of first marriage');
1283
+		$xtitle            = I18N::translate('age');
1284
+		$ytitle            = I18N::translate('numbers');
1285
+		$boundaries_x_axis = Filter::get('x-axis-boundaries-ages_m');
1286
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1287
+		calculate_axis($boundaries_x_axis);
1288
+		if ($z_axis !== 300 && $z_axis !== 301) {
1289
+			calculate_legend($boundaries_z_axis);
1319 1290
 		}
1320
-	}
1321
-	$total = age_at_first_marriage($z_axis, $z_boundaries, $stats);
1322
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1323
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1324
-	break;
1325
-case '21':
1326
-	$monthdata = array();
1327
-	for ($i = 0; $i < 12; ++$i) {
1328
-		$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1329
-	}
1330
-	$xgiven            = false;
1331
-	$zgiven            = false;
1332
-	$title             = I18N::translate('Number of children');
1333
-	$xtitle            = I18N::translate('children');
1334
-	$ytitle            = I18N::translate('numbers');
1335
-	$boundaries_x_axis = Filter::get('x-axis-boundaries-numbers');
1336
-	$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1337
-	calculate_axis($boundaries_x_axis);
1338
-	if ($z_axis !== 300 && $z_axis !== 301) {
1339
-		calculate_legend($boundaries_z_axis);
1340
-	}
1341
-	$percentage = false;
1342
-	if ($y_axis === 201) {
1343 1291
 		$percentage = false;
1344
-		$ytitle     = I18N::translate('Families');
1345
-	} elseif ($y_axis === 202) {
1346
-		$percentage = true;
1347
-		$ytitle     = I18N::translate('percentage');
1348
-	}
1349
-	$male_female = false;
1350
-	if ($z_axis === 300) {
1351
-		$zgiven          = false;
1352
-		$legend[0]       = 'all';
1353
-		$zmax            = 1;
1354
-		$z_boundaries[0] = 100000;
1355
-	} elseif ($z_axis === 301) {
1356
-		$male_female = true;
1357
-		$zgiven      = true;
1358
-		$legend[0]   = I18N::translate('Male');
1359
-		$legend[1]   = I18N::translate('Female');
1360
-		$zmax        = 2;
1361
-		$xtitle      = $xtitle . I18N::translate(' per gender');
1362
-	} elseif ($z_axis === 302) {
1363
-		$xtitle = $xtitle . I18N::translate(' per time period');
1364
-	}
1365
-	//-- reset the data array
1366
-	for ($i = 0; $i < $zmax; $i++) {
1367
-		for ($j = 0; $j < $xmax; $j++) {
1368
-			$ydata[$i][$j] = 0;
1292
+		if ($y_axis === 201) {
1293
+			$percentage = false;
1294
+			$ytitle     = I18N::translate('Individuals');
1295
+		} elseif ($y_axis === 202) {
1296
+			$percentage = true;
1297
+			$ytitle     = I18N::translate('percentage');
1369 1298
 		}
1370
-	}
1371
-	$total = number_of_children($z_axis, $z_boundaries, $stats);
1372
-	$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalChildren();
1373
-	my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1374
-	break;
1375
-default:
1376
-	echo '<i class="icon-loading-large"></i>';
1377
-	break;
1299
+		$male_female = false;
1300
+		if ($z_axis === 300) {
1301
+			$zgiven          = false;
1302
+			$legend[0]       = 'all';
1303
+			$zmax            = 1;
1304
+			$z_boundaries[0] = 100000;
1305
+		} elseif ($z_axis === 301) {
1306
+			$male_female = true;
1307
+			$zgiven      = true;
1308
+			$legend[0]   = I18N::translate('Male');
1309
+			$legend[1]   = I18N::translate('Female');
1310
+			$zmax        = 2;
1311
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1312
+		} elseif ($z_axis === 302) {
1313
+			$xtitle = $xtitle . I18N::translate(' per time period');
1314
+		}
1315
+		//-- reset the data array
1316
+		for ($i = 0; $i < $zmax; $i++) {
1317
+			for ($j = 0; $j < $xmax; $j++) {
1318
+				$ydata[$i][$j] = 0;
1319
+			}
1320
+		}
1321
+		$total = age_at_first_marriage($z_axis, $z_boundaries, $stats);
1322
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalIndividuals();
1323
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1324
+		break;
1325
+	case '21':
1326
+		$monthdata = array();
1327
+		for ($i = 0; $i < 12; ++$i) {
1328
+			$monthdata[$i] = GregorianDate::monthNameNominativeCase($i + 1, false);
1329
+		}
1330
+		$xgiven            = false;
1331
+		$zgiven            = false;
1332
+		$title             = I18N::translate('Number of children');
1333
+		$xtitle            = I18N::translate('children');
1334
+		$ytitle            = I18N::translate('numbers');
1335
+		$boundaries_x_axis = Filter::get('x-axis-boundaries-numbers');
1336
+		$boundaries_z_axis = Filter::get('z-axis-boundaries-periods', null, '0');
1337
+		calculate_axis($boundaries_x_axis);
1338
+		if ($z_axis !== 300 && $z_axis !== 301) {
1339
+			calculate_legend($boundaries_z_axis);
1340
+		}
1341
+		$percentage = false;
1342
+		if ($y_axis === 201) {
1343
+			$percentage = false;
1344
+			$ytitle     = I18N::translate('Families');
1345
+		} elseif ($y_axis === 202) {
1346
+			$percentage = true;
1347
+			$ytitle     = I18N::translate('percentage');
1348
+		}
1349
+		$male_female = false;
1350
+		if ($z_axis === 300) {
1351
+			$zgiven          = false;
1352
+			$legend[0]       = 'all';
1353
+			$zmax            = 1;
1354
+			$z_boundaries[0] = 100000;
1355
+		} elseif ($z_axis === 301) {
1356
+			$male_female = true;
1357
+			$zgiven      = true;
1358
+			$legend[0]   = I18N::translate('Male');
1359
+			$legend[1]   = I18N::translate('Female');
1360
+			$zmax        = 2;
1361
+			$xtitle      = $xtitle . I18N::translate(' per gender');
1362
+		} elseif ($z_axis === 302) {
1363
+			$xtitle = $xtitle . I18N::translate(' per time period');
1364
+		}
1365
+		//-- reset the data array
1366
+		for ($i = 0; $i < $zmax; $i++) {
1367
+			for ($j = 0; $j < $xmax; $j++) {
1368
+				$ydata[$i][$j] = 0;
1369
+			}
1370
+		}
1371
+		$total = number_of_children($z_axis, $z_boundaries, $stats);
1372
+		$hstr  = $title . '|' . I18N::translate('Counts ') . ' ' . I18N::number($total) . ' ' . I18N::translate('of') . ' ' . $stats->totalChildren();
1373
+		my_plot($hstr, $xdata, $xtitle, $ydata, $ytitle, $legend);
1374
+		break;
1375
+	default:
1376
+		echo '<i class="icon-loading-large"></i>';
1377
+		break;
1378 1378
 }
1379 1379
 echo '</div>';
Please login to merge, or discard this patch.