18c2e8227SGreg Roach<?php 28c2e8227SGreg Roach/** 38c2e8227SGreg Roach * webtrees: online genealogy 46bdf7674SGreg Roach * Copyright (C) 2017 webtrees development team 58c2e8227SGreg Roach * This program is free software: you can redistribute it and/or modify 68c2e8227SGreg Roach * it under the terms of the GNU General Public License as published by 78c2e8227SGreg Roach * the Free Software Foundation, either version 3 of the License, or 88c2e8227SGreg Roach * (at your option) any later version. 98c2e8227SGreg Roach * This program is distributed in the hope that it will be useful, 108c2e8227SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 118c2e8227SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 128c2e8227SGreg Roach * GNU General Public License for more details. 138c2e8227SGreg Roach * You should have received a copy of the GNU General Public License 148c2e8227SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 158c2e8227SGreg Roach */ 1676692c8bSGreg Roachnamespace Fisharebest\Webtrees\Module; 1776692c8bSGreg Roach 180e62c4b8SGreg Roachuse Fisharebest\Webtrees\Auth; 190e62c4b8SGreg Roachuse Fisharebest\Webtrees\Controller\PageController; 200e62c4b8SGreg Roachuse Fisharebest\Webtrees\Family; 210e62c4b8SGreg Roachuse Fisharebest\Webtrees\Filter; 220e62c4b8SGreg Roachuse Fisharebest\Webtrees\GedcomRecord; 23047f239bSGreg Roachuse Fisharebest\Webtrees\Html; 240e62c4b8SGreg Roachuse Fisharebest\Webtrees\I18N; 250e62c4b8SGreg Roachuse Fisharebest\Webtrees\Individual; 260e62c4b8SGreg Roachuse Fisharebest\Webtrees\Menu; 270e62c4b8SGreg Roachuse Fisharebest\Webtrees\Module\ClippingsCart\ClippingsCartController; 280e62c4b8SGreg Roachuse Fisharebest\Webtrees\Session; 298c2e8227SGreg Roach 308c2e8227SGreg Roach/** 318c2e8227SGreg Roach * Class ClippingsCartModule 328c2e8227SGreg Roach */ 33e2a378d3SGreg Roachclass ClippingsCartModule extends AbstractModule implements ModuleMenuInterface, ModuleSidebarInterface { 348c2e8227SGreg Roach /** {@inheritdoc} */ 358c2e8227SGreg Roach public function getTitle() { 36a86dd8b1SGreg Roach return /* I18N: Name of a module */ 37a86dd8b1SGreg Roach I18N::translate('Clippings cart'); 388c2e8227SGreg Roach } 398c2e8227SGreg Roach 408c2e8227SGreg Roach /** {@inheritdoc} */ 418c2e8227SGreg Roach public function getDescription() { 42a86dd8b1SGreg Roach return /* I18N: Description of the “Clippings cart” module */ 433bf19670SGreg Roach I18N::translate('Select records from your family tree and save them as a GEDCOM file.'); 448c2e8227SGreg Roach } 458c2e8227SGreg Roach 460ee13198SGreg Roach /** 470ee13198SGreg Roach * What is the default access level for this module? 480ee13198SGreg Roach * 490ee13198SGreg Roach * Some modules are aimed at admins or managers, and are not generally shown to users. 500ee13198SGreg Roach * 510ee13198SGreg Roach * @return int 520ee13198SGreg Roach */ 538c2e8227SGreg Roach public function defaultAccessLevel() { 544b9ff166SGreg Roach return Auth::PRIV_USER; 558c2e8227SGreg Roach } 568c2e8227SGreg Roach 5776692c8bSGreg Roach /** 5876692c8bSGreg Roach * This is a general purpose hook, allowing modules to respond to routes 5976692c8bSGreg Roach * of the form module.php?mod=FOO&mod_action=BAR 6076692c8bSGreg Roach * 6176692c8bSGreg Roach * @param string $mod_action 6276692c8bSGreg Roach */ 638c2e8227SGreg Roach public function modAction($mod_action) { 648c2e8227SGreg Roach switch ($mod_action) { 658c2e8227SGreg Roach case 'ajax': 668c2e8227SGreg Roach $html = $this->getSidebarAjaxContent(); 678c2e8227SGreg Roach header('Content-Type: text/html; charset=UTF-8'); 688c2e8227SGreg Roach echo $html; 698c2e8227SGreg Roach break; 708c2e8227SGreg Roach case 'index': 7131bc7874SGreg Roach global $controller, $WT_TREE; 728c2e8227SGreg Roach 738c2e8227SGreg Roach $MAX_PEDIGREE_GENERATIONS = $WT_TREE->getPreference('MAX_PEDIGREE_GENERATIONS'); 748c2e8227SGreg Roach 750e62c4b8SGreg Roach $clip_ctrl = new ClippingsCartController; 767bd2dc19SGreg Roach $cart = Session::get('cart'); 778c2e8227SGreg Roach 788c2e8227SGreg Roach $controller = new PageController; 798c2e8227SGreg Roach $controller 808c2e8227SGreg Roach ->setPageTitle($this->getTitle()) 8115d603e7SGreg Roach ->pageHeader(); 828c2e8227SGreg Roach 838c2e8227SGreg Roach echo '<script>'; 848c2e8227SGreg Roach echo 'function radAncestors(elementid) {var radFamilies=document.getElementById(elementid);radFamilies.checked=true;}'; 858c2e8227SGreg Roach echo '</script>'; 868c2e8227SGreg Roach 8731bc7874SGreg Roach if (!$cart[$WT_TREE->getTreeId()]) { 888c2e8227SGreg Roach echo '<h2>', I18N::translate('Family tree clippings cart'), '</h2>'; 898c2e8227SGreg Roach } 908c2e8227SGreg Roach 918c2e8227SGreg Roach if ($clip_ctrl->action == 'add') { 924e3c4966SGreg Roach $record = GedcomRecord::getInstance($clip_ctrl->id, $WT_TREE); 938c2e8227SGreg Roach if ($clip_ctrl->type === 'FAM') { ?> 9415d603e7SGreg Roach <form action="module.php"> 958c2e8227SGreg Roach <input type="hidden" name="mod" value="clippings"> 968c2e8227SGreg Roach <input type="hidden" name="mod_action" value="index"> 9715d603e7SGreg Roach <input type="hidden" name="id" value="<?= $clip_ctrl->id ?>"> 9815d603e7SGreg Roach <input type="hidden" name="type" value="<?= $clip_ctrl->type ?>"> 994e3c4966SGreg Roach <input type="hidden" name="action" value="add1"> 1004e3c4966SGreg Roach <table> 1014e3c4966SGreg Roach <thead> 1024e3c4966SGreg Roach <tr> 1034e3c4966SGreg Roach <td class="topbottombar"> 10415d603e7SGreg Roach <?= I18N::translate('Add to the clippings cart') ?> 1054e3c4966SGreg Roach </td> 1064e3c4966SGreg Roach </tr> 1074e3c4966SGreg Roach </thead> 1084e3c4966SGreg Roach <tbody> 1094e3c4966SGreg Roach <tr> 1104e3c4966SGreg Roach <td class="optionbox"> 1114e3c4966SGreg Roach <input type="radio" name="others" value="parents"> 11215d603e7SGreg Roach <?= $record->getFullName() ?> 1134e3c4966SGreg Roach </td> 1144e3c4966SGreg Roach </tr> 1154e3c4966SGreg Roach <tr> 1164e3c4966SGreg Roach <td class="optionbox"> 1174e3c4966SGreg Roach <input type="radio" name="others" value="members" checked> 11815d603e7SGreg Roach <?= /* I18N: %s is a family (husband + wife) */ 11915d603e7SGreg Roach I18N::translate('%s and their children', $record->getFullName()) ?> 1204e3c4966SGreg Roach </td> 1214e3c4966SGreg Roach </tr> 1224e3c4966SGreg Roach <tr> 1234e3c4966SGreg Roach <td class="optionbox"> 1244e3c4966SGreg Roach <input type="radio" name="others" value="descendants"> 12515d603e7SGreg Roach <?= /* I18N: %s is a family (husband + wife) */ 12615d603e7SGreg Roach I18N::translate('%s and their descendants', $record->getFullName()) ?> 1274e3c4966SGreg Roach </td> 1284e3c4966SGreg Roach </tr> 1294e3c4966SGreg Roach </tbody> 1304e3c4966SGreg Roach <tfoot> 1314e3c4966SGreg Roach <tr> 13215d603e7SGreg Roach <td class="topbottombar"><input type="submit" value="<?= I18N::translate('continue') ?>"> 1334e3c4966SGreg Roach </td> 1344e3c4966SGreg Roach </tr> 1354e3c4966SGreg Roach </tfoot> 1368c2e8227SGreg Roach </table> 1378c2e8227SGreg Roach </form> 1388c2e8227SGreg Roach <?php } elseif ($clip_ctrl->type === 'INDI') { ?> 13915d603e7SGreg Roach <form action="module.php"> 1408c2e8227SGreg Roach <input type="hidden" name="mod" value="clippings"> 1418c2e8227SGreg Roach <input type="hidden" name="mod_action" value="index"> 14215d603e7SGreg Roach <input type="hidden" name="id" value="<?= $clip_ctrl->id ?>"> 14315d603e7SGreg Roach <input type="hidden" name="type" value="<?= $clip_ctrl->type ?>"> 144a86dd8b1SGreg Roach <input type="hidden" name="action" value="add1"> 1454e3c4966SGreg Roach <table> 1464e3c4966SGreg Roach <thead> 1474e3c4966SGreg Roach <tr> 1484e3c4966SGreg Roach <td class="topbottombar"> 14915d603e7SGreg Roach <?= I18N::translate('Add to the clippings cart') ?> 1504e3c4966SGreg Roach </td> 1514e3c4966SGreg Roach </tr> 1524e3c4966SGreg Roach </thead> 1534e3c4966SGreg Roach <tbody> 1544e3c4966SGreg Roach <tr> 1554e3c4966SGreg Roach <td class="optionbox"> 1564e3c4966SGreg Roach <label> 1574e3c4966SGreg Roach <input type="radio" name="others" checked value="none"> 15815d603e7SGreg Roach <?= $record->getFullName() ?> 1594e3c4966SGreg Roach </label> 1604e3c4966SGreg Roach </td> 1614e3c4966SGreg Roach </tr> 1624e3c4966SGreg Roach <tr> 1634e3c4966SGreg Roach <td class="optionbox"> 1644e3c4966SGreg Roach <label> 1654e3c4966SGreg Roach <input type="radio" name="others" value="parents"> 1664e3c4966SGreg Roach <?php 1674e3c4966SGreg Roach if ($record->getSex() === 'F') { 168a86dd8b1SGreg Roach echo /* I18N: %s is a woman's name */ 169a86dd8b1SGreg Roach I18N::translate('%s, her parents and siblings', $record->getFullName()); 1704e3c4966SGreg Roach } else { 171a86dd8b1SGreg Roach echo /* I18N: %s is a man's name */ 172a86dd8b1SGreg Roach I18N::translate('%s, his parents and siblings', $record->getFullName()); 1734e3c4966SGreg Roach } 1744e3c4966SGreg Roach ?> 1754e3c4966SGreg Roach </label> 1764e3c4966SGreg Roach </td> 1774e3c4966SGreg Roach </tr> 1784e3c4966SGreg Roach <tr> 1794e3c4966SGreg Roach <td class="optionbox"> 1804e3c4966SGreg Roach <label> 1814e3c4966SGreg Roach <input type="radio" name="others" value="members"> 1824e3c4966SGreg Roach <?php 1834e3c4966SGreg Roach if ($record->getSex() === 'F') { 184a86dd8b1SGreg Roach echo /* I18N: %s is a woman's name */ 185a86dd8b1SGreg Roach I18N::translate('%s, her spouses and children', $record->getFullName()); 1864e3c4966SGreg Roach } else { 187a86dd8b1SGreg Roach echo /* I18N: %s is a man's name */ 188a86dd8b1SGreg Roach I18N::translate('%s, his spouses and children', $record->getFullName()); 1894e3c4966SGreg Roach } 1904e3c4966SGreg Roach ?> 1914e3c4966SGreg Roach </label> 1924e3c4966SGreg Roach </td> 1934e3c4966SGreg Roach </tr> 1944e3c4966SGreg Roach <tr> 1954e3c4966SGreg Roach <td class="optionbox"> 1964e3c4966SGreg Roach <label> 1974e3c4966SGreg Roach <input type="radio" name="others" value="ancestors" id="ancestors"> 1984e3c4966SGreg Roach <?php 1994e3c4966SGreg Roach if ($record->getSex() === 'F') { 200a86dd8b1SGreg Roach echo /* I18N: %s is a woman's name */ 201a86dd8b1SGreg Roach I18N::translate('%s and her ancestors', $record->getFullName()); 2024e3c4966SGreg Roach } else { 203a86dd8b1SGreg Roach echo /* I18N: %s is a man's name */ 204a86dd8b1SGreg Roach I18N::translate('%s and his ancestors', $record->getFullName()); 2054e3c4966SGreg Roach } 2064e3c4966SGreg Roach ?> 2074e3c4966SGreg Roach </label> 2084e3c4966SGreg Roach <br> 20915d603e7SGreg Roach <?= I18N::translate('Number of generations') ?> 21015d603e7SGreg Roach <input type="text" size="5" name="level1" value="<?= $MAX_PEDIGREE_GENERATIONS ?>" onfocus="radAncestors('ancestors');"> 2114e3c4966SGreg Roach </td> 2124e3c4966SGreg Roach </tr> 2134e3c4966SGreg Roach <tr> 2144e3c4966SGreg Roach <td class="optionbox"> 2154e3c4966SGreg Roach <label> 2164e3c4966SGreg Roach <input type="radio" name="others" value="ancestorsfamilies" id="ancestorsfamilies"> 2174e3c4966SGreg Roach <?php 2184e3c4966SGreg Roach if ($record->getSex() === 'F') { 219a86dd8b1SGreg Roach echo /* I18N: %s is a woman's name */ 220a86dd8b1SGreg Roach I18N::translate('%s, her ancestors and their families', $record->getFullName()); 2214e3c4966SGreg Roach } else { 222a86dd8b1SGreg Roach echo /* I18N: %s is a man's name */ 223a86dd8b1SGreg Roach I18N::translate('%s, his ancestors and their families', $record->getFullName()); 2244e3c4966SGreg Roach } 2254e3c4966SGreg Roach ?> 2264e3c4966SGreg Roach </label> 2274e3c4966SGreg Roach <br> 22815d603e7SGreg Roach <?= I18N::translate('Number of generations') ?> 22915d603e7SGreg Roach <input type="text" size="5" name="level2" value="<?= $MAX_PEDIGREE_GENERATIONS ?>" onfocus="radAncestors('ancestorsfamilies');"> 2304e3c4966SGreg Roach </td> 2314e3c4966SGreg Roach </tr> 2324e3c4966SGreg Roach <tr> 2334e3c4966SGreg Roach <td class="optionbox"> 2344e3c4966SGreg Roach <label> 2354e3c4966SGreg Roach <input type="radio" name="others" value="descendants" id="descendants"> 2364e3c4966SGreg Roach <?php 2374e3c4966SGreg Roach if ($record->getSex() === 'F') { 238a86dd8b1SGreg Roach echo /* I18N: %s is a woman's name */ 239a86dd8b1SGreg Roach I18N::translate('%s, her spouses and descendants', $record->getFullName()); 2404e3c4966SGreg Roach } else { 241a86dd8b1SGreg Roach echo /* I18N: %s is a man's name */ 242a86dd8b1SGreg Roach I18N::translate('%s, his spouses and descendants', $record->getFullName()); 2434e3c4966SGreg Roach } 2444e3c4966SGreg Roach ?> 2454e3c4966SGreg Roach </label> 2464e3c4966SGreg Roach <br> 24715d603e7SGreg Roach <?= I18N::translate('Number of generations') ?> 24815d603e7SGreg Roach <input type="text" size="5" name="level3" value="<?= $MAX_PEDIGREE_GENERATIONS ?>" onfocus="radAncestors('descendants');"> 2494e3c4966SGreg Roach </td> 2504e3c4966SGreg Roach </tr> 2514e3c4966SGreg Roach </tbody> 2524e3c4966SGreg Roach <tfoot> 2534e3c4966SGreg Roach <tr> 2544e3c4966SGreg Roach <td class="topbottombar"> 25515d603e7SGreg Roach <input type="submit" value="<?= I18N::translate('continue') ?>"> 2564e3c4966SGreg Roach </td> 2574e3c4966SGreg Roach </tr> 2584e3c4966SGreg Roach </tfoot> 2598c2e8227SGreg Roach </table> 2608c2e8227SGreg Roach </form> 2618c2e8227SGreg Roach <?php } elseif ($clip_ctrl->type === 'SOUR') { ?> 26215d603e7SGreg Roach <form action="module.php"> 2638c2e8227SGreg Roach <input type="hidden" name="mod" value="clippings"> 2648c2e8227SGreg Roach <input type="hidden" name="mod_action" value="index"> 26515d603e7SGreg Roach <input type="hidden" name="id" value="<?= $clip_ctrl->id ?>"> 26615d603e7SGreg Roach <input type="hidden" name="type" value="<?= $clip_ctrl->type ?>"> 267a86dd8b1SGreg Roach <input type="hidden" name="action" value="add1"> 2684e3c4966SGreg Roach <table> 2694e3c4966SGreg Roach <thead> 2704e3c4966SGreg Roach <tr> 2714e3c4966SGreg Roach <td class="topbottombar"> 27215d603e7SGreg Roach <?= I18N::translate('Add to the clippings cart') ?> 2734e3c4966SGreg Roach </td> 2744e3c4966SGreg Roach </tr> 2754e3c4966SGreg Roach </thead> 2764e3c4966SGreg Roach <tbody> 2774e3c4966SGreg Roach <tr> 2784e3c4966SGreg Roach <td class="optionbox"> 2794e3c4966SGreg Roach <label> 2804e3c4966SGreg Roach <input type="radio" name="others" checked value="none"> 28115d603e7SGreg Roach <?= $record->getFullName() ?> 2824e3c4966SGreg Roach </label> 2834e3c4966SGreg Roach </td> 2844e3c4966SGreg Roach </tr> 2854e3c4966SGreg Roach <tr> 2864e3c4966SGreg Roach <td class="optionbox"> 2874e3c4966SGreg Roach <label> 2884e3c4966SGreg Roach <input type="radio" name="others" value="linked"> 28915d603e7SGreg Roach <?= /* I18N: %s is the name of a source */ 29015d603e7SGreg Roach I18N::translate('%s and the individuals that reference it.', $record->getFullName()) ?> 2914e3c4966SGreg Roach </label> 2924e3c4966SGreg Roach </td> 2934e3c4966SGreg Roach </tr> 2944e3c4966SGreg Roach </tbody> 2954e3c4966SGreg Roach <tfoot> 2964e3c4966SGreg Roach <tr> 2974e3c4966SGreg Roach <td class="topbottombar"> 29815d603e7SGreg Roach <input type="submit" value="<?= I18N::translate('continue') ?>"> 2994e3c4966SGreg Roach </td> 3004e3c4966SGreg Roach </tr> 3014e3c4966SGreg Roach </tfoot> 3028c2e8227SGreg Roach </table> 3038c2e8227SGreg Roach </form> 3048c2e8227SGreg Roach <?php } 3058c2e8227SGreg Roach } 3068c2e8227SGreg Roach 30731bc7874SGreg Roach if (!$cart[$WT_TREE->getTreeId()]) { 3088c2e8227SGreg Roach if ($clip_ctrl->action != 'add') { 3092a277e58SGreg Roach echo I18N::translate('The clippings cart allows you to take extracts from this family tree and download them as a GEDCOM file.'); 3108c2e8227SGreg Roach ?> 31115d603e7SGreg Roach <form name="addin" action="module.php"> 3128c2e8227SGreg Roach <input type="hidden" name="mod" value="clippings"> 3138c2e8227SGreg Roach <input type="hidden" name="mod_action" value="index"> 3148c2e8227SGreg Roach <table> 3154e3c4966SGreg Roach <thead> 3168c2e8227SGreg Roach <tr> 3174e3c4966SGreg Roach <td colspan="2" class="topbottombar"> 31815d603e7SGreg Roach <?= I18N::translate('Add to the clippings cart') ?> 3198c2e8227SGreg Roach </td> 3208c2e8227SGreg Roach </tr> 3214e3c4966SGreg Roach </thead> 3224e3c4966SGreg Roach <tbody> 3238c2e8227SGreg Roach <tr> 3248c2e8227SGreg Roach <td class="optionbox"> 3258c2e8227SGreg Roach <input type="hidden" name="action" value="add"> 3268c2e8227SGreg Roach <input type="text" data-autocomplete-type="IFSRO" name="id" id="cart_item_id" size="5"> 3278c2e8227SGreg Roach </td> 3288c2e8227SGreg Roach <td class="optionbox"> 32915d603e7SGreg Roach <input type="submit" value="<?= /* I18N: A button label. */ I18N::translate('add') ?>"> 3308c2e8227SGreg Roach </td> 3318c2e8227SGreg Roach </tr> 3324e3c4966SGreg Roach </tbody> 3338c2e8227SGreg Roach </table> 3348c2e8227SGreg Roach </form> 3358c2e8227SGreg Roach <?php 3368c2e8227SGreg Roach } 3378c2e8227SGreg Roach 3388c2e8227SGreg Roach // -- end new lines 3398c2e8227SGreg Roach echo I18N::translate('Your clippings cart is empty.'); 3408c2e8227SGreg Roach } else { 3418c2e8227SGreg Roach // Keep track of the INDI from the parent page, otherwise it will 3428c2e8227SGreg Roach // get lost after ajax updates 3438c2e8227SGreg Roach $pid = Filter::get('pid', WT_REGEX_XREF); 3448c2e8227SGreg Roach 345a86dd8b1SGreg Roach if ($clip_ctrl->action !== 'download' && $clip_ctrl->action !== 'add') { ?> 34615d603e7SGreg Roach <form action="module.php"> 3478c2e8227SGreg Roach <input type="hidden" name="mod" value="clippings"> 3488c2e8227SGreg Roach <input type="hidden" name="mod_action" value="index"> 3498c2e8227SGreg Roach <input type="hidden" name="action" value="download"> 35015d603e7SGreg Roach <input type="hidden" name="pid" value="<?= $pid ?>"> 3518c2e8227SGreg Roach <table> 352a86dd8b1SGreg Roach <tr> 353a86dd8b1SGreg Roach <td colspan="2" class="topbottombar"> 35415d603e7SGreg Roach <h2><?= I18N::translate('Download') ?></h2> 355a86dd8b1SGreg Roach </td> 356a86dd8b1SGreg Roach </tr> 3574b9ff166SGreg Roach <?php if (Auth::isManager($WT_TREE)) { ?> 358a86dd8b1SGreg Roach <tr> 359a86dd8b1SGreg Roach <td class="descriptionbox width50 wrap"> 36015d603e7SGreg Roach <?= I18N::translate('Apply privacy settings') ?> 361a86dd8b1SGreg Roach </td> 3628c2e8227SGreg Roach <td class="optionbox"> 363a86dd8b1SGreg Roach <input type="radio" name="privatize_export" value="none" checked> 36415d603e7SGreg Roach <?= I18N::translate('None') ?> 365a86dd8b1SGreg Roach <br> 366a86dd8b1SGreg Roach <input type="radio" name="privatize_export" value="gedadmin"> 36715d603e7SGreg Roach <?= I18N::translate('Manager') ?> 368a86dd8b1SGreg Roach <br> 369a86dd8b1SGreg Roach <input type="radio" name="privatize_export" value="user"> 37015d603e7SGreg Roach <?= I18N::translate('Member') ?> 371a86dd8b1SGreg Roach <br> 372a86dd8b1SGreg Roach <input type="radio" name="privatize_export" value="visitor"> 37315d603e7SGreg Roach <?= I18N::translate('Visitor') ?> 374a86dd8b1SGreg Roach </td> 375a86dd8b1SGreg Roach </tr> 3764b9ff166SGreg Roach <?php } elseif (Auth::isMember($WT_TREE)) { ?> 377a86dd8b1SGreg Roach <tr> 378a86dd8b1SGreg Roach <td class="descriptionbox width50 wrap"> 37915d603e7SGreg Roach <?= I18N::translate('Apply privacy settings') ?> 380a86dd8b1SGreg Roach </td> 3818c2e8227SGreg Roach <td class="optionbox"> 38215d603e7SGreg Roach <input type="radio" name="privatize_export" value="user" checked> <?= I18N::translate('Member') ?><br> 38315d603e7SGreg Roach <input type="radio" name="privatize_export" value="visitor"> <?= I18N::translate('Visitor') ?> 384a86dd8b1SGreg Roach </td> 385a86dd8b1SGreg Roach </tr> 3868c2e8227SGreg Roach <?php } ?> 3878c2e8227SGreg Roach 388a86dd8b1SGreg Roach <tr> 389a86dd8b1SGreg Roach <td class="descriptionbox width50 wrap"> 39015d603e7SGreg Roach <?= I18N::translate('Convert from UTF-8 to ISO-8859-1') ?> 391a86dd8b1SGreg Roach </td> 392a86dd8b1SGreg Roach <td class="optionbox"> 393a86dd8b1SGreg Roach <input type="checkbox" name="convert" value="yes"> 394a86dd8b1SGreg Roach </td> 395a86dd8b1SGreg Roach </tr> 3968c2e8227SGreg Roach 397a86dd8b1SGreg Roach <tr> 398a86dd8b1SGreg Roach <td class="topbottombar" colspan="2"> 39915d603e7SGreg Roach <input type="submit" value="<?= /* I18N: A button label. */ I18N::translate('download') ?>"> 400a86dd8b1SGreg Roach </td> 401a86dd8b1SGreg Roach </tr> 402a86dd8b1SGreg Roach </table> 4038c2e8227SGreg Roach </form> 4048c2e8227SGreg Roach <br> 4058c2e8227SGreg Roach 40615d603e7SGreg Roach <form name="addin" action="module.php"> 4078c2e8227SGreg Roach <input type="hidden" name="mod" value="clippings"> 4088c2e8227SGreg Roach <input type="hidden" name="mod_action" value="index"> 4098c2e8227SGreg Roach <table> 4104e3c4966SGreg Roach <thead> 4118c2e8227SGreg Roach <tr> 4128c2e8227SGreg Roach <td colspan="2" class="topbottombar" style="text-align:center; "> 41315d603e7SGreg Roach <?= I18N::translate('Add to the clippings cart') ?> 4148c2e8227SGreg Roach </td> 4158c2e8227SGreg Roach </tr> 4164e3c4966SGreg Roach </thead> 4174e3c4966SGreg Roach <tbody> 4188c2e8227SGreg Roach <tr> 4198c2e8227SGreg Roach <td class="optionbox"> 4208c2e8227SGreg Roach <input type="hidden" name="action" value="add"> 4218c2e8227SGreg Roach <input type="text" data-autocomplete-type="IFSRO" name="id" id="cart_item_id" size="8"> 4228c2e8227SGreg Roach </td> 4238c2e8227SGreg Roach <td class="optionbox"> 42415d603e7SGreg Roach <input type="submit" value="<?= /* I18N: A button label. */ I18N::translate('add') ?>"> 4258c2e8227SGreg Roach </td> 4268c2e8227SGreg Roach </tr> 4274e3c4966SGreg Roach </tbody> 428a86dd8b1SGreg Roach <tfoot> 429a86dd8b1SGreg Roach <tr> 430a86dd8b1SGreg Roach <th colspan="2"> 431a86dd8b1SGreg Roach <a href="module.php?mod=clippings&mod_action=index&action=empty"> 43215d603e7SGreg Roach <?= I18N::translate('Empty the clippings cart') ?> 433a86dd8b1SGreg Roach </a> 434a86dd8b1SGreg Roach </th> 435a86dd8b1SGreg Roach </tr> 436a86dd8b1SGreg Roach </tfoot> 4378c2e8227SGreg Roach </table> 4388c2e8227SGreg Roach </form> 4398c2e8227SGreg Roach 4408c2e8227SGreg Roach <?php } ?> 4418c2e8227SGreg Roach 442a86dd8b1SGreg Roach <h2> 44315d603e7SGreg Roach <?= I18N::translate('Family tree clippings cart') ?> 444a86dd8b1SGreg Roach </h2> 4458c2e8227SGreg Roach <table id="mycart" class="sortable list_table width100"> 446a86dd8b1SGreg Roach <thead> 4478c2e8227SGreg Roach <tr> 44815d603e7SGreg Roach <th class="list_label"><?= I18N::translate('Record') ?></th> 44915d603e7SGreg Roach <th class="list_label"><?= I18N::translate('Remove') ?></th> 4508c2e8227SGreg Roach </tr> 451a86dd8b1SGreg Roach </thead> 452a86dd8b1SGreg Roach <tbody> 4538c2e8227SGreg Roach <?php 45431bc7874SGreg Roach foreach (array_keys($cart[$WT_TREE->getTreeId()]) as $xref) { 45524ec66ceSGreg Roach $record = GedcomRecord::getInstance($xref, $WT_TREE); 4568c2e8227SGreg Roach if ($record) { 4578c2e8227SGreg Roach switch ($record::RECORD_TYPE) { 458a86dd8b1SGreg Roach case 'INDI': 459a86dd8b1SGreg Roach $icon = 'icon-indis'; 460a86dd8b1SGreg Roach break; 461a86dd8b1SGreg Roach case 'FAM': 462a86dd8b1SGreg Roach $icon = 'icon-sfamily'; 463a86dd8b1SGreg Roach break; 464a86dd8b1SGreg Roach case 'SOUR': 465a86dd8b1SGreg Roach $icon = 'icon-source'; 466a86dd8b1SGreg Roach break; 467a86dd8b1SGreg Roach case 'REPO': 468a86dd8b1SGreg Roach $icon = 'icon-repository'; 469a86dd8b1SGreg Roach break; 470a86dd8b1SGreg Roach case 'NOTE': 471a86dd8b1SGreg Roach $icon = 'icon-note'; 472a86dd8b1SGreg Roach break; 473a86dd8b1SGreg Roach case 'OBJE': 474a86dd8b1SGreg Roach $icon = 'icon-media'; 475a86dd8b1SGreg Roach break; 476a86dd8b1SGreg Roach default: 477a86dd8b1SGreg Roach $icon = 'icon-clippings'; 478a86dd8b1SGreg Roach break; 4798c2e8227SGreg Roach } 4808c2e8227SGreg Roach ?> 481a86dd8b1SGreg Roach <tr> 482a86dd8b1SGreg Roach <td class="list_value"> 48315d603e7SGreg Roach <i class="<?= $icon ?>"></i> 4848c2e8227SGreg Roach <?php 4858c2e8227SGreg Roach echo '<a href="', $record->getHtmlUrl(), '">', $record->getFullName(), '</a>'; 4868c2e8227SGreg Roach ?> 4878c2e8227SGreg Roach </td> 48815d603e7SGreg Roach <td class="list_value center vmiddle"><a href="module.php?mod=clippings&mod_action=index&action=remove&id=<?= $xref ?>" class="icon-remove" title="<?= I18N::translate('Remove') ?>"></a></td> 4898c2e8227SGreg Roach </tr> 4908c2e8227SGreg Roach <?php 4918c2e8227SGreg Roach } 4928c2e8227SGreg Roach } 4938c2e8227SGreg Roach ?> 4948c2e8227SGreg Roach </table> 4958c2e8227SGreg Roach <?php 4968c2e8227SGreg Roach } 4978c2e8227SGreg Roach break; 4988c2e8227SGreg Roach default: 4998c2e8227SGreg Roach http_response_code(404); 5008c2e8227SGreg Roach break; 5018c2e8227SGreg Roach } 5028c2e8227SGreg Roach } 5038c2e8227SGreg Roach 5040ee13198SGreg Roach /** 5050ee13198SGreg Roach * The user can re-order menus. Until they do, they are shown in this order. 5060ee13198SGreg Roach * 5070ee13198SGreg Roach * @return int 5080ee13198SGreg Roach */ 5098c2e8227SGreg Roach public function defaultMenuOrder() { 5108c2e8227SGreg Roach return 20; 5118c2e8227SGreg Roach } 5128c2e8227SGreg Roach 5130ee13198SGreg Roach /** 5140ee13198SGreg Roach * A menu, to be added to the main application menu. 5150ee13198SGreg Roach * 5160ee13198SGreg Roach * @return Menu|null 5170ee13198SGreg Roach */ 5188c2e8227SGreg Roach public function getMenu() { 5194b9ff166SGreg Roach global $controller, $WT_TREE; 5208c2e8227SGreg Roach 52113abd6f3SGreg Roach $submenus = []; 5228c2e8227SGreg Roach if (isset($controller->record)) { 52315d603e7SGreg Roach $submenus[] = new Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . $WT_TREE->getNameUrl(), 'menu-clippings-cart', ['rel' => 'nofollow']); 5248c2e8227SGreg Roach } 5258c2e8227SGreg Roach if (!empty($controller->record) && $controller->record->canShow()) { 52615d603e7SGreg Roach $submenus[] = new Menu(I18N::translate('Add to the clippings cart'), 'module.php?mod=clippings&mod_action=index&action=add&id=' . $controller->record->getXref(), 'menu-clippings-add', ['rel' => 'nofollow']); 5278c2e8227SGreg Roach } 528cbc1590aSGreg Roach 529941edf23SGreg Roach if ($submenus) { 53013abd6f3SGreg Roach return new Menu($this->getTitle(), '#', 'menu-clippings', ['rel' => 'nofollow'], $submenus); 531941edf23SGreg Roach } else { 53213abd6f3SGreg Roach return new Menu($this->getTitle(), 'module.php?mod=clippings&mod_action=index&ged=' . $WT_TREE->getNameUrl(), 'menu-clippings', ['rel' => 'nofollow']); 533941edf23SGreg Roach } 5348c2e8227SGreg Roach } 5358c2e8227SGreg Roach 5368c2e8227SGreg Roach /** {@inheritdoc} */ 5378c2e8227SGreg Roach public function defaultSidebarOrder() { 5388c2e8227SGreg Roach return 60; 5398c2e8227SGreg Roach } 5408c2e8227SGreg Roach 5418c2e8227SGreg Roach /** {@inheritdoc} */ 5428c2e8227SGreg Roach public function hasSidebarContent() { 5438c2e8227SGreg Roach // Creating a controller has the side effect of initialising the cart 5440e62c4b8SGreg Roach new ClippingsCartController; 5458c2e8227SGreg Roach 5468c2e8227SGreg Roach return true; 5478c2e8227SGreg Roach } 5488c2e8227SGreg Roach 54976692c8bSGreg Roach /** 55076692c8bSGreg Roach * Load this sidebar synchronously. 55176692c8bSGreg Roach * 55276692c8bSGreg Roach * @return string 55376692c8bSGreg Roach */ 5548c2e8227SGreg Roach public function getSidebarContent() { 5558c2e8227SGreg Roach global $controller; 5568c2e8227SGreg Roach 5578c2e8227SGreg Roach $controller->addInlineJavascript(' 55815d603e7SGreg Roach $("#sb_clippings_content").on("click", ".add_cart, .remove_cart", function() { 55915d603e7SGreg Roach $("#sb_clippings_content").load(this.href); 5608c2e8227SGreg Roach return false; 5618c2e8227SGreg Roach }); 5628c2e8227SGreg Roach '); 5638c2e8227SGreg Roach 5648c2e8227SGreg Roach return '<div id="sb_clippings_content">' . $this->getCartList() . '</div>'; 5658c2e8227SGreg Roach } 5668c2e8227SGreg Roach 5678c2e8227SGreg Roach /** {@inheritdoc} */ 5688c2e8227SGreg Roach public function getSidebarAjaxContent() { 56931bc7874SGreg Roach global $WT_TREE; 57031bc7874SGreg Roach 57131bc7874SGreg Roach $cart = Session::get('cart'); 5728c2e8227SGreg Roach 5730e62c4b8SGreg Roach $clip_ctrl = new ClippingsCartController; 5748c2e8227SGreg Roach $add = Filter::get('add', WT_REGEX_XREF); 5758c2e8227SGreg Roach $add1 = Filter::get('add1', WT_REGEX_XREF); 5768c2e8227SGreg Roach $remove = Filter::get('remove', WT_REGEX_XREF); 5778c2e8227SGreg Roach $others = Filter::get('others'); 5788c2e8227SGreg Roach $clip_ctrl->level1 = Filter::getInteger('level1'); 5798c2e8227SGreg Roach $clip_ctrl->level2 = Filter::getInteger('level2'); 5808c2e8227SGreg Roach $clip_ctrl->level3 = Filter::getInteger('level3'); 5818c2e8227SGreg Roach if ($add) { 58224ec66ceSGreg Roach $record = GedcomRecord::getInstance($add, $WT_TREE); 5838c2e8227SGreg Roach if ($record) { 5848c2e8227SGreg Roach $clip_ctrl->id = $record->getXref(); 5858c2e8227SGreg Roach $clip_ctrl->type = $record::RECORD_TYPE; 5868c2e8227SGreg Roach $clip_ctrl->addClipping($record); 5878c2e8227SGreg Roach } 5888c2e8227SGreg Roach } elseif ($add1) { 58924ec66ceSGreg Roach $record = Individual::getInstance($add1, $WT_TREE); 5908c2e8227SGreg Roach if ($record) { 5918c2e8227SGreg Roach $clip_ctrl->id = $record->getXref(); 5928c2e8227SGreg Roach $clip_ctrl->type = $record::RECORD_TYPE; 5938c2e8227SGreg Roach if ($others == 'parents') { 5948c2e8227SGreg Roach foreach ($record->getChildFamilies() as $family) { 5958c2e8227SGreg Roach $clip_ctrl->addClipping($family); 5968c2e8227SGreg Roach $clip_ctrl->addFamilyMembers($family); 5978c2e8227SGreg Roach } 5988c2e8227SGreg Roach } elseif ($others == 'ancestors') { 5998c2e8227SGreg Roach $clip_ctrl->addAncestorsToCart($record, $clip_ctrl->level1); 6008c2e8227SGreg Roach } elseif ($others == 'ancestorsfamilies') { 6018c2e8227SGreg Roach $clip_ctrl->addAncestorsToCartFamilies($record, $clip_ctrl->level2); 6028c2e8227SGreg Roach } elseif ($others == 'members') { 6038c2e8227SGreg Roach foreach ($record->getSpouseFamilies() as $family) { 6048c2e8227SGreg Roach $clip_ctrl->addClipping($family); 6058c2e8227SGreg Roach $clip_ctrl->addFamilyMembers($family); 6068c2e8227SGreg Roach } 6078c2e8227SGreg Roach } elseif ($others == 'descendants') { 6088c2e8227SGreg Roach foreach ($record->getSpouseFamilies() as $family) { 6098c2e8227SGreg Roach $clip_ctrl->addClipping($family); 6108c2e8227SGreg Roach $clip_ctrl->addFamilyDescendancy($family, $clip_ctrl->level3); 6118c2e8227SGreg Roach } 6128c2e8227SGreg Roach } 6138c2e8227SGreg Roach } 6148c2e8227SGreg Roach } elseif ($remove) { 61531bc7874SGreg Roach unset($cart[$WT_TREE->getTreeId()][$remove]); 61631bc7874SGreg Roach Session::put('cart', $cart); 6178c2e8227SGreg Roach } elseif (isset($_REQUEST['empty'])) { 61813abd6f3SGreg Roach $cart[$WT_TREE->getTreeId()] = []; 61931bc7874SGreg Roach Session::put('cart', $cart); 6208c2e8227SGreg Roach } elseif (isset($_REQUEST['download'])) { 621*b6468bb9SGreg Roach return $this->downloadForm(); 6228c2e8227SGreg Roach } 62331bc7874SGreg Roach 6248c2e8227SGreg Roach return $this->getCartList(); 6258c2e8227SGreg Roach } 6268c2e8227SGreg Roach 6278c2e8227SGreg Roach /** 6288c2e8227SGreg Roach * A list for the side bar. 6298c2e8227SGreg Roach * 6308c2e8227SGreg Roach * @return string 6318c2e8227SGreg Roach */ 6328c2e8227SGreg Roach public function getCartList() { 63331bc7874SGreg Roach global $WT_TREE; 6348c2e8227SGreg Roach 63513abd6f3SGreg Roach $cart = Session::get('cart', []); 63631bc7874SGreg Roach if (!array_key_exists($WT_TREE->getTreeId(), $cart)) { 63713abd6f3SGreg Roach $cart[$WT_TREE->getTreeId()] = []; 63831bc7874SGreg Roach } 6398c2e8227SGreg Roach $pid = Filter::get('pid', WT_REGEX_XREF); 6408c2e8227SGreg Roach 64131bc7874SGreg Roach if (!$cart[$WT_TREE->getTreeId()]) { 6428c2e8227SGreg Roach $out = I18N::translate('Your clippings cart is empty.'); 6438c2e8227SGreg Roach } else { 644*b6468bb9SGreg Roach $out = ''; 645*b6468bb9SGreg Roach if (!empty($cart[$WT_TREE->getTreeId()])) { 646*b6468bb9SGreg Roach $out .= 647*b6468bb9SGreg Roach '<a href="module.php?mod=' . $this->getName() . '&mod_action=ajax&empty=true&pid=' . $pid . '" class="remove_cart">' . 648*b6468bb9SGreg Roach I18N::translate('Empty the clippings cart') . 649*b6468bb9SGreg Roach '</a>' . 650*b6468bb9SGreg Roach '<br>' . 651*b6468bb9SGreg Roach '<a href="module.php?mod=' . $this->getName() . '&mod_action=ajax&download=true&pid=' . $pid . '" class="add_cart">' . 652*b6468bb9SGreg Roach I18N::translate('Download') . 653*b6468bb9SGreg Roach '</a><br><br>'; 654*b6468bb9SGreg Roach } 655*b6468bb9SGreg Roach $out .= '<ul>'; 65631bc7874SGreg Roach foreach (array_keys($cart[$WT_TREE->getTreeId()]) as $xref) { 65724ec66ceSGreg Roach $record = GedcomRecord::getInstance($xref, $WT_TREE); 6588c2e8227SGreg Roach if ($record instanceof Individual || $record instanceof Family) { 6598c2e8227SGreg Roach switch ($record::RECORD_TYPE) { 6608c2e8227SGreg Roach case 'INDI': 6618c2e8227SGreg Roach $icon = 'icon-indis'; 6628c2e8227SGreg Roach break; 6638c2e8227SGreg Roach case 'FAM': 6648c2e8227SGreg Roach $icon = 'icon-sfamily'; 6658c2e8227SGreg Roach break; 6668c2e8227SGreg Roach } 6678c2e8227SGreg Roach $out .= '<li>'; 6688c2e8227SGreg Roach if (!empty($icon)) { 6698c2e8227SGreg Roach $out .= '<i class="' . $icon . '"></i>'; 6708c2e8227SGreg Roach } 6718c2e8227SGreg Roach $out .= '<a href="' . $record->getHtmlUrl() . '">'; 6728c2e8227SGreg Roach if ($record instanceof Individual) { 6738c2e8227SGreg Roach $out .= $record->getSexImage(); 6748c2e8227SGreg Roach } 6758c2e8227SGreg Roach $out .= ' ' . $record->getFullName() . ' '; 6768c2e8227SGreg Roach if ($record instanceof Individual && $record->canShow()) { 6778c2e8227SGreg Roach $out .= ' (' . $record->getLifeSpan() . ')'; 6788c2e8227SGreg Roach } 6798c2e8227SGreg Roach $out .= '</a>'; 680cdaf7c6cSGreg Roach $out .= '<a class="icon-remove remove_cart" href="module.php?mod=' . $this->getName() . '&mod_action=ajax&remove=' . $xref . '&pid=' . $pid . '" title="' . I18N::translate('Remove') . '"></a>'; 6818c2e8227SGreg Roach $out .= '</li>'; 6828c2e8227SGreg Roach } 6838c2e8227SGreg Roach } 6848c2e8227SGreg Roach $out .= '</ul>'; 6858c2e8227SGreg Roach } 6868c2e8227SGreg Roach 68724ec66ceSGreg Roach $record = Individual::getInstance($pid, $WT_TREE); 68831bc7874SGreg Roach if ($record && !array_key_exists($record->getXref(), $cart[$WT_TREE->getTreeId()])) { 689beb9c394SGreg Roach $out .= '<br><a href="module.php?mod=' . $this->getName() . '&mod_action=ajax&action=add1&type=INDI&id=' . $pid . '&pid=' . $pid . '" class="add_cart"><i class="icon-clippings"></i> ' . I18N::translate('Add %s to the clippings cart', $record->getFullName()) . '</a>'; 6908c2e8227SGreg Roach } 691cbc1590aSGreg Roach 6928c2e8227SGreg Roach return $out; 6938c2e8227SGreg Roach } 6948c2e8227SGreg Roach 6958c2e8227SGreg Roach /** 69676692c8bSGreg Roach * A form to choose the download options. 69776692c8bSGreg Roach * 6988c2e8227SGreg Roach * @return string 6998c2e8227SGreg Roach */ 700*b6468bb9SGreg Roach public function downloadForm() { 7018c2e8227SGreg Roach global $WT_TREE; 7028c2e8227SGreg Roach 7038c2e8227SGreg Roach $pid = Filter::get('pid', WT_REGEX_XREF); 7048c2e8227SGreg Roach 7058c2e8227SGreg Roach $out = '<script>'; 7068c2e8227SGreg Roach $out .= 'function cancelDownload() { 707cdaf7c6cSGreg Roach var link = "module.php?mod=' . $this->getName() . '&mod_action=ajax&pid=' . $pid . '"; 70815d603e7SGreg Roach $("#sb_clippings_content").load(link); 7098c2e8227SGreg Roach }'; 7108c2e8227SGreg Roach $out .= '</script>'; 71115d603e7SGreg Roach $out .= '<form action="module.php"> 7128c2e8227SGreg Roach <input type="hidden" name="mod" value="clippings"> 7138c2e8227SGreg Roach <input type="hidden" name="mod_action" value="index"> 7148c2e8227SGreg Roach <input type="hidden" name="pid" value="' . $pid . '"> 7158c2e8227SGreg Roach <input type="hidden" name="action" value="download"> 7168c2e8227SGreg Roach <table> 7178c2e8227SGreg Roach <tr><td colspan="2" class="topbottombar"><h2>' . I18N::translate('Download') . '</h2></td></tr> 7188c2e8227SGreg Roach '; 7198c2e8227SGreg Roach 7204b9ff166SGreg Roach if (Auth::isManager($WT_TREE)) { 7218c2e8227SGreg Roach $out .= 722d1928687SGreg Roach '<tr><td class="descriptionbox width50 wrap">' . I18N::translate('Apply privacy settings') . '</td>' . 7238c2e8227SGreg Roach '<td class="optionbox">' . 7248c2e8227SGreg Roach '<input type="radio" name="privatize_export" value="none" checked> ' . I18N::translate('None') . '<br>' . 7258c2e8227SGreg Roach '<input type="radio" name="privatize_export" value="gedadmin"> ' . I18N::translate('Manager') . '<br>' . 7268c2e8227SGreg Roach '<input type="radio" name="privatize_export" value="user"> ' . I18N::translate('Member') . '<br>' . 7278c2e8227SGreg Roach '<input type="radio" name="privatize_export" value="visitor"> ' . I18N::translate('Visitor') . 7288c2e8227SGreg Roach '</td></tr>'; 7294b9ff166SGreg Roach } elseif (Auth::isMember($WT_TREE)) { 7308c2e8227SGreg Roach $out .= 731d1928687SGreg Roach '<tr><td class="descriptionbox width50 wrap">' . I18N::translate('Apply privacy settings') . '</td>' . 7328c2e8227SGreg Roach '<td class="list_value">' . 7338c2e8227SGreg Roach '<input type="radio" name="privatize_export" value="user" checked> ' . I18N::translate('Member') . '<br>' . 7348c2e8227SGreg Roach '<input type="radio" name="privatize_export" value="visitor"> ' . I18N::translate('Visitor') . 7358c2e8227SGreg Roach '</td></tr>'; 7368c2e8227SGreg Roach } 7378c2e8227SGreg Roach 7388c2e8227SGreg Roach $out .= ' 739d1928687SGreg Roach <tr><td class="descriptionbox width50 wrap">' . I18N::translate('Convert from UTF-8 to ISO-8859-1') . '</td> 7408c2e8227SGreg Roach <td class="optionbox"><input type="checkbox" name="convert" value="yes"></td></tr> 7418c2e8227SGreg Roach 7428c2e8227SGreg Roach <tr><td class="topbottombar" colspan="2"> 743*b6468bb9SGreg Roach <input type="button" class="btn btn-secondary" value="' . /* I18N: A button label. */ I18N::translate('cancel') . '" onclick="cancelDownload();"> 744*b6468bb9SGreg Roach <input type="submit" class="btn btn-primary" value="' . /* I18N: A button label. */ I18N::translate('download') . '"> 7458c2e8227SGreg Roach </form>'; 7468c2e8227SGreg Roach 7478c2e8227SGreg Roach return $out; 7488c2e8227SGreg Roach } 7498c2e8227SGreg Roach} 750