Skip to content

Commit 5eea127

Browse files
committed
Merge branch 'support/2.13.0' into support/2.14.0
2 parents 4534735 + 6ed85cd commit 5eea127

2 files changed

Lines changed: 80 additions & 0 deletions

File tree

front/wizardreminders.php

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
/**
3+
* ---------------------------------------------------------------------
4+
* Formcreator is a plugin which allows creation of custom forms of
5+
* easy access.
6+
* ---------------------------------------------------------------------
7+
* LICENSE
8+
*
9+
* This file is part of Formcreator.
10+
*
11+
* Formcreator is free software; you can redistribute it and/or modify
12+
* it under the terms of the GNU General Public License as published by
13+
* the Free Software Foundation; either version 2 of the License, or
14+
* (at your option) any later version.
15+
*
16+
* Formcreator is distributed in the hope that it will be useful,
17+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
* GNU General Public License for more details.
20+
*
21+
* You should have received a copy of the GNU General Public License
22+
* along with Formcreator. If not, see <http://www.gnu.org/licenses/>.
23+
* ---------------------------------------------------------------------
24+
* @copyright Copyright © 2011 - 2021 Teclib'
25+
* @license http://www.gnu.org/licenses/gpl.txt GPLv3+
26+
* @link https://github.com/pluginsGLPI/formcreator/
27+
* @link https://pluginsglpi.github.io/formcreator/
28+
* @link http://plugins.glpi-project.org/#/plugin/formcreator
29+
* ---------------------------------------------------------------------
30+
*/
31+
32+
global $CFG_GLPI;
33+
include ("../../../inc/includes.php");
34+
35+
// Check if plugin is activated...
36+
if (!(new Plugin())->isActivated('formcreator')) {
37+
Html::displayNotFoundError();
38+
}
39+
40+
if (! plugin_formcreator_replaceHelpdesk()) {
41+
Html::redirect($CFG_GLPI['root_doc']."/front/helpdesk.public.php");
42+
}
43+
44+
if (!Reminder::canView()) {
45+
Html::displayRightError();
46+
}
47+
48+
if (Session::getCurrentInterface() == "helpdesk") {
49+
Html::helpHeader(__('Service catalog', 'formcreator'));
50+
} else {
51+
Html::header(__('Service catalog', 'formcreator'));
52+
}
53+
54+
Reminder::showListForCentral(false);
55+
56+
if (Session::getCurrentInterface() == "helpdesk") {
57+
Html::helpFooter();
58+
} else {
59+
Html::footer();
60+
}

inc/common.class.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,26 @@ public static function hookRedefineMenu($menus) {
773773
$newMenu['reservation'] = $menus['reservation'];
774774
}
775775
}
776+
$reminderTable = Reminder::getTable();
777+
$criteria = [
778+
'SELECT' => "$reminderTable.*",
779+
'DISTINCT' => true,
780+
'FROM' => $reminderTable,
781+
'ORDER' => "$reminderTable.name"
782+
];
783+
$criteria = $criteria + Reminder::getVisibilityCriteria();
784+
$criteria['WHERE']["$reminderTable.users_id"] = ['<>', Session::getLoginUserID()];
785+
$iterator = $DB->request($criteria);
786+
$hasReminder = $iterator->count() > 0;
787+
788+
if (Reminder::canView() && $hasReminder) {
789+
$newMenu['reminders'] = [
790+
'default' => Plugin::getWebDir('formcreator', false) . '/front/wizardreminders.php',
791+
'title' => __('Consult reminders', 'formcreator'),
792+
'icon' => 'fa fa-sticky-note',
793+
];
794+
}
795+
776796
$rssFeedTable = RSSFeed::getTable();
777797
$criteria = [
778798
'SELECT' => "$rssFeedTable.*",

0 commit comments

Comments
 (0)