-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathReviewersControlReportReportPlugin.php
More file actions
89 lines (79 loc) · 2.89 KB
/
Copy pathReviewersControlReportReportPlugin.php
File metadata and controls
89 lines (79 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
namespace APP\plugins\generic\reviewersControlReport;
use APP\plugins\generic\reviewersControlReport\classes\ReviewersControlReportForm;
use APP\template\TemplateManager;
use PKP\config\Config;
use PKP\plugins\ReportPlugin;
/**
* @file plugins/generic/reviewersControlReport/ReviewersControlReportReportPlugin.php
*
* Copyright (c) 2019-2023 Lepidus Tecnologia
* Distributed under the GNU GPL v3. For full terms see the file LICENSE.
*
* @class ReviewersControlReportReportPlugin
* @ingroup plugin_reports_reviewersControlReport
*
* @brief reviewersControlReport plugin class
*/
class ReviewersControlReportReportPlugin extends ReportPlugin
{
public function register($category, $path, $mainContextId = null): ?bool
{
$success = parent::register($category, $path, $mainContextId);
if ($success && Config::getVar('general', 'installed')) {
$this->addLocaleData();
return true;
}
return $success;
}
public function getName(): string
{
return 'ReviewersControlReportReportPlugin';
}
public function getDisplayName(): string
{
return __('plugins.reports.reviewersControlReport.displayName');
}
public function getDescription(): string
{
return __('plugins.reports.reviewersControlReport.description');
}
public function display($args, $request): void
{
$form = new ReviewersControlReportForm($this);
if ($request->isPost()) {
$form->readInputData();
if ($form->validate()) {
$form->generateReport($request);
return;
}
} else {
$form->initData();
}
$templateManager = TemplateManager::getManager($request);
$templateManager->addStyleSheet(
'reviewersControlReport',
$request->getBaseUrl() . '/' . $this->getPluginPath() . '/styles/reviewersControlReport.css',
['contexts' => 'backend']
);
$templateManager->assign([
'breadcrumbs' => [
[
'id' => 'reports',
'name' => __('manager.statistics.reports'),
'url' => $request->getRouter()->url($request, null, 'stats', 'reports'),
],
[
'id' => 'reviewersControlReport',
'name' => __('plugins.reports.reviewersControlReport.displayName')
],
],
'pageTitle' => __('plugins.reports.reviewersControlReport.displayName'),
'reportTypes' => [
ReviewersControlReportForm::REPORT_TYPE_REVIEWERS => __('plugins.reports.reviewersControlReport.reportType.reviewers'),
ReviewersControlReportForm::REPORT_TYPE_REVIEWS => __('plugins.reports.reviewersControlReport.reportType.reviews'),
],
]);
$form->display($request);
}
}