summaryrefslogtreecommitdiff
path: root/library/WT/Report
diff options
context:
space:
mode:
Diffstat (limited to 'library/WT/Report')
-rw-r--r--library/WT/Report/Base.php138
-rw-r--r--library/WT/Report/HTML.php4
-rw-r--r--library/WT/Report/PDF.php4
3 files changed, 72 insertions, 74 deletions
diff --git a/library/WT/Report/Base.php b/library/WT/Report/Base.php
index ac0787ac9d..b083122dd9 100644
--- a/library/WT/Report/Base.php
+++ b/library/WT/Report/Base.php
@@ -4,13 +4,11 @@
// used by the SAX parser to generate reports from the XML report file.
//
// webtrees: Web based Family History software
-// Copyright (C) 2013 webtrees development team.
+// Copyright (C) 2014 webtrees development team.
//
// Derived from PhpGedView
// Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
//
-// Modifications Copyright (c) 2010 Greg Roach
-//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
@@ -23,7 +21,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
if (!defined('WT_WEBTREES')) {
header('HTTP/1.0 403 Forbidden');
@@ -31,19 +29,19 @@ if (!defined('WT_WEBTREES')) {
}
/**
- * Enable HTML code to pass for testing
- * false = use the old style, HTML disabled
- * true = use the new style, HTML enabled
- */
+* Enable HTML code to pass for testing
+* false = use the old style, HTML disabled
+* true = use the new style, HTML enabled
+*/
define("WT_RNEW", false);
/**
- * Main Report Class
- *
- * Document wide functions and variable defaults that will be inherited of the report modules
- * @package webtrees
- * @subpackage Reports
- */
+* Main Report Class
+*
+* Document wide functions and variable defaults that will be inherited of the report modules
+* @package webtrees
+* @subpackage Reports
+*/
class WT_Report_Base {
/**
* Left Margin (expressed in points) Default: 17.99 mm, 0.7083 inch
@@ -406,11 +404,11 @@ class WT_Report_Base {
}
/**
- * Main WT Report Element class that all other page elements are extended from
- *
- * @package webtrees
- * @subpackage Reports
- */
+* Main WT Report Element class that all other page elements are extended from
+*
+* @package webtrees
+* @subpackage Reports
+*/
class Element {
/**
* @var string
@@ -541,7 +539,7 @@ class Html extends Element {
}
/**
- * Cell element class
+* Cell element class
*
* @package webtrees
* @subpackage Reports
@@ -694,7 +692,7 @@ class Cell extends Element {
}
/**
- * TextBox element class
+* TextBox element class
*
* @package webtrees
* @subpackage Reports
@@ -839,7 +837,7 @@ class TextBox extends Element {
}
/**
- * Text element class
+* Text element class
*
* @package webtrees
* @subpackage Reports
@@ -905,7 +903,7 @@ class Text extends Element {
}
/**
- * Footnote element class
+* Footnote element class
*
* @package webtrees
* @subpackage Reports
@@ -1002,7 +1000,7 @@ class Footnote extends Element {
}
/**
- * PageHeader element class
+* PageHeader element class
*
* @package webtrees
* @subpackage Reports
@@ -1040,7 +1038,7 @@ class PageHeader extends Element {
}
/**
- * Image element class
+* Image element class
*
* @package webtrees
* @subpackage Reports
@@ -1123,7 +1121,7 @@ class Image extends Element {
}
/**
- * Line element class
+* Line element class
*
* @package webtrees
* @subpackage Reports
@@ -1184,16 +1182,16 @@ class Line extends Element {
}
/**
- *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
- *
- * @param resource $parser the resource handler for the XML parser
- * @param string $name the name of the XML element parsed
- * @param array $attrs an array of key value pairs for the attributes
- * @see endElement()
- */
+*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
+*
+* @param resource $parser the resource handler for the XML parser
+* @param string $name the name of the XML element parsed
+* @param array $attrs an array of key value pairs for the attributes
+* @see endElement()
+*/
function startElement($parser, $name, $attrs) {
global $elementHandler, $processIfs, $processGedcoms, $processRepeats, $vars;
global $processFootnote;
@@ -1222,15 +1220,15 @@ function startElement($parser, $name, $attrs) {
}
/**
- * XML end element handler
- *
- * This function is called whenever an ending element is reached
- * The element handler will be called if found, otherwise it must be HTML
- *
- * @param resource $parser the resource handler for the XML parser
- * @param string $name the name of the XML element parsed
- * @see startElement()
- */
+* XML end element handler
+*
+* This function is called whenever an ending element is reached
+* The element handler will be called if found, otherwise it must be HTML
+*
+* @param resource $parser the resource handler for the XML parser
+* @param string $name the name of the XML element parsed
+* @see startElement()
+*/
function endElement($parser, $name) {
global $elementHandler, $processIfs, $processGedcoms, $processRepeats;
global $processFootnote;
@@ -1247,14 +1245,14 @@ function endElement($parser, $name) {
}
/**
- * XML character data handler
- *
- * This function is called whenever raw character data is reached
- * just print it to the screen
- * @param resource $parser the resource handler for the XML parser
- * @param string $data the name of the XML element parsed
- * @todo check this
- */
+* XML character data handler
+*
+* This function is called whenever raw character data is reached
+* just print it to the screen
+* @param resource $parser the resource handler for the XML parser
+* @param string $data the name of the XML element parsed
+* @todo check this
+*/
function characterData($parser, $data) {
global $printData, $currentElement, $processGedcoms, $processIfs, $processRepeats, $reportTitle, $wt_report, $reportDescription;
@@ -1659,7 +1657,7 @@ function GedcomSHandler($attrs) {
$newgedrec = "";
if (count($tags)<2) {
$tmp=WT_GedcomRecord::getInstance($attrs['id']);
- $newgedrec=$tmp ? $tmp->getGedcom() : '';
+ $newgedrec=$tmp ? $tmp->privatizeGedcom(WT_USER_ACCESS_LEVEL) : '';
}
if (empty($newgedrec)) {
$tgedrec = $gedrec;
@@ -1670,14 +1668,14 @@ function GedcomSHandler($attrs) {
$newgedrec = $vars[$match[1]]['gedcom'];
} else {
$tmp=WT_GedcomRecord::getInstance($match[1]);
- $newgedrec=$tmp ? $tmp->getGedcom() : '';
+ $newgedrec=$tmp ? $tmp->privatizeGedcom(WT_USER_ACCESS_LEVEL) : '';
}
} else {
if (preg_match("/@(.+)/", $tag, $match)) {
$gmatch = array();
if (preg_match("/\d $match[1] @([^@]+)@/", $tgedrec, $gmatch)) {
$tmp=WT_GedcomRecord::getInstance($gmatch[1]);
- $newgedrec=$tmp ? $tmp->getGedcom() : '';
+ $newgedrec=$tmp ? $tmp->privatizeGedcom(WT_USER_ACCESS_LEVEL) : '';
$tgedrec = $newgedrec;
} else {
$newgedrec = "";
@@ -2241,7 +2239,7 @@ function varSHandler($attrs) {
$var = $vars[$var]['id'];
} else {
$tfact = $fact;
- if (($fact == "EVEN" or $fact == "FACT") and $type != " ") {
+ if (($fact == "EVEN" || $fact == "FACT") && is_string($type) && $type != " ") {
// Use :
// n TYPE This text if string
$tfact = $type;
@@ -3138,7 +3136,7 @@ function ListSHandler($attrs) {
if ($filters) {
foreach ($list as $key=>$record) {
foreach ($filters as $filter) {
- if (!preg_match("/".$filter."/i", $record->getGedcom())) {
+ if (!preg_match("/".$filter."/i", $record->privatizeGedcom(WT_USER_ACCESS_LEVEL))) {
unset($list[$key]);
break;
}
@@ -3149,7 +3147,7 @@ function ListSHandler($attrs) {
$mylist = array();
foreach ($list as $indi) {
$key=$indi->getXref();
- $grec=$indi->getGedcom();
+ $grec=$indi->privatizeGedcom(WT_USER_ACCESS_LEVEL);
$keep = true;
foreach ($filters2 as $filter) {
if ($keep) {
@@ -3301,7 +3299,7 @@ function ListEHandler() {
$list_private = 0;
foreach ($list as $record) {
if ($record->canShow()) {
- $gedrec = $record->getGedcom();
+ $gedrec = $record->privatizeGedcom(WT_USER_ACCESS_LEVEL);
//-- start the sax parser
$repeat_parser = xml_parser_create();
$parser = $repeat_parser;
@@ -3533,7 +3531,7 @@ function RelativesEHandler() {
$generation = $value->generation;
}
$tmp=WT_GedcomRecord::getInstance($key);
- $gedrec = $tmp->getGedcom();
+ $gedrec = $tmp->privatizeGedcom(WT_USER_ACCESS_LEVEL);
//-- start the sax parser
$repeat_parser = xml_parser_create();
$parser = $repeat_parser;
@@ -3674,15 +3672,15 @@ function DescriptionEHandler() {
}
/**
- * get gedcom tag value
- *
- * returns the value of a gedcom tag from the given gedcom record
- * @param string $tag The tag to find, use : to delineate subtags
- * @param int $level The gedcom line level of the first tag to find, setting level to 0 will cause it to use 1+ the level of the incoming record
- * @param string $gedrec The gedcom record to get the value from
- * @param int $truncate Should the value be truncated to a certain number of characters
- * @return string
- */
+* get gedcom tag value
+*
+* returns the value of a gedcom tag from the given gedcom record
+* @param string $tag The tag to find, use : to delineate subtags
+* @param int $level The gedcom line level of the first tag to find, setting level to 0 will cause it to use 1+ the level of the incoming record
+* @param string $gedrec The gedcom record to get the value from
+* @param int $truncate Should the value be truncated to a certain number of characters
+* @return string
+*/
function get_gedcom_value($tag, $level, $gedrec, $truncate='') {
global $GEDCOM;
$ged_id=get_id_from_gedcom($GEDCOM);
diff --git a/library/WT/Report/HTML.php b/library/WT/Report/HTML.php
index a409ce27ef..dfce1ad9b1 100644
--- a/library/WT/Report/HTML.php
+++ b/library/WT/Report/HTML.php
@@ -4,7 +4,7 @@
// used by the SAX parser to generate HTML reports from the XML report file.
//
// webtrees: Web based Family History software
-// Copyright (C) 2013 webtrees development team.
+// Copyright (C) 2014 webtrees development team.
//
// Derived from PhpGedView
// Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
@@ -21,7 +21,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
if (!defined('WT_WEBTREES')) {
header('HTTP/1.0 403 Forbidden');
diff --git a/library/WT/Report/PDF.php b/library/WT/Report/PDF.php
index 5e86101c61..e59e39365d 100644
--- a/library/WT/Report/PDF.php
+++ b/library/WT/Report/PDF.php
@@ -4,7 +4,7 @@
// used by the SAX parser to generate PDF reports from the XML report file.
//
// webtrees: Web based Family History software
-// Copyright (C) 2013 webtrees development team.
+// Copyright (C) 2014 webtrees development team.
//
// Derived from PhpGedView
// Copyright (C) 2002 to 2009 PGV Development Team. All rights reserved.
@@ -21,7 +21,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
if (!defined('WT_WEBTREES')) {
header('HTTP/1.0 403 Forbidden');