diff options
Diffstat (limited to 'app/Report')
32 files changed, 225 insertions, 128 deletions
diff --git a/app/Report/ReportBase.php b/app/Report/ReportBase.php index 1bdef4ddfc..fab00d30f7 100644 --- a/app/Report/ReportBase.php +++ b/app/Report/ReportBase.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,8 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; + use Fisharebest\Webtrees\I18N; /** diff --git a/app/Report/ReportBaseCell.php b/app/Report/ReportBaseCell.php index 55cd9e3829..12a024658a 100644 --- a/app/Report/ReportBaseCell.php +++ b/app/Report/ReportBaseCell.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseCell @@ -109,6 +108,7 @@ class ReportBaseCell extends ReportBaseElement { */ public $width; + /** @var int Unknown */ public $reseth; /** diff --git a/app/Report/ReportBaseElement.php b/app/Report/ReportBaseElement.php index b0952bf9fb..617b606796 100644 --- a/app/Report/ReportBaseElement.php +++ b/app/Report/ReportBaseElement.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,15 +13,14 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseElement */ class ReportBaseElement { - /** - * @var string - */ - public $text = ""; + /** @var string Text*/ + public $text = ''; /** * Element renderer @@ -35,6 +32,8 @@ class ReportBaseElement { } /** + * Get the height. + * * @param ReportHtml|ReportTcpdf $renderer * * @return float @@ -44,6 +43,8 @@ class ReportBaseElement { } /** + * Get the width. + * * @param ReportHtml|ReportTcpdf $renderer * * @return float @@ -53,6 +54,8 @@ class ReportBaseElement { } /** + * Add text. + * * @param string $t * * @return int @@ -68,6 +71,8 @@ class ReportBaseElement { } /** + * Add an end-of-line. + * * @return int */ public function addNewline() { @@ -77,6 +82,8 @@ class ReportBaseElement { } /** + * Get the current text. + * * @return string */ public function getValue() { @@ -84,6 +91,8 @@ class ReportBaseElement { } /** + * Set the width to wrap text. + * * @param $wrapwidth * @param $cellwidth * @@ -94,13 +103,16 @@ class ReportBaseElement { } /** + * Render the footnotes. + * * @param $renderer */ public function renderFootnote($renderer) { - // To be implemented in inherited classes } /** + * Set the text. + * * @param $text */ public function setText($text) { diff --git a/app/Report/ReportBaseFootnote.php b/app/Report/ReportBaseFootnote.php index 4293d2cf7a..61736ffbec 100644 --- a/app/Report/ReportBaseFootnote.php +++ b/app/Report/ReportBaseFootnote.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseFootnote @@ -55,9 +54,12 @@ class ReportBaseFootnote extends ReportBaseElement { */ public $wrapWidthCell; + /** @var string A link */ public $addlink; /** + * Createa an element. + * * @param string $style */ public function __construct($style = "") { @@ -67,11 +69,11 @@ class ReportBaseFootnote extends ReportBaseElement { } else { $this->styleName = "footnote"; } - - return 0; } /** + * Add text. + * * @param $t * * @return int @@ -87,6 +89,8 @@ class ReportBaseFootnote extends ReportBaseElement { } /** + * Set the width to wrap text. + * * @param $wrapwidth * @param $cellwidth * @@ -104,6 +108,8 @@ class ReportBaseFootnote extends ReportBaseElement { } /** + * Set the number. + * * @param $n * * @return int @@ -116,6 +122,8 @@ class ReportBaseFootnote extends ReportBaseElement { } /** + * Add a link. + * * @param $a * * @return int diff --git a/app/Report/ReportBaseHtml.php b/app/Report/ReportBaseHtml.php index ea38e2eabc..0165aae94c 100644 --- a/app/Report/ReportBaseHtml.php +++ b/app/Report/ReportBaseHtml.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,16 +13,24 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseHtml */ class ReportBaseHtml extends ReportBaseElement { + /** @var string The XML tag. */ public $tag; + + /** @var string[] Attributes of the XML tag. */ public $attrs; + + /** @var ReportBaseElement[] A list of elements. */ public $elements = array(); /** + * Create an element. + * * @param $tag * @param $attrs */ @@ -36,6 +42,8 @@ class ReportBaseHtml extends ReportBaseElement { } /** + * Get the start tag. + * * @return string */ public function getStart() { @@ -49,6 +57,8 @@ class ReportBaseHtml extends ReportBaseElement { } /** + * Get the end tag. + * * @return string */ public function getEnd() { @@ -56,7 +66,9 @@ class ReportBaseHtml extends ReportBaseElement { } /** - * @param $element + * Add an element. + * + * @param ReportBaseElement $element */ public function addElement($element) { $this->elements[] = $element; diff --git a/app/Report/ReportBaseImage.php b/app/Report/ReportBaseImage.php index 1a94463c8d..7aa40f1517 100644 --- a/app/Report/ReportBaseImage.php +++ b/app/Report/ReportBaseImage.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseImage @@ -87,6 +86,8 @@ class ReportBaseImage extends ReportBaseElement { } /** + * Get the height. + * * @param $renderer * * @return float @@ -96,6 +97,8 @@ class ReportBaseImage extends ReportBaseElement { } /** + * Get the width. + * * @param $renderer * * @return float diff --git a/app/Report/ReportBaseLine.php b/app/Report/ReportBaseLine.php index f36bab985f..870e61b38f 100644 --- a/app/Report/ReportBaseLine.php +++ b/app/Report/ReportBaseLine.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseLine @@ -63,6 +62,8 @@ class ReportBaseLine extends ReportBaseElement { } /** + * Get the height of the line. + * * @param $renderer * * @return number @@ -72,6 +73,8 @@ class ReportBaseLine extends ReportBaseElement { } /** + * Get the width of the line. + * * @param $renderer * * @return number diff --git a/app/Report/ReportBasePageheader.php b/app/Report/ReportBasePageheader.php index 7511fd76ab..efe8bf9437 100644 --- a/app/Report/ReportBasePageheader.php +++ b/app/Report/ReportBasePageheader.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,15 +13,17 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBasePageheader */ class ReportBasePageheader extends ReportBaseElement { + /** @var ReportBaseElement[] Elements */ public $elements = array(); /** - * + * Create a page header */ public function __construct() { $this->elements = array(); @@ -32,6 +32,8 @@ class ReportBasePageheader extends ReportBaseElement { } /** + * Unknown? + * * @return int */ public function textBox() { @@ -43,7 +45,7 @@ class ReportBasePageheader extends ReportBaseElement { /** * Add element - PageHeader * - * @param $element + * @param ReportBaseElement $element */ public function addElement($element) { $this->elements[] = $element; diff --git a/app/Report/ReportBaseText.php b/app/Report/ReportBaseText.php index b28cdcef27..c90bc91d58 100644 --- a/app/Report/ReportBaseText.php +++ b/app/Report/ReportBaseText.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseText @@ -61,6 +60,8 @@ class ReportBaseText extends ReportBaseElement { } /** + * Set the width for word-wrapping. + * * @param $wrapwidth * @param $cellwidth * @@ -78,6 +79,8 @@ class ReportBaseText extends ReportBaseElement { } /** + * Get the style name. + * * @return string */ public function getStyleName() { diff --git a/app/Report/ReportBaseTextbox.php b/app/Report/ReportBaseTextbox.php index 02c16ed890..614e917463 100644 --- a/app/Report/ReportBaseTextbox.php +++ b/app/Report/ReportBaseTextbox.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportBaseTextbox @@ -59,17 +58,12 @@ class ReportBaseTextbox extends ReportBaseElement { */ public $newline; - /** - * @var bool - */ + /** @var bool Unused? */ public $pagecheck; - /** - * Whether or not a border should be printed around this box. 0 = no border, 1 = border. Default is 0 - * - * @var bool - */ + /** @var bool Whether to print a border */ public $border; + /** * Style of rendering * diff --git a/app/Report/ReportHtml.php b/app/Report/ReportHtml.php index aa5ad15eb3..47ab83efcf 100644 --- a/app/Report/ReportHtml.php +++ b/app/Report/ReportHtml.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,8 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; + use Fisharebest\Webtrees\Controller\SimpleController; use Fisharebest\Webtrees\Functions\FunctionsRtl; use Fisharebest\Webtrees\I18N; @@ -163,6 +163,8 @@ class ReportHtml extends ReportBase { } /** + * Add an element. + * * @param $element */ public function addElement($element) { @@ -176,7 +178,7 @@ class ReportHtml extends ReportBase { } /** - * + * Generate the page header */ public function runPageHeader() { foreach ($this->pageHeaderElements as $element) { @@ -191,7 +193,7 @@ class ReportHtml extends ReportBase { } /** - * + * Generate footnotes */ public function footnotes() { $this->currentStyle = ""; @@ -203,7 +205,7 @@ class ReportHtml extends ReportBase { } /** - * + * Run the report. */ public function run() { $controller = new SimpleController; @@ -313,6 +315,8 @@ class ReportHtml extends ReportBase { } /** + * Create a text box. + * * @param $width * @param $height * @param $border @@ -333,6 +337,8 @@ class ReportHtml extends ReportBase { } /** + * Create a text element. + * * @param $style * @param $color * @@ -343,6 +349,8 @@ class ReportHtml extends ReportBase { } /** + * Create a footnote. + * * @param string $style * * @return ReportHtmlFootnote @@ -352,6 +360,8 @@ class ReportHtml extends ReportBase { } /** + * Create a page header. + * * @return ReportHtmlPageheader */ public function createPageHeader() { @@ -359,6 +369,8 @@ class ReportHtml extends ReportBase { } /** + * Create an image. + * * @param $file * @param $x * @param $y @@ -374,6 +386,8 @@ class ReportHtml extends ReportBase { } /** + * Create an image. + * * @param Media $mediaobject * @param $x * @param $y @@ -389,6 +403,8 @@ class ReportHtml extends ReportBase { } /** + * Create a line. + * * @param $x1 * @param $y1 * @param $x2 @@ -401,6 +417,7 @@ class ReportHtml extends ReportBase { } /** + * Create an HTML element. * @param $tag * @param $attrs * @@ -417,10 +434,6 @@ class ReportHtml extends ReportBase { $this->headerElements = array(); } - /**************************** - * Local HTML Report functions - ****************************/ - /** * Update the Page Number and set a new Y if max Y is larger - ReportHtml */ @@ -450,6 +463,8 @@ class ReportHtml extends ReportBase { } /** + * Add a page header. + * * @param $element * * @return int @@ -512,6 +527,8 @@ class ReportHtml extends ReportBase { } /** + * Get the current style. + * * @return string */ public function getCurrentStyle() { @@ -519,6 +536,8 @@ class ReportHtml extends ReportBase { } /** + * Get the current style height. + * * @return int */ public function getCurrentStyleHeight() { @@ -531,6 +550,8 @@ class ReportHtml extends ReportBase { } /** + * Get the current footnotes height. + * * @param $cellWidth * * @return int @@ -554,6 +575,8 @@ class ReportHtml extends ReportBase { } /** + * Get the page height. + * * @return float */ public function getPageHeight() { @@ -561,6 +584,8 @@ class ReportHtml extends ReportBase { } /** + * Get the width of a string. + * * @param $text * * @return int @@ -613,6 +638,8 @@ class ReportHtml extends ReportBase { } /** + * Set the current style. + * * @param $s */ public function setCurrentStyle($s) { diff --git a/app/Report/ReportHtmlCell.php b/app/Report/ReportHtmlCell.php index d2c5f7b308..ef42206041 100644 --- a/app/Report/ReportHtmlCell.php +++ b/app/Report/ReportHtmlCell.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportHtmlCell diff --git a/app/Report/ReportHtmlFootnote.php b/app/Report/ReportHtmlFootnote.php index 6e960ec969..324a045739 100644 --- a/app/Report/ReportHtmlFootnote.php +++ b/app/Report/ReportHtmlFootnote.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * class ReportHtmlFootnote diff --git a/app/Report/ReportHtmlHtml.php b/app/Report/ReportHtmlHtml.php index 9fb6e86169..c04b50bdb4 100644 --- a/app/Report/ReportHtmlHtml.php +++ b/app/Report/ReportHtmlHtml.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,12 +13,15 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportHtmlHtml */ class ReportHtmlHtml extends ReportBaseHtml { /** + * Render the elements. + * * @param ReportHtml $renderer * @param bool $sub * @param bool $inat diff --git a/app/Report/ReportHtmlImage.php b/app/Report/ReportHtmlImage.php index 146b594f57..aa8012d9a5 100644 --- a/app/Report/ReportHtmlImage.php +++ b/app/Report/ReportHtmlImage.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportHtmlImage diff --git a/app/Report/ReportHtmlLine.php b/app/Report/ReportHtmlLine.php index 588e92e2aa..62a2b949f4 100644 --- a/app/Report/ReportHtmlLine.php +++ b/app/Report/ReportHtmlLine.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportHtmlLine diff --git a/app/Report/ReportHtmlPageheader.php b/app/Report/ReportHtmlPageheader.php index 8d773e532a..996649c137 100644 --- a/app/Report/ReportHtmlPageheader.php +++ b/app/Report/ReportHtmlPageheader.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,12 +13,15 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportHtmlPageheader */ class ReportHtmlPageheader extends ReportBasePageheader { /** + * Render elements. + * * @param ReportHtml $renderer */ public function render($renderer) { diff --git a/app/Report/ReportHtmlText.php b/app/Report/ReportHtmlText.php index 68e11567dd..fada92ece4 100644 --- a/app/Report/ReportHtmlText.php +++ b/app/Report/ReportHtmlText.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,12 +13,15 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportHtmlText */ class ReportHtmlText extends ReportBaseText { /** + * Render the elements. + * * @param ReportHtml $renderer * @param int $curx * @param bool $attrib Is is called from a different element? diff --git a/app/Report/ReportHtmlTextbox.php b/app/Report/ReportHtmlTextbox.php index 82db40e6d6..2ce893dfc0 100644 --- a/app/Report/ReportHtmlTextbox.php +++ b/app/Report/ReportHtmlTextbox.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,12 +13,15 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportHtmlTextbox */ class ReportHtmlTextbox extends ReportBaseTextbox { /** + * Render the elements. + * * @param ReportHtml $renderer */ public function render($renderer) { diff --git a/app/Report/ReportParserBase.php b/app/Report/ReportParserBase.php index 5a40396d58..09682701b0 100644 --- a/app/Report/ReportParserBase.php +++ b/app/Report/ReportParserBase.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportParserBase @@ -31,8 +30,9 @@ class ReportParserBase { * * @param string $report The XML filename * @param ReportBase $report_root + * @param string[][] $vars */ - public function __construct($report, ReportBase $report_root = null) { + public function __construct($report, ReportBase $report_root = null, $vars = array()) { $this->xml_parser = xml_parser_create(); xml_parser_set_option($this->xml_parser, XML_OPTION_CASE_FOLDING, false); xml_set_element_handler($this->xml_parser, array($this, 'startElement'), array($this, 'endElement')); diff --git a/app/Report/ReportParserGenerate.php b/app/Report/ReportParserGenerate.php index 58448a930e..a8dcfc3cec 100644 --- a/app/Report/ReportParserGenerate.php +++ b/app/Report/ReportParserGenerate.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,8 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Database; use Fisharebest\Webtrees\Date; @@ -43,13 +43,13 @@ class ReportParserGenerate extends ReportParserBase { /** @var bool[] Push-down stack of $print_data */ private $print_data_stack = array(); - /** @var int */ + /** @var int Are we processing GEDCOM data */ private $process_gedcoms = 0; - /** @var int */ + /** @var int Are we processing conditionals */ private $process_ifs = 0; - /** @var int */ + /** @var int Are we processing repeats*/ private $process_repeats = 0; /** @var int Quantity of data to repeat during loops */ @@ -112,7 +112,13 @@ class ReportParserGenerate extends ReportParserBase { /** @var string[][] Variables defined in the report at run-time */ private $vars; - /** {@inheritDoc} */ + /** + * Create a parser for a report + * + * @param string $report The XML filename + * @param ReportBase $report_root + * @param string[][] $vars + */ public function __construct($report, ReportBase $report_root = null, array $vars = array()) { $this->report_root = $report_root; $this->wt_report = $report_root; @@ -122,7 +128,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - *XML start element handler + * XML start element handler * * This function is called whenever a starting element is reached * The element handler will be called if found, otherwise it must be HTML @@ -188,7 +194,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML <style> start element handler + * XML <style> * * @param array $attrs an array of key value pairs for the attributes */ @@ -225,7 +231,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML <Doc> start element handler + * XML <Doc> * * Sets up the basics of the document proparties * @@ -318,14 +324,14 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML </Doc> end element handler + * XML </Doc> */ private function docEndHandler() { $this->wt_report->run(); } /** - * XML <Header> start element handler + * XML <Header> */ private function headerStartHandler() { // Clear the Header before any new elements are added @@ -334,7 +340,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML <PageHeader> start element handler + * XML <PageHeader> */ private function pageHeaderStartHandler() { array_push($this->print_data_stack, $this->print_data); @@ -344,7 +350,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML <pageHeaderEndHandler> end element handler + * XML <pageHeaderEndHandler> */ private function pageHeaderEndHandler() { $this->print_data = array_pop($this->print_data_stack); @@ -354,21 +360,21 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML <bodyStartHandler> start element handler + * XML <bodyStartHandler> */ private function bodyStartHandler() { $this->wt_report->setProcessing("B"); } /** - * XML <footerStartHandler> start element handler + * XML <footerStartHandler> */ private function footerStartHandler() { $this->wt_report->setProcessing("F"); } /** - * XML <Cell> start element handler + * XML <Cell> * * @param array $attrs an array of key value pairs for the attributes */ @@ -524,7 +530,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML </Cell> end element handler + * XML </Cell> */ private function cellEndHandler() { $this->print_data = array_pop($this->print_data_stack); @@ -630,7 +636,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML <textBoxStartHandler> start element handler + * XML <textBoxStartHandler> * * @param array $attrs an array of key value pairs for the attributes */ @@ -755,7 +761,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML <textBoxEndHandler> end element handler + * XML <textBoxEndHandler> */ private function textBoxEndHandler() { $this->print_data = array_pop($this->print_data_stack); @@ -765,6 +771,8 @@ class ReportParserGenerate extends ReportParserBase { } /** + * XLM <Text>. + * * @param array $attrs an array of key value pairs for the attributes */ private function textStartHandler($attrs) { @@ -787,7 +795,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * + * XML </Text> */ private function textEndHandler() { $this->print_data = array_pop($this->print_data_stack); @@ -795,7 +803,8 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML <GetPersonName> start element handler + * XML <GetPersonName/> + * * Get the name * 1. id is empty - current GEDCOM record * 2. id is set with a record id @@ -881,7 +890,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML <GedcomValue> start element handler + * XML <GedcomValue/> * * @param array $attrs an array of key value pairs for the attributes */ @@ -948,7 +957,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML <RepeatTag> start element handler + * XML <RepeatTag> * * @param array $attrs an array of key value pairs for the attributes */ @@ -1012,7 +1021,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML </ RepeatTag> end element handler + * XML </ RepeatTag> */ private function repeatTagEndHandler() { global $report; @@ -1130,6 +1139,8 @@ class ReportParserGenerate extends ReportParserBase { } /** + * XML <Facts> + * * @param array $attrs an array of key value pairs for the attributes */ private function factsStartHandler($attrs) { @@ -1178,7 +1189,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML </ Facts> end element handler + * XML </Facts> */ private function factsEndHandler() { global $report; @@ -1530,6 +1541,8 @@ class ReportParserGenerate extends ReportParserBase { } /** + * XML <HighlightedImage/> + * * @param array $attrs an array of key value pairs for the attributes */ private function highlightedImageStartHandler($attrs) { @@ -1629,6 +1642,8 @@ class ReportParserGenerate extends ReportParserBase { } /** + * XML <Image/> + * * @param array $attrs an array of key value pairs for the attributes */ private function imageStartHandler($attrs) { @@ -1799,7 +1814,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML <List> start element handler + * XML <List> * * @param array $attrs an array of key value pairs for the attributes */ @@ -1839,7 +1854,7 @@ class ReportParserGenerate extends ReportParserBase { " GROUP BY xref" . " )" )->execute(array( - 'tree_id' => $WT_TREE->getTreeId() + 'tree_id' => $WT_TREE->getTreeId(), ))->fetchAll(); $this->list = array(); foreach ($rows as $row) { @@ -1860,7 +1875,7 @@ class ReportParserGenerate extends ReportParserBase { $sql_join .= " JOIN `##dates` AS {$attr} ON ({$attr}.d_file=i_file AND {$attr}.d_gid=i_id)"; $sql_where .= " AND {$attr}.d_fact = :{$attr}fact'"; $sql_params[$attr . 'fact'] = $match[1]; - $date = new Date($match[3]); + $date = new Date($match[3]); if ($match[2] == "LTE") { $sql_where .= " AND {$attr}.d_julianday2 <= :{$attr}date"; $sql_params[$attr . 'date'] = $date->maximumJulianDay(); @@ -1935,7 +1950,7 @@ class ReportParserGenerate extends ReportParserBase { if (preg_match('/^(\w+):DATE (LTE|GTE) (.+)$/', $value, $match)) { $sql_where .= " AND {$attr}.d_fact = :{$attr}fact'"; $sql_params[$attr . 'fact'] = $match[1]; - $date = new Date($match[3]); + $date = new Date($match[3]); if ($match[2] == "LTE") { $sql_where .= " AND {$attr}.d_julianday2 <= :{$attr}date"; $sql_params[$attr . 'date'] = $date->maximumJulianDay(); @@ -2177,7 +2192,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML <List> end element handler + * XML <List> */ private function listEndHandler() { global $report; @@ -2267,6 +2282,8 @@ class ReportParserGenerate extends ReportParserBase { } /** + * XML <Relatives> + * * @param array $attrs an array of key value pairs for the attributes */ private function relativesStartHandler($attrs) { @@ -2406,7 +2423,7 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML </ Relatives> end element handler + * XML </ Relatives> */ private function relativesEndHandler() { global $report, $WT_TREE; @@ -2498,8 +2515,10 @@ class ReportParserGenerate extends ReportParserBase { } /** - * @param array $attrs an array of key value pairs for the attributes - * @param string $tag HTML tag name + * XML <html> + * + * @param string $tag HTML tag name + * @param array[] $attrs an array of key value pairs for the attributes */ private function htmlStartHandler($tag, $attrs) { if ($tag === "tempdoc") { @@ -2514,6 +2533,8 @@ class ReportParserGenerate extends ReportParserBase { } /** + * XML </html> + * * @param string $tag */ private function htmlEndHandler($tag) { @@ -2560,20 +2581,22 @@ class ReportParserGenerate extends ReportParserBase { } /** - * XML </titleEndHandler> end element handler + * XML </titleEndHandler> */ private function titleEndHandler() { $this->report_root->addTitle($this->text); } /** - * XML </descriptionEndHandler> end element handler + * XML </descriptionEndHandler> */ private function descriptionEndHandler() { $this->report_root->addDescription($this->text); } /** + * Create a list of all descendants. + * * @param string[] $list * @param string $pid * @param bool $parents @@ -2633,6 +2656,8 @@ class ReportParserGenerate extends ReportParserBase { } /** + * Create a list of all ancestors. + * * @param string[] $list * @param string $pid * @param bool $children diff --git a/app/Report/ReportParserSetup.php b/app/Report/ReportParserSetup.php index e9180d3433..9168ce3bf4 100644 --- a/app/Report/ReportParserSetup.php +++ b/app/Report/ReportParserSetup.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,8 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Date; use Fisharebest\Webtrees\I18N; diff --git a/app/Report/ReportPdf.php b/app/Report/ReportPdf.php index 68671d030d..0ca82b98be 100644 --- a/app/Report/ReportPdf.php +++ b/app/Report/ReportPdf.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,8 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; + use Fisharebest\Webtrees\Auth; use Fisharebest\Webtrees\Media; @@ -122,7 +122,7 @@ class ReportPdf extends ReportBase { } /** - * + * Run the report. */ public function run() { $this->pdf->body(); @@ -277,6 +277,8 @@ class ReportPdf extends ReportBase { } /** + * Create an HTML element. + * * @param $tag * @param $attrs * diff --git a/app/Report/ReportPdfCell.php b/app/Report/ReportPdfCell.php index b25d5972ba..d645231f0f 100644 --- a/app/Report/ReportPdfCell.php +++ b/app/Report/ReportPdfCell.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,8 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; + use Fisharebest\Webtrees\Functions\FunctionsRtl; /** diff --git a/app/Report/ReportPdfFootnote.php b/app/Report/ReportPdfFootnote.php index b8ccfc698c..113fd4e061 100644 --- a/app/Report/ReportPdfFootnote.php +++ b/app/Report/ReportPdfFootnote.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportPdfFootnote diff --git a/app/Report/ReportPdfHtml.php b/app/Report/ReportPdfHtml.php index 1ff238d90e..84e233fbec 100644 --- a/app/Report/ReportPdfHtml.php +++ b/app/Report/ReportPdfHtml.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,12 +13,15 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportPdfHtml */ class ReportPdfHtml extends ReportBaseHtml { /** + * Render the output. + * * @param $renderer * @param bool $sub * diff --git a/app/Report/ReportPdfImage.php b/app/Report/ReportPdfImage.php index dd589fc065..c4102b1328 100644 --- a/app/Report/ReportPdfImage.php +++ b/app/Report/ReportPdfImage.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportPdfImage @@ -106,6 +105,8 @@ class ReportPdfImage extends ReportBaseImage { } /** + * Get the image width. + * * @param $pdf * * @return float diff --git a/app/Report/ReportPdfLine.php b/app/Report/ReportPdfLine.php index e8f9b203d1..fb2dc082ea 100644 --- a/app/Report/ReportPdfLine.php +++ b/app/Report/ReportPdfLine.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportPdfLine diff --git a/app/Report/ReportPdfPageheader.php b/app/Report/ReportPdfPageheader.php index 998c2d5136..10821b26c7 100644 --- a/app/Report/ReportPdfPageheader.php +++ b/app/Report/ReportPdfPageheader.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * class ReportPdfPageheader diff --git a/app/Report/ReportPdfText.php b/app/Report/ReportPdfText.php index f129532a5c..53c7649472 100644 --- a/app/Report/ReportPdfText.php +++ b/app/Report/ReportPdfText.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,8 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; + use Fisharebest\Webtrees\Functions\FunctionsRtl; /** diff --git a/app/Report/ReportPdfTextbox.php b/app/Report/ReportPdfTextbox.php index 6ce1ac85cb..67e98c0fbf 100644 --- a/app/Report/ReportPdfTextbox.php +++ b/app/Report/ReportPdfTextbox.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; /** * Class ReportPdfTextbox diff --git a/app/Report/ReportTcpdf.php b/app/Report/ReportTcpdf.php index 5d69d0ab35..e92caa9858 100644 --- a/app/Report/ReportTcpdf.php +++ b/app/Report/ReportTcpdf.php @@ -1,6 +1,4 @@ <?php -namespace Fisharebest\Webtrees\Report; - /** * webtrees: online genealogy * Copyright (C) 2015 webtrees development team @@ -15,6 +13,7 @@ namespace Fisharebest\Webtrees\Report; * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +namespace Fisharebest\Webtrees\Report; use TCPDF; @@ -51,6 +50,7 @@ class ReportTcpdf extends TCPDF { /** @var int The last pictures page number */ public $lastpicpage = 0; + /** @var ReportBase The current report. */ public $wt_report; /** @@ -178,6 +178,8 @@ class ReportTcpdf extends TCPDF { } /** + * Remove the header. + * * @param $index */ public function removeHeader($index) { @@ -185,6 +187,8 @@ class ReportTcpdf extends TCPDF { } /** + * Remove the page header. + * * @param $index */ public function removePageHeader($index) { @@ -192,6 +196,8 @@ class ReportTcpdf extends TCPDF { } /** + * Remove the body. + * * @param $index */ public function removeBody($index) { @@ -199,6 +205,8 @@ class ReportTcpdf extends TCPDF { } /** + * Remove the footer. + * * @param $index */ public function removeFooter($index) { @@ -222,6 +230,8 @@ class ReportTcpdf extends TCPDF { } /** + * Set the report. + * * @param $r */ public function setReport($r) { @@ -300,6 +310,8 @@ class ReportTcpdf extends TCPDF { } /** + * Get the height of the footnote. + * * @return int */ public function getFootnotesHeight() { @@ -365,10 +377,6 @@ class ReportTcpdf extends TCPDF { $this->AddPage(); } - /******************************************* - * TCPDF protected functions - *******************************************/ - /** * Add a page if needed -PDF * |
