Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report additions #4945

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open

Report additions #4945

wants to merge 46 commits into from

Conversation

sevtor
Copy link
Contributor

@sevtor sevtor commented Jan 23, 2024

The app/Report tool creates reports from the collected gedcom data. The current version has some limitation and shortcomings that this update addresses. A detailed description is included as a pdf file, and in short the changes are:

Report tries to place text on an exact position on a page. But many pitfalls on the way. Counting lines in a textbox is not enough, the lines may be set in different font sizes; converting lines to points in HTML uses a much too high number, which results in a lot of white space, especially for long reports (many pages). The PDF reports have problems to predict when the tool TcPdf will break a line or add a page. This applies to the files HtmlRenderer.php, ReportHtmlTextbox.php, ReportHtmlText.php, PdfRenderer.php, ReportPdfTextBox.php and ReportPdfText.php,

The file ReportParserGenerate.php is responsible for the interpretation of the xml code that defines the layout and contents of the report. A number of addition have been introduced.
(1) GetPersonName has got a new attribute, select=..., that allows the report to present the last name used or a combination of latest and surname at birth. Another attribute, fam_relation="1", will add the relation the current person to the start person of a report, e.g. mmf which means mother's mother's father.
(2) The value that is returned by GedcomValue can be a very long string. An attribute truncate=... already exists but has been two new possibilities for dates: "Y" will give only the year and "d" gives the date with the three character short for the month, "dd mmm yyyy".
(3) The calculation of the family relation that can be give with the name requires a substantial amount of code.
(4) The xml keyword Facts returns all facts and events of the current object (person, family) in the order they appear. But in a report one wants chronological order and that has been implemented. A special addition is that a temporary gedcom event is introduced in the process, _SP_DEAT, which when a spouse has died, if applicable. This is used only during calculations, not added to the Gedcom database or file. This (hidden) gedcom value must be added to the gedcom.php file. (A similar presentation is given on the main page for each person.)
(5) The keyword SetVar has been expanded with new possibilities for the attribute value=.... The value can now specify "@$xxx" which means the the value of xxx is interpreted as the name of the varible to select. Other new values are "@Format" that responds PDF or HTML depending on whichever form of report is selected. "@$dump" can give some help in debugging new or modified reports.
(6) Sometimes ancestors have married a relative. In pedigree charts these persons were given as separate persons, although with tha same name, birthdate, et c. But now such persons are detected and the second occurrance is given as "same person as ...".
(7) Some errors are corrected.

Seved Torstendahl added 4 commits January 22, 2024 22:28
The app/Report tool creates reports from the collected gedcom data. The current versio has some
limitation and shortcomings that this update addresses. A detailed description is incuded as a
pdf file, and in short the changes are:

Report tries to place text on an exact position on a page. But many pitfalls on the way. Counting lines
in a textbox is not enough, the lines may be set in different font sizes; converting lines to points
in HTML uses a much too high number, which results in a lot of white space, especially for long reports
(many pages). The PDF reports have problems to predict when the tool TcPdf will break a line or add a page.
This applies to the files HtmlRenderer.php, ReportHtmlTextbox.php, ReportHtmlText.php, PdfRenderer.php,
ReportPdfTextBox.php and ReportPdfText.php,

The file ReportParserGenerate.php is responsible for the interpretation of the xml code that defines
the layout and contents of the report. A number of addition have been introduced.
(1) GetPersonName has got a new attribute, select=..., that allows the report to present the last name
used or a combination of latest and surname at birth. Another attribute, fam_relation="1", will add
the relation the current person to the start person of a report, e.g. mmf which means mother's
mother's father.
(2) The value that is returned by GedcomValue can be a very long string. An attribute truncate=... already
exists but has been two new possibilities for dates: "Y" will give only the year and "d" gives the date
with the three character short for the month, "dd mmm yyyy".
(3) The calculation of the family relation that can be give with the name requires a substatial amount
of code.
(4) The xml keyword Facts returns all facts and events of the current object (person, family) in the
order they appear. But in a report one wants chronological order and that has been implemented. A special
addition is that a temporary gedcom event is introduced in the process, _SP_DEAT, which when a spouse
has died, if applicable. This is used only during calculations, not added to the Gedcom database or file.
This (hidden) gedcom value must be added to the gedcom.php file.
(A similar presentation is given on the main page for each person.)
(5) The keyword SetVar has been expanded with new possibilities for the attribute value=.... The value can
now specify "@$xxx" which means the the value of xxx is interpreted as the name of the varible to select.
Other new values are "@Format" that responds PDF or HTML depending on whichever form of report is selected.
"@$dump" can give some help in debugging new or modified reports.
(6) Sometimes ancestors have married a relative. In pedigree charts these persons were given as separate
persons, although with tha same name, birthdate, et c. But now such persons are detected and the second
occurrance is given as "same person as ...".
(7) Some errors are corrected.
Some of the reports supplied with webtrees relies on the current app/Report tool. The layout can be
slightly changed with the suggested new app/report. A couple of reports try to give the result as tables.
The changes here take care of that. These new  xml files work well with the old app/Report xml tool.
Not sure were to put it but this seems to be a logical place.
@sevtor
Copy link
Contributor Author

sevtor commented Jan 26, 2024

Unfortunately I used my own indentation rules and did not know how to fix it. So please make the corrections!
And please tell me how I can use the tool StyleCI in the future.

Copy link

codecov bot commented Jan 27, 2024

Codecov Report

Attention: 130 lines in your changes are missing coverage. Please review.

Comparison is base (d5c9d9c) 32.29% compared to head (42b74bb) 32.53%.
Report is 24 commits behind head on main.

Files Patch % Lines
app/Report/ReportParserGenerate.php 59.52% 119 Missing ⚠️
app/Report/ReportHtmlTextbox.php 88.23% 4 Missing ⚠️
app/Report/ReportPdfTextBox.php 85.18% 4 Missing ⚠️
app/Gedcom.php 0.00% 2 Missing ⚠️
app/Report/PdfRenderer.php 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4945      +/-   ##
============================================
+ Coverage     32.29%   32.53%   +0.24%     
- Complexity    11401    11535     +134     
============================================
  Files          1171     1172       +1     
  Lines         48056    48166     +110     
============================================
+ Hits          15521    15673     +152     
+ Misses        32535    32493      -42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sevtor
Copy link
Contributor Author

sevtor commented Jan 28, 2024

The static analysis checks that still fail relate to code that "always" has been there.

Therefore I want this pull request to be set to 'Ready for review' !

@sevtor
Copy link
Contributor Author

sevtor commented Feb 1, 2024

PR ready for review!

@sevtor
Copy link
Contributor Author

sevtor commented Feb 9, 2024

This PR solved the 'Missing data' Feature Request.
It also handles translations for custom modules, especially reports, where the title and description strings were un-translated (because the translations were included too late).

Seved Torstendahl added 5 commits February 11, 2024 16:24
The change was due to bad test environment
HerzScheisse proposed this in general but that is not good for most other languages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant