xref: /webtrees/app/Module/BirthDeathMarriageReportModule.php (revision 962e29c940cdd655a7b3eb3820043674ccfe6852)
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;
21dc809433SGreg 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	 *
61*962e29c9SGreg Roach	 * @param Tree $tree
62*962e29c9SGreg Roach	 *
630ee13198SGreg Roach	 * @return Menu
6476692c8bSGreg Roach	 */
65dc809433SGreg Roach	public function getReportMenu(Tree $tree): Menu {
660ee13198SGreg Roach		return new Menu(
670e62c4b8SGreg Roach			$this->getTitle(),
68dc809433SGreg Roach			e(route('report-setup', ['ged' => $tree->getName(), 'report' => $this->getName()])),
690ee13198SGreg Roach			'menu-report-' . $this->getName(),
7013abd6f3SGreg Roach			['rel' => 'nofollow']
710e62c4b8SGreg Roach		);
720e62c4b8SGreg Roach	}
730e62c4b8SGreg Roach}
74