xref: /webtrees/app/Module/BirthDeathMarriageReportModule.php (revision dc809433c88836dc8210543ebbe3c78e35d80084)
10e62c4b8SGreg Roach<?php
20e62c4b8SGreg Roach/**
30e62c4b8SGreg Roach * webtrees: online genealogy
41062a142SGreg Roach * Copyright (C) 2018 webtrees development team
50e62c4b8SGreg Roach * This program is free software: you can redistribute it and/or modify
60e62c4b8SGreg Roach * it under the terms of the GNU General Public License as published by
70e62c4b8SGreg Roach * the Free Software Foundation, either version 3 of the License, or
80e62c4b8SGreg Roach * (at your option) any later version.
90e62c4b8SGreg Roach * This program is distributed in the hope that it will be useful,
100e62c4b8SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
110e62c4b8SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
120e62c4b8SGreg Roach * GNU General Public License for more details.
130e62c4b8SGreg Roach * You should have received a copy of the GNU General Public License
140e62c4b8SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
150e62c4b8SGreg Roach */
1676692c8bSGreg Roachnamespace Fisharebest\Webtrees\Module;
1776692c8bSGreg Roach
180e62c4b8SGreg Roachuse Fisharebest\Webtrees\Auth;
190e62c4b8SGreg Roachuse Fisharebest\Webtrees\I18N;
200e62c4b8SGreg Roachuse Fisharebest\Webtrees\Menu;
21*dc809433SGreg Roachuse Fisharebest\Webtrees\Tree;
220e62c4b8SGreg Roach
230e62c4b8SGreg Roach/**
240e62c4b8SGreg Roach * Class BirthDeathMarriageReportModule
250e62c4b8SGreg Roach */
260e62c4b8SGreg Roachclass BirthDeathMarriageReportModule extends AbstractModule implements ModuleReportInterface {
2776692c8bSGreg Roach	/**
2876692c8bSGreg Roach	 * How should this module be labelled on tabs, menus, etc.?
2976692c8bSGreg Roach	 *
3076692c8bSGreg Roach	 * @return string
3176692c8bSGreg Roach	 */
320e62c4b8SGreg Roach	public function getTitle() {
330e62c4b8SGreg Roach		// This text also appears in the .XML file - update both together
340e62c4b8SGreg Roach		return /* I18N: Name of a module/report. “Vital records” are life events - birth/marriage/death */ I18N::translate('Vital records');
350e62c4b8SGreg Roach	}
360e62c4b8SGreg Roach
3776692c8bSGreg Roach	/**
3876692c8bSGreg Roach	 * A sentence describing what this module does.
3976692c8bSGreg Roach	 *
4076692c8bSGreg Roach	 * @return string
4176692c8bSGreg Roach	 */
420e62c4b8SGreg Roach	public function getDescription() {
430e62c4b8SGreg Roach		// This text also appears in the .XML file - update both together
440e62c4b8SGreg Roach		return /* I18N: Description of the “Vital records” module. “Vital records” are life events - birth/marriage/death */ I18N::translate('A report of vital records for a given date or place.');
450e62c4b8SGreg Roach	}
460e62c4b8SGreg Roach
4776692c8bSGreg Roach	/**
4876692c8bSGreg Roach	 * What is the default access level for this module?
4976692c8bSGreg Roach	 *
5076692c8bSGreg Roach	 * Some modules are aimed at admins or managers, and are not generally shown to users.
5176692c8bSGreg Roach	 *
5276692c8bSGreg Roach	 * @return int
5376692c8bSGreg Roach	 */
540e62c4b8SGreg Roach	public function defaultAccessLevel() {
550e62c4b8SGreg Roach		return Auth::PRIV_PRIVATE;
560e62c4b8SGreg Roach	}
570e62c4b8SGreg Roach
5876692c8bSGreg Roach	/**
590ee13198SGreg Roach	 * Return a menu item for this report.
6076692c8bSGreg Roach	 *
610ee13198SGreg Roach	 * @return Menu
6276692c8bSGreg Roach	 */
63*dc809433SGreg Roach	public function getReportMenu(Tree $tree): Menu {
640ee13198SGreg Roach		return new Menu(
650e62c4b8SGreg Roach			$this->getTitle(),
66*dc809433SGreg Roach			e(route('report-setup', ['ged' => $tree->getName(), 'report' => $this->getName()])),
670ee13198SGreg Roach			'menu-report-' . $this->getName(),
6813abd6f3SGreg Roach			['rel' => 'nofollow']
690e62c4b8SGreg Roach		);
700e62c4b8SGreg Roach	}
710e62c4b8SGreg Roach}
72