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

Commit 4db227d

Browse files
committed
Correction de language, refactoring de code, amelioration du code
1 parent 905f322 commit 4db227d

13 files changed

Lines changed: 399 additions & 449 deletions

front/mantis.form.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
}else if (isset($_GET['action']) && $_GET['action'] == 'deleteIssue'){
2020
Html::popHeader('Mantis', $_SERVER['PHP_SELF']);
2121

22-
$id = $_GET['id'];
23-
$idticket = $_GET['idTicket'];
24-
$idMantis = $_GET['idMantis'];
22+
$id_link = $_GET['id'];
23+
$id_ticket = $_GET['idTicket'];
24+
$id_mantis = $_GET['idMantis'];
2525

26-
$mantis->getFormToDelLinkOrissue($id, $idticket, $idMantis);
26+
$mantis->getFormToDelLinkOrIssue($id_link, $id_ticket, $id_mantis);
2727
Html::popFooter();
2828
}
2929

hook.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,6 @@ function plugin_mantis_install()
2222
}
2323

2424

25-
26-
27-
28-
29-
30-
31-
32-
33-
34-
3525
// Création de la table uniquement lors de la première installation
3626
if (!TableExists("glpi_plugin_mantis_profiles")) {
3727

@@ -50,26 +40,6 @@ function plugin_mantis_install()
5040
PluginMantisProfile::createAdminAccess($_SESSION['glpiactiveprofile']['id']);
5141

5242
}
53-
/*
54-
//création de la table pour la gestion des profiles du plugin
55-
if (!TableExists("glpi_plugin_mantis_profiles")) {
56-
$query = "CREATE TABLE glpi_plugin_mantis_profiles (
57-
id int(11) NOT NULL PRIMARY KEY ,
58-
droit char(1) NOT NULL default '')";
59-
$DB->query($query) or die($DB->error());
60-
61-
//creation du premier accès nécessaire lors de l'installation du plugin
62-
include_once("inc/profile.class.php");
63-
PluginMantisProfile::createAdminAccess($_SESSION['glpiactiveprofile']['id']);
64-
}
65-
66-
*/
67-
68-
69-
70-
71-
72-
7343

7444

7545

inc/config.class.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,13 @@ static function canView()
2828

2929

3030
/**
31-
* Function to show form for configurate the plugin Mantis
31+
* Function to show form to configure the plugin MantisBT
3232
*/
3333
function showConfigForm()
34-
{
35-
$this->showConfigWS();
36-
}
37-
38-
39-
/**
40-
* Function to display form to configure
41-
* connection to WS MantisBT
42-
*/
43-
function showConfigWS()
4434
{
4535
//we recover the first and only record
4636
$this->getFromDB(1);
4737

48-
//we built the target
4938
$target = $this->getFormURL();
5039
if (isset($options['target'])) {
5140
$target = $options['target'];
@@ -62,25 +51,30 @@ function showConfigWS()
6251

6352
$content .= "<tr class='tab_bg_1'>";
6453
$content .= "<td>" . __("MantisBT server IP", "mantis") . "</td>";
65-
$content .= "<td><input id='host' type='text' onblur='testIP();' value='" . $this->fields["host"] . "'/></td>";
54+
$content .= "<td><input id='host' name='host' type='text' onblur='testIP();' value='" .
55+
$this->fields["host"] . "'/></td>";
6656
$content .= "<td>ex: 128.65.25.74</td>";
6757
$content .= "</tr>";
6858

6959
$content .= "<tr class='tab_bg_1'>";
7060
$content .= "<td>" . __("Wsdl file path", "mantis") . "</td>";
71-
$content .= "<td><input id='url' type='text' value='" . $this->fields["url"] . "'/></td>";
61+
$content .= "<td><input id='url' name='url' type='text' value='" . $this->fields["url"] .
62+
"'/></td>";
7263
$content .= "<td>ex: mantis/api/soap/mantisconnect.php?wsdl</td>";
7364
$content .= "</tr>";
7465

7566
$content .= "<tr class='tab_bg_1'>";
7667
$content .= "<td>" . __("MantisBT user login", "mantis") . "</td>";
77-
$content .= "<td><input id='login' type='text' value='" . $this->fields["login"] . "'/></td>";
68+
$content .= "<td><input id='login' name='login' type='text' value='" .
69+
$this->fields["login"] .
70+
"'/></td>";
7871
$content .= "<td></td>";
7972
$content .= "</tr>";
8073

8174
$content .= "<tr class='tab_bg_1'>";
8275
$content .= "<td>" . __("MantisBT user password", "mantis") . "</td>";
83-
$content .= "<td><input id='pwd' type='password' value='" . $this->fields["pwd"] . "'/></td>";
76+
$content .= "<td><input id='pwd' name='pwd' type='password' value='" .
77+
$this->fields["pwd"] . "'/></td>";
8478
$content .= "<td></td>";
8579
$content .= "</tr>";
8680

@@ -94,7 +88,9 @@ function showConfigWS()
9488
$content .= "</tr>";
9589

9690
$content .= "<tr class='tab_bg_1'>";
97-
$content .= "<td>" . __("MantisBT field for GLPI fields</br>(title, description, category, follow-up, tasks)", "mantis") . "</td>";
91+
$content .= "<td>" .
92+
__("MantisBT field for GLPI fields<br/> (title, description, category, follow-up, tasks)",
93+
"mantis") . "</td>";
9894
$content .= "<td>";
9995
$content .= DropDown::showFromArray('champsGlpi', PluginMantisIssue::$champsMantis,
10096
array('value' => $this->fields["champsGlpi"], 'display' => false));
@@ -104,16 +100,20 @@ function showConfigWS()
104100

105101
$content .= "<tr class='tab_bg_1'>";
106102
$content .= "<td><input type='hidden' name='id' value='1' class='submit'>";
107-
$content .= "<input id='update' type='submit' name='update' value='" . __("Update", "mantis") . "' class='submit'></td>";
108-
$content .= "<td><input id='test' onclick='testConnexionMantisWS();' value='" . __("Test the connection", "mantis") . "' class='submit'></td>";
103+
$content .= "<input id='update' type='submit' name='update' value='" . __("Update", "mantis") .
104+
"' class='submit'></td>";
105+
$content .= "<td><input id='test' onclick='testConnexionMantisWS();' value='"
106+
. __("Test the connection", "mantis") . "' class='submit'></td>";
109107
$content .= "<td><div id='infoAjax'/></td>";
110108
$content .= "</tr>";
111109

112110
$content .= "</table>";
113111
$content .= Html::closeForm(false);
114112

115113
echo $content;
116-
117114
}
118115

116+
117+
118+
119119
}

0 commit comments

Comments
 (0)