@@ -37,7 +37,7 @@ |
||
37 | 37 | if ($individual->getSex() === 'F') { |
38 | 38 | return ''; |
39 | 39 | } else { |
40 | - return (string)Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0); |
|
40 | + return (string) Date::getAge($individual->getEstimatedBirthDate(), $this->date(), 0); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function __construct(stdClass $user) |
51 | 51 | { |
52 | - $this->user_id = (int)$user->user_id; |
|
52 | + $this->user_id = (int) $user->user_id; |
|
53 | 53 | $this->user_name = $user->user_name; |
54 | 54 | $this->real_name = $user->real_name; |
55 | 55 | $this->email = $user->email; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | Database::prepare("DELETE `##block_setting` FROM `##block_setting` JOIN `##block` USING (block_id) WHERE user_id=?")->execute([$this->user_id]); |
106 | 106 | Database::prepare("DELETE FROM `##block` WHERE user_id=?")->execute([$this->user_id]); |
107 | 107 | Database::prepare("DELETE FROM `##user_gedcom_setting` WHERE user_id=?")->execute([$this->user_id]); |
108 | - Database::prepare("DELETE FROM `##gedcom_setting` WHERE setting_value=? AND setting_name IN ('CONTACT_USER_ID', 'WEBMASTER_USER_ID')")->execute([(string)$this->user_id]); |
|
108 | + Database::prepare("DELETE FROM `##gedcom_setting` WHERE setting_value=? AND setting_name IN ('CONTACT_USER_ID', 'WEBMASTER_USER_ID')")->execute([(string) $this->user_id]); |
|
109 | 109 | Database::prepare("DELETE FROM `##user_setting` WHERE user_id=?")->execute([$this->user_id]); |
110 | 110 | Database::prepare("DELETE FROM `##message` WHERE user_id=?")->execute([$this->user_id]); |
111 | 111 | Database::prepare("DELETE FROM `##user` WHERE user_id=?")->execute([$this->user_id]); |
@@ -191,7 +191,7 @@ |
||
191 | 191 | */ |
192 | 192 | public function getShortName() |
193 | 193 | { |
194 | - $SHOW_PEDIGREE_PLACES = (int)$this->tree->getPreference('SHOW_PEDIGREE_PLACES'); |
|
194 | + $SHOW_PEDIGREE_PLACES = (int) $this->tree->getPreference('SHOW_PEDIGREE_PLACES'); |
|
195 | 195 | |
196 | 196 | if ($SHOW_PEDIGREE_PLACES >= count($this->gedcom_place)) { |
197 | 197 | // A short place name - no need to abbreviate |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | if ($note->canShow()) { |
140 | 140 | $noterec = $note->getGedcom(); |
141 | 141 | $nt = preg_match("/0 @$nmatch[1]@ NOTE (.*)/", $noterec, $n1match); |
142 | - $data .= self::printNoteRecord($tree, ($nt > 0) ? $n1match[1] : '', 1, $noterec); |
|
142 | + $data .= self::printNoteRecord($tree, ($nt > 0) ? $n1match[1] : '', 1, $noterec); |
|
143 | 143 | } |
144 | 144 | } else { |
145 | 145 | $data = '<div class="fact_NOTE"><span class="label">' . I18N::translate('Note') . '</span>: <span class="field error">' . $nmatch[1] . '</span></div>'; |
@@ -385,35 +385,35 @@ discard block |
||
385 | 385 | if (preg_match_all('/\n3 (?:_HEB|ROMN) (.+)/', $placerec, $matches)) { |
386 | 386 | foreach ($matches[1] as $match) { |
387 | 387 | $wt_place = new Place($match, $tree); |
388 | - $html .= ' - ' . $wt_place->getFullName(); |
|
388 | + $html .= ' - ' . $wt_place->getFullName(); |
|
389 | 389 | } |
390 | 390 | } |
391 | 391 | $map_lati = ''; |
392 | 392 | $cts = preg_match('/\d LATI (.*)/', $placerec, $match); |
393 | 393 | if ($cts > 0) { |
394 | 394 | $map_lati = $match[1]; |
395 | - $html .= '<br><span class="label">' . I18N::translate('Latitude') . ': </span>' . $map_lati; |
|
395 | + $html .= '<br><span class="label">' . I18N::translate('Latitude') . ': </span>' . $map_lati; |
|
396 | 396 | } |
397 | 397 | $map_long = ''; |
398 | 398 | $cts = preg_match('/\d LONG (.*)/', $placerec, $match); |
399 | 399 | if ($cts > 0) { |
400 | 400 | $map_long = $match[1]; |
401 | - $html .= ' <span class="label">' . I18N::translate('Longitude') . ': </span>' . $map_long; |
|
401 | + $html .= ' <span class="label">' . I18N::translate('Longitude') . ': </span>' . $map_long; |
|
402 | 402 | } |
403 | 403 | if ($map_lati && $map_long) { |
404 | 404 | $map_lati = trim(strtr($map_lati, 'NSEW,�', ' - -. ')); // S5,6789 ==> -5.6789 |
405 | 405 | $map_long = trim(strtr($map_long, 'NSEW,�', ' - -. ')); // E3.456� ==> 3.456 |
406 | - $html .= FontAwesome::linkIcon('google-maps', I18N::translate('Google Maps™'), [ |
|
406 | + $html .= FontAwesome::linkIcon('google-maps', I18N::translate('Google Maps™'), [ |
|
407 | 407 | 'class' => 'btn btn-link', |
408 | 408 | 'url' => 'https://maps.google.com/maps?q=' . $map_lati . ',' . $map_long, |
409 | 409 | 'rel' => 'nofollow', |
410 | 410 | ]); |
411 | - $html .= FontAwesome::linkIcon('bing-maps', I18N::translate('Bing Maps™'), [ |
|
411 | + $html .= FontAwesome::linkIcon('bing-maps', I18N::translate('Bing Maps™'), [ |
|
412 | 412 | 'class' => 'btn btn-link', |
413 | 413 | 'url' => 'https://www.bing.com/maps/?lvl=15&cp=' . $map_lati . '~' . $map_long, |
414 | 414 | 'rel' => 'nofollow', |
415 | 415 | ]); |
416 | - $html .= FontAwesome::linkIcon('openstreetmap', I18N::translate('OpenStreetMap™'), [ |
|
416 | + $html .= FontAwesome::linkIcon('openstreetmap', I18N::translate('OpenStreetMap™'), [ |
|
417 | 417 | 'class' => 'btn btn-link', |
418 | 418 | 'url' => 'https://www.openstreetmap.org/#map=15/' . $map_lati . '/' . $map_long, |
419 | 419 | 'rel' => 'nofollow', |
@@ -345,10 +345,10 @@ |
||
345 | 345 | } |
346 | 346 | // print gedcom ages |
347 | 347 | foreach ([ |
348 | - I18N::translate('Age') => $fact_age, |
|
349 | - I18N::translate('Husband') => $husb_age, |
|
350 | - I18N::translate('Wife') => $wife_age, |
|
351 | - ] as $label => $age) { |
|
348 | + I18N::translate('Age') => $fact_age, |
|
349 | + I18N::translate('Husband') => $husb_age, |
|
350 | + I18N::translate('Wife') => $wife_age, |
|
351 | + ] as $label => $age) { |
|
352 | 352 | if ($age != '') { |
353 | 353 | $html .= ' <span class="label">' . $label . ':</span> <span class="age">' . FunctionsDate::getAgeAtEvent($age) . '</span>'; |
354 | 354 | } |
@@ -175,14 +175,14 @@ discard block |
||
175 | 175 | switch ($fact->getTag()) { |
176 | 176 | case '_BIRT_CHIL': |
177 | 177 | $children[$fact->getParent()->getXref()] = true; |
178 | - $label .= '<br>' . /* I18N: Abbreviation for "number %s" */ |
|
178 | + $label .= '<br>' . /* I18N: Abbreviation for "number %s" */ |
|
179 | 179 | I18N::translate('#%s', count($children)); |
180 | 180 | break; |
181 | 181 | case '_BIRT_GCHI': |
182 | 182 | case '_BIRT_GCH1': |
183 | 183 | case '_BIRT_GCH2': |
184 | 184 | $grandchildren[$fact->getParent()->getXref()] = true; |
185 | - $label .= '<br>' . /* I18N: Abbreviation for "number %s" */ |
|
185 | + $label .= '<br>' . /* I18N: Abbreviation for "number %s" */ |
|
186 | 186 | I18N::translate('#%s', count($grandchildren)); |
187 | 187 | break; |
188 | 188 | } |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | for ($j = 0; $j < $ct; $j++) { |
578 | 578 | if (strpos($match[$j][1], '@') === false) { |
579 | 579 | $source = e($match[$j][1] . preg_replace('/\n\d CONT ?/', "\n", $match[$j][2])); |
580 | - $data .= '<div class="fact_SOUR"><span class="label">' . I18N::translate('Source') . ':</span> <span class="field" dir="auto">' . Filter::formatText($source, $tree) . '</span></div>'; |
|
580 | + $data .= '<div class="fact_SOUR"><span class="label">' . I18N::translate('Source') . ':</span> <span class="field" dir="auto">' . Filter::formatText($source, $tree) . '</span></div>'; |
|
581 | 581 | } |
582 | 582 | } |
583 | 583 | // Find source for each fact |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | } |
596 | 596 | $srec = substr($factrec, $spos1, $spos2 - $spos1); |
597 | 597 | $lt = preg_match_all("/$nlevel \w+/", $srec, $matches); |
598 | - $data .= '<div class="fact_SOUR">'; |
|
598 | + $data .= '<div class="fact_SOUR">'; |
|
599 | 599 | $elementID = Uuid::uuid4()->toString(); |
600 | 600 | if ($tree->getPreference('EXPAND_SOURCES')) { |
601 | 601 | $plusminus = 'icon-minus'; |
@@ -192,23 +192,23 @@ |
||
192 | 192 | <?= $label ?> |
193 | 193 | <div class="editfacts"> |
194 | 194 | <?= FontAwesome::linkIcon('edit', I18N::translate('Edit'), [ |
195 | - 'class' => 'btn btn-link', |
|
196 | - 'href' => route('edit-fact', [ |
|
197 | - 'xref' => $parent->getXref(), |
|
198 | - 'fact_id' => $fact->getFactId(), |
|
199 | - 'ged' . $tree->getName(), |
|
200 | - ]), |
|
201 | - ]) ?> |
|
195 | + 'class' => 'btn btn-link', |
|
196 | + 'href' => route('edit-fact', [ |
|
197 | + 'xref' => $parent->getXref(), |
|
198 | + 'fact_id' => $fact->getFactId(), |
|
199 | + 'ged' . $tree->getName(), |
|
200 | + ]), |
|
201 | + ]) ?> |
|
202 | 202 | <?= FontAwesome::linkIcon('copy', I18N::translate('Copy'), [ |
203 | - 'class' => 'btn btn-link', |
|
204 | - 'href' => '#', |
|
205 | - 'onclick' => 'return copy_fact("' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");', |
|
206 | - ]) ?> |
|
203 | + 'class' => 'btn btn-link', |
|
204 | + 'href' => '#', |
|
205 | + 'onclick' => 'return copy_fact("' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");', |
|
206 | + ]) ?> |
|
207 | 207 | <?= FontAwesome::linkIcon('delete', I18N::translate('Delete'), [ |
208 | - 'class' => 'btn btn-link', |
|
209 | - 'href' => '#', |
|
210 | - 'onclick' => 'return delete_fact("' . I18N::translate('Are you sure you want to delete this fact?') . '", "' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");', |
|
211 | - ]) ?> |
|
208 | + 'class' => 'btn btn-link', |
|
209 | + 'href' => '#', |
|
210 | + 'onclick' => 'return delete_fact("' . I18N::translate('Are you sure you want to delete this fact?') . '", "' . e($tree->getName()) . '", "' . e($parent->getXref()) . '", "' . $fact->getFactId() . '");', |
|
211 | + ]) ?> |
|
212 | 212 | </div> |
213 | 213 | <?php |
214 | 214 | } else { |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | if ($islink) { |
526 | 526 | $value = trim($value, '@'); |
527 | 527 | } else { |
528 | - $value = (string)substr($tag, strlen($fact) + 3); |
|
528 | + $value = (string) substr($tag, strlen($fact) + 3); |
|
529 | 529 | } |
530 | 530 | if ($fact === 'REPO' || $fact === 'SOUR' || $fact === 'OBJE' || $fact === 'FAMC') { |
531 | 531 | $islink = true; |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | $html .= '<p class="small text-muted">' . I18N::translate('Use this image for charts and on the individual’s page.') . '</p>'; |
814 | 814 | } elseif ($fact === 'TYPE' && $level === '3') { |
815 | 815 | //-- Build the selector for the Media 'TYPE' Fact |
816 | - $html .= '<select name="text[]"><option selected value="" ></option>'; |
|
816 | + $html .= '<select name="text[]"><option selected value="" ></option>'; |
|
817 | 817 | $selectedValue = strtolower($value); |
818 | 818 | if (!array_key_exists($selectedValue, GedcomTag::getFileFormTypes())) { |
819 | 819 | $html .= '<option selected value="' . e($value) . '" >' . e($value) . '</option>'; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | // Convert the query into a SQL expression |
79 | 79 | foreach ($query as $n => $q) { |
80 | - $sql .= " AND n_full COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
80 | + $sql .= " AND n_full COLLATE :collate_" . $n . " LIKE CONCAT('%', :query_" . $n . ", '%')"; |
|
81 | 81 | $args['collate_' . $n] = I18N::collation(); |
82 | 82 | $args['query_' . $n] = Database::escapeLike($q); |
83 | 83 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $sql .= ":tree_id_" . $n; |
89 | 89 | $args['tree_id_' . $n] = $tree->getTreeId(); |
90 | 90 | } |
91 | - $sql .= ")"; |
|
91 | + $sql .= ")"; |
|
92 | 92 | $list = []; |
93 | 93 | $rows = Database::prepare($sql)->execute($args)->fetchAll(); |
94 | 94 | foreach ($rows as $row) { |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $sql .= ")"; |
165 | 165 | |
166 | 166 | if ($givn_sdx !== '') { |
167 | - $sql .= " AND ("; |
|
167 | + $sql .= " AND ("; |
|
168 | 168 | $givn_sdx = explode(':', $givn_sdx); |
169 | 169 | foreach ($givn_sdx as $n => $sdx) { |
170 | 170 | $sql .= $n ? " OR " : ""; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | } |
183 | 183 | |
184 | 184 | if ($surn_sdx !== '') { |
185 | - $sql .= " AND ("; |
|
185 | + $sql .= " AND ("; |
|
186 | 186 | $surn_sdx = explode(':', $surn_sdx); |
187 | 187 | foreach ($surn_sdx as $n => $sdx) { |
188 | 188 | $sql .= $n ? " OR " : ""; |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | } |
201 | 201 | |
202 | 202 | if ($plac_sdx !== '') { |
203 | - $sql .= " AND ("; |
|
203 | + $sql .= " AND ("; |
|
204 | 204 | $plac_sdx = explode(':', $plac_sdx); |
205 | 205 | foreach ($plac_sdx as $n => $sdx) { |
206 | 206 | $sql .= $n ? " OR " : ""; |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | { |
261 | 261 | // Use n_surn, rather than n_surname, as it is used to generate URLs for |
262 | 262 | // the indi-list, etc. |
263 | - $max = (int)$max; |
|
263 | + $max = (int) $max; |
|
264 | 264 | if ($max == 0) { |
265 | 265 | return |
266 | 266 | Database::prepare( |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | "SELECT DISTINCT f_id AS xref, f_gedcom AS gedcom, d_type, d_day, d_month, d_year, d_fact" . |
319 | 319 | " FROM `##dates` JOIN `##families` ON d_gid = f_id AND d_file = f_file" . |
320 | 320 | " WHERE d_type = :type AND d_file = :tree_id"; |
321 | - $args = [ |
|
321 | + $args = [ |
|
322 | 322 | 'type' => $anniv->format('%@'), |
323 | 323 | 'tree_id' => $tree->getTreeId(), |
324 | 324 | ]; |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | $where .= " AND d_day = :day"; |
349 | 349 | $args['day'] = $anniv->d; |
350 | 350 | } |
351 | - $where .= " AND d_mon = :month"; |
|
351 | + $where .= " AND d_mon = :month"; |
|
352 | 352 | $args['month'] = $anniv->m; |
353 | 353 | } else { |
354 | 354 | // SPECIAL CASES: |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | } elseif ($anniv->d === 29 && $anniv->daysInMonth() === 29) { |
363 | 363 | $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 2"; |
364 | 364 | } else { |
365 | - $where .= " AND d_day = :day AND d_mon = 2"; |
|
365 | + $where .= " AND d_day = :day AND d_mon = 2"; |
|
366 | 366 | $args['day'] = $anniv->d; |
367 | 367 | } |
368 | 368 | break; |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | } elseif ($anniv->d == 29 && $anniv->daysInMonth() === 29) { |
386 | 386 | $where .= " AND (d_day = 29 OR d_day > 30) AND d_mon = 3"; |
387 | 387 | } else { |
388 | - $where .= " AND d_day = :day AND d_mon = 3"; |
|
388 | + $where .= " AND d_day = :day AND d_mon = 3"; |
|
389 | 389 | $args['day'] = $anniv->d; |
390 | 390 | } |
391 | 391 | break; |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | } |
441 | 441 | } |
442 | 442 | // Only events in the past (includes dates without a year) |
443 | - $where .= " AND d_year <= :year"; |
|
443 | + $where .= " AND d_year <= :year"; |
|
444 | 444 | $args['year'] = $anniv->y; |
445 | 445 | |
446 | 446 | if ($facts) { |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | public static function isMediaUsedInOtherTree($file_name, $ged_id) |
618 | 618 | { |
619 | 619 | return |
620 | - (bool)Database::prepare( |
|
620 | + (bool) Database::prepare( |
|
621 | 621 | "SELECT COUNT(*) FROM `##media_file`" . |
622 | 622 | " WHERE multimedia_file_refn LIKE :search AND m_file <> :tree_id" |
623 | 623 | )->execute([ |
@@ -302,13 +302,13 @@ discard block |
||
302 | 302 | { |
303 | 303 | $found_facts = []; |
304 | 304 | foreach ([ |
305 | - new GregorianDate($jd), |
|
306 | - new JulianDate($jd), |
|
307 | - new FrenchDate($jd), |
|
308 | - new JewishDate($jd), |
|
309 | - new HijriDate($jd), |
|
310 | - new JalaliDate($jd), |
|
311 | - ] as $anniv) { |
|
305 | + new GregorianDate($jd), |
|
306 | + new JulianDate($jd), |
|
307 | + new FrenchDate($jd), |
|
308 | + new JewishDate($jd), |
|
309 | + new HijriDate($jd), |
|
310 | + new JalaliDate($jd), |
|
311 | + ] as $anniv) { |
|
312 | 312 | // Build a SQL where clause to match anniversaries in the appropriate calendar. |
313 | 313 | $ind_sql = |
314 | 314 | "SELECT DISTINCT i_id AS xref, i_gedcom AS gedcom, d_type, d_day, d_month, d_year, d_fact" . |
@@ -462,9 +462,9 @@ discard block |
||
462 | 462 | |
463 | 463 | // Now fetch these anniversaries |
464 | 464 | foreach ([ |
465 | - 'INDI' => $ind_sql . $where . $order_by, |
|
466 | - 'FAM' => $fam_sql . $where . $order_by, |
|
467 | - ] as $type => $sql) { |
|
465 | + 'INDI' => $ind_sql . $where . $order_by, |
|
466 | + 'FAM' => $fam_sql . $where . $order_by, |
|
467 | + ] as $type => $sql) { |
|
468 | 468 | $rows = Database::prepare($sql)->execute($args)->fetchAll(); |
469 | 469 | foreach ($rows as $row) { |
470 | 470 | if ($type === 'INDI') { |
@@ -522,9 +522,9 @@ discard block |
||
522 | 522 | $ind_sql = "SELECT d_gid AS xref, i_gedcom AS gedcom, d_type, d_day, d_month, d_year, d_fact, d_type FROM `##dates`, `##individuals` {$where} AND d_gid=i_id AND d_file=i_file ORDER BY d_julianday1"; |
523 | 523 | $fam_sql = "SELECT d_gid AS xref, f_gedcom AS gedcom, d_type, d_day, d_month, d_year, d_fact, d_type FROM `##dates`, `##families` {$where} AND d_gid=f_id AND d_file=f_file ORDER BY d_julianday1"; |
524 | 524 | foreach ([ |
525 | - 'INDI' => $ind_sql, |
|
526 | - 'FAM' => $fam_sql, |
|
527 | - ] as $type => $sql) { |
|
525 | + 'INDI' => $ind_sql, |
|
526 | + 'FAM' => $fam_sql, |
|
527 | + ] as $type => $sql) { |
|
528 | 528 | $rows = Database::prepare($sql)->fetchAll(); |
529 | 529 | foreach ($rows as $row) { |
530 | 530 | if ($type === 'INDI') { |
@@ -307,17 +307,17 @@ |
||
307 | 307 | return false; |
308 | 308 | } |
309 | 309 | |
310 | - $spouse_codes = [ |
|
310 | + $spouse_codes = [ |
|
311 | 311 | 'M' => 'hus', |
312 | 312 | 'F' => 'wif', |
313 | 313 | 'U' => 'spo', |
314 | 314 | ]; |
315 | - $parent_codes = [ |
|
315 | + $parent_codes = [ |
|
316 | 316 | 'M' => 'fat', |
317 | 317 | 'F' => 'mot', |
318 | 318 | 'U' => 'par', |
319 | 319 | ]; |
320 | - $child_codes = [ |
|
320 | + $child_codes = [ |
|
321 | 321 | 'M' => 'son', |
322 | 322 | 'F' => 'dau', |
323 | 323 | 'U' => 'chi', |
@@ -64,7 +64,7 @@ |
||
64 | 64 | break; |
65 | 65 | } |
66 | 66 | $newrec .= mb_substr($line, 0, $pos) . Gedcom::EOL; |
67 | - $line = $level . ' CONC ' . mb_substr($line, $pos); |
|
67 | + $line = $level . ' CONC ' . mb_substr($line, $pos); |
|
68 | 68 | } while (mb_strlen($line) > Gedcom::LINE_LENGTH); |
69 | 69 | } |
70 | 70 | $newrec .= $line . Gedcom::EOL; |