@@ -79,22 +79,22 @@ discard block |
||
79 | 79 | /** @var SosaStatisticsService $sosa_stats_service */ |
80 | 80 | $sosa_stats_service = app()->makeWith(SosaStatisticsService::class, ['tree' => $tree, 'user' => $user]); |
81 | 81 | |
82 | - $current_gen = Validator::queryParams($request)->integer( |
|
82 | + $current_gen = Validator::queryParams($request)->integer( |
|
83 | 83 | 'gen', |
84 | 84 | Validator::attributes($request)->integer('gen', 0) |
85 | 85 | ); |
86 | 86 | |
87 | 87 | $list_missing = $this->sosa_record_service->listMissingAncestorsAtGeneration($tree, $user, $current_gen); |
88 | - $nb_missing_diff = $list_missing->sum(function (stdClass $value): int { |
|
88 | + $nb_missing_diff = $list_missing->sum(function(stdClass $value): int { |
|
89 | 89 | return ($value->majs_fat_id === null ? 1 : 0) + ($value->majs_mot_id === null ? 1 : 0); |
90 | 90 | }); |
91 | 91 | |
92 | - $list_missing = $list_missing->map(function (stdClass $value) use ($tree): ?MissingAncestor { |
|
92 | + $list_missing = $list_missing->map(function(stdClass $value) use ($tree): ?MissingAncestor { |
|
93 | 93 | $indi = Registry::individualFactory()->make($value->majs_i_id, $tree); |
94 | 94 | if ($indi !== null && $indi->canShowName()) { |
95 | 95 | return new MissingAncestor( |
96 | 96 | $indi, |
97 | - (int) $value->majs_sosa, |
|
97 | + (int)$value->majs_sosa, |
|
98 | 98 | $value->majs_fat_id === null, |
99 | 99 | $value->majs_mot_id === null |
100 | 100 | ); |
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | return null; |
103 | 103 | })->filter(); |
104 | 104 | |
105 | - $nb_missing_shown = $list_missing->sum(function (MissingAncestor $value): int { |
|
105 | + $nb_missing_shown = $list_missing->sum(function(MissingAncestor $value): int { |
|
106 | 106 | return ($value->isFatherMissing() ? 1 : 0) + ($value->isMotherMissing() ? 1 : 0); |
107 | 107 | }); |
108 | 108 | |
109 | - return $this->viewResponse($this->module->name() . '::list-missing-page', [ |
|
109 | + return $this->viewResponse($this->module->name().'::list-missing-page', [ |
|
110 | 110 | 'module_name' => $this->module->name(), |
111 | 111 | 'title' => I18N::translate('Missing Ancestors'), |
112 | 112 | 'tree' => $tree, |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | public function sosaNumbers(Tree $tree, UserInterface $user, Individual $indi): Collection |
99 | 99 | { |
100 | 100 | return Registry::cache()->array()->remember( |
101 | - 'sosanumbers-' . $indi->xref() . '@' . $tree->id() . '-' . $user->id(), |
|
102 | - function () use ($tree, $user, $indi): Collection { |
|
101 | + 'sosanumbers-'.$indi->xref().'@'.$tree->id().'-'.$user->id(), |
|
102 | + function() use ($tree, $user, $indi): Collection { |
|
103 | 103 | return DB::table('maj_sosa') |
104 | 104 | ->select(['majs_sosa', 'majs_gen']) |
105 | 105 | ->where('majs_gedcom_id', '=', $tree->id()) |
@@ -159,14 +159,14 @@ discard block |
||
159 | 159 | { |
160 | 160 | $table_prefix = DB::connection()->getTablePrefix(); |
161 | 161 | return DB::table('families') |
162 | - ->join('maj_sosa AS sosa_husb', function (JoinClause $join) use ($tree, $user): void { |
|
162 | + ->join('maj_sosa AS sosa_husb', function(JoinClause $join) use ($tree, $user): void { |
|
163 | 163 | // Link to family husband |
164 | 164 | $join->on('families.f_file', '=', 'sosa_husb.majs_gedcom_id') |
165 | 165 | ->on('families.f_husb', '=', 'sosa_husb.majs_i_id') |
166 | 166 | ->where('sosa_husb.majs_gedcom_id', '=', $tree->id()) |
167 | 167 | ->where('sosa_husb.majs_user_id', '=', $user->id()); |
168 | 168 | }) |
169 | - ->join('maj_sosa AS sosa_wife', function (JoinClause $join) use ($tree, $user): void { |
|
169 | + ->join('maj_sosa AS sosa_wife', function(JoinClause $join) use ($tree, $user): void { |
|
170 | 170 | // Link to family husband |
171 | 171 | $join->on('families.f_file', '=', 'sosa_wife.majs_gedcom_id') |
172 | 172 | ->on('families.f_wife', '=', 'sosa_wife.majs_i_id') |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | }) |
176 | 176 | ->select(['sosa_husb.majs_sosa', 'families.f_id']) |
177 | 177 | ->where('sosa_husb.majs_gen', '=', $gen) |
178 | - ->whereRaw($table_prefix . 'sosa_husb.majs_sosa + 1 = ' . $table_prefix . 'sosa_wife.majs_sosa') |
|
178 | + ->whereRaw($table_prefix.'sosa_husb.majs_sosa + 1 = '.$table_prefix.'sosa_wife.majs_sosa') |
|
179 | 179 | ->orderBy('sosa_husb.majs_sosa') |
180 | 180 | ->get(); |
181 | 181 | } |
@@ -198,28 +198,28 @@ discard block |
||
198 | 198 | $table_prefix = DB::connection()->getTablePrefix(); |
199 | 199 | return DB::table('maj_sosa AS sosa') |
200 | 200 | ->select(['sosa.majs_i_id', 'sosa_fat.majs_i_id AS majs_fat_id', 'sosa_mot.majs_i_id AS majs_mot_id']) |
201 | - ->selectRaw('MIN(' . $table_prefix . 'sosa.majs_sosa) AS majs_sosa') |
|
202 | - ->leftJoin('maj_sosa AS sosa_fat', function (JoinClause $join) use ($tree, $user, $table_prefix): void { |
|
201 | + ->selectRaw('MIN('.$table_prefix.'sosa.majs_sosa) AS majs_sosa') |
|
202 | + ->leftJoin('maj_sosa AS sosa_fat', function(JoinClause $join) use ($tree, $user, $table_prefix): void { |
|
203 | 203 | // Link to sosa's father |
204 | - $join->whereRaw($table_prefix . 'sosa_fat.majs_sosa = 2 * ' . $table_prefix . 'sosa.majs_sosa') |
|
204 | + $join->whereRaw($table_prefix.'sosa_fat.majs_sosa = 2 * '.$table_prefix.'sosa.majs_sosa') |
|
205 | 205 | ->where('sosa_fat.majs_gedcom_id', '=', $tree->id()) |
206 | 206 | ->where('sosa_fat.majs_user_id', '=', $user->id()); |
207 | 207 | }) |
208 | - ->leftJoin('maj_sosa AS sosa_mot', function (JoinClause $join) use ($tree, $user, $table_prefix): void { |
|
208 | + ->leftJoin('maj_sosa AS sosa_mot', function(JoinClause $join) use ($tree, $user, $table_prefix): void { |
|
209 | 209 | // Link to sosa's mother |
210 | - $join->whereRaw($table_prefix . 'sosa_mot.majs_sosa = 2 * ' . $table_prefix . 'sosa.majs_sosa + 1') |
|
210 | + $join->whereRaw($table_prefix.'sosa_mot.majs_sosa = 2 * '.$table_prefix.'sosa.majs_sosa + 1') |
|
211 | 211 | ->where('sosa_mot.majs_gedcom_id', '=', $tree->id()) |
212 | 212 | ->where('sosa_mot.majs_user_id', '=', $user->id()); |
213 | 213 | }) |
214 | 214 | ->where('sosa.majs_gedcom_id', '=', $tree->id()) |
215 | 215 | ->where('sosa.majs_user_id', '=', $user->id()) |
216 | 216 | ->where('sosa.majs_gen', '=', $gen - 1) |
217 | - ->where(function (Builder $query): void { |
|
217 | + ->where(function(Builder $query): void { |
|
218 | 218 | $query->whereNull('sosa_fat.majs_i_id') |
219 | 219 | ->orWhereNull('sosa_mot.majs_i_id'); |
220 | 220 | }) |
221 | 221 | ->groupBy('sosa.majs_i_id', 'sosa_fat.majs_i_id', 'sosa_mot.majs_i_id') |
222 | - ->orderByRaw('MIN(' . $table_prefix . 'sosa.majs_sosa)') |
|
222 | + ->orderByRaw('MIN('.$table_prefix.'sosa.majs_sosa)') |
|
223 | 223 | ->get(); |
224 | 224 | } |
225 | 225 | |
@@ -271,26 +271,26 @@ discard block |
||
271 | 271 | $has_records = false; |
272 | 272 | foreach ($sosa_records as $i => $row) { |
273 | 273 | $gen = $this->generation($row['sosa']); |
274 | - if ($gen <= $this->maxSystemGenerations()) { |
|
274 | + if ($gen <= $this->maxSystemGenerations()) { |
|
275 | 275 | $has_records = true; |
276 | 276 | if ($mass_update) { |
277 | - $bindings_placeholders[] = '(:tree_id' . $i . ', :user_id' . $i . ', :sosa' . $i . ',' . |
|
278 | - ' :indi_id' . $i . ', :gen' . $i . ',' . |
|
279 | - ' :byear' . $i . ', :byearest' . $i . ', :dyear' . $i . ', :dyearest' . $i . ')'; |
|
277 | + $bindings_placeholders[] = '(:tree_id'.$i.', :user_id'.$i.', :sosa'.$i.','. |
|
278 | + ' :indi_id'.$i.', :gen'.$i.','. |
|
279 | + ' :byear'.$i.', :byearest'.$i.', :dyear'.$i.', :dyearest'.$i.')'; |
|
280 | 280 | $bindings_values += [ |
281 | - 'tree_id' . $i => $tree->id(), |
|
282 | - 'user_id' . $i => $user->id(), |
|
283 | - 'sosa' . $i => $row['sosa'], |
|
284 | - 'indi_id' . $i => $row['indi'], |
|
285 | - 'gen' . $i => $gen, |
|
286 | - 'byear' . $i => $row['birth_year'], |
|
287 | - 'byearest' . $i => $row['birth_year_est'], |
|
288 | - 'dyear' . $i => $row['death_year'], |
|
289 | - 'dyearest' . $i => $row['death_year_est'] |
|
281 | + 'tree_id'.$i => $tree->id(), |
|
282 | + 'user_id'.$i => $user->id(), |
|
283 | + 'sosa'.$i => $row['sosa'], |
|
284 | + 'indi_id'.$i => $row['indi'], |
|
285 | + 'gen'.$i => $gen, |
|
286 | + 'byear'.$i => $row['birth_year'], |
|
287 | + 'byearest'.$i => $row['birth_year_est'], |
|
288 | + 'dyear'.$i => $row['death_year'], |
|
289 | + 'dyearest'.$i => $row['death_year_est'] |
|
290 | 290 | ]; |
291 | 291 | } else { |
292 | 292 | DB::table('maj_sosa')->updateOrInsert( |
293 | - [ 'majs_gedcom_id' => $tree->id(), 'majs_user_id' => $user->id(), 'majs_sosa' => $row['sosa']], |
|
293 | + ['majs_gedcom_id' => $tree->id(), 'majs_user_id' => $user->id(), 'majs_sosa' => $row['sosa']], |
|
294 | 294 | [ |
295 | 295 | 'majs_i_id' => $row['indi'], |
296 | 296 | 'majs_gen' => $gen, |
@@ -306,12 +306,12 @@ discard block |
||
306 | 306 | |
307 | 307 | if ($has_records && $mass_update) { |
308 | 308 | DB::connection()->statement( |
309 | - 'INSERT INTO `' . DB::connection()->getTablePrefix() . 'maj_sosa`' . |
|
310 | - ' (majs_gedcom_id, majs_user_id, majs_sosa,' . |
|
311 | - ' majs_i_id, majs_gen, majs_birth_year, majs_birth_year_est, majs_death_year, majs_death_year_est)' . |
|
312 | - ' VALUES ' . implode(',', $bindings_placeholders) . |
|
313 | - ' ON DUPLICATE KEY UPDATE majs_i_id = VALUES(majs_i_id), majs_gen = VALUES(majs_gen),' . |
|
314 | - ' majs_birth_year = VALUES(majs_birth_year), majs_birth_year_est = VALUES(majs_birth_year_est),' . |
|
309 | + 'INSERT INTO `'.DB::connection()->getTablePrefix().'maj_sosa`'. |
|
310 | + ' (majs_gedcom_id, majs_user_id, majs_sosa,'. |
|
311 | + ' majs_i_id, majs_gen, majs_birth_year, majs_birth_year_est, majs_death_year, majs_death_year_est)'. |
|
312 | + ' VALUES '.implode(',', $bindings_placeholders). |
|
313 | + ' ON DUPLICATE KEY UPDATE majs_i_id = VALUES(majs_i_id), majs_gen = VALUES(majs_gen),'. |
|
314 | + ' majs_birth_year = VALUES(majs_birth_year), majs_birth_year_est = VALUES(majs_birth_year_est),'. |
|
315 | 315 | ' majs_death_year = VALUES(majs_death_year), majs_death_year_est = VALUES(majs_death_year_est)', |
316 | 316 | $bindings_values |
317 | 317 | ); |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function loadRoutes(Map $router): void |
64 | 64 | { |
65 | - $router->attach('', '', static function (Map $router): void { |
|
65 | + $router->attach('', '', static function(Map $router): void { |
|
66 | 66 | |
67 | - $router->attach('', '/module-maj/welcomeblock/{block_id}', static function (Map $router): void { |
|
67 | + $router->attach('', '/module-maj/welcomeblock/{block_id}', static function(Map $router): void { |
|
68 | 68 | $router->tokens(['block_id' => '\d+']); |
69 | 69 | $router->get(MatomoStats::class, '/matomostats', MatomoStats::class); |
70 | 70 | }); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $fab_login_block_view = app(\Fisharebest\Webtrees\Module\LoginBlockModule::class) |
95 | 95 | ->getBlock($tree, $block_id, ModuleBlockInterface::CONTEXT_EMBED); |
96 | 96 | |
97 | - $content = view($this->name() . '::block-embed', [ |
|
97 | + $content = view($this->name().'::block-embed', [ |
|
98 | 98 | 'block_id' => $block_id, |
99 | 99 | 'fab_welcome_block_view' => $fab_welcome_block_view, |
100 | 100 | 'fab_login_block_view' => $fab_login_block_view, |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function editBlockConfiguration(Tree $tree, int $block_id): string |
132 | 132 | { |
133 | - return view($this->name() . '::config', $this->matomoSettings($block_id)); |
|
133 | + return view($this->name().'::config', $this->matomoSettings($block_id)); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | $this |
163 | 163 | ->setBlockSetting($block_id, 'matomo_url', $matomo_url) |
164 | 164 | ->setBlockSetting($block_id, 'matomo_token', $matomo_token) |
165 | - ->setBlockSetting($block_id, 'matomo_siteid', (string) $matomo_siteid); |
|
165 | + ->setBlockSetting($block_id, 'matomo_siteid', (string)$matomo_siteid); |
|
166 | 166 | |
167 | - Registry::cache()->file()->forget($this->name() . '-matomovisits-yearly-' . $block_id); |
|
167 | + Registry::cache()->file()->forget($this->name().'-matomovisits-yearly-'.$block_id); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | 'matomo_enabled' => $this->isMatomoEnabled($block_id), |
191 | 191 | 'matomo_url' => $this->getBlockSetting($block_id, 'matomo_url'), |
192 | 192 | 'matomo_token' => $this->getBlockSetting($block_id, 'matomo_token'), |
193 | - 'matomo_siteid' => (int) $this->getBlockSetting($block_id, 'matomo_siteid', '0') |
|
193 | + 'matomo_siteid' => (int)$this->getBlockSetting($block_id, 'matomo_siteid', '0') |
|
194 | 194 | ]; |
195 | 195 | } |
196 | 196 | } |
@@ -76,9 +76,9 @@ |
||
76 | 76 | $has_task_config = $task instanceof ConfigurableTaskInterface; |
77 | 77 | /** @var \MyArtJaub\Webtrees\Contracts\Tasks\TaskInterface&\MyArtJaub\Webtrees\Contracts\Tasks\ConfigurableTaskInterface $task */ |
78 | 78 | |
79 | - return $this->viewResponse($this->module->name() . '::admin/tasks-edit', [ |
|
79 | + return $this->viewResponse($this->module->name().'::admin/tasks-edit', [ |
|
80 | 80 | 'module' => $this->module, |
81 | - 'title' => I18N::translate('Edit the administrative task') . ' - ' . $task->name(), |
|
81 | + 'title' => I18N::translate('Edit the administrative task').' - '.$task->name(), |
|
82 | 82 | 'task_schedule' => $task_schedule, |
83 | 83 | 'task' => $task, |
84 | 84 | 'has_task_config' => $has_task_config, |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function icon(ModuleInterface $module): string |
47 | 47 | { |
48 | - return view($module->name() . '::icons/view-map', ['type' => $this->type()]); |
|
48 | + return view($module->name().'::icons/view-map', ['type' => $this->type()]); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function globalSettingsContent(ModuleInterface $module): string |
56 | 56 | { |
57 | - return view($module->name() . '::admin/view-edit-map', [ |
|
57 | + return view($module->name().'::admin/view-edit-map', [ |
|
58 | 58 | 'module_name' => $module->name(), |
59 | 59 | 'view' => $this, |
60 | 60 | 'colors' => $this->colors(), |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | { |
72 | 72 | $default_color = Validator::parsedBody($request)->string('view_map_color_default', ''); |
73 | 73 | $stroke_color = Validator::parsedBody($request)->string('view_map_color_stroke', ''); |
74 | - $maxvalue_color = Validator::parsedBody($request)->string('view_map_color_maxvalue', ''); |
|
75 | - $hover_color = Validator::parsedBody($request)->string('view_map_color_hover', ''); |
|
74 | + $maxvalue_color = Validator::parsedBody($request)->string('view_map_color_maxvalue', ''); |
|
75 | + $hover_color = Validator::parsedBody($request)->string('view_map_color_hover', ''); |
|
76 | 76 | |
77 | 77 | try { |
78 | 78 | return $this->withColors(new MapColorsConfig( |
@@ -99,17 +99,16 @@ discard block |
||
99 | 99 | foreach ($map_adapters as $map_adapter) { |
100 | 100 | $adapter_result_tmp = $map_adapter->convert($result); |
101 | 101 | $adapter_result = $adapter_result === null ? |
102 | - $adapter_result_tmp : |
|
103 | - $adapter_result->merge($adapter_result_tmp); |
|
102 | + $adapter_result_tmp : $adapter_result->merge($adapter_result_tmp); |
|
104 | 103 | } |
105 | 104 | |
106 | 105 | if ($adapter_result === null) { |
107 | - return view($module->name() . '::errors/tab-error', [ |
|
106 | + return view($module->name().'::errors/tab-error', [ |
|
108 | 107 | 'message' => I18N::translate('The map could not be loaded.'), |
109 | 108 | ]); |
110 | 109 | } |
111 | 110 | |
112 | - return view($module->name() . '::geoanalysisview-tab-glb-map', $params + [ |
|
111 | + return view($module->name().'::geoanalysisview-tab-glb-map', $params + [ |
|
113 | 112 | 'result' => $adapter_result->geoAnalysisResult(), |
114 | 113 | 'features' => $adapter_result->features(), |
115 | 114 | 'colors' => $this->colors(), |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | { |
32 | 32 | $in_transaction = DB::connection()->getPdo()->inTransaction(); |
33 | 33 | |
34 | - DB::schema()->create('maj_geodisp_views', static function (Blueprint $table): void { |
|
34 | + DB::schema()->create('maj_geodisp_views', static function(Blueprint $table): void { |
|
35 | 35 | $table->integer('majgv_id')->autoIncrement(); |
36 | 36 | $table->integer('majgv_gedcom_id')->index(); |
37 | 37 | $table->string('majgv_view_class', 255); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $table->foreign('majgv_gedcom_id')->references('gedcom_id')->on('gedcom')->onDelete('cascade'); |
46 | 46 | }); |
47 | 47 | |
48 | - DB::schema()->create('maj_geodisp_mapviews', static function (Blueprint $table): void { |
|
48 | + DB::schema()->create('maj_geodisp_mapviews', static function(Blueprint $table): void { |
|
49 | 49 | $table->integer('majgm_id')->autoIncrement(); |
50 | 50 | $table->integer('majgm_majgv_id')->index(); |
51 | 51 | $table->string('majgm_map_id', 127); |
@@ -68,7 +68,7 @@ |
||
68 | 68 | } |
69 | 69 | $tree = Validator::attributes($request)->tree(); |
70 | 70 | |
71 | - return $this->viewResponse($this->module->name() . '::admin/view-add', [ |
|
71 | + return $this->viewResponse($this->module->name().'::admin/view-add', [ |
|
72 | 72 | 'module' => $this->module, |
73 | 73 | 'title' => I18N::translate('Add a geographical dispersion analysis view'), |
74 | 74 | 'tree' => $tree, |
@@ -83,7 +83,7 @@ |
||
83 | 83 | ); |
84 | 84 | } |
85 | 85 | |
86 | - return $this->viewResponse($this->module->name() . '::admin/map-adapter-edit', [ |
|
86 | + return $this->viewResponse($this->module->name().'::admin/map-adapter-edit', [ |
|
87 | 87 | 'module' => $this->module, |
88 | 88 | 'title' => I18N::translate('Edit the map configuration'), |
89 | 89 | 'tree' => $tree, |
@@ -83,7 +83,7 @@ |
||
83 | 83 | ); |
84 | 84 | } |
85 | 85 | |
86 | - return $this->viewResponse($this->module->name() . '::admin/map-adapter-edit', [ |
|
86 | + return $this->viewResponse($this->module->name().'::admin/map-adapter-edit', [ |
|
87 | 87 | 'module' => $this->module, |
88 | 88 | 'title' => I18N::translate('Add a map configuration'), |
89 | 89 | 'tree' => $tree, |