xref: /webtrees/app/Module/BirthDeathMarriageReportModule.php (revision 76692c8b291f16d9251d67f27078779f6737fe7e)
10e62c4b8SGreg Roach<?php
20e62c4b8SGreg Roach/**
30e62c4b8SGreg Roach * webtrees: online genealogy
40e62c4b8SGreg Roach * Copyright (C) 2015 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 */
16*76692c8bSGreg Roachnamespace Fisharebest\Webtrees\Module;
17*76692c8bSGreg Roach
180e62c4b8SGreg Roachuse Fisharebest\Webtrees\Auth;
190e62c4b8SGreg Roachuse Fisharebest\Webtrees\I18N;
200e62c4b8SGreg Roachuse Fisharebest\Webtrees\Menu;
210e62c4b8SGreg Roach
220e62c4b8SGreg Roach/**
230e62c4b8SGreg Roach * Class BirthDeathMarriageReportModule
240e62c4b8SGreg Roach */
250e62c4b8SGreg Roachclass BirthDeathMarriageReportModule extends AbstractModule implements ModuleReportInterface {
26*76692c8bSGreg Roach	/**
27*76692c8bSGreg Roach	 * How should this module be labelled on tabs, menus, etc.?
28*76692c8bSGreg Roach	 *
29*76692c8bSGreg Roach	 * @return string
30*76692c8bSGreg Roach	 */
310e62c4b8SGreg Roach	public function getTitle() {
320e62c4b8SGreg Roach		// This text also appears in the .XML file - update both together
330e62c4b8SGreg Roach		return /* I18N: Name of a module/report. “Vital records” are life events - birth/marriage/death */ I18N::translate('Vital records');
340e62c4b8SGreg Roach	}
350e62c4b8SGreg Roach
36*76692c8bSGreg Roach	/**
37*76692c8bSGreg Roach	 * A sentence describing what this module does.
38*76692c8bSGreg Roach	 *
39*76692c8bSGreg Roach	 * @return string
40*76692c8bSGreg Roach	 */
410e62c4b8SGreg Roach	public function getDescription() {
420e62c4b8SGreg Roach		// This text also appears in the .XML file - update both together
430e62c4b8SGreg 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.');
440e62c4b8SGreg Roach	}
450e62c4b8SGreg Roach
46*76692c8bSGreg Roach	/**
47*76692c8bSGreg Roach	 * What is the default access level for this module?
48*76692c8bSGreg Roach	 *
49*76692c8bSGreg Roach	 * Some modules are aimed at admins or managers, and are not generally shown to users.
50*76692c8bSGreg Roach	 *
51*76692c8bSGreg Roach	 * @return int
52*76692c8bSGreg Roach	 */
530e62c4b8SGreg Roach	public function defaultAccessLevel() {
540e62c4b8SGreg Roach		return Auth::PRIV_PRIVATE;
550e62c4b8SGreg Roach	}
560e62c4b8SGreg Roach
57*76692c8bSGreg Roach	/**
58*76692c8bSGreg Roach	 * Return a list of (usually just one) menu items.
59*76692c8bSGreg Roach	 *
60*76692c8bSGreg Roach	 * @return Menu[]
61*76692c8bSGreg Roach	 */
620e62c4b8SGreg Roach	public function getReportMenus() {
630e62c4b8SGreg Roach		global $WT_TREE;
640e62c4b8SGreg Roach
650e62c4b8SGreg Roach		$menus = array();
660e62c4b8SGreg Roach		$menu  = new Menu(
670e62c4b8SGreg Roach			$this->getTitle(),
680e62c4b8SGreg Roach			'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&amp;action=setup&amp;report=' . WT_MODULES_DIR . $this->getName() . '/report.xml',
690e62c4b8SGreg Roach			'menu-report-' . $this->getName()
700e62c4b8SGreg Roach		);
710e62c4b8SGreg Roach		$menus[] = $menu;
720e62c4b8SGreg Roach
730e62c4b8SGreg Roach		return $menus;
740e62c4b8SGreg Roach	}
750e62c4b8SGreg Roach}
76