Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Commit 7f0f2ff

Browse files
committed
fix SQL queries for plugin installation
1 parent c65b0c3 commit 7f0f2ff

1 file changed

Lines changed: 34 additions & 34 deletions

File tree

hook.php

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ function plugin_mantis_install() {
5353

5454
// création de la table du plugin
5555
if (! TableExists ( "glpi_plugin_mantis_mantis" )) {
56-
$query = "CREATE TABLE glpi_plugin_mantis_mantis (
57-
id int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
58-
items_id int(11) NOT NULL,
59-
idMantis int(11) NOT NULL,
60-
dateEscalade date NOT NULL,
61-
itemtype varchar NOT NULL,
62-
user int(11) NOT NULL)";
56+
$query = "CREATE TABLE `glpi_plugin_mantis_mantis` (
57+
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
58+
`items_id` int(11) NOT NULL,
59+
`idMantis` int(11) NOT NULL,
60+
`dateEscalade` date NOT NULL,
61+
`itemtype` varchar(255) NOT NULL,
62+
`user` int(11) NOT NULL)";
6363
$DB->query ( $query ) or die ( $DB->error () );
6464
} else {
6565
$mig = new Migration ( 200 );
@@ -77,16 +77,16 @@ function plugin_mantis_install() {
7777

7878
// création de la table du plugin
7979
if (! TableExists ( "glpi_plugin_mantis_userprefs" )) {
80-
$query = "CREATE TABLE glpi_plugin_mantis_userprefs (
81-
id int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
82-
users_id int(11) NOT NULL ,
83-
followTask int(11) NOT NULL default '0',
84-
followFollow int(11) NOT NULL default '0',
85-
followAttachment int(11) NOT NULL default '0',
86-
followTitle int(11) NOT NULL default '0',
87-
followDescription int(11) NOT NULL default '0',
88-
followCategorie int(11) NOT NULL default '0',
89-
followLinkedItem int(11) NOT NULL default '0',
80+
$query = "CREATE TABLE `glpi_plugin_mantis_userprefs` (
81+
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
82+
`users_id` int(11) NOT NULL ,
83+
`followTask` int(11) NOT NULL default '0',
84+
`followFollow` int(11) NOT NULL default '0',
85+
`followAttachment` int(11) NOT NULL default '0',
86+
`followTitle` int(11) NOT NULL default '0',
87+
`followDescription` int(11) NOT NULL default '0',
88+
`followCategorie` int(11) NOT NULL default '0',
89+
`followLinkedItem` int(11) NOT NULL default '0',
9090
UNIQUE KEY (`users_id`))";
9191
$DB->query ( $query ) or die ( $DB->error () );
9292
}
@@ -108,25 +108,25 @@ function plugin_mantis_install() {
108108

109109
// création de la table pour la configuration du plugin
110110
if (! TableExists ( "glpi_plugin_mantis_configs" )) {
111-
$query = "CREATE TABLE glpi_plugin_mantis_configs (
112-
id int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
113-
host varchar(255) NOT NULL default '',
114-
url varchar(255) NOT NULL default '',
115-
login varchar(255) NOT NULL default '',
116-
pwd varchar(255) NOT NULL default '',
117-
champsUrlGlpi varchar(100) NOT NULL default '',
118-
champsGlpi varchar(100) NOT NULL default '',
119-
enable_assign int(3) NOT NULL default 0,
120-
neutralize_escalation int(3) NOT NULL default 0,
121-
status_after_escalation int(3) NOT NULL default 0,
122-
show_option_delete int(3) NOT NULL default 0,
123-
doc_categorie int(3) NOT NULL default 0,
124-
itemType varchar(255) NOT NULL,
125-
etatMantis varchar(100) NOT NULL default '')";
111+
$query = "CREATE TABLE `glpi_plugin_mantis_configs` (
112+
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
113+
`host` varchar(255) NOT NULL default '',
114+
`url` varchar(255) NOT NULL default '',
115+
`login` varchar(255) NOT NULL default '',
116+
`pwd` varchar(255) NOT NULL default '',
117+
`champsUrlGlpi` varchar(100) NOT NULL default '',
118+
`champsGlpi` varchar(100) NOT NULL default '',
119+
`enable_assign` int(3) NOT NULL default 0,
120+
`neutralize_escalation` int(3) NOT NULL default 0,
121+
`status_after_escalation` int(3) NOT NULL default 0,
122+
`show_option_delete` int(3) NOT NULL default 0,
123+
`doc_categorie` int(3) NOT NULL default 0,
124+
`itemType` varchar(255) NOT NULL,
125+
`etatMantis` varchar(100) NOT NULL default '')";
126126
$DB->query ( $query ) or die ( $DB->error () );
127127
// insertion du occcurence dans la table (occurrence par default)
128-
$query = "INSERT INTO glpi_plugin_mantis_configs
129-
(id, host,url,login,pwd)
128+
$query = "INSERT INTO `glpi_plugin_mantis_configs`
129+
(`id`, `host`, `url`, `login`, `pwd`)
130130
VALUES (NULL, '','','','')";
131131
$DB->query ( $query ) or die ( "error in glpi_plugin_mantis_configs table" . $DB->error () );
132132
} else {

0 commit comments

Comments
 (0)