@@ -346,7 +346,7 @@ |
||
346 | 346 | '_MBON', |
347 | 347 | '_NMR', |
348 | 348 | '_SEPR', |
349 | - '_SP_DEAT', // only used internally, not exported to a gedcom file |
|
349 | + '_SP_DEAT', // only used internally, not exported to a gedcom file |
|
350 | 350 | ]; |
351 | 351 | |
352 | 352 | public const CUSTOM_INDIVIDUAL_TAGS = [ |
@@ -828,21 +828,21 @@ discard block |
||
828 | 828 | // position of box absolute or relative, and possibly top and height |
829 | 829 | if (isset($attrs['pos'])) { |
830 | 830 | $pos = $attrs['pos']; |
831 | - if (substr($pos,0,3) == 'abs') { |
|
831 | + if (substr($pos, 0, 3) == 'abs') { |
|
832 | 832 | //-- check absolute or relative position |
833 | 833 | $top += -222000; |
834 | 834 | } |
835 | - if (substr($pos,0,3) == 'rel') { |
|
835 | + if (substr($pos, 0, 3) == 'rel') { |
|
836 | 836 | //-- check absolute or relative position |
837 | 837 | $top = -100000; |
838 | 838 | } |
839 | - if (substr($pos,3,3) == '_fh') { |
|
839 | + if (substr($pos, 3, 3) == '_fh') { |
|
840 | 840 | $top = -100012; |
841 | 841 | } |
842 | - if (substr($pos,3,3) == '_f2') { |
|
842 | + if (substr($pos, 3, 3) == '_f2') { |
|
843 | 843 | $top = -100018; |
844 | 844 | } |
845 | - if (substr($pos,6,5) == '_html') { |
|
845 | + if (substr($pos, 6, 5) == '_html') { |
|
846 | 846 | $top = -90012; |
847 | 847 | } |
848 | 848 | } |
@@ -1016,11 +1016,11 @@ discard block |
||
1016 | 1016 | } |
1017 | 1017 | } |
1018 | 1018 | $nameselect = ""; |
1019 | - if ( isset($attrs['select']) ) { |
|
1019 | + if (isset($attrs['select'])) { |
|
1020 | 1020 | $nameselect = $attrs['select']; |
1021 | 1021 | } |
1022 | 1022 | $famrel = false; |
1023 | - if ( isset($attrs['fam_relation']) ) { |
|
1023 | + if (isset($attrs['fam_relation'])) { |
|
1024 | 1024 | $famrel = true; |
1025 | 1025 | } |
1026 | 1026 | if (!empty($id)) { |
@@ -1030,28 +1030,28 @@ discard block |
||
1030 | 1030 | } |
1031 | 1031 | if (!$record->canShowName()) { |
1032 | 1032 | $this->current_element->addText(I18N::translate('Private')); |
1033 | - } else if ( $nameselect == 'latest' ) { |
|
1033 | + } else if ($nameselect == 'latest') { |
|
1034 | 1034 | $tmp = $record->getAllNames(); |
1035 | - $name = strip_tags($tmp[count($tmp)-1]['full']); |
|
1035 | + $name = strip_tags($tmp[count($tmp) - 1]['full']); |
|
1036 | 1036 | $this->current_element->addText(trim($name)); |
1037 | - } else if ( $nameselect == 'combined' ) { |
|
1037 | + } else if ($nameselect == 'combined') { |
|
1038 | 1038 | $tmp = $record->getAllNames(); |
1039 | - $name = $tmp[count($tmp)-1]['full']; |
|
1040 | - if ($ix1 = strpos($name,'<span class="starredname">')) { // '«' and '»' mark text for underlining |
|
1039 | + $name = $tmp[count($tmp) - 1]['full']; |
|
1040 | + if ($ix1 = strpos($name, '<span class="starredname">')) { // '«' and '»' mark text for underlining |
|
1041 | 1041 | $name = substr_replace($name, '«', $ix1, 26); |
1042 | - $ix1 = strpos($name,'</span>',$ix1); |
|
1042 | + $ix1 = strpos($name, '</span>', $ix1); |
|
1043 | 1043 | $name = substr_replace($name, '»', $ix1, 7); |
1044 | 1044 | } |
1045 | 1045 | $addname = strip_tags((string) $tmp[0]['surn']); |
1046 | - if ( !empty($addname) && !($addname==='@N.N.') && !str_contains($name,$addname) ) { |
|
1047 | - $name .= " ".I18N::translate('b.')." ".$addname; |
|
1046 | + if (!empty($addname) && !($addname === '@N.N.') && !str_contains($name, $addname)) { |
|
1047 | + $name .= " " . I18N::translate('b.') . " " . $addname; |
|
1048 | 1048 | } |
1049 | 1049 | $this->current_element->addText(trim($name)); |
1050 | 1050 | } else { |
1051 | 1051 | $name = $record->fullName(); |
1052 | 1052 | $name = strip_tags($name); |
1053 | 1053 | if (!empty($attrs['truncate'])) { |
1054 | - if ( (int) $attrs['truncate'] > 0 ) |
|
1054 | + if ((int) $attrs['truncate'] > 0) |
|
1055 | 1055 | $name = Str::limit($name, (int) $attrs['truncate'], I18N::translate('…')); |
1056 | 1056 | } else { |
1057 | 1057 | $addname = (string) $record->alternateName(); |
@@ -1063,8 +1063,8 @@ discard block |
||
1063 | 1063 | $this->current_element->addText(trim($name)); |
1064 | 1064 | } |
1065 | 1065 | } |
1066 | - if ( $famrel && ($this->mfrelation[$record->xref()] != "") ) { |
|
1067 | - $this->current_element->addText(" (".(string) $this->mfrelation[$record->xref()].")"); |
|
1066 | + if ($famrel && ($this->mfrelation[$record->xref()] != "")) { |
|
1067 | + $this->current_element->addText(" (" . (string) $this->mfrelation[$record->xref()] . ")"); |
|
1068 | 1068 | } |
1069 | 1069 | } |
1070 | 1070 | |
@@ -1112,11 +1112,11 @@ discard block |
||
1112 | 1112 | $value = $this->getGedcomValue($tag, $level, $this->gedrec); |
1113 | 1113 | switch (end($tags)) { |
1114 | 1114 | case 'DATE': |
1115 | - $tmp = new Date($value); |
|
1115 | + $tmp = new Date($value); |
|
1116 | 1116 | $dfmt = "%j %F %Y"; |
1117 | 1117 | if (!empty($attrs['truncate'])) { |
1118 | - if ( $attrs['truncate'] === "d" ) $dfmt = "%j %M %Y"; |
|
1119 | - if ( $attrs['truncate'] === "Y" ) $dfmt = "%Y"; |
|
1118 | + if ($attrs['truncate'] === "d") $dfmt = "%j %M %Y"; |
|
1119 | + if ($attrs['truncate'] === "Y") $dfmt = "%Y"; |
|
1120 | 1120 | } |
1121 | 1121 | $value = strip_tags($tmp->display(null, $dfmt)); |
1122 | 1122 | break; |
@@ -1148,12 +1148,12 @@ discard block |
||
1148 | 1148 | |
1149 | 1149 | if (isset($attrs['lcfirst'])) { |
1150 | 1150 | $value = lcfirst($value); |
1151 | - $value = str_replace(["Å","Ä","Ö"], ["å","ä","ö"], $value); |
|
1151 | + $value = str_replace(["Å", "Ä", "Ö"], ["å", "ä", "ö"], $value); |
|
1152 | 1152 | } |
1153 | 1153 | |
1154 | 1154 | if (!empty($attrs['truncate'])) { |
1155 | 1155 | $value = strip_tags($value); |
1156 | - if ( (int) $attrs['truncate'] > 0 ) |
|
1156 | + if ((int) $attrs['truncate'] > 0) |
|
1157 | 1157 | $value = Str::limit($value, (int) $attrs['truncate'], I18N::translate('…')); |
1158 | 1158 | } |
1159 | 1159 | $this->current_element->addText($value); |
@@ -1385,7 +1385,7 @@ discard block |
||
1385 | 1385 | } |
1386 | 1386 | if (isset($attrs['cut'])) { |
1387 | 1387 | $cut = (int) $attrs['cut']; |
1388 | - $var = $cut >0 ? substr($var, 0, $cut) : substr($var, $cut); |
|
1388 | + $var = $cut > 0 ? substr($var, 0, $cut) : substr($var, $cut); |
|
1389 | 1389 | if ($cut == 0) $var = ""; |
1390 | 1390 | } |
1391 | 1391 | if (isset($attrs['lcfirst'])) { |
@@ -1497,7 +1497,7 @@ discard block |
||
1497 | 1497 | // Resort facts in chronological order, if possible |
1498 | 1498 | $m = count($this->repeats) - 1; |
1499 | 1499 | $prevd = 0; |
1500 | - for ($i = 0; $i <= $m; $i ++) { // keep undated events after previous dated event |
|
1500 | + for ($i = 0; $i <= $m; $i++) { // keep undated events after previous dated event |
|
1501 | 1501 | if ($jdarr[$i] === 0) |
1502 | 1502 | $jdarr[$i] = $prevd; |
1503 | 1503 | else |
@@ -1522,7 +1522,7 @@ discard block |
||
1522 | 1522 | |
1523 | 1523 | // Remove spouse deaths that are too late: after new marriage or own death |
1524 | 1524 | $currfam = ""; |
1525 | - for ($i = 0; $i <= count($this->repeats) - 1; $i ++) { |
|
1525 | + for ($i = 0; $i <= count($this->repeats) - 1; $i++) { |
|
1526 | 1526 | if (preg_match('/[1234] FAMS @(.+)@/', $this->repeats[$i], $match)) |
1527 | 1527 | $currfam = $match[1]; |
1528 | 1528 | if (preg_match('/_SP_DEAT.*\n2 DATE (.*)\n.*_O_FAM (.+)\n/', $this->repeats[$i], $match)) { |
@@ -1574,8 +1574,8 @@ discard block |
||
1574 | 1574 | $count = count($this->repeats); |
1575 | 1575 | $i = 0; |
1576 | 1576 | while ($i < $count) { |
1577 | - if (! isset($this->repeats[$i])) { |
|
1578 | - $i ++; |
|
1577 | + if (!isset($this->repeats[$i])) { |
|
1578 | + $i++; |
|
1579 | 1579 | continue; // this fact has been removed above, occured too late |
1580 | 1580 | } |
1581 | 1581 | $this->gedrec = $this->repeats[$i]; |
@@ -1691,7 +1691,7 @@ discard block |
||
1691 | 1691 | $nnn = 0; |
1692 | 1692 | error_log("\n---- setvar start " . date("Y-m-d H:i:s") . " RPG " . __LINE__ . " " . $name . " -----\n", 3, "my-errors.log"); |
1693 | 1693 | foreach ($this->vars as $key => $val) { |
1694 | - if ($nnn -- < 0) |
|
1694 | + if ($nnn-- < 0) |
|
1695 | 1695 | error_log($key . "='" . $val['id'] . "'\n", 3, "my-errors.log"); |
1696 | 1696 | } |
1697 | 1697 | } |
@@ -1702,7 +1702,7 @@ discard block |
||
1702 | 1702 | else |
1703 | 1703 | $value = "0"; |
1704 | 1704 | } |
1705 | - if ( isset($attrs['trim']) ) { |
|
1705 | + if (isset($attrs['trim'])) { |
|
1706 | 1706 | $value = str_replace($attrs['trim'], '', $value); |
1707 | 1707 | } |
1708 | 1708 | if (preg_match("/\\$(\w+)/", $name, $match)) { |
@@ -2889,7 +2889,7 @@ discard block |
||
2889 | 2889 | static $focusperson = true; |
2890 | 2890 | static $dupl = 1; |
2891 | 2891 | $sx = $person->sex(); |
2892 | - $rl="x"; // unknown |
|
2892 | + $rl = "x"; // unknown |
|
2893 | 2893 | if ($sx == "M") |
2894 | 2894 | $rl = "s"; // son |
2895 | 2895 | if ($sx == "F") |
@@ -2903,7 +2903,7 @@ discard block |
||
2903 | 2903 | $list[$pid] = $person; |
2904 | 2904 | } |
2905 | 2905 | else if (!$focusperson) { |
2906 | - $newpid = "D_".$dupl."_".$pid; |
|
2906 | + $newpid = "D_" . $dupl . "_" . $pid; |
|
2907 | 2907 | $list[$newpid] = $person; |
2908 | 2908 | } |
2909 | 2909 | if (!isset($list[$newpid]->generation)) { |
@@ -2939,14 +2939,14 @@ discard block |
||
2939 | 2939 | $this->mfrelation[$wife->xref()] = $this->mfrelation[$person->xref()] . "x"; |
2940 | 2940 | if ($wife->canShow()) |
2941 | 2941 | $list[$wife->xref()] = $wife; |
2942 | - if (! isset($wife->generation)) |
|
2942 | + if (!isset($wife->generation)) |
|
2943 | 2943 | $wife->generation = $person->generation; |
2944 | 2944 | $nam = $wife->getAllNames()[0]['fullNN']; |
2945 | 2945 | } else { |
2946 | 2946 | $this->mfrelation[$husband->xref()] = $this->mfrelation[$person->xref()] . "x"; |
2947 | 2947 | if ($husband->canShow()) |
2948 | 2948 | $list[$husband->xref()] = $husband; |
2949 | - if (! isset($husband->generation)) |
|
2949 | + if (!isset($husband->generation)) |
|
2950 | 2950 | $husband->generation = $person->generation; |
2951 | 2951 | $nam = $husband->getAllNames()[0]['fullNN']; |
2952 | 2952 | } |
@@ -2957,7 +2957,7 @@ discard block |
||
2957 | 2957 | if ($child) { |
2958 | 2958 | |
2959 | 2959 | $sx = $child->sex(); |
2960 | - $rl="x"; // unknown |
|
2960 | + $rl = "x"; // unknown |
|
2961 | 2961 | if ($sx == "M") |
2962 | 2962 | $rl = "s"; // son |
2963 | 2963 | if ($sx == "F") |
@@ -3000,7 +3000,7 @@ discard block |
||
3000 | 3000 | if (str_starts_with($id, 'empty')) { |
3001 | 3001 | continue; // id can be something like “empty7” |
3002 | 3002 | } |
3003 | - if (! isset($this->mfrelation[$id])) |
|
3003 | + if (!isset($this->mfrelation[$id])) |
|
3004 | 3004 | $this->mfrelation[$id] = ""; |
3005 | 3005 | $person = Registry::individualFactory()->make($id, $this->tree); |
3006 | 3006 | foreach ($person->childFamilies() as $family) { |
@@ -3028,7 +3028,7 @@ discard block |
||
3028 | 3028 | foreach ($family->children() as $child) { |
3029 | 3029 | $list[$child->xref()] = $child; |
3030 | 3030 | $child->generation = $list[$id]->generation ?? 1; |
3031 | - if ( $child->xref() != $person->xref() ) |
|
3031 | + if ($child->xref() != $person->xref()) |
|
3032 | 3032 | $this->mfrelation[$child->xref()] = $this->mfrelation[$id] . "x"; |
3033 | 3033 | } |
3034 | 3034 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $lastelement = $element; |
70 | 70 | } |
71 | 71 | } elseif ($element instanceof ReportHtmlImage) { |
72 | - $lastelement = $element; |
|
72 | + $lastelement = $element; |
|
73 | 73 | } elseif ($element instanceof ReportHtmlFootnote) { |
74 | 74 | // Check if the Footnote has been set with it’s link number |
75 | 75 | $renderer->checkFootnote($element); |
@@ -140,9 +140,9 @@ discard block |
||
140 | 140 | if ($this->top < -110000) // pos='abs' |
141 | 141 | $this->top += 222000; |
142 | 142 | if ($this->top < -10000) { // <= -100000: both pdf and html; -100000 -- -90000: only html |
143 | - $this->top += 90000; //= ReportBaseElement::CURRENT_POSITION; |
|
143 | + $this->top += 90000; //= ReportBaseElement::CURRENT_POSITION; |
|
144 | 144 | if ($this->top < -9000) $this->top += 10000; |
145 | - $topstr = "top:".$this->top."pt;"; |
|
145 | + $topstr = "top:" . $this->top . "pt;"; |
|
146 | 146 | $align_Y = true; |
147 | 147 | } |
148 | 148 | if ($this->top === ReportBaseElement::CURRENT_POSITION) { |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | if ($this->top === ReportBaseElement::CURRENT_POSITION) { |
148 | 148 | $cY = $renderer->tcpdf->GetY(); |
149 | 149 | //-- check for space after the last picture |
150 | - if ($align_Y && ($cY < $lastBoxYfinal) ) |
|
150 | + if ($align_Y && ($cY < $lastBoxYfinal)) |
|
151 | 151 | $cY = $lastBoxYfinal; |
152 | 152 | } else { |
153 | 153 | $cY = $this->top; |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | $curr_P = $renderer->tcpdf->getPage(); |
352 | 352 | // New line and some clean up |
353 | 353 | if (!$this->newline) { |
354 | - $renderer->tcpdf->setXY($cX + $cW, $cY); // $curr_Y); |
|
354 | + $renderer->tcpdf->setXY($cX + $cW, $cY); // $curr_Y); |
|
355 | 355 | $renderer->lastCellHeight = $cH; |
356 | 356 | } else { |
357 | 357 | // addMarginX() also updates X |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | $renderer->tcpdf->setY($min_Y); |
362 | 362 | } else { |
363 | 363 | // 15 is good enough, should be a more general value ($cH is too large!) |
364 | - $renderer->tcpdf->setY($curr_Y + ($cH>15?15:$cH)); |
|
364 | + $renderer->tcpdf->setY($curr_Y + ($cH > 15 ? 15 : $cH)); |
|
365 | 365 | } |
366 | 366 | $renderer->lastCellHeight = 0; |
367 | 367 | } |
@@ -202,8 +202,8 @@ |
||
202 | 202 | echo '<div id="bottommargin" style="position: relative; top: auto; height: ', $this->bottom_margin - $this->footer_margin, 'pt;width:', $this->noMarginWidth, 'pt;"></div>'; |
203 | 203 | echo '<div id="footerdiv" style="position: relative; top: auto; width: ', $this->noMarginWidth, 'pt;height:auto;">'; |
204 | 204 | } else { |
205 | - echo '<div id="bottommargin" style="position: relative; top: '.$this->Y.'pt; height: ', $this->bottom_margin - $this->footer_margin, 'pt;width:', $this->noMarginWidth, 'pt;"></div>'; |
|
206 | - echo '<div id="footerdiv" style="position: relative; top: '.$this->Y.'pt; width: ', $this->noMarginWidth, 'pt;height:auto;">'; |
|
205 | + echo '<div id="bottommargin" style="position: relative; top: ' . $this->Y . 'pt; height: ', $this->bottom_margin - $this->footer_margin, 'pt;width:', $this->noMarginWidth, 'pt;"></div>'; |
|
206 | + echo '<div id="footerdiv" style="position: relative; top: ' . $this->Y . 'pt; width: ', $this->noMarginWidth, 'pt;height:auto;">'; |
|
207 | 207 | } |
208 | 208 | $this->Y = 0; |
209 | 209 | $this->X = 0; |