@@ -255,35 +255,35 @@ discard block |
||
255 | 255 | |
256 | 256 | $args = []; |
257 | 257 | if ($search) { |
258 | - $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
258 | + $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
259 | 259 | $args['search'] = $search; |
260 | 260 | } |
261 | 261 | if ($from) { |
262 | - $sql .= " AND log_time >= :from"; |
|
262 | + $sql .= " AND log_time >= :from"; |
|
263 | 263 | $args['from'] = $from; |
264 | 264 | } |
265 | 265 | if ($to) { |
266 | - $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
266 | + $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
267 | 267 | $args['to'] = $to; |
268 | 268 | } |
269 | 269 | if ($type) { |
270 | - $sql .= " AND log_type = :type"; |
|
270 | + $sql .= " AND log_type = :type"; |
|
271 | 271 | $args['type'] = $type; |
272 | 272 | } |
273 | 273 | if ($text) { |
274 | - $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
274 | + $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
275 | 275 | $args['text'] = $text; |
276 | 276 | } |
277 | 277 | if ($ip) { |
278 | - $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
278 | + $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
279 | 279 | $args['ip'] = $ip; |
280 | 280 | } |
281 | 281 | if ($username) { |
282 | - $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
282 | + $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
283 | 283 | $args['user'] = $username; |
284 | 284 | } |
285 | 285 | if ($gedc) { |
286 | - $sql .= " AND gedcom_name = :gedc"; |
|
286 | + $sql .= " AND gedcom_name = :gedc"; |
|
287 | 287 | $args['gedc'] = $gedc; |
288 | 288 | } |
289 | 289 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | } |
310 | 310 | |
311 | 311 | if ($length) { |
312 | - $sql .= " LIMIT :limit OFFSET :offset"; |
|
312 | + $sql .= " LIMIT :limit OFFSET :offset"; |
|
313 | 313 | $args['limit'] = $length; |
314 | 314 | $args['offset'] = $start; |
315 | 315 | } |
@@ -361,35 +361,35 @@ discard block |
||
361 | 361 | |
362 | 362 | $args = []; |
363 | 363 | if ($search) { |
364 | - $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
364 | + $sql .= " AND log_message LIKE CONCAT('%', :search, '%')"; |
|
365 | 365 | $args['search'] = $search; |
366 | 366 | } |
367 | 367 | if ($from) { |
368 | - $sql .= " AND log_time >= :from"; |
|
368 | + $sql .= " AND log_time >= :from"; |
|
369 | 369 | $args['from'] = $from; |
370 | 370 | } |
371 | 371 | if ($to) { |
372 | - $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
372 | + $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
373 | 373 | $args['to'] = $to; |
374 | 374 | } |
375 | 375 | if ($type) { |
376 | - $sql .= " AND log_type = :type"; |
|
376 | + $sql .= " AND log_type = :type"; |
|
377 | 377 | $args['type'] = $type; |
378 | 378 | } |
379 | 379 | if ($text) { |
380 | - $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
380 | + $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
381 | 381 | $args['text'] = $text; |
382 | 382 | } |
383 | 383 | if ($ip) { |
384 | - $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
384 | + $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
385 | 385 | $args['ip'] = $ip; |
386 | 386 | } |
387 | 387 | if ($username) { |
388 | - $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
388 | + $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
389 | 389 | $args['user'] = $username; |
390 | 390 | } |
391 | 391 | if ($gedc) { |
392 | - $sql .= " AND gedcom_name = :gedc"; |
|
392 | + $sql .= " AND gedcom_name = :gedc"; |
|
393 | 393 | $args['gedc'] = $gedc; |
394 | 394 | } |
395 | 395 | |
@@ -421,37 +421,37 @@ discard block |
||
421 | 421 | |
422 | 422 | $args = []; |
423 | 423 | if ($from) { |
424 | - $sql .= " AND log_time >= :from"; |
|
424 | + $sql .= " AND log_time >= :from"; |
|
425 | 425 | $args['from'] = $from; |
426 | 426 | } |
427 | 427 | if ($to) { |
428 | - $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
428 | + $sql .= " AND log_time < TIMESTAMPADD(DAY, 1 , :to)"; // before end of the day |
|
429 | 429 | $args['to'] = $to; |
430 | 430 | } |
431 | 431 | if ($type) { |
432 | - $sql .= " AND log_type = :type"; |
|
432 | + $sql .= " AND log_type = :type"; |
|
433 | 433 | $args['type'] = $type; |
434 | 434 | } |
435 | 435 | if ($text) { |
436 | - $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
436 | + $sql .= " AND log_message LIKE CONCAT('%', :text, '%')"; |
|
437 | 437 | $args['text'] = $text; |
438 | 438 | } |
439 | 439 | if ($ip) { |
440 | - $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
440 | + $sql .= " AND ip_address LIKE CONCAT('%', :ip, '%')"; |
|
441 | 441 | $args['ip'] = $ip; |
442 | 442 | } |
443 | 443 | if ($username) { |
444 | - $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
444 | + $sql .= " AND user_name LIKE CONCAT('%', :user, '%')"; |
|
445 | 445 | $args['user'] = $username; |
446 | 446 | } |
447 | 447 | if ($gedc) { |
448 | - $sql .= " AND gedcom_name = :gedc"; |
|
448 | + $sql .= " AND gedcom_name = :gedc"; |
|
449 | 449 | $args['gedc'] = $gedc; |
450 | 450 | } |
451 | 451 | |
452 | 452 | $sql .= " ORDER BY log_id"; |
453 | 453 | |
454 | - $rows = Database::prepare($sql )->execute($args)->fetchAll(); |
|
454 | + $rows = Database::prepare($sql)->execute($args)->fetchAll(); |
|
455 | 455 | |
456 | 456 | $data = ''; |
457 | 457 |
@@ -165,7 +165,7 @@ |
||
165 | 165 | public function getFileAction(Request $request): Response { |
166 | 166 | $file = $request->get('file', ''); |
167 | 167 | |
168 | - if (!preg_match('/^(\d+)-([imnrs])-(\d+)$/', $file, $match)) { |
|
168 | + if (!preg_match('/^(\d+)-([imnrs])-(\d+)$/', $file, $match)) { |
|
169 | 169 | throw new NotFoundHttpException('Bad sitemap file'); |
170 | 170 | } |
171 | 171 |
@@ -165,7 +165,7 @@ |
||
165 | 165 | public function getFileAction(Request $request): Response { |
166 | 166 | $file = $request->get('file', ''); |
167 | 167 | |
168 | - if (!preg_match('/^(\d+)-([imnrs])-(\d+)$/', $file, $match)) { |
|
168 | + if (!preg_match('/^(\d+)-([imnrs])-(\d+)$/', $file, $match)) { |
|
169 | 169 | throw new NotFoundHttpException('Bad sitemap file'); |
170 | 170 | } |
171 | 171 |
@@ -223,7 +223,7 @@ |
||
223 | 223 | /** @var Tree $tree */ |
224 | 224 | $tree = $request->attributes->get('tree'); |
225 | 225 | |
226 | - $xref = $request->get('xref', ''); |
|
226 | + $xref = $request->get('xref', ''); |
|
227 | 227 | |
228 | 228 | $individual = Individual::getInstance($xref, $tree); |
229 | 229 |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | $this->checkModuleIsActive($tree, 'descendancy_chart'); |
103 | 103 | |
104 | - $xref = $request->get('xref'); |
|
104 | + $xref = $request->get('xref'); |
|
105 | 105 | $individual = Individual::getInstance($xref, $tree); |
106 | 106 | |
107 | 107 | $this->checkIndividualAccess($individual); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | $descendants = $this->descendants($individual, $generations, []); |
120 | 120 | |
121 | - switch($chart_style) { |
|
121 | + switch ($chart_style) { |
|
122 | 122 | case self::CHART_STYLE_LIST: |
123 | 123 | default: |
124 | 124 | return $this->descendantsList($individual, $generations); |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | * @return Response |
316 | 316 | */ |
317 | 317 | private function descendantsFamilies(Tree $tree, array $descendants): Response { |
318 | - $families = []; |
|
318 | + $families = []; |
|
319 | 319 | foreach ($descendants as $individual) { |
320 | 320 | foreach ($individual->getChildFamilies() as $family) { |
321 | 321 | $families[$family->getXref()] = $family; |
@@ -14,7 +14,7 @@ |
||
14 | 14 | $count_media = Database::prepare( |
15 | 15 | "SELECT l_to, COUNT(*) FROM `##media` JOIN `##link` ON l_from = m_id AND l_file = m_file AND l_type = 'NOTE' AND l_file = :tree_id GROUP BY l_to" |
16 | 16 | )->execute(['tree_id' => $tree->getTreeId()])->fetchAssoc(); |
17 | -$count_sources = Database::prepare( |
|
17 | +$count_sources = Database::prepare( |
|
18 | 18 | "SELECT l_to, COUNT(*) FROM `##sources` JOIN `##link` ON l_from = s_id AND l_file = s_file AND l_type = 'NOTE' AND l_file = :tree_id GROUP BY l_to" |
19 | 19 | )->execute(['tree_id' => $tree->getTreeId()])->fetchAssoc(); |
20 | 20 | ?> |
@@ -24,7 +24,7 @@ |
||
24 | 24 | } |
25 | 25 | $chart_url .= '|1:||' . rawurlencode(I18N::percentage($vmax / $count)); // y axis |
26 | 26 | $chart_url .= '|2:||'; |
27 | -$step = $vmax; |
|
27 | +$step = $vmax; |
|
28 | 28 | for ($d = $vmax; $d > 0; $d--) { |
29 | 29 | if ($vmax < ($d * 10 + 1) && ($vmax % $d) == 0) { |
30 | 30 | $step = $d; |
@@ -43,14 +43,14 @@ |
||
43 | 43 | <?php endforeach ?> |
44 | 44 | </td> |
45 | 45 | |
46 | - <td class="text-center" data-sort="<?= array_sum(array_map(function(array $x) { return count($x); }, $surns)) ?>"> |
|
46 | + <td class="text-center" data-sort="<?= array_sum(array_map(function (array $x) { return count($x); }, $surns)) ?>"> |
|
47 | 47 | <?php foreach ($surns as $indis): ?> |
48 | 48 | <?= I18N::number(count($indis)) ?> |
49 | 49 | <br> |
50 | 50 | <?php endforeach ?> |
51 | 51 | |
52 | 52 | <?php if (count($surns) > 1): ?> |
53 | - <?= I18N::number(array_sum(array_map(function(array $x) { return count($x); }, $surns))) ?> |
|
53 | + <?= I18N::number(array_sum(array_map(function (array $x) { return count($x); }, $surns))) ?> |
|
54 | 54 | <?php endif ?> |
55 | 55 | </td> |
56 | 56 | </tr> |
@@ -12,7 +12,8 @@ discard block |
||
12 | 12 | <th> |
13 | 13 | <?php if ($route == 'family-list'):?> |
14 | 14 | <?= I18N::translate('Spouses') ?> |
15 | - <?php else: ?> |
|
15 | + <?php else { |
|
16 | + : ?> |
|
16 | 17 | <?= I18N::translate('Individuals') ?> |
17 | 18 | <?php endif ?> |
18 | 19 | </th> |
@@ -43,7 +44,9 @@ discard block |
||
43 | 44 | <?php endforeach ?> |
44 | 45 | </td> |
45 | 46 | |
46 | - <td class="text-center" data-sort="<?= array_sum(array_map(function(array $x) { return count($x); }, $surns)) ?>"> |
|
47 | + <td class="text-center" data-sort="<?= array_sum(array_map(function(array $x) { return count($x); |
|
48 | +} |
|
49 | +}, $surns)) ?>"> |
|
47 | 50 | <?php foreach ($surns as $indis): ?> |
48 | 51 | <?= I18N::number(count($indis)) ?> |
49 | 52 | <br> |
@@ -319,8 +319,11 @@ |
||
319 | 319 | <?php if (!isset($unique_indis[$individual->getXref()]) && $age_at_death >= 0 && $age_at_death <= $max_age): ?> |
320 | 320 | <?php $deat_by_age[$age_at_death] .= $individual->getSex(); ?> |
321 | 321 | <?php endif ?> |
322 | - <?php else: ?> |
|
323 | - <?php $age_at_death = ''; ?> |
|
322 | + <?php else { |
|
323 | + : ?> |
|
324 | + <?php $age_at_death = ''; |
|
325 | +} |
|
326 | +?> |
|
324 | 327 | <?php $age_at_death_sort = PHP_INT_MAX; ?> |
325 | 328 | <?php endif ?> |
326 | 329 | <td class="center" data-sort="<?= e($age_at_death_sort) ?>"> |
@@ -8,13 +8,13 @@ |
||
8 | 8 | |
9 | 9 | <?php if ($source->isPendingDeletion()): ?> |
10 | 10 | <?php if (Auth::isModerator($source->getTree())): ?> |
11 | - <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This source has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($source->getXref()) . '\', \'' . e($source->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($source->getXref()) . '\', \'' . e($source->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
|
11 | + <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This source has been deleted. You should review the deletion and then %1$s or %2$s it.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($source->getXref()) . '\', \'' . e($source->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . e($source->getXref()) . '\', \'' . e($source->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
|
12 | 12 | <?php elseif (Auth::isEditor($source->getTree())): ?> |
13 | 13 | <?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This source has been deleted. The deletion will need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
14 | 14 | <?php endif ?> |
15 | 15 | <?php elseif ($source->isPendingAddition()): ?> |
16 | 16 | <?php if (Auth::isModerator($source->getTree())): ?> |
17 | - <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate( 'This source has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($source->getXref()) . '\', \'' . e($source->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $source->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>' ) . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
|
17 | + <?= view('alerts/warning-dissmissible', ['alert' => /* I18N: %1$s is “accept”, %2$s is “reject”. These are links. */ I18N::translate('This source has been edited. You should review the changes and then %1$s or %2$s them.', '<a href="#" class="alert-link" onclick="accept_changes(\'' . e($source->getXref()) . '\', \'' . e($source->getTree()->getName()) . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" class="alert-link" onclick="reject_changes(\'' . $source->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
|
18 | 18 | <?php elseif (Auth::isEditor($source->getTree())): ?> |
19 | 19 | <?= view('alerts/warning-dissmissible', ['alert' => I18N::translate('This source has been edited. The changes need to be reviewed by a moderator.') . ' ' . FunctionsPrint::helpLink('pending_changes')]) ?> |
20 | 20 | <?php endif ?> |