xref: /webtrees/app/Module/MissingFactsReportModule.php (revision 2c2c92e6806fc0a4c57e0b7af1b85615c041c083)
13763c3f2SGreg Roach<?php
23763c3f2SGreg Roach/**
33763c3f2SGreg Roach * webtrees: online genealogy
41062a142SGreg Roach * Copyright (C) 2018 webtrees development team
53763c3f2SGreg Roach * This program is free software: you can redistribute it and/or modify
63763c3f2SGreg Roach * it under the terms of the GNU General Public License as published by
73763c3f2SGreg Roach * the Free Software Foundation, either version 3 of the License, or
83763c3f2SGreg Roach * (at your option) any later version.
93763c3f2SGreg Roach * This program is distributed in the hope that it will be useful,
103763c3f2SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
113763c3f2SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
123763c3f2SGreg Roach * GNU General Public License for more details.
133763c3f2SGreg Roach * You should have received a copy of the GNU General Public License
143763c3f2SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
153763c3f2SGreg Roach */
16e7f56f2aSGreg Roachdeclare(strict_types=1);
17e7f56f2aSGreg Roach
1876692c8bSGreg Roachnamespace Fisharebest\Webtrees\Module;
1976692c8bSGreg Roach
200e62c4b8SGreg Roachuse Fisharebest\Webtrees\Auth;
210e62c4b8SGreg Roachuse Fisharebest\Webtrees\I18N;
22*2c2c92e6SGreg Roachuse Fisharebest\Webtrees\Individual;
230e62c4b8SGreg Roachuse Fisharebest\Webtrees\Menu;
243763c3f2SGreg Roach
253763c3f2SGreg Roach/**
263763c3f2SGreg Roach * Class MissingFactsReportModule
273763c3f2SGreg Roach */
28c1010edaSGreg Roachclass MissingFactsReportModule extends AbstractModule implements ModuleReportInterface
29c1010edaSGreg Roach{
303763c3f2SGreg Roach    /** {@inheritdoc} */
318f53f488SRico Sonntag    public function getTitle(): string
32c1010edaSGreg Roach    {
333763c3f2SGreg Roach        // This text also appears in the .XML file - update both together
34bbb76c12SGreg Roach        /* I18N: Name of a module/report */
35bbb76c12SGreg Roach        return I18N::translate('Missing data');
363763c3f2SGreg Roach    }
373763c3f2SGreg Roach
383763c3f2SGreg Roach    /** {@inheritdoc} */
398f53f488SRico Sonntag    public function getDescription(): string
40c1010edaSGreg Roach    {
413763c3f2SGreg Roach        // This text also appears in the .XML file - update both together
42bbb76c12SGreg Roach        /* I18N: Description of the “Missing data” */
43bbb76c12SGreg Roach        return I18N::translate('A report of the information that is missing for an individual and their relatives.');
443763c3f2SGreg Roach    }
453763c3f2SGreg Roach
460ee13198SGreg Roach    /**
470ee13198SGreg Roach     * What is the default access level for this module?
480ee13198SGreg Roach     * Some modules are aimed at admins or managers, and are not generally shown to users.
490ee13198SGreg Roach     *
500ee13198SGreg Roach     * @return int
510ee13198SGreg Roach     */
528f53f488SRico Sonntag    public function defaultAccessLevel(): int
53c1010edaSGreg Roach    {
543763c3f2SGreg Roach        return Auth::PRIV_USER;
553763c3f2SGreg Roach    }
563763c3f2SGreg Roach
570ee13198SGreg Roach    /**
580ee13198SGreg Roach     * Return a menu item for this report.
590ee13198SGreg Roach     *
60*2c2c92e6SGreg Roach     * @param Individual $individual
61dc809433SGreg Roach     *
620ee13198SGreg Roach     * @return Menu
630ee13198SGreg Roach     */
64*2c2c92e6SGreg Roach    public function getReportMenu(Individual $individual): Menu
65c1010edaSGreg Roach    {
660ee13198SGreg Roach        return new Menu(
673763c3f2SGreg Roach            $this->getTitle(),
68*2c2c92e6SGreg Roach            route('report-setup', [
69*2c2c92e6SGreg Roach                'xref'   => $individual->xref(),
70*2c2c92e6SGreg Roach                'ged'    => $individual->tree()->name(),
71c1010edaSGreg Roach                'report' => $this->getName(),
72c1010edaSGreg Roach            ]),
730ee13198SGreg Roach            'menu-report-' . $this->getName(),
7413abd6f3SGreg Roach            ['rel' => 'nofollow']
753763c3f2SGreg Roach        );
763763c3f2SGreg Roach    }
773763c3f2SGreg Roach}
78