@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | return redirect($admin_config_route); |
69 | 69 | } |
70 | 70 | |
71 | - $task_sched_id = (int) $request->getAttribute('task'); |
|
71 | + $task_sched_id = (int)$request->getAttribute('task'); |
|
72 | 72 | $task_schedule = $this->taskschedules_service->find($task_sched_id); |
73 | 73 | |
74 | 74 | $admin_config_route = route(AdminConfigPage::class); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | return redirect($admin_config_route); |
82 | 82 | } |
83 | 83 | |
84 | - ((bool) $request->getAttribute('enable', false)) ? $task_schedule->enable() : $task_schedule->disable(); |
|
84 | + ((bool)$request->getAttribute('enable', false)) ? $task_schedule->enable() : $task_schedule->disable(); |
|
85 | 85 | |
86 | 86 | if ($this->taskschedules_service->update($task_schedule) > 0) { |
87 | 87 | FlashMessages::addMessage( |
@@ -89,14 +89,14 @@ discard block |
||
89 | 89 | 'success' |
90 | 90 | ); |
91 | 91 | //phpcs:ignore Generic.Files.LineLength.TooLong |
92 | - Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” has been updated.'); |
|
92 | + Log::addConfigurationLog('Module '.$this->module->title().' : Task Schedule “'.$task_schedule->id().'” has been updated.'); |
|
93 | 93 | } else { |
94 | 94 | FlashMessages::addMessage( |
95 | 95 | I18N::translate('An error occured while updating the scheduled task'), |
96 | 96 | 'danger' |
97 | 97 | ); |
98 | 98 | //phpcs:ignore Generic.Files.LineLength.TooLong |
99 | - Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” could not be updated. See error log.'); |
|
99 | + Log::addConfigurationLog('Module '.$this->module->title().' : Task Schedule “'.$task_schedule->id().'” could not be updated. See error log.'); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | return redirect($admin_config_route); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $interval_lastrun = $task_schedule->lastRunTime()->diffAsCarbonInterval(Carbon::now()); |
137 | 137 | //@phpcs:ignore Generic.Files.LineLength.TooLong |
138 | 138 | $interval = $interval_lastrun->greaterThan($task_schedule->frequency()) ? $interval_lastrun : $task_schedule->frequency(); |
139 | - $nb_days = (int) $interval->ceilDay()->totalDays; |
|
139 | + $nb_days = (int)$interval->ceilDay()->totalDays; |
|
140 | 140 | |
141 | 141 | $view_params_site = [ |
142 | 142 | 'nb_days' => $nb_days, |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | continue; |
156 | 156 | } |
157 | 157 | |
158 | - $webmaster = $this->user_service->find((int) $tree->getPreference('WEBMASTER_USER_ID')); |
|
158 | + $webmaster = $this->user_service->find((int)$tree->getPreference('WEBMASTER_USER_ID')); |
|
159 | 159 | if ($webmaster === null) { |
160 | 160 | continue; |
161 | 161 | } |
@@ -176,9 +176,9 @@ discard block |
||
176 | 176 | new TreeUser($tree), |
177 | 177 | $webmaster, |
178 | 178 | new NoReplyUser(), |
179 | - I18N::translate('Health Check Report') . ' - ' . I18N::translate('Tree %s', $tree->name()), |
|
180 | - view($this->module->name() . '::tasks/healthcheck/email-healthcheck-text', $view_params), |
|
181 | - view($this->module->name() . '::tasks/healthcheck/email-healthcheck-html', $view_params) |
|
179 | + I18N::translate('Health Check Report').' - '.I18N::translate('Tree %s', $tree->name()), |
|
180 | + view($this->module->name().'::tasks/healthcheck/email-healthcheck-text', $view_params), |
|
181 | + view($this->module->name().'::tasks/healthcheck/email-healthcheck-html', $view_params) |
|
182 | 182 | ); |
183 | 183 | } |
184 | 184 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function configView(ServerRequestInterface $request): string |
193 | 193 | { |
194 | - return $this->module === null ? '' : view($this->module->name() . '::tasks/healthcheck/config', [ |
|
194 | + return $this->module === null ? '' : view($this->module->name().'::tasks/healthcheck/config', [ |
|
195 | 195 | 'all_trees' => $this->tree_service->all() |
196 | 196 | ]); |
197 | 197 | } |
@@ -203,11 +203,11 @@ discard block |
||
203 | 203 | public function updateConfig(ServerRequestInterface $request, TaskSchedule $task_schedule): bool |
204 | 204 | { |
205 | 205 | try { |
206 | - $params = (array) $request->getParsedBody(); |
|
206 | + $params = (array)$request->getParsedBody(); |
|
207 | 207 | |
208 | 208 | foreach ($this->tree_service->all() as $tree) { |
209 | 209 | if (Auth::isManager($tree)) { |
210 | - $tree_enabled = (bool) ($params['HEALTHCHECK_ENABLED_' . $tree->id()] ?? false); |
|
210 | + $tree_enabled = (bool)($params['HEALTHCHECK_ENABLED_'.$tree->id()] ?? false); |
|
211 | 211 | $tree->setPreference(self::TREE_PREFERENCE_NAME, $tree_enabled ? '1' : '0'); |
212 | 212 | } |
213 | 213 | } |
@@ -197,14 +197,14 @@ discard block |
||
197 | 197 | $query = DB::table('maj_admintasks') |
198 | 198 | ->select() |
199 | 199 | ->where('majat_status', '=', 'enabled') |
200 | - ->where(function (Builder $query): void { |
|
200 | + ->where(function(Builder $query): void { |
|
201 | 201 | |
202 | 202 | $query->where('majat_running', '=', 0) |
203 | 203 | ->orWhere('majat_last_run', '<=', Carbon::now()->subSeconds(self::TASK_TIME_OUT)); |
204 | 204 | }); |
205 | 205 | |
206 | 206 | if (!$force) { |
207 | - $query->where(function (Builder $query): void { |
|
207 | + $query->where(function(Builder $query): void { |
|
208 | 208 | |
209 | 209 | $query->where('majat_running', '=', 0) |
210 | 210 | ->orWhereRaw('DATE_ADD(majat_last_run, INTERVAL majat_frequency MINUTE) <= NOW()'); |
@@ -253,9 +253,9 @@ discard block |
||
253 | 253 | $task_schedule->setLastResult($task->run($task_schedule)); |
254 | 254 | } catch (Throwable $ex) { |
255 | 255 | if ($first_error) { // Only record the first error, as this could fill the log. |
256 | - Log::addErrorLog(I18N::translate('Error while running task %s:', $task->name()) . ' ' . |
|
257 | - '[' . get_class($ex) . '] ' . $ex->getMessage() . ' ' . $ex->getFile() . ':' |
|
258 | - . $ex->getLine() . PHP_EOL . $ex->getTraceAsString()); |
|
256 | + Log::addErrorLog(I18N::translate('Error while running task %s:', $task->name()).' '. |
|
257 | + '['.get_class($ex).'] '.$ex->getMessage().' '.$ex->getFile().':' |
|
258 | + . $ex->getLine().PHP_EOL.$ex->getTraceAsString()); |
|
259 | 259 | } |
260 | 260 | } |
261 | 261 | |
@@ -276,17 +276,17 @@ discard block |
||
276 | 276 | */ |
277 | 277 | public static function rowMapper(): Closure |
278 | 278 | { |
279 | - return static function (stdClass $row): TaskSchedule { |
|
279 | + return static function(stdClass $row): TaskSchedule { |
|
280 | 280 | |
281 | 281 | return new TaskSchedule( |
282 | - (int) $row->majat_id, |
|
282 | + (int)$row->majat_id, |
|
283 | 283 | $row->majat_task_id, |
284 | 284 | $row->majat_status === 'enabled', |
285 | 285 | Carbon::parse($row->majat_last_run), |
286 | - (bool) $row->majat_last_result, |
|
286 | + (bool)$row->majat_last_result, |
|
287 | 287 | CarbonInterval::minutes($row->majat_frequency), |
288 | - (int) $row->majat_nb_occur, |
|
289 | - (bool) $row->majat_running |
|
288 | + (int)$row->majat_nb_occur, |
|
289 | + (bool)$row->majat_running |
|
290 | 290 | ); |
291 | 291 | }; |
292 | 292 | } |
@@ -77,9 +77,9 @@ |
||
77 | 77 | /** @var SosaStatisticsService $sosa_stats_service */ |
78 | 78 | $sosa_stats_service = app()->makeWith(SosaStatisticsService::class, ['tree' => $tree, 'user' => $user]); |
79 | 79 | |
80 | - $current_gen = (int) ($request->getQueryParams()['gen'] ?? $request->getAttribute('gen') ?? 0); |
|
80 | + $current_gen = (int)($request->getQueryParams()['gen'] ?? $request->getAttribute('gen') ?? 0); |
|
81 | 81 | |
82 | - return $this->viewResponse($this->module->name() . '::list-ancestors-page', [ |
|
82 | + return $this->viewResponse($this->module->name().'::list-ancestors-page', [ |
|
83 | 83 | 'module_name' => $this->module->name(), |
84 | 84 | 'title' => I18N::translate('Sosa Ancestors'), |
85 | 85 | 'tree' => $tree, |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | $user = Auth::check() ? $request->getAttribute('user') : new DefaultUser(); |
80 | 80 | |
81 | - $current_gen = (int) ($request->getAttribute('gen') ?? 0); |
|
81 | + $current_gen = (int)($request->getAttribute('gen') ?? 0); |
|
82 | 82 | |
83 | 83 | if ($current_gen <= 0) { |
84 | 84 | return response('Invalid generation', StatusCodeInterface::STATUS_UNPROCESSABLE_ENTITY); |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | $nb_ancestors_all = $list_ancestors->count(); |
89 | 89 | |
90 | 90 | /** @var \Illuminate\Support\Collection<int, \Fisharebest\Webtrees\Individual> $list_ancestors */ |
91 | - $list_ancestors = $list_ancestors->mapWithKeys(function (stdClass $value) use ($tree): ?array { |
|
91 | + $list_ancestors = $list_ancestors->mapWithKeys(function(stdClass $value) use ($tree): ?array { |
|
92 | 92 | $indi = Registry::individualFactory()->make($value->majs_i_id, $tree); |
93 | - return ($indi !== null && $indi->canShowName()) ? [(int) $value->majs_sosa => $indi] : null; |
|
93 | + return ($indi !== null && $indi->canShowName()) ? [(int)$value->majs_sosa => $indi] : null; |
|
94 | 94 | })->filter(); |
95 | 95 | |
96 | 96 | $nb_ancestors_shown = $list_ancestors->count(); |
97 | 97 | |
98 | - return $this->viewResponse($this->module->name() . '::list-ancestors-indi-tab', [ |
|
98 | + return $this->viewResponse($this->module->name().'::list-ancestors-indi-tab', [ |
|
99 | 99 | 'module_name' => $this->module->name(), |
100 | 100 | 'title' => I18N::translate('Sosa Ancestors'), |
101 | 101 | 'tree' => $tree, |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | $user = Auth::check() ? $request->getAttribute('user') : new DefaultUser(); |
80 | 80 | |
81 | - $current_gen = (int) ($request->getAttribute('gen') ?? 0); |
|
81 | + $current_gen = (int)($request->getAttribute('gen') ?? 0); |
|
82 | 82 | |
83 | 83 | if ($current_gen <= 0) { |
84 | 84 | return response('Invalid generation', StatusCodeInterface::STATUS_UNPROCESSABLE_ENTITY); |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | $nb_families_all = $list_families->count(); |
89 | 89 | |
90 | 90 | /** @var \Illuminate\Support\Collection<int, \Fisharebest\Webtrees\Family> $list_families */ |
91 | - $list_families = $list_families->mapWithKeys(function (stdClass $value) use ($tree): ?array { |
|
91 | + $list_families = $list_families->mapWithKeys(function(stdClass $value) use ($tree): ?array { |
|
92 | 92 | $fam = Registry::familyFactory()->make($value->f_id, $tree); |
93 | - return ($fam !== null && $fam->canShow()) ? [(int) $value->majs_sosa => $fam] : null; |
|
93 | + return ($fam !== null && $fam->canShow()) ? [(int)$value->majs_sosa => $fam] : null; |
|
94 | 94 | })->filter(); |
95 | 95 | |
96 | 96 | $nb_families_shown = $list_families->count(); |
97 | 97 | |
98 | - return $this->viewResponse($this->module->name() . '::list-ancestors-fam-tab', [ |
|
98 | + return $this->viewResponse($this->module->name().'::list-ancestors-fam-tab', [ |
|
99 | 99 | 'module_name' => $this->module->name(), |
100 | 100 | 'title' => I18N::translate('Sosa Ancestors'), |
101 | 101 | 'tree' => $tree, |
@@ -80,19 +80,19 @@ discard block |
||
80 | 80 | /** @var SosaStatisticsService $sosa_stats_service */ |
81 | 81 | $sosa_stats_service = app()->makeWith(SosaStatisticsService::class, ['tree' => $tree, 'user' => $user]); |
82 | 82 | |
83 | - $current_gen = (int) ($request->getQueryParams()['gen'] ?? $request->getAttribute('gen') ?? 0); |
|
83 | + $current_gen = (int)($request->getQueryParams()['gen'] ?? $request->getAttribute('gen') ?? 0); |
|
84 | 84 | |
85 | 85 | $list_missing = $this->sosa_record_service->listMissingAncestorsAtGeneration($tree, $user, $current_gen); |
86 | - $nb_missing_diff = $list_missing->sum(function (stdClass $value): int { |
|
86 | + $nb_missing_diff = $list_missing->sum(function(stdClass $value): int { |
|
87 | 87 | return ($value->majs_fat_id === null ? 1 : 0) + ($value->majs_mot_id === null ? 1 : 0); |
88 | 88 | }); |
89 | 89 | |
90 | - $list_missing = $list_missing->map(function (stdClass $value) use ($tree): ?MissingAncestor { |
|
90 | + $list_missing = $list_missing->map(function(stdClass $value) use ($tree): ?MissingAncestor { |
|
91 | 91 | $indi = Registry::individualFactory()->make($value->majs_i_id, $tree); |
92 | 92 | if ($indi !== null && $indi->canShowName()) { |
93 | 93 | return new MissingAncestor( |
94 | 94 | $indi, |
95 | - (int) $value->majs_sosa, |
|
95 | + (int)$value->majs_sosa, |
|
96 | 96 | $value->majs_fat_id === null, |
97 | 97 | $value->majs_mot_id === null |
98 | 98 | ); |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | return null; |
101 | 101 | })->filter(); |
102 | 102 | |
103 | - $nb_missing_shown = $list_missing->sum(function (MissingAncestor $value): int { |
|
103 | + $nb_missing_shown = $list_missing->sum(function(MissingAncestor $value): int { |
|
104 | 104 | return ($value->isFatherMissing() ? 1 : 0) + ($value->isMotherMissing() ? 1 : 0); |
105 | 105 | }); |
106 | 106 | |
107 | - return $this->viewResponse($this->module->name() . '::list-missing-page', [ |
|
107 | + return $this->viewResponse($this->module->name().'::list-missing-page', [ |
|
108 | 108 | 'module_name' => $this->module->name(), |
109 | 109 | 'title' => I18N::translate('Missing Ancestors'), |
110 | 110 | 'tree' => $tree, |
@@ -78,7 +78,7 @@ |
||
78 | 78 | if ($ancestor === null || !$ancestor->canShow()) { |
79 | 79 | continue; |
80 | 80 | } |
81 | - $generation = $this->records_service->generation((int) $item->majs_sosa); |
|
81 | + $generation = $this->records_service->generation((int)$item->majs_sosa); |
|
82 | 82 | $significantplace = new GeoAnalysisPlace($tree, null, $depth); |
83 | 83 | foreach ($this->significantPlaces($ancestor) as $place) { |
84 | 84 | $significantplace = new GeoAnalysisPlace($tree, $place, $depth, true); |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | public function sosaNumbers(Tree $tree, UserInterface $user, Individual $indi): Collection |
89 | 89 | { |
90 | 90 | return Registry::cache()->array()->remember( |
91 | - 'sosanumbers-' . $indi->xref() . '@' . $tree->id() . '-' . $user->id(), |
|
92 | - function () use ($tree, $user, $indi): Collection { |
|
91 | + 'sosanumbers-'.$indi->xref().'@'.$tree->id().'-'.$user->id(), |
|
92 | + function() use ($tree, $user, $indi): Collection { |
|
93 | 93 | return DB::table('maj_sosa') |
94 | 94 | ->select(['majs_sosa', 'majs_gen']) |
95 | 95 | ->where('majs_gedcom_id', '=', $tree->id()) |
@@ -149,14 +149,14 @@ discard block |
||
149 | 149 | { |
150 | 150 | $table_prefix = DB::connection()->getTablePrefix(); |
151 | 151 | return DB::table('families') |
152 | - ->join('maj_sosa AS sosa_husb', function (JoinClause $join) use ($tree, $user): void { |
|
152 | + ->join('maj_sosa AS sosa_husb', function(JoinClause $join) use ($tree, $user): void { |
|
153 | 153 | // Link to family husband |
154 | 154 | $join->on('families.f_file', '=', 'sosa_husb.majs_gedcom_id') |
155 | 155 | ->on('families.f_husb', '=', 'sosa_husb.majs_i_id') |
156 | 156 | ->where('sosa_husb.majs_gedcom_id', '=', $tree->id()) |
157 | 157 | ->where('sosa_husb.majs_user_id', '=', $user->id()); |
158 | 158 | }) |
159 | - ->join('maj_sosa AS sosa_wife', function (JoinClause $join) use ($tree, $user): void { |
|
159 | + ->join('maj_sosa AS sosa_wife', function(JoinClause $join) use ($tree, $user): void { |
|
160 | 160 | // Link to family husband |
161 | 161 | $join->on('families.f_file', '=', 'sosa_wife.majs_gedcom_id') |
162 | 162 | ->on('families.f_wife', '=', 'sosa_wife.majs_i_id') |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | }) |
166 | 166 | ->select(['sosa_husb.majs_sosa', 'families.f_id']) |
167 | 167 | ->where('sosa_husb.majs_gen', '=', $gen) |
168 | - ->whereRaw($table_prefix . 'sosa_husb.majs_sosa + 1 = ' . $table_prefix . 'sosa_wife.majs_sosa') |
|
168 | + ->whereRaw($table_prefix.'sosa_husb.majs_sosa + 1 = '.$table_prefix.'sosa_wife.majs_sosa') |
|
169 | 169 | ->orderBy('sosa_husb.majs_sosa') |
170 | 170 | ->get(); |
171 | 171 | } |
@@ -188,28 +188,28 @@ discard block |
||
188 | 188 | $table_prefix = DB::connection()->getTablePrefix(); |
189 | 189 | return DB::table('maj_sosa AS sosa') |
190 | 190 | ->select(['sosa.majs_i_id', 'sosa_fat.majs_i_id AS majs_fat_id', 'sosa_mot.majs_i_id AS majs_mot_id']) |
191 | - ->selectRaw('MIN(' . $table_prefix . 'sosa.majs_sosa) AS majs_sosa') |
|
192 | - ->leftJoin('maj_sosa AS sosa_fat', function (JoinClause $join) use ($tree, $user, $table_prefix): void { |
|
191 | + ->selectRaw('MIN('.$table_prefix.'sosa.majs_sosa) AS majs_sosa') |
|
192 | + ->leftJoin('maj_sosa AS sosa_fat', function(JoinClause $join) use ($tree, $user, $table_prefix): void { |
|
193 | 193 | // Link to sosa's father |
194 | - $join->whereRaw($table_prefix . 'sosa_fat.majs_sosa = 2 * ' . $table_prefix . 'sosa.majs_sosa') |
|
194 | + $join->whereRaw($table_prefix.'sosa_fat.majs_sosa = 2 * '.$table_prefix.'sosa.majs_sosa') |
|
195 | 195 | ->where('sosa_fat.majs_gedcom_id', '=', $tree->id()) |
196 | 196 | ->where('sosa_fat.majs_user_id', '=', $user->id()); |
197 | 197 | }) |
198 | - ->leftJoin('maj_sosa AS sosa_mot', function (JoinClause $join) use ($tree, $user, $table_prefix): void { |
|
198 | + ->leftJoin('maj_sosa AS sosa_mot', function(JoinClause $join) use ($tree, $user, $table_prefix): void { |
|
199 | 199 | // Link to sosa's mother |
200 | - $join->whereRaw($table_prefix . 'sosa_mot.majs_sosa = 2 * ' . $table_prefix . 'sosa.majs_sosa + 1') |
|
200 | + $join->whereRaw($table_prefix.'sosa_mot.majs_sosa = 2 * '.$table_prefix.'sosa.majs_sosa + 1') |
|
201 | 201 | ->where('sosa_mot.majs_gedcom_id', '=', $tree->id()) |
202 | 202 | ->where('sosa_mot.majs_user_id', '=', $user->id()); |
203 | 203 | }) |
204 | 204 | ->where('sosa.majs_gedcom_id', '=', $tree->id()) |
205 | 205 | ->where('sosa.majs_user_id', '=', $user->id()) |
206 | 206 | ->where('sosa.majs_gen', '=', $gen - 1) |
207 | - ->where(function (Builder $query): void { |
|
207 | + ->where(function(Builder $query): void { |
|
208 | 208 | $query->whereNull('sosa_fat.majs_i_id') |
209 | 209 | ->orWhereNull('sosa_mot.majs_i_id'); |
210 | 210 | }) |
211 | 211 | ->groupBy('sosa.majs_i_id', 'sosa_fat.majs_i_id', 'sosa_mot.majs_i_id') |
212 | - ->orderByRaw('MIN(' . $table_prefix . 'sosa.majs_sosa)') |
|
212 | + ->orderByRaw('MIN('.$table_prefix.'sosa.majs_sosa)') |
|
213 | 213 | ->get(); |
214 | 214 | } |
215 | 215 | |
@@ -261,29 +261,29 @@ discard block |
||
261 | 261 | $has_records = false; |
262 | 262 | foreach ($sosa_records as $i => $row) { |
263 | 263 | $gen = $this->generation($row['sosa']); |
264 | - if ($gen <= $this->maxSystemGenerations()) { |
|
264 | + if ($gen <= $this->maxSystemGenerations()) { |
|
265 | 265 | $has_records = true; |
266 | 266 | if ($mass_update) { |
267 | - $bindings_placeholders[] = '(:tree_id' . $i . ', :user_id' . $i . ', :sosa' . $i . ',' . |
|
268 | - ' :indi_id' . $i . ', :gen' . $i . ',' . |
|
269 | - ' :byear' . $i . ', :byearest' . $i . ', :dyear' . $i . ', :dyearest' . $i . ')'; |
|
267 | + $bindings_placeholders[] = '(:tree_id'.$i.', :user_id'.$i.', :sosa'.$i.','. |
|
268 | + ' :indi_id'.$i.', :gen'.$i.','. |
|
269 | + ' :byear'.$i.', :byearest'.$i.', :dyear'.$i.', :dyearest'.$i.')'; |
|
270 | 270 | $bindings_values = array_merge( |
271 | 271 | $bindings_values, |
272 | 272 | [ |
273 | - 'tree_id' . $i => $tree->id(), |
|
274 | - 'user_id' . $i => $user->id(), |
|
275 | - 'sosa' . $i => $row['sosa'], |
|
276 | - 'indi_id' . $i => $row['indi'], |
|
277 | - 'gen' . $i => $gen, |
|
278 | - 'byear' . $i => $row['birth_year'], |
|
279 | - 'byearest' . $i => $row['birth_year_est'], |
|
280 | - 'dyear' . $i => $row['death_year'], |
|
281 | - 'dyearest' . $i => $row['death_year_est'] |
|
273 | + 'tree_id'.$i => $tree->id(), |
|
274 | + 'user_id'.$i => $user->id(), |
|
275 | + 'sosa'.$i => $row['sosa'], |
|
276 | + 'indi_id'.$i => $row['indi'], |
|
277 | + 'gen'.$i => $gen, |
|
278 | + 'byear'.$i => $row['birth_year'], |
|
279 | + 'byearest'.$i => $row['birth_year_est'], |
|
280 | + 'dyear'.$i => $row['death_year'], |
|
281 | + 'dyearest'.$i => $row['death_year_est'] |
|
282 | 282 | ] |
283 | 283 | ); |
284 | 284 | } else { |
285 | 285 | DB::table('maj_sosa')->updateOrInsert( |
286 | - [ 'majs_gedcom_id' => $tree->id(), 'majs_user_id' => $user->id(), 'majs_sosa' => $row['sosa']], |
|
286 | + ['majs_gedcom_id' => $tree->id(), 'majs_user_id' => $user->id(), 'majs_sosa' => $row['sosa']], |
|
287 | 287 | [ |
288 | 288 | 'majs_i_id' => $row['indi'], |
289 | 289 | 'majs_gen' => $gen, |
@@ -299,12 +299,12 @@ discard block |
||
299 | 299 | |
300 | 300 | if ($has_records && $mass_update) { |
301 | 301 | DB::connection()->statement( |
302 | - 'INSERT INTO `' . DB::connection()->getTablePrefix() . 'maj_sosa`' . |
|
303 | - ' (majs_gedcom_id, majs_user_id, majs_sosa,' . |
|
304 | - ' majs_i_id, majs_gen, majs_birth_year, majs_birth_year_est, majs_death_year, majs_death_year_est)' . |
|
305 | - ' VALUES ' . implode(',', $bindings_placeholders) . |
|
306 | - ' ON DUPLICATE KEY UPDATE majs_i_id = VALUES(majs_i_id), majs_gen = VALUES(majs_gen),' . |
|
307 | - ' majs_birth_year = VALUES(majs_birth_year), majs_birth_year_est = VALUES(majs_birth_year_est),' . |
|
302 | + 'INSERT INTO `'.DB::connection()->getTablePrefix().'maj_sosa`'. |
|
303 | + ' (majs_gedcom_id, majs_user_id, majs_sosa,'. |
|
304 | + ' majs_i_id, majs_gen, majs_birth_year, majs_birth_year_est, majs_death_year, majs_death_year_est)'. |
|
305 | + ' VALUES '.implode(',', $bindings_placeholders). |
|
306 | + ' ON DUPLICATE KEY UPDATE majs_i_id = VALUES(majs_i_id), majs_gen = VALUES(majs_gen),'. |
|
307 | + ' majs_birth_year = VALUES(majs_birth_year), majs_birth_year_est = VALUES(majs_birth_year_est),'. |
|
308 | 308 | ' majs_death_year = VALUES(majs_death_year), majs_death_year_est = VALUES(majs_death_year_est)', |
309 | 309 | $bindings_values |
310 | 310 | ); |