Skip to content

Commit 070e875

Browse files
committed
Prepare 9.5
1 parent 7b231fa commit 070e875

9 files changed

Lines changed: 95 additions & 20 deletions

hook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function plugin_satisfaction_install() {
1010
include_once(GLPI_ROOT . "/plugins/satisfaction/inc/notificationtargetticket.class.php");
1111

1212
if (!$DB->tableExists("glpi_plugin_satisfaction_surveys")) {
13-
$DB->runFile(GLPI_ROOT . "/plugins/satisfaction/install/sql/empty-1.4.5.sql");
13+
$DB->runFile(GLPI_ROOT . "/plugins/satisfaction/install/sql/empty-1.5.0.sql");
1414

1515
} else {
1616
if (!$DB->fieldExists("glpi_plugin_satisfaction_surveyquestions", "type")) {

inc/dashboard.class.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function getWidgetTitle($widgetId) {
8282
function getIcon($icon) {
8383
switch ($icon) {
8484
case self::ICON_CIRCLE:
85-
return "<i class='fa fa-info-circle'></i>";
85+
return "<i class='fas fa-info-circle'></i>";
8686
}
8787
}
8888

@@ -225,7 +225,7 @@ function addDateCriteria(&$query, $dateBegin, $dateEnd){
225225
$result = $DB->query($query);
226226

227227
if ($DB->numrows($result)) {
228-
while ($data = $DB->fetch_assoc($result)) {
228+
while ($data = $DB->fetchAssoc($result)) {
229229
$numberOfSurveys = $data['nb'];
230230
}
231231
}
@@ -238,7 +238,7 @@ function addDateCriteria(&$query, $dateBegin, $dateEnd){
238238
$result = $DB->query($query);
239239

240240
if ($DB->numrows($result)) {
241-
while ($data = $DB->fetch_assoc($result)) {
241+
while ($data = $DB->fetchAssoc($result)) {
242242
$numberOfImpactedTickets = $data['nb'];
243243
}
244244
}
@@ -252,7 +252,7 @@ function addDateCriteria(&$query, $dateBegin, $dateEnd){
252252
$result = $DB->query($query);
253253

254254
if ($DB->numrows($result)) {
255-
while ($data = $DB->fetch_assoc($result)) {
255+
while ($data = $DB->fetchAssoc($result)) {
256256
$numberSurveyNotAnswered = $data['nb'];
257257
}
258258
}
@@ -266,7 +266,7 @@ function addDateCriteria(&$query, $dateBegin, $dateEnd){
266266
$result = $DB->query($query);
267267

268268
if ($DB->numrows($result)) {
269-
while ($data = $DB->fetch_assoc($result)) {
269+
while ($data = $DB->fetchAssoc($result)) {
270270
$numberSurveyAnswered = $data['nb'];
271271
}
272272
}
@@ -280,7 +280,7 @@ function addDateCriteria(&$query, $dateBegin, $dateEnd){
280280
$result = $DB->query($query);
281281

282282
if ($DB->numrows($result)) {
283-
while ($data = $DB->fetch_assoc($result)) {
283+
while ($data = $DB->fetchAssoc($result)) {
284284
$globalSatisfaction = $data['nb'];
285285
}
286286
}

inc/menu.class.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,15 @@ static function getMenuContent() {
3131
}
3232
}
3333

34+
$menu['icon'] = self::getIcon();
35+
3436
return $menu;
3537
}
3638

39+
static function getIcon() {
40+
return "fas fa-thumbs-up";
41+
}
42+
3743
static function removeRightsFromSession() {
3844
if (isset($_SESSION['glpimenu']['admin']['types']['PluginSatisfactionMenu'])) {
3945
unset($_SESSION['glpimenu']['admin']['types']['PluginSatisfactionMenu']);

inc/notificationMailing.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function getItems($resources_id, $start = 0) {
151151

152152
$result = $DB->query($query);
153153
if ($DB->numrows($result)) {
154-
while ($data = $DB->fetch_assoc($result)) {
154+
while ($data = $DB->fetchAssoc($result)) {
155155
$output[$data['id']] = $data;
156156
}
157157
}

inc/reminder.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static function getTicketSatisfaction($date_begin, $date_answered, $entities_id)
100100
$result = $DB->query($query);
101101

102102
if ($DB->numrows($result)) {
103-
while ($data = $DB->fetch_assoc($result)) {
103+
while ($data = $DB->fetchAssoc($result)) {
104104
$ticketSatisfactions[] = $data;
105105
}
106106
}

inc/surveyresult.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static function showResult(PluginSatisfactionSurvey $item) {
8383
if ($total_number == 0) {
8484
echo "<div class='center'>";
8585
echo "<table class='tab_cadre_fixe'>";
86-
echo "<tr><th>" . __('No result of the survey', 'satisfaction') . "</th></tr>";
86+
echo "<tr class='tab_bg_1'><th>" . __('No result of the survey', 'satisfaction') . "</th></trclass>";
8787
echo "</table>";
8888
echo "</div><br>";
8989
return;
@@ -96,7 +96,7 @@ static function showResult(PluginSatisfactionSurvey $item) {
9696
echo "<div class='center'>";
9797
echo "<table class='tab_cadre_fixehov'>";
9898
if ($total_number > 0) {
99-
echo "<tr>";
99+
echo "<tr class='tab_bg_1'>";
100100
echo "<th>" . __('Ticket') . "</th>";
101101

102102
$squestion_obj = new PluginSatisfactionSurveyQuestion;
@@ -121,7 +121,7 @@ static function showResult(PluginSatisfactionSurvey $item) {
121121
$iterator = $DB->request($query);
122122

123123
while ($data = $iterator->next()) {
124-
echo "<tr>";
124+
echo "<tr class='tab_bg_1'>";
125125

126126
$ticket_satisfaction = new TicketSatisfaction();
127127
$ticket_satisfaction->getFromDBByRequest(['WHERE' =>

inc/surveytranslation.dao.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static function getSurveyTranslationByCrit($crit = []){
6262

6363
$result = $DB->query($query);
6464

65-
while ($data = $DB->fetch_assoc($result)) {
65+
while ($data = $DB->fetchAssoc($result)) {
6666
$datas[] = $data;
6767
}
6868
return $datas;
@@ -91,7 +91,7 @@ static function countSurveyTranslationByCrit($crit = []){
9191
}
9292

9393
$result = $DB->query($query);
94-
while ($data = $DB->fetch_assoc($result)) {
94+
while ($data = $DB->fetchAssoc($result)) {
9595
return $data['nb'];
9696
}
9797
return 0;
@@ -104,7 +104,7 @@ static function getSurveyTranslationByID($ID){
104104
$query .=" WHERE `id` = ".$ID;
105105

106106
$result = $DB->query($query);
107-
while ($data = $DB->fetch_assoc($result)) {
107+
while ($data = $DB->fetchAssoc($result)) {
108108
return $data;
109109
}
110110
}

install/sql/empty-1.5.0.sql

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# noinspection SqlNoDataSourceInspectionForFile
2+
3+
CREATE TABLE `glpi_plugin_satisfaction_surveys` (
4+
`id` int(11) NOT NULL AUTO_INCREMENT,
5+
`entities_id` int(11) NOT NULL DEFAULT 0,
6+
`is_recursive` tinyint(1) NOT NULL default '0',
7+
`is_active` tinyint(1) NOT NULL default '0',
8+
`name` varchar(255) collate utf8_unicode_ci default NULL,
9+
`comment` text collate utf8_unicode_ci default NULL,
10+
`date_creation` timestamp NULL DEFAULT NULL,
11+
`date_mod` timestamp NULL DEFAULT NULL,
12+
`reminders_days` int(11) NOT NULL default '30',
13+
PRIMARY KEY (`id`)
14+
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
15+
16+
CREATE TABLE `glpi_plugin_satisfaction_surveyquestions` (
17+
`id` int(11) NOT NULL AUTO_INCREMENT,
18+
`plugin_satisfaction_surveys_id` int(11) NOT NULL,
19+
`name` text collate utf8_unicode_ci default NULL,
20+
`type` varchar(255) collate utf8_unicode_ci default NULL,
21+
`comment` text collate utf8_unicode_ci default NULL,
22+
`number` int(11) NOT NULL DEFAULT 0,
23+
`default_value` int(11) NOT NULL DEFAULT 1,
24+
PRIMARY KEY (`id`)
25+
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
26+
27+
CREATE TABLE `glpi_plugin_satisfaction_surveyanswers` (
28+
`id` int(11) NOT NULL AUTO_INCREMENT,
29+
`answer` text collate utf8_unicode_ci default NULL,
30+
`comment` text collate utf8_unicode_ci default NULL,
31+
`plugin_satisfaction_surveys_id` int(11) NOT NULL,
32+
`ticketsatisfactions_id` int(11) NOT NULL,
33+
PRIMARY KEY (`id`)
34+
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
35+
36+
DROP TABLE IF EXISTS `glpi_plugin_satisfaction_surveytranslations`;
37+
CREATE TABLE `glpi_plugin_satisfaction_surveytranslations` (
38+
`id` int(11) NOT NULL AUTO_INCREMENT,
39+
`plugin_satisfaction_surveys_id` int(11) NOT NULL DEFAULT '0',
40+
`glpi_plugin_satisfaction_surveyquestions_id` int(11) NOT NULL DEFAULT '0',
41+
`language` varchar(5) COLLATE utf8_unicode_ci DEFAULT NULL,
42+
`value` text COLLATE utf8_unicode_ci,
43+
PRIMARY KEY (`id`),
44+
UNIQUE KEY `unicity` (`plugin_satisfaction_surveys_id`,`glpi_plugin_satisfaction_surveyquestions_id`,`language`),
45+
KEY `typeid` (`plugin_satisfaction_surveys_id`,`glpi_plugin_satisfaction_surveyquestions_id`),
46+
KEY `language` (`language`)
47+
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
48+
49+
DROP TABLE IF EXISTS `glpi_plugin_satisfaction_surveyreminders`;
50+
CREATE TABLE `glpi_plugin_satisfaction_surveyreminders` (
51+
`id` int(11) NOT NULL AUTO_INCREMENT,
52+
`plugin_satisfaction_surveys_id` int(11) NOT NULL,
53+
`name` text collate utf8_unicode_ci default NULL,
54+
`duration_type` int(11) NOT NULL,
55+
`duration` int(11) NOT NULL,
56+
`is_active` tinyint(1) NOT NULL default '0',
57+
`comment` text collate utf8_unicode_ci default NULL,
58+
PRIMARY KEY (`id`)
59+
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
60+
61+
DROP TABLE IF EXISTS `glpi_plugin_satisfaction_reminders`;
62+
CREATE TABLE `glpi_plugin_satisfaction_reminders` (
63+
`id` int(11) NOT NULL AUTO_INCREMENT,
64+
`type` int(11) NOT NULL DEFAULT '0',
65+
`tickets_id` int(11) NOT NULL,
66+
`date` timestamp NULL DEFAULT NULL,
67+
PRIMARY KEY (`id`),
68+
UNIQUE KEY `unicity` (`tickets_id`)
69+
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

setup.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Init the hooks of the plugins -Needed
55
*/
66

7-
define('PLUGIN_SATISFACTION_VERSION', '1.4.5');
7+
define('PLUGIN_SATISFACTION_VERSION', '1.5.0');
88

99
function plugin_init_satisfaction() {
1010
global $PLUGIN_HOOKS;
@@ -66,7 +66,7 @@ function plugin_version_satisfaction() {
6666
'homepage' => 'https://github.com/pluginsGLPI/satisfaction',
6767
'requirements' => [
6868
'glpi' => [
69-
'min' => '9.4',
69+
'min' => '9.5',
7070
'dev' => false
7171
]
7272
]
@@ -79,10 +79,10 @@ function plugin_version_satisfaction() {
7979
* @return bool
8080
*/
8181
function plugin_satisfaction_check_prerequisites() {
82-
if (version_compare(GLPI_VERSION, '9.4', 'lt')
83-
|| version_compare(GLPI_VERSION, '9.5', 'ge')) {
82+
if (version_compare(GLPI_VERSION, '9.5', 'lt')
83+
|| version_compare(GLPI_VERSION, '9.6', 'ge')) {
8484
if (method_exists('Plugin', 'messageIncompatible')) {
85-
echo Plugin::messageIncompatible('core', '9.4');
85+
echo Plugin::messageIncompatible('core', '9.5');
8686
}
8787
return false;
8888
}

0 commit comments

Comments
 (0)