Lines Matching refs:this

196         $this->report          = $report;
197 $this->report_root = $report_root;
198 $this->wt_report = $report_root;
199 $this->current_element = new ReportBaseElement();
200 $this->vars = $vars;
201 $this->tree = $tree;
305 … if (isset($this->vars[$match[1]]['id']) && !isset($this->vars[$match[1]]['gedcom'])) {
306 $value = $this->vars[$match[1]]['id'];
312 …if ($this->process_footnote && ($this->process_ifs === 0 || $name === 'if') && ($this->process_ged…
315 if (method_exists($this, $method)) {
316 $this->{$method}($attrs);
333this->process_footnote || $name === 'Footnote') && ($this->process_ifs === 0 || $name === 'if') &&…
336 if (method_exists($this, $method)) {
337 $this->{$method}();
352 …if ($this->print_data && $this->process_gedcoms === 0 && $this->process_ifs === 0 && $this->proces…
353 $this->current_element->addText($data);
372 'font' => $attrs['font'] ?? $this->wt_report->default_font,
373 'size' => (float) ($attrs['size'] ?? $this->wt_report->default_font_size),
377 $this->wt_report->addStyle($style);
390 $this->parser = $this->xml_parser;
394 $this->wt_report->page_width = (float) $attrs['customwidth'];
398 $this->wt_report->page_height = (float) $attrs['customheight'];
404 $this->wt_report->left_margin = 0;
406 $this->wt_report->left_margin = (float) $attrs['leftmargin'];
412 $this->wt_report->right_margin = 0;
414 $this->wt_report->right_margin = (float) $attrs['rightmargin'];
420 $this->wt_report->top_margin = 0;
422 $this->wt_report->top_margin = (float) $attrs['topmargin'];
428 $this->wt_report->bottom_margin = 0;
430 $this->wt_report->bottom_margin = (float) $attrs['bottommargin'];
436 $this->wt_report->header_margin = 0;
438 $this->wt_report->header_margin = (float) $attrs['headermargin'];
444 $this->wt_report->footer_margin = 0;
446 $this->wt_report->footer_margin = (float) $attrs['footermargin'];
453 $this->wt_report->orientation = 'landscape';
455 $this->wt_report->orientation = 'portrait';
460 $this->wt_report->page_format = strtoupper($attrs['pageSize']);
466 $this->wt_report->show_generated_by = false;
468 $this->wt_report->show_generated_by = true;
472 $this->wt_report->setup();
482 $this->wt_report->run();
493 $this->wt_report->clearHeader();
494 $this->wt_report->setProcessing('H');
504 $this->wt_report->setProcessing('B');
514 $this->wt_report->setProcessing('F');
530 if ($this->wt_report->rtl) {
536 if ($this->wt_report->rtl) {
616 $this->print_data_stack[] = $this->print_data;
617 $this->print_data = true;
619 $this->current_element = $this->report_root->createCell(
644 $this->print_data = array_pop($this->print_data_stack);
645 $this->wt_report->addElement($this->current_element);
655 $this->current_element->addText(Registry::timestampFactory()->now()->isoFormat('LLLL'));
665 $this->current_element->addText('#PAGENUM#');
675 $this->current_element->addText('{{:ptp:}}');
687 if ($this->process_gedcoms > 0) {
688 $this->process_gedcoms++;
694 $tag = str_replace('@fact', $this->fact, $tag);
698 $tmp = Registry::gedcomRecordFactory()->make($attrs['id'], $this->tree);
699 $newgedrec = $tmp ? $tmp->privatizeGedcom(Auth::accessLevel($this->tree)) : '';
702 $tgedrec = $this->gedrec;
706 if (isset($this->vars[$match[1]]['gedcom'])) {
707 $newgedrec = $this->vars[$match[1]]['gedcom'];
709 $tmp = Registry::gedcomRecordFactory()->make($match[1], $this->tree);
710 … $newgedrec = $tmp ? $tmp->privatizeGedcom(Auth::accessLevel($this->tree)) : '';
716 … $tmp = Registry::gedcomRecordFactory()->make($gmatch[1], $this->tree);
717 … $newgedrec = $tmp ? $tmp->privatizeGedcom(Auth::accessLevel($this->tree)) : '';
732 $this->gedrec_stack[] = [$this->gedrec, $this->fact, $this->desc];
733 $this->gedrec = $newgedrec;
734 if (preg_match("/(\d+) (_?[A-Z0-9]+) (.*)/", $this->gedrec, $match)) {
735 $this->fact = $match[2];
736 $this->desc = trim($match[3]);
739 $this->process_gedcoms++;
750 if ($this->process_gedcoms > 0) {
751 $this->process_gedcoms--;
753 [$this->gedrec, $this->fact, $this->desc] = array_pop($this->gedrec_stack);
865 $this->print_data_stack[] = $this->print_data;
866 $this->print_data = false;
868 $this->wt_report_stack[] = $this->wt_report;
869 $this->wt_report = $this->report_root->createTextBox(
892 $this->print_data = array_pop($this->print_data_stack);
893 $this->current_element = $this->wt_report;
897 assert($this->current_element instanceof ReportBaseElement, new LogicException());
899 $this->wt_report = array_pop($this->wt_report_stack);
900 $this->wt_report->addElement($this->current_element);
912 $this->print_data_stack[] = $this->print_data;
913 $this->print_data = true;
927 $this->current_element = $this->report_root->createText($style, $color);
937 $this->print_data = array_pop($this->print_data_stack);
938 $this->wt_report->addElement($this->current_element);
956 if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
961 if (isset($this->vars[$match[1]]['id'])) {
962 $id = $this->vars[$match[1]]['id'];
967 if (preg_match("/\d $match[1] @([^@]+)@/", $this->gedrec, $gmatch)) {
976 $record = Registry::gedcomRecordFactory()->make($id, $this->tree);
981 $this->current_element->addText(I18N::translate('Private'));
994 $this->current_element->addText(trim($name));
1010 if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
1023 $value = $this->desc;
1025 $this->current_element->addText($value);
1028 $this->current_element->addText($id);
1030 $tag = str_replace('@fact', $this->fact, $tag);
1032 $level = (int) explode(' ', trim($this->gedrec))[0];
1040 $value = $this->getGedcomValue($tag, $level, $this->gedrec);
1047 $tmp = new Place($value, $this->tree);
1063 if ($this->tree->getPreference('FORMAT_TEXT') === 'markdown') {
1064 … $value = strip_tags(Registry::markdownFactory()->markdown($value, $this->tree), ['br']);
1066 … $value = strip_tags(Registry::markdownFactory()->autolink($value, $this->tree), ['br']);
1074 $this->current_element->addText($value);
1088 $this->process_repeats++;
1089 if ($this->process_repeats > 1) {
1093 $this->repeats_stack[] = [$this->repeats, $this->repeat_bytes];
1094 $this->repeats = [];
1095 $this->repeat_bytes = xml_get_current_line_number($this->parser);
1100 $value = $this->desc;
1102 $this->current_element->addText($value);
1104 $tag = str_replace('@fact', $this->fact, $tag);
1106 $level = (int) explode(' ', trim($this->gedrec))[0];
1110 $subrec = $this->gedrec;
1121 $subrec = self::getSubRecord($level, "@ $t", $this->gedrec);
1139 … $linked_object = Registry::gedcomRecordFactory()->make($xref_match[1], $this->tree);
1144 $this->repeats[] = $subrecord;
1157 $this->process_repeats--;
1158 if ($this->process_repeats > 0) {
1163 if (count($this->repeats) > 0) {
1167 foreach ($this->repeats_stack as $rep) {
1171 $lines = file($this->report);
1172 while (!str_contains($lines[$lineoffset + $this->repeat_bytes], '<RepeatTag')) {
1177 $line_nr = $lineoffset + $this->repeat_bytes;
1195 $this->parser_stack[] = $this->parser;
1196 $oldgedrec = $this->gedrec;
1197 foreach ($this->repeats as $gedrec) {
1198 $this->gedrec = $gedrec;
1200 $this->parser = $repeat_parser;
1206 $this->startElement($parser, $name, $attrs);
1209 $this->endElement($parser, $name);
1216 $this->characterData($parser, $data);
1230 $this->gedrec = $oldgedrec;
1231 $this->parser = array_pop($this->parser_stack);
1233 [$this->repeats, $this->repeat_bytes] = array_pop($this->repeats_stack);
1252 …r=" is missing or not set in the XML file on line: ' . xml_get_current_line_number($this->parser));
1257 if (!empty($this->vars[$var]['id'])) {
1258 $var = $this->vars[$var]['id'];
1260 $tfact = $this->fact;
1261 if (($this->fact === 'EVEN' || $this->fact === 'FACT') && $this->type !== '') {
1264 $tfact = $this->type;
1267 $element = Registry::elementFactory()->make($record_type . ':' . $this->fact);
1276 $var = strtr($var, ['@desc' => $this->desc, '@fact' => $tfact]);
1293 $this->current_element->addText($var);
1294 $this->text = $var; // Used for title/descriptio
1306 $this->process_repeats++;
1307 if ($this->process_repeats > 1) {
1311 $this->repeats_stack[] = [$this->repeats, $this->repeat_bytes];
1312 $this->repeats = [];
1313 $this->repeat_bytes = xml_get_current_line_number($this->parser);
1317 if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
1325 $tag = $this->vars[$match[1]]['id'];
1328 $record = Registry::gedcomRecordFactory()->make($id, $this->tree);
1331 $this->repeats = [];
1337 $this->repeats[] = $fact->gedcom();
1343 $this->repeats[] = $fact->gedcom();
1356 $this->process_repeats--;
1357 if ($this->process_repeats > 0) {
1362 if (count($this->repeats) > 0) {
1363 $line = xml_get_current_line_number($this->parser) - 1;
1365 foreach ($this->repeats_stack as $rep) {
1370 $lines = file($this->report);
1371 …while ($lineoffset + $this->repeat_bytes > 0 && !str_contains($lines[$lineoffset + $this->repeat_b…
1377 $line_nr = $this->repeat_bytes + $lineoffset;
1386 $this->parser_stack[] = $this->parser;
1387 $oldgedrec = $this->gedrec;
1388 $count = count($this->repeats);
1391 $this->gedrec = $this->repeats[$i];
1392 $this->fact = '';
1393 $this->desc = '';
1394 if (preg_match('/1 (\w+)(.*)/', $this->gedrec, $match)) {
1395 $this->fact = $match[1];
1396 if ($this->fact === 'EVEN' || $this->fact === 'FACT') {
1398 if (preg_match('/2 TYPE (.+)/', $this->gedrec, $tmatch)) {
1399 $this->type = trim($tmatch[1]);
1401 $this->type = ' ';
1404 $this->desc = trim($match[2]);
1405 $this->desc .= self::getCont(2, $this->gedrec);
1408 $this->parser = $repeat_parser;
1414 $this->startElement($parser, $name, $attrs);
1417 $this->endElement($parser, $name);
1424 $this->characterData($parser, $data);
1439 $this->parser = array_pop($this->parser_stack);
1440 $this->gedrec = $oldgedrec;
1442 [$this->repeats, $this->repeat_bytes] = array_pop($this->repeats_stack);
1464 if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
1468 $value = $this->fact;
1470 $value = $this->desc;
1472 $value = (string) $this->generation;
1475 if (preg_match("/\d $match[1] (.+)/", $this->gedrec, $gmatch)) {
1480 $name = $this->vars["'" . $match[1] . "'"]['id'];
1485 $t = $this->vars[$match[$i][1]]['id'];
1510 $this->vars[$name]['id'] = $value;
1522 if ($this->process_ifs > 0) {
1523 $this->process_ifs++;
1529 $condition = $this->substituteVars($condition, true);
1538 $condition = str_replace('@fact:', $this->fact . ':', $condition);
1546 if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
1550 $value = '"' . $this->fact . '"';
1552 $value = '"' . addslashes($this->desc) . '"';
1554 $value = '"' . $this->generation . '"';
1556 $level = (int) explode(' ', trim($this->gedrec))[0];
1560 $value = $this->getGedcomValue($id, $level, $this->gedrec);
1563 $value = $this->getGedcomValue($id, $level, $this->gedrec);
1580 $this->process_ifs++;
1591 if ($this->process_ifs > 0) {
1592 $this->process_ifs--;
1608 if (preg_match('/[0-9] (.+) @(.+)@/', $this->gedrec, $match)) {
1611 $record = Registry::gedcomRecordFactory()->make($id, $this->tree);
1613 $this->print_data_stack[] = $this->print_data;
1614 $this->print_data = true;
1619 $this->footnote_element = $this->current_element;
1620 $this->current_element = $this->report_root->createFootnote($style);
1622 $this->print_data = false;
1623 $this->process_footnote = false;
1635 if ($this->process_footnote) {
1636 $this->print_data = array_pop($this->print_data_stack);
1637 $temp = trim($this->current_element->getValue());
1639 $this->wt_report->addElement($this->current_element);
1641 $this->current_element = $this->footnote_element;
1643 $this->process_footnote = true;
1655 $this->wt_report->addElement($temp);
1665 if ($this->print_data && $this->process_gedcoms === 0) {
1666 $this->current_element->addText('<br>');
1678 if ($this->print_data && $this->process_gedcoms === 0) {
1679 $this->current_element->addText(' ');
1693 if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
1713 $person = Registry::individualFactory()->make($id, $this->tree);
1730 …$image = $this->report_root->createImageFromObject($media_file, $left, $top, $width, $height, $ali…
1731 $this->wt_report->addElement($image);
1764 if (preg_match("/\d OBJE @(.+)@/", $this->gedrec, $match)) {
1765 $mediaobject = Registry::mediaFactory()->make($match[1], $this->tree);
1782 …$image = $this->report_root->createImageFromObject($media_file, $left, $top, $width, $height, $ali…
1783 $this->wt_report->addElement($image);
1799 … $image = $this->report_root->createImage($file, $left, $top, $width, $height, $align, $ln);
1800 $this->wt_report->addElement($image);
1859 $line = $this->report_root->createLine($x1, $y1, $x2, $y2);
1860 $this->wt_report->addElement($line);
1872 $this->process_repeats++;
1873 if ($this->process_repeats > 1) {
1881 $sortby = $this->vars[$match[1]]['id'];
1893 $this->list = DB::table('change')
1897 ->where('gedcom_id', '=', $this->tree->id())
1902 …: GedcomRecord|null => Registry::gedcomRecordFactory()->make($row->xref, $this->tree, $row->new_ge…
1909 ->where('i_file', '=', $this->tree->id())
1915 $value = $this->substituteVars($value, false);
1986 $this->list = [];
1989 …$this->list[$row->xref] = Registry::individualFactory()->make($row->xref, $this->tree, $row->gedco…
1995 ->where('f_file', '=', $this->tree->id())
2001 $value = $this->substituteVars($value, false);
2080 $this->list = [];
2083 … $this->list[$row->xref] = Registry::familyFactory()->make($row->xref, $this->tree, $row->gedcom);
2093 if (isset($attrs['filter1']) && count($this->list) > 0) {
2101 if (preg_match('/0 @(.+)@/', $this->gedrec, $match)) {
2105 $value = "'" . $this->fact . "'";
2107 $value = "'" . $this->desc . "'";
2109 if (preg_match("/\d $id (.+)/", $this->gedrec, $match)) {
2121 $val = $this->vars[$match[1]]['id'];
2173 foreach ($this->list as $key => $record) {
2175 … if (!preg_match('/' . $filter . '/i', $record->privatizeGedcom(Auth::accessLevel($this->tree)))) {
2176 unset($this->list[$key]);
2184 foreach ($this->list as $indi) {
2186 $grec = $indi->privatizeGedcom(Auth::accessLevel($this->tree));
2198 $v = $this->getGedcomValue($tag, 1, $grec);
2240 $this->list = $mylist;
2245 uasort($this->list, GedcomRecord::nameComparator());
2248 uasort($this->list, GedcomRecord::lastChangeComparator());
2251 uasort($this->list, Individual::birthDateComparator());
2254 uasort($this->list, Individual::deathDateComparator());
2257 uasort($this->list, Family::marriageDateComparator());
2264 $this->repeats_stack[] = [$this->repeats, $this->repeat_bytes];
2265 $this->repeat_bytes = xml_get_current_line_number($this->parser) + 1;
2275 $this->process_repeats--;
2276 if ($this->process_repeats > 0) {
2281 if (count($this->list) > 0) {
2283 foreach ($this->repeats_stack as $rep) {
2287 $lines = file($this->report);
2288 …while ((!str_contains($lines[$lineoffset + $this->repeat_bytes], '<List')) && (($lineoffset + $thi…
2293 $line_nr = $lineoffset + $this->repeat_bytes;
2311 $this->parser_stack[] = $this->parser;
2312 $oldgedrec = $this->gedrec;
2314 $this->list_total = count($this->list);
2315 $this->list_private = 0;
2316 foreach ($this->list as $record) {
2318 $this->gedrec = $record->privatizeGedcom(Auth::accessLevel($record->tree()));
2321 $this->parser = $repeat_parser;
2327 $this->startElement($parser, $name, $attrs);
2330 $this->endElement($parser, $name);
2337 $this->characterData($parser, $data);
2350 $this->list_private++;
2353 $this->list = [];
2354 $this->parser = array_pop($this->parser_stack);
2355 $this->gedrec = $oldgedrec;
2357 [$this->repeats, $this->repeat_bytes] = array_pop($this->repeats_stack);
2369 if ($this->list_private == 0) {
2370 $this->current_element->addText((string) $this->list_total);
2372 …$this->current_element->addText(($this->list_total - $this->list_private) . ' / ' . $this->list_to…
2385 $this->process_repeats++;
2386 if ($this->process_repeats > 1) {
2394 $sortby = $this->vars[$match[1]]['id'];
2406 $group = $this->vars[$match[1]]['id'];
2413 $id = $this->vars[$match[1]]['id'];
2417 $this->list = [];
2418 $person = Registry::individualFactory()->make($id, $this->tree);
2420 $this->list[$id] = $person;
2425 $this->list[$spouse->xref()] = $spouse;
2429 $this->list[$child->xref()] = $child;
2436 $this->list[$spouse->xref()] = $spouse;
2440 $this->list[$child->xref()] = $child;
2445 $this->addAncestors($this->list, $id, false, $maxgen);
2448 $this->addAncestors($this->list, $id, true, $maxgen);
2451 $this->list[$id]->generation = 1;
2452 $this->addDescendancy($this->list, $id, false, $maxgen);
2455 $this->addAncestors($this->list, $id, true, $maxgen);
2456 $this->addDescendancy($this->list, $id, true, $maxgen);
2463 uasort($this->list, GedcomRecord::nameComparator());
2466 uasort($this->list, Individual::birthDateComparator());
2469 uasort($this->list, Individual::deathDateComparator());
2473 reset($this->list);
2475 while (count($newarray) < count($this->list)) {
2476 foreach ($this->list as $key => $value) {
2477 $this->generation = $value->generation;
2478 if ($this->generation == $genCounter) {
2479 $newarray[$key] = (object) ['generation' => $this->generation];
2484 $this->list = $newarray;
2490 $this->repeats_stack[] = [$this->repeats, $this->repeat_bytes];
2491 $this->repeat_bytes = xml_get_current_line_number($this->parser) + 1;
2501 $this->process_repeats--;
2502 if ($this->process_repeats > 0) {
2507 if (count($this->list) > 0) {
2509 foreach ($this->repeats_stack as $rep) {
2513 $lines = file($this->report);
2514 …while (!str_contains($lines[$lineoffset + $this->repeat_bytes], '<Relatives') && $lineoffset + $th…
2519 $line_nr = $lineoffset + $this->repeat_bytes;
2537 $this->parser_stack[] = $this->parser;
2538 $oldgedrec = $this->gedrec;
2540 $this->list_total = count($this->list);
2541 $this->list_private = 0;
2542 foreach ($this->list as $xref => $value) {
2544 $this->generation = $value->generation;
2546 $tmp = Registry::gedcomRecordFactory()->make((string) $xref, $this->tree);
2547 $this->gedrec = $tmp->privatizeGedcom(Auth::accessLevel($this->tree));
2550 $this->parser = $repeat_parser;
2556 $this->startElement($parser, $name, $attrs);
2559 $this->endElement($parser, $name);
2566 $this->characterData($parser, $data);
2576 $this->list = [];
2577 $this->parser = array_pop($this->parser_stack);
2578 $this->gedrec = $oldgedrec;
2580 [$this->repeats, $this->repeat_bytes] = array_pop($this->repeats_stack);
2591 $this->current_element->addText((string) $this->generation);
2603 $this->wt_report->addElement($temp);
2613 $this->report_root->addTitle($this->text);
2623 $this->report_root->addDescription($this->text);
2638 $person = Registry::individualFactory()->make($pid, $this->tree);
2685 …$this->addDescendancy($list, $child->xref(), $parents, $generations); // recurse on the childs fam…
2710 $person = Registry::individualFactory()->make($id, $this->tree);
2799 $note = Registry::noteFactory()->make($match[1], $this->tree);
2834 if (isset($this->vars[$matches[1]]['id'])) {
2836 return "'" . addcslashes($this->vars[$matches[1]]['id'], "'") . "'";
2839 return $this->vars[$matches[1]]['id'];