Passed
Pull Request — main (#4945)
by
unknown
15:00
created
app/Module/IndividualListModule.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -290,7 +290,8 @@  discard block
 block discarded – undo
290 290
                     <li class="wt-initials-list-item d-flex">
291 291
                         <?php if ($count > 0) : ?>
292 292
                             <a href="<?= e($this->listUrl($tree, ['alpha' => $letter, 'show_marnm' => $show_marnm, 'tree' => $tree->name()])) ?>" class="wt-initial px-1<?= $letter === $alpha ? ' active' : '' ?> '" title="<?= I18N::number($count) ?>"><?= $this->displaySurnameInitial((string) $letter) ?></a>
293
-                        <?php else : ?>
293
+                        <?php else {
294
+    : ?>
294 295
                             <span class="wt-initial px-1 text-muted"><?= $this->displaySurnameInitial((string) $letter) ?></span>
295 296
 
296 297
                         <?php endif ?>
@@ -345,6 +346,7 @@  discard block
 block discarded – undo
345 346
                 switch ($alpha) {
346 347
                     case '@':
347 348
                         $filter = static fn(string $x): bool => $x === Individual::NOMEN_NESCIO;
349
+}
348 350
                         break;
349 351
                     case ',':
350 352
                         $filter = static fn(string $x): bool => $x === '';
Please login to merge, or discard this patch.
app/Report/ReportHtmlText.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -98,8 +98,9 @@
 block discarded – undo
98 98
     public function getHeight($renderer): float
99 99
     {
100 100
         $txt2 = $this->text;
101
-        if (substr($txt2, -1) == "\n")
102
-            $txt2 = substr($txt2, 0, -1);
101
+        if (substr($txt2, -1) == "\n") {
102
+                    $txt2 = substr($txt2, 0, -1);
103
+        }
103 104
         $ct = substr_count($txt2, "\n");
104 105
         if ($ct > 0) {
105 106
             $ct += 1;
Please login to merge, or discard this patch.
app/Report/ReportParserGenerate.php 1 patch
Braces   +140 added lines, -91 removed lines patch added patch discarded remove patch
@@ -1037,7 +1037,8 @@  discard block
 block discarded – undo
1037 1037
             } else if ( $nameselect == 'combined' ) {
1038 1038
                 $tmp = $record->getAllNames();
1039 1039
                 $name = $tmp[count($tmp)-1]['full'];
1040
-                if ($ix1 = strpos($name,'<span class="starredname">')) {   // '«' and '»' mark text for underlining
1040
+                if ($ix1 = strpos($name,'<span class="starredname">')) {
1041
+// '«' and '»' mark text for underlining
1041 1042
                     $name = substr_replace($name, '«', $ix1, 26);
1042 1043
                     $ix1 = strpos($name,'</span>',$ix1);
1043 1044
                     $name = substr_replace($name, '»', $ix1, 7);
@@ -1051,8 +1052,9 @@  discard block
 block discarded – undo
1051 1052
                 $name = $record->fullName();
1052 1053
                 $name = strip_tags($name);
1053 1054
                 if (!empty($attrs['truncate'])) {
1054
-                    if ( (int) $attrs['truncate'] > 0 )
1055
-                    $name = Str::limit($name, (int) $attrs['truncate'], I18N::translate('…'));
1055
+                    if ( (int) $attrs['truncate'] > 0 ) {
1056
+                                        $name = Str::limit($name, (int) $attrs['truncate'], I18N::translate('…'));
1057
+                    }
1056 1058
                 } else {
1057 1059
                     $addname = (string) $record->alternateName();
1058 1060
                     $addname = strip_tags($addname);
@@ -1115,8 +1117,12 @@  discard block
 block discarded – undo
1115 1117
                         $tmp   = new Date($value);
1116 1118
             $dfmt = "%j %F %Y";
1117 1119
             if (!empty($attrs['truncate'])) {
1118
-                if ( $attrs['truncate'] === "d" ) $dfmt = "%j %M %Y";
1119
-                if ( $attrs['truncate'] === "Y" ) $dfmt = "%Y";
1120
+                if ( $attrs['truncate'] === "d" ) {
1121
+                    $dfmt = "%j %M %Y";
1122
+                }
1123
+                if ( $attrs['truncate'] === "Y" ) {
1124
+                    $dfmt = "%Y";
1125
+                }
1120 1126
             }
1121 1127
                         $value = strip_tags($tmp->display(null, $dfmt));
1122 1128
                         break;
@@ -1153,8 +1159,9 @@  discard block
 block discarded – undo
1153 1159
 
1154 1160
                 if (!empty($attrs['truncate'])) {
1155 1161
                     $value = strip_tags($value);
1156
-            if ( (int) $attrs['truncate'] > 0 )
1157
-              $value = Str::limit($value, (int) $attrs['truncate'], I18N::translate('…'));
1162
+            if ( (int) $attrs['truncate'] > 0 ) {
1163
+                          $value = Str::limit($value, (int) $attrs['truncate'], I18N::translate('…'));
1164
+            }
1158 1165
                 }
1159 1166
                 $this->current_element->addText($value);
1160 1167
             }
@@ -1386,7 +1393,9 @@  discard block
 block discarded – undo
1386 1393
         if (isset($attrs['cut'])) {
1387 1394
         $cut = (int) $attrs['cut'];
1388 1395
         $var = $cut >0 ? substr($var, 0, $cut) : substr($var, $cut);
1389
-        if ($cut == 0) $var = "";
1396
+        if ($cut == 0) {
1397
+            $var = "";
1398
+        }
1390 1399
         }
1391 1400
         if (isset($attrs['lcfirst'])) {
1392 1401
         $var = lcfirst($var);
@@ -1453,36 +1462,43 @@  discard block
 block discarded – undo
1453 1462
                 $famid = $match[1];
1454 1463
                 $fam = Registry::familyFactory()->make($match[1], $this->tree);
1455 1464
                 $dt = $this->getGedcomValue("MARR:DATE", 0, $fam->gedcom());
1456
-                if ($dt == "")
1457
-                    $dt = $this->getGedcomValue("ENGA:DATE", 0, $fam->gedcom());
1458
-                if ($dt == "" && $this->getGedcomValue("EVEN:TYPE", 0, $fam->gedcom()) == "Sambo")
1459
-                    $dt = $this->getGedcomValue("EVEN:DATE", 0, $fam->gedcom());
1465
+                if ($dt == "") {
1466
+                                    $dt = $this->getGedcomValue("ENGA:DATE", 0, $fam->gedcom());
1467
+                }
1468
+                if ($dt == "" && $this->getGedcomValue("EVEN:TYPE", 0, $fam->gedcom()) == "Sambo") {
1469
+                                    $dt = $this->getGedcomValue("EVEN:DATE", 0, $fam->gedcom());
1470
+                }
1460 1471
                 $date = new Date($dt);
1461 1472
                 $jd = $date->julianDay();
1462 1473
                 $jdarr[$key] = $jd;
1463 1474
                 // Divorce
1464 1475
                 $dt = $this->getGedcomValue("DIV:DATE", 0, $fam->gedcom());
1465
-                if ($dt != "")
1466
-                    $this->repeats[] = "1 DIV\n2 DATE " . $dt . "\n";
1476
+                if ($dt != "") {
1477
+                                    $this->repeats[] = "1 DIV\n2 DATE " . $dt . "\n";
1478
+                }
1467 1479
                 // Separation // Doesn't work!! getGedComValue only reports the first event!! I.e. no match here
1468 1480
                 if ($this->getGedcomValue("EVEN:TYPE", 0, $fam->gedcom()) == "Separation") {
1469 1481
                     $dt = $this->getGedcomValue("EVEN:DATE", 0, $fam->gedcom());
1470
-                    if ($dt != "")
1471
-                        $this->repeats[] = "1 EVEN\n2 TYPE Separation\n2 DATE " . $dt . "\n";
1482
+                    if ($dt != "") {
1483
+                                            $this->repeats[] = "1 EVEN\n2 TYPE Separation\n2 DATE " . $dt . "\n";
1484
+                    }
1472 1485
                 }
1473 1486
                 // death of husband / wife
1474 1487
                 $husb = $fam->husband();
1475 1488
                 $wife = $fam->wife();
1476
-                if ($this->getGedcomValue("SEX", 0, $this->gedrec) == "M")
1477
-                    $spouse = $wife;
1478
-                else
1479
-                    $spouse = $husb;
1480
-                if ($spouse)
1481
-                    $dt = $this->getGedcomValue("DEAT:DATE", 0, $spouse->gedcom());
1482
-                else
1483
-                    $dt = "";
1484
-                if ($dt != "")
1485
-                    $this->repeats[] = "1 _SP_DEAT\n2 DATE " . $dt . "\n2 _O_FAM " . $famid . "\n";
1489
+                if ($this->getGedcomValue("SEX", 0, $this->gedrec) == "M") {
1490
+                                    $spouse = $wife;
1491
+                } else {
1492
+                                    $spouse = $husb;
1493
+                }
1494
+                if ($spouse) {
1495
+                                    $dt = $this->getGedcomValue("DEAT:DATE", 0, $spouse->gedcom());
1496
+                } else {
1497
+                                    $dt = "";
1498
+                }
1499
+                if ($dt != "") {
1500
+                                    $this->repeats[] = "1 _SP_DEAT\n2 DATE " . $dt . "\n2 _O_FAM " . $famid . "\n";
1501
+                }
1486 1502
             }
1487 1503
         }
1488 1504
         // Find the dates for the facts that are found
@@ -1497,11 +1513,13 @@  discard block
 block discarded – undo
1497 1513
         // Resort facts in chronological order, if possible
1498 1514
         $m = count($this->repeats) - 1;
1499 1515
         $prevd = 0;
1500
-        for ($i = 0; $i <= $m; $i ++) { // keep undated events after previous dated event
1501
-            if ($jdarr[$i] === 0)
1502
-                $jdarr[$i] = $prevd;
1503
-            else
1504
-                $prevd = $jdarr[$i];
1516
+        for ($i = 0; $i <= $m; $i ++) {
1517
+// keep undated events after previous dated event
1518
+            if ($jdarr[$i] === 0) {
1519
+                            $jdarr[$i] = $prevd;
1520
+            } else {
1521
+                            $prevd = $jdarr[$i];
1522
+            }
1505 1523
         }
1506 1524
 
1507 1525
         while ($m > 1) {
@@ -1523,11 +1541,14 @@  discard block
 block discarded – undo
1523 1541
         // Remove spouse deaths that are too late: after new marriage or own death
1524 1542
         $currfam = "";
1525 1543
         for ($i = 0; $i <= count($this->repeats) - 1; $i ++) {
1526
-            if (preg_match('/[1234] FAMS @(.+)@/', $this->repeats[$i], $match))
1527
-                $currfam = $match[1];
1544
+            if (preg_match('/[1234] FAMS @(.+)@/', $this->repeats[$i], $match)) {
1545
+                            $currfam = $match[1];
1546
+            }
1528 1547
             if (preg_match('/_SP_DEAT.*\n2 DATE (.*)\n.*_O_FAM (.+)\n/', $this->repeats[$i], $match)) {
1529
-                if ($currfam != $match[2] || $i == count($this->repeats) - 1)
1530
-                    $this->repeats[$i] = "1 _XXX\n"; // ignore fact
1548
+                if ($currfam != $match[2] || $i == count($this->repeats) - 1) {
1549
+                                    $this->repeats[$i] = "1 _XXX\n";
1550
+                }
1551
+                // ignore fact
1531 1552
             }
1532 1553
         }
1533 1554
     }
@@ -1648,8 +1669,11 @@  discard block
 block discarded – undo
1648 1669
 
1649 1670
         $name  = $attrs['name'];
1650 1671
         $value = $attrs['value'];
1651
-        if (isset($attrs['dumpvar'])) $dumpvar = $attrs['dumpvar'];
1652
-        else $dumpvar = "";
1672
+        if (isset($attrs['dumpvar'])) {
1673
+            $dumpvar = $attrs['dumpvar'];
1674
+        } else {
1675
+            $dumpvar = "";
1676
+        }
1653 1677
         $match = [];
1654 1678
         // Current GEDCOM record strings
1655 1679
         if ($value === '@ID') {
@@ -1661,17 +1685,19 @@  discard block
 block discarded – undo
1661 1685
         } elseif ($value === '@desc') {
1662 1686
             $value = $this->desc;
1663 1687
         } elseif ($value === '@format') {
1664
-            if (isset($_GET["format"]))
1665
-                $value = $_GET["format"];
1666
-            else
1667
-                $value = "";
1688
+            if (isset($_GET["format"])) {
1689
+                            $value = $_GET["format"];
1690
+            } else {
1691
+                            $value = "";
1692
+            }
1668 1693
         } elseif ($value === '@generation') {
1669 1694
             $value = (string) $this->generation;
1670 1695
         } elseif ($value === '@relation') {
1671
-            if (isset($this->mfrelation[$this->xref()]))
1672
-                $value = (string) $this->mfrelation[$this->xref()];
1673
-            else
1674
-                $value = "";
1696
+            if (isset($this->mfrelation[$this->xref()])) {
1697
+                            $value = (string) $this->mfrelation[$this->xref()];
1698
+            } else {
1699
+                            $value = "";
1700
+            }
1675 1701
         } elseif (preg_match("/@(\w+)/", $value, $match)) {
1676 1702
             $gmatch = [];
1677 1703
             if (preg_match("/\d $match[1] (.+)/", $this->gedrec, $gmatch)) {
@@ -1680,27 +1706,30 @@  discard block
 block discarded – undo
1680 1706
         } elseif (preg_match("/@\\$(\w+)/", $value, $match)) {
1681 1707
             if ($match[1] == "dump" && $this->vars['dval']['id'] > 0) {
1682 1708
                 // if ($this->vars[ 'dval' ]['id'] == 1001)
1683
-                if ($dumpvar == "gedrec")
1684
-                    error_log("\n---- setvar start  " . date("Y-m-d H:i:s") . " RPG " . __LINE__ . "  " . $name . "  gedcom=\n" . $this->gedrec . "\n", 3, "my-errors.log");
1685
-                else if ($dumpvar != "")
1686
-                    error_log("var: " . $dumpvar . " = " . $this->vars[$dumpvar]['id'] . "\n", 3, "my-errors.log");
1687
-                else {
1688
-                    if (isset($this->vars['dval']['id']))
1689
-                        $nnn = $this->vars['dval']['id'];
1690
-                    else
1691
-                        $nnn = 0;
1709
+                if ($dumpvar == "gedrec") {
1710
+                                    error_log("\n---- setvar start  " . date("Y-m-d H:i:s") . " RPG " . __LINE__ . "  " . $name . "  gedcom=\n" . $this->gedrec . "\n", 3, "my-errors.log");
1711
+                } else if ($dumpvar != "") {
1712
+                                    error_log("var: " . $dumpvar . " = " . $this->vars[$dumpvar]['id'] . "\n", 3, "my-errors.log");
1713
+                } else {
1714
+                    if (isset($this->vars['dval']['id'])) {
1715
+                                            $nnn = $this->vars['dval']['id'];
1716
+                    } else {
1717
+                                            $nnn = 0;
1718
+                    }
1692 1719
                     error_log("\n---- setvar start  " . date("Y-m-d H:i:s") . " RPG " . __LINE__ . "  " . $name . "  -----\n", 3, "my-errors.log");
1693 1720
                     foreach ($this->vars as $key => $val) {
1694
-                        if ($nnn -- < 0)
1695
-                            error_log($key . "='" . $val['id'] . "'\n", 3, "my-errors.log");
1721
+                        if ($nnn -- < 0) {
1722
+                                                    error_log($key . "='" . $val['id'] . "'\n", 3, "my-errors.log");
1723
+                        }
1696 1724
                     }
1697 1725
                 }
1698 1726
             }
1699 1727
             $value = $this->vars[$match[1]]['id'];
1700
-            if (isset($this->vars[$value]['id']))
1701
-                $value = '$' . $this->vars[$match[1]]['id'];
1702
-            else
1703
-                $value = "0";
1728
+            if (isset($this->vars[$value]['id'])) {
1729
+                            $value = '$' . $this->vars[$match[1]]['id'];
1730
+            } else {
1731
+                            $value = "0";
1732
+            }
1704 1733
         }
1705 1734
         if ( isset($attrs['trim']) ) {
1706 1735
           $value = str_replace($attrs['trim'], '', $value);
@@ -1722,7 +1751,8 @@  discard block
 block discarded – undo
1722 1751
         } elseif (preg_match('/^I18N::translateContext\(\'(.+)\', *\'(.+)\'\)$/', $value, $match)) {
1723 1752
             $value = I18N::translateContext($match[1], $match[2]);
1724 1753
         }
1725
-        if (isset($attrs['lcfirst'])) { // set 1st char to lower case
1754
+        if (isset($attrs['lcfirst'])) {
1755
+// set 1st char to lower case
1726 1756
             $value = lcfirst($value);
1727 1757
         }
1728 1758
 
@@ -2711,10 +2741,13 @@  discard block
 block discarded – undo
2711 2741
                 $genCounter = 1;
2712 2742
                 while (count($newarray) < count($this->list)) {
2713 2743
                     foreach ($this->list as $key => $value) {
2714
-                        if ($value->generation < 0)
2715
-                            $this->generation = -$value->generation; // indication of husband or wife
2716
-                        else
2717
-                            $this->generation = $value->generation;
2744
+                        if ($value->generation < 0) {
2745
+                                                    $this->generation = -$value->generation;
2746
+                        }
2747
+                        // indication of husband or wife
2748
+                        else {
2749
+                                                    $this->generation = $value->generation;
2750
+                        }
2718 2751
                         if ($this->generation == $genCounter) {
2719 2752
                             $newarray[$key] = (object) ['generation' => $this->generation];
2720 2753
                         }
@@ -2890,19 +2923,23 @@  discard block
 block discarded – undo
2890 2923
         static $dupl = 1;
2891 2924
         $sx = $person->sex();
2892 2925
         $rl="x"; // unknown
2893
-        if ($sx == "M")
2894
-            $rl = "s"; // son
2895
-        if ($sx == "F")
2896
-            $rl = "d"; // daughter
2897
-        if ($focusperson)
2898
-            $this->mfrelation[$pid] = "";
2926
+        if ($sx == "M") {
2927
+                    $rl = "s";
2928
+        }
2929
+        // son
2930
+        if ($sx == "F") {
2931
+                    $rl = "d";
2932
+        }
2933
+        // daughter
2934
+        if ($focusperson) {
2935
+                    $this->mfrelation[$pid] = "";
2936
+        }
2899 2937
         $nam = $person->getAllNames()[0]['fullNN'];
2900 2938
 
2901 2939
         $newpid = $pid;
2902 2940
         if (!isset($list[$pid])) {
2903 2941
                 $list[$pid] = $person;
2904
-            }
2905
-        else if (!$focusperson) {
2942
+            } else if (!$focusperson) {
2906 2943
             $newpid = "D_".$dupl."_".$pid;
2907 2944
             $list[$newpid] = $person;
2908 2945
         }
@@ -2937,17 +2974,21 @@  discard block
 block discarded – undo
2937 2974
             if ($husband && $wife) {
2938 2975
                 if ($husband->xref() == $person->xref()) {
2939 2976
                     $this->mfrelation[$wife->xref()] = $this->mfrelation[$person->xref()] . "x";
2940
-                    if ($wife->canShow())
2941
-                        $list[$wife->xref()] = $wife;
2942
-                    if (! isset($wife->generation))
2943
-                        $wife->generation = $person->generation;
2977
+                    if ($wife->canShow()) {
2978
+                                            $list[$wife->xref()] = $wife;
2979
+                    }
2980
+                    if (! isset($wife->generation)) {
2981
+                                            $wife->generation = $person->generation;
2982
+                    }
2944 2983
                     $nam = $wife->getAllNames()[0]['fullNN'];
2945 2984
                 } else {
2946 2985
                     $this->mfrelation[$husband->xref()] = $this->mfrelation[$person->xref()] . "x";
2947
-                    if ($husband->canShow())
2948
-                        $list[$husband->xref()] = $husband;
2949
-                    if (! isset($husband->generation))
2950
-                        $husband->generation = $person->generation;
2986
+                    if ($husband->canShow()) {
2987
+                                            $list[$husband->xref()] = $husband;
2988
+                    }
2989
+                    if (! isset($husband->generation)) {
2990
+                                            $husband->generation = $person->generation;
2991
+                    }
2951 2992
                     $nam = $husband->getAllNames()[0]['fullNN'];
2952 2993
                 }
2953 2994
             }
@@ -2958,10 +2999,14 @@  discard block
 block discarded – undo
2958 2999
 
2959 3000
                     $sx = $child->sex();
2960 3001
                     $rl="x"; // unknown
2961
-                    if ($sx == "M")
2962
-                        $rl = "s"; // son
2963
-                    if ($sx == "F")
2964
-                        $rl = "d"; // daughter
3002
+                    if ($sx == "M") {
3003
+                                            $rl = "s";
3004
+                    }
3005
+                    // son
3006
+                    if ($sx == "F") {
3007
+                                            $rl = "d";
3008
+                    }
3009
+                    // daughter
2965 3010
                     $rl = $this->mfrelation[$person->xref()] . $rl;
2966 3011
                     $this->mfrelation[$child->xref()] = $rl;
2967 3012
                     if (isset($list[$pid]->generation)) {
@@ -2973,8 +3018,10 @@  discard block
 block discarded – undo
2973 3018
             }
2974 3019
             if ($generations == -1 || $list[$pid]->generation < $generations) {
2975 3020
                 foreach ($children as $child) {
2976
-                    if ($child->canShow())
2977
-                        $this->addDescendancy($list, $child->xref(), $parents, $generations); // recurse on the childs family
3021
+                    if ($child->canShow()) {
3022
+                                            $this->addDescendancy($list, $child->xref(), $parents, $generations);
3023
+                    }
3024
+                    // recurse on the childs family
2978 3025
                 }
2979 3026
             }
2980 3027
         }
@@ -3000,8 +3047,9 @@  discard block
 block discarded – undo
3000 3047
             if (str_starts_with($id, 'empty')) {
3001 3048
                 continue; // id can be something like “empty7”
3002 3049
             }
3003
-            if (! isset($this->mfrelation[$id]))
3004
-                $this->mfrelation[$id] = "";
3050
+            if (! isset($this->mfrelation[$id])) {
3051
+                            $this->mfrelation[$id] = "";
3052
+            }
3005 3053
             $person = Registry::individualFactory()->make($id, $this->tree);
3006 3054
             foreach ($person->childFamilies() as $family) {
3007 3055
                 $husband = $family->husband();
@@ -3028,8 +3076,9 @@  discard block
 block discarded – undo
3028 3076
                     foreach ($family->children() as $child) {
3029 3077
                     $list[$child->xref()] = $child;
3030 3078
                     $child->generation = $list[$id]->generation ?? 1;
3031
-                    if ( $child->xref() != $person->xref() )
3032
-                        $this->mfrelation[$child->xref()] = $this->mfrelation[$id] . "x";
3079
+                    if ( $child->xref() != $person->xref() ) {
3080
+                                            $this->mfrelation[$child->xref()] = $this->mfrelation[$id] . "x";
3081
+                    }
3033 3082
                    }
3034 3083
                 }
3035 3084
             }
Please login to merge, or discard this patch.
app/Report/ReportHtmlTextbox.php 1 patch
Braces   +26 added lines, -16 removed lines patch added patch discarded remove patch
@@ -137,11 +137,16 @@  discard block
 block discarded – undo
137 137
         // If current position (top)
138 138
         $align_Y = false;
139 139
         $topstr = "";
140
-        if ($this->top < -110000) // pos='abs'
141
-            $this->top += 222000; 
142
-        if ($this->top < -10000) { // <= -100000: both pdf and html; -100000 -- -90000: only html
140
+        if ($this->top < -110000) {
141
+            // pos='abs'
142
+            $this->top += 222000;
143
+        }
144
+        if ($this->top < -10000) {
145
+// <= -100000: both pdf and html; -100000 -- -90000: only html
143 146
             $this->top += 90000;  //= ReportBaseElement::CURRENT_POSITION;
144
-            if ($this->top < -9000) $this->top += 10000; 
147
+            if ($this->top < -9000) {
148
+                $this->top += 10000;
149
+            }
145 150
             $topstr = "top:".$this->top."pt;";
146 151
             $align_Y = true;
147 152
         }
@@ -239,10 +244,11 @@  discard block
 block discarded – undo
239 244
         $renderer->addMaxY($this->top + $cH);
240 245
 
241 246
         // Start to print HTML
242
-        if (!$align_Y)
243
-            echo '<div style="position:absolute;top:', $this->top, 'pt;';
244
-        else
245
-            echo '<div style="position:relative;top:', $this->top, 'pt;';
247
+        if (!$align_Y) {
248
+                    echo '<div style="position:absolute;top:', $this->top, 'pt;';
249
+        } else {
250
+                    echo '<div style="position:relative;top:', $this->top, 'pt;';
251
+        }
246 252
             //echo '<div style="position:relative;';
247 253
         // LTR (left) or RTL (right)
248 254
         echo $renderer->alignRTL, ':', $cX, 'pt;';
@@ -258,15 +264,19 @@  discard block
 block discarded – undo
258 264
         // Border setup
259 265
         if ($this->border) {
260 266
             echo ' border:solid black 1pt;';
261
-            if (!$align_Y)
262
-                echo 'width:', $this->width - 1 - $cP * 2, 'pt;height:', $cH - 1, 'pt;';
263
-            else
264
-                echo 'width:', $this->width - 1 - $cP * 2, 'pt;height:auto;'; // height:',$this->height,'pt;'; //,$topstr;
267
+            if (!$align_Y) {
268
+                            echo 'width:', $this->width - 1 - $cP * 2, 'pt;height:', $cH - 1, 'pt;';
269
+            } else {
270
+                            echo 'width:', $this->width - 1 - $cP * 2, 'pt;height:auto;';
271
+            }
272
+            // height:',$this->height,'pt;'; //,$topstr;
265 273
         } else {
266
-            if (!$align_Y)
267
-                echo 'width:', $this->width - $cP * 2, 'pt;height:', $cH, 'pt;';
268
-            else
269
-                echo 'width:', $this->width - $cP * 2, 'pt;height:auto;'; //height:',$this->height,'pt;'; //,$topstr;
274
+            if (!$align_Y) {
275
+                            echo 'width:', $this->width - $cP * 2, 'pt;height:', $cH, 'pt;';
276
+            } else {
277
+                            echo 'width:', $this->width - $cP * 2, 'pt;height:auto;';
278
+            }
279
+            //height:',$this->height,'pt;'; //,$topstr;
270 280
         }
271 281
         echo '">';
272 282
 
Please login to merge, or discard this patch.
app/Report/ReportPdfTextBox.php 1 patch
Braces   +16 added lines, -9 removed lines patch added patch discarded remove patch
@@ -96,7 +96,9 @@  discard block
 block discarded – undo
96 96
                 if (!empty($lastelement)) {
97 97
                     if ($element instanceof ReportBaseImage) {
98 98
                         $imgH = $element->getHeight();
99
-                    } else $imgH = 0;
99
+                    } else {
100
+                        $imgH = 0;
101
+                    }
100 102
                     $cX = $renderer->tcpdf->GetX();
101 103
                     $newelements[] = $lastelement;
102 104
                     $lastelement   = [];
@@ -137,18 +139,22 @@  discard block
 block discarded – undo
137 139
         // If current position (top)
138 140
         $align_Y = false;
139 141
         $curr_P = $renderer->tcpdf->getPage();
140
-        if ($this->top < -95000) { // 90000: only html; 100000: both pdf and html
142
+        if ($this->top < -95000) {
143
+// 90000: only html; 100000: both pdf and html
141 144
             $align_Y = true;
142 145
         }
143
-        if ($this->top < -200000)   // pos="abs"
146
+        if ($this->top < -200000) {
147
+            // pos="abs"
144 148
             $this->top += 222000;
145
-        else
146
-            $this->top = ReportBaseElement::CURRENT_POSITION;
149
+        } else {
150
+                    $this->top = ReportBaseElement::CURRENT_POSITION;
151
+        }
147 152
         if ($this->top === ReportBaseElement::CURRENT_POSITION) {
148 153
             $cY = $renderer->tcpdf->GetY();
149 154
             //-- check for space after the last picture
150
-            if ($align_Y && ($cY < $lastBoxYfinal) )
151
-                $cY = $lastBoxYfinal;
155
+            if ($align_Y && ($cY < $lastBoxYfinal) ) {
156
+                            $cY = $lastBoxYfinal;
157
+            }
152 158
         } else {
153 159
             $cY = $this->top;
154 160
             $renderer->tcpdf->setY($cY);
@@ -326,8 +332,9 @@  discard block
 block discarded – undo
326 332
                 $cMT = $renderer->tcpdf->getMargins();
327 333
                 $element->render($renderer);
328 334
                 // If tcpdf has added a new page the left margin must be restored
329
-                if ($cPT != $renderer->tcpdf->getPage())
330
-                	$renderer->tcpdf->setLeftMargin($cMT['left']);
335
+                if ($cPT != $renderer->tcpdf->getPage()) {
336
+                                	$renderer->tcpdf->setLeftMargin($cMT['left']);
337
+                }
331 338
             } elseif ($element === 'footnotetexts') {
332 339
                 $renderer->footnotes();
333 340
             } elseif ($element === 'addpage') {
Please login to merge, or discard this patch.
app/Report/HtmlRenderer.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -198,7 +198,8 @@
 block discarded – undo
198 198
         //-- footer
199 199
         echo '</div>';
200 200
         //echo '<script>document.getElementById("bodydiv").style.height="', $this->maxY, 'pt";</script>';
201
-        if ($this->Y < 200) { //heuristic guess!
201
+        if ($this->Y < 200) {
202
+//heuristic guess!
202 203
             echo '<div id="bottommargin" style="position: relative; top: auto; height: ', $this->bottom_margin - $this->footer_margin, 'pt;width:', $this->noMarginWidth, 'pt;"></div>';
203 204
             echo '<div id="footerdiv" style="position: relative; top: auto; width: ', $this->noMarginWidth, 'pt;height:auto;">';
204 205
         } else {
Please login to merge, or discard this patch.