Hi Gerry,
I've noticed a formatting issue in Polish version of hourglass diagram. Vertical lines were shifted. After deep investigation I've found that one of language files, namely languages/countries.pl.php
has BOM mark at the top of it. This mark was added as an empty line between person boxes in the diagram causing the issue.
In the second file languages/faqlist.pl.php
the BOM mark was placed in a string (as c' character). The file with corrected this and one else typos is attached.
Next, some of the vertical lines in the chart were placed in background and therefore were not printed if user chosen not to print backgrounds. My proposition is:
line 77 of includes/controllers/hourglass_ctrl.php
:
was:
print "<td style=\"background: url('".$PGV_IMAGE_DIR."/".$PGV_IMAGES["vline"]["other"]."');\"><img src=\"".$PGV_IMAGE_DIR."/".$PGV_IMAGES["spacer"]["other"]."\" width=\"3\" alt=\"\" /></td>";
is:
print "<td><img name=\"mvertline\" src=\"".$PGV_IMAGE_DIR."/".$PGV_IMAGES["vline"]["other"]."\" width=\"3\" alt=\"\"/></td>";
btw. in 365 line of the file =
sign is missing after colspan
but it must be assisted by js code to correctly scaling the vertical lines (line 570):
`function sizeLines() {
var vlines;
vlines = document.getElementsByName("tvertline");
for(i=0; i < vlines.length; i++) {
var pid = vlines[i].id.substr(vlines[i].id.indexOf("")+1);
var hline = document.getElementById("table"+pid);
var hline2 = document.getElementById("table2_"+pid);
//var newHeight = Math.abs(hline.offsetHeight - (hline2.offsetTop + <?php //print $bhalfheight+2;1?>//));
var newHeight = Math.abs(hline.offsetHeight - (hline2.offsetTop + hline2.querySelector('td > img').offsetTop + 2)); //this line changed
vlines[i].style.height=newHeight+'px';
}
vlines = document.getElementsByName("bvertline");
for(i=0; i < vlines.length; i++) {
var pid = vlines[i].id.substr(vlines[i].id.indexOf("_")+1);
var hline = document.getElementById("table_"+pid);
var hline2 = document.getElementById("table2_"+pid);
//vlines[i].style.height=(hline.offsetTop+hline2.offsetTop + <?php //print $bhalfheight+2; ?>//)+'px';
vlines[i].style.height=(hline.offsetTop+hline2.offsetTop + hline2.querySelector('td > img').offsetTop + 2)+'px'; //this line changed
}
vlines = document.getElementsByName("mvertline"); //this part added
//alert(vlines[0].parentNode.parentNode.parentNode);
for(i=0; i < vlines.length; i++) {
//vlines[i].parentNode.style.height="50%";
vlines[i].style.height=(vlines[i].parentNode.offsetHeight)+'px';
}
vlines = document.getElementsByName("pvline");
//alert(vlines[0].parentNode.parentNode.parentNode);
for(i=0; i < vlines.length; i++) {
//vlines[i].parentNode.style.height="50%";
vlines[i].style.height=(vlines[i].parentNode.offsetHeight/2)+'px';
}`
:) T.B.
In the previous post, the function is oddly formatted. Here I attach the whole file.
The 577 line is commented out and an alternative calculation is placed in the next line (also in 587). These alternatives ensures that vertical lines touch the horizontal ones even in a case when something strange happens with formatting of personal box or between them (as in the issue with BOM mark).
T.B.
btw. could you remove svn:eol-style=native from the whole project? I have the project both in windows and in linux and continuously have "different line ends" messages.
Last edit: Tomasz Babczyński 2022-09-28
Diff:
Thank you.
The attached ZIP file contains your fixes. Please try it and let me know if it's OK to post this to the SVN repository.
Hi,
here you can find the second part of the patch I promised. The patch is simple - adding
class="noprint"
to some elements, which, in my opinion, shouldn't appear in the printouts.T.B.