18c2e8227SGreg Roach<?php 28c2e8227SGreg Roach/** 38c2e8227SGreg Roach * webtrees: online genealogy 48c2e8227SGreg Roach * Copyright (C) 2015 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\I18N; 200e62c4b8SGreg Roachuse Fisharebest\Webtrees\Menu; 218c2e8227SGreg Roach 228c2e8227SGreg Roach/** 238c2e8227SGreg Roach * Class OccupationReportModule 248c2e8227SGreg Roach */ 25e2a378d3SGreg Roachclass OccupationReportModule extends AbstractModule implements ModuleReportInterface { 268c2e8227SGreg Roach /** {@inheritdoc} */ 278c2e8227SGreg Roach public function getTitle() { 288c2e8227SGreg Roach // This text also appears in the .XML file - update both together 298c2e8227SGreg Roach return /* I18N: Name of a report */ I18N::translate('Occupations'); 308c2e8227SGreg Roach } 318c2e8227SGreg Roach 328c2e8227SGreg Roach /** {@inheritdoc} */ 338c2e8227SGreg Roach public function getDescription() { 348c2e8227SGreg Roach // This text also appears in the .XML file - update both together 358c2e8227SGreg Roach return /* I18N: Description of the “Occupations” module */ I18N::translate('A report of individuals who had a given occupation.'); 368c2e8227SGreg Roach } 378c2e8227SGreg Roach 38*0ee13198SGreg Roach /** 39*0ee13198SGreg Roach * What is the default access level for this module? 40*0ee13198SGreg Roach * 41*0ee13198SGreg Roach * Some modules are aimed at admins or managers, and are not generally shown to users. 42*0ee13198SGreg Roach * 43*0ee13198SGreg Roach * @return int 44*0ee13198SGreg Roach */ 458c2e8227SGreg Roach public function defaultAccessLevel() { 464b9ff166SGreg Roach return Auth::PRIV_USER; 478c2e8227SGreg Roach } 488c2e8227SGreg Roach 49*0ee13198SGreg Roach /** 50*0ee13198SGreg Roach * Return a menu item for this report. 51*0ee13198SGreg Roach * 52*0ee13198SGreg Roach * @return Menu 53*0ee13198SGreg Roach */ 54*0ee13198SGreg Roach public function getReportMenu() { 554b9ff166SGreg Roach global $WT_TREE; 564b9ff166SGreg Roach 57*0ee13198SGreg Roach return new Menu( 588c2e8227SGreg Roach $this->getTitle(), 594b9ff166SGreg Roach 'reportengine.php?ged=' . $WT_TREE->getNameUrl() . '&action=setup&report=' . WT_MODULES_DIR . $this->getName() . '/report.xml', 60*0ee13198SGreg Roach 'menu-report-' . $this->getName(), 61*0ee13198SGreg Roach array('rel' => 'nofollow') 628c2e8227SGreg Roach ); 638c2e8227SGreg Roach } 648c2e8227SGreg Roach} 65