Plugin DBReport with mPDF enhancement
- Status
- Open
- Subject
- Plugin DBReport with mPDF enhancement
- Version
- 18.x
- Category
- Patch
- Feature
- Resolution status
- New
- Submitted by
- Roni Wolf
- Lastmod by
- Roni Wolf
- Rating
- Description
Hi Devs!
My setup:
Tiki: 18.0
PHP: 7.0.32
Linux: CentOS 7
mPDF: v7.0.3One feature that bothered me was the lack of repetition of the header in PLUGIN DBReport when generated in PDF (usually via PLUGIN LISTEXECUTE) in tables that were divided into more than one page.
Reading the mPDF documentation
I discovered that the header line that was wrapped around the < thead> TAG is repeated on each page that the table is split.
Repeating Table Header row on new page
If a table is split onto more than one page, the first row of the table will be repeated at the top of the new page if < thead> or < tfoot> is defined
I changed the code in /lib/wiki-plugins/wikiplugin_dbreport.php file as the snippet below:Copy to clipboard615 public function header_row_html($data) 616 { 617 $html = ''; 618 // generate a new table 619 if (isset($this->style)) { 620 $html .= '<table' . $this->style->attributes() . '>' . "\n" . '<thead>' . "\n"; 621 } else { 622 $html .= '<table>' . "\n" . '<thead>' . "\n"; 623 } 624 // write headers 625 $style_index = 0; 626 if (isset($this->headers)) { 627 $html .= $this->line_row_html($this->headers, $data, true); 628 } 629 $html .= '</thead>'; NEW return $html; 630 }
After this change, all tables generated by PLUGIN DBReport that split on more than one page in the PDF file automatically repeats the header.I believe that other PLUGINS that generate tables (like PLUGIN LIST, for example) can benefit from this functionality (thead TAG involving the header line).
I have helped in something.
Salutes from Brazil!
- Importance
- 4
- Easy to solve?
- 10 easy
- Priority
- 40
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 6921
- Created
- Wednesday 14 November, 2018 20:58:36 UTC
by Roni Wolf - LastModif
- Wednesday 14 November, 2018 20:58:36 UTC