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

Commit 7f313b5

Browse files
committed
better coding standard : remove not wanted whitespaces
1 parent 663290a commit 7f313b5

18 files changed

Lines changed: 1355 additions & 1453 deletions

ajax/ajax.php

Lines changed: 105 additions & 105 deletions
Large diffs are not rendered by default.

front/config.form.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,23 @@
4141
*/
4242
include ('../../../inc/includes.php');
4343

44-
Html::header ( __ ( "Setup - MantisBT", "mantis" ), $_SERVER ['PHP_SELF'], 'plugins', 'Mantis', 'configuration' );
44+
Html::header(__("Setup - MantisBT", "mantis"), $_SERVER ['PHP_SELF'], 'plugins', 'Mantis', 'configuration');
4545

46-
$plugin = new Plugin ();
46+
$plugin = new Plugin();
4747

48-
if ($plugin->isActivated ( 'mantis' )) {
49-
$config = new PluginMantisConfig ();
50-
if (isset ( $_POST ['update'] )) {
51-
session::checkRight ( 'config', 'w' );
52-
$config->update ( $_POST );
53-
Html::back ();
48+
if ($plugin->isActivated('mantis')) {
49+
$config = new PluginMantisConfig();
50+
if (isset($_POST ['update'])) {
51+
session::checkRight('config', 'w');
52+
$config->update($_POST);
53+
Html::back();
5454
} else {
55-
$config->showConfigForm ();
55+
$config->showConfigForm();
5656
}
5757
} else {
5858
global $CFG_GLPI;
5959
echo '<div class=\'center\'><br><br><img src=\'' . $CFG_GLPI ['root_doc'] . '/pics/warning.png\' alt=\'warning\'><br><br>';
60-
echo '<b>' . __ ( "Thank you to activate plugin", "mantis" ) . '</b></div>';
60+
echo '<b>' . __("Thank you to activate plugin", "mantis") . '</b></div>';
6161
}
6262

63-
Html::footer ();
63+
Html::footer();

front/mantis.form.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,25 @@
4141
*/
4242
include ('../../../inc/includes.php');
4343

44-
$mantis = new PluginMantisMantis ();
44+
$mantis = new PluginMantisMantis();
4545

46-
if (isset ( $_GET ['action'] ) && $_GET ['action'] == 'linkToIssue') {
46+
if (isset($_GET ['action']) && $_GET ['action'] == 'linkToIssue') {
4747

48-
Html::popHeader ( 'Mantis', $_SERVER ['PHP_SELF'] );
49-
$mantis->getFormForLinkGlpiTicketToMantisTicket ( $_GET ['idTicket'], $_GET ['itemType'] );
50-
Html::popFooter ();
51-
} else if (isset ( $_GET ['action'] ) && $_GET ['action'] == 'linkToProject') {
48+
Html::popHeader('Mantis', $_SERVER ['PHP_SELF']);
49+
$mantis->getFormForLinkGlpiTicketToMantisTicket($_GET ['idTicket'], $_GET ['itemType']);
50+
Html::popFooter();
51+
} else if (isset($_GET ['action']) && $_GET ['action'] == 'linkToProject') {
5252

53-
Html::popHeader ( 'Mantis', $_SERVER ['PHP_SELF'] );
54-
$mantis->getFormForLinkGlpiTicketToMantisProject ( $_GET ['idTicket'], $_GET ['itemType'] );
55-
Html::popFooter ();
56-
} else if (isset ( $_GET ['action'] ) && $_GET ['action'] == 'deleteIssue') {
57-
Html::popHeader ( 'Mantis', $_SERVER ['PHP_SELF'] );
53+
Html::popHeader('Mantis', $_SERVER ['PHP_SELF']);
54+
$mantis->getFormForLinkGlpiTicketToMantisProject($_GET ['idTicket'], $_GET ['itemType']);
55+
Html::popFooter();
56+
} else if (isset($_GET ['action']) && $_GET ['action'] == 'deleteIssue') {
57+
Html::popHeader('Mantis', $_SERVER ['PHP_SELF']);
5858

5959
$id_link = $_GET ['id'];
6060
$id_ticket = $_GET ['idTicket'];
6161
$id_mantis = $_GET ['idMantis'];
6262

63-
$mantis->getFormToDelLinkOrIssue ( $id_link, $id_ticket, $id_mantis, $_GET ['itemType'] );
64-
Html::popFooter ();
63+
$mantis->getFormToDelLinkOrIssue($id_link, $id_ticket, $id_mantis, $_GET ['itemType']);
64+
Html::popFooter();
6565
}

front/profile.form.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141
*/
4242
include ("../../../inc/includes.php");
4343

44-
Session::checkRight ( "profile", "r" );
44+
Session::checkRight("profile", "r");
4545

46-
$prof = new PluginMantisProfile ();
46+
$prof = new PluginMantisProfile();
4747

48-
if (isset ( $_POST ['update_user_profile'] )) {
49-
$prof->update ( $_POST );
50-
Html::back ();
48+
if (isset($_POST ['update_user_profile'])) {
49+
$prof->update($_POST);
50+
Html::back();
5151
}

front/userpref.form.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
<?php
22
include ('../../../inc/includes.php');
33

4-
if (isset ( $_POST ['update'] )) {
4+
if (isset($_POST ['update'])) {
55

6-
if (isset ( $_POST ['followFollow'] ))
6+
if (isset($_POST ['followFollow']))
77
$_POST ['followFollow'] = 1;
88
else
99
$_POST ['followFollow'] = 0;
1010

11-
if (isset ( $_POST ['followTitle'] ))
11+
if (isset($_POST ['followTitle']))
1212
$_POST ['followTitle'] = 1;
1313
else
1414
$_POST ['followTitle'] = 0;
1515

16-
if (isset ( $_POST ['followTask'] ))
16+
if (isset($_POST ['followTask']))
1717
$_POST ['followTask'] = 1;
1818
else
1919
$_POST ['followTask'] = 0;
2020

21-
if (isset ( $_POST ['followCategorie'] ))
21+
if (isset($_POST ['followCategorie']))
2222
$_POST ['followCategorie'] = 1;
2323
else
2424
$_POST ['followCategorie'] = 0;
2525

26-
if (isset ( $_POST ['followDescription'] ))
26+
if (isset($_POST ['followDescription']))
2727
$_POST ['followDescription'] = 1;
2828
else
2929
$_POST ['followDescription'] = 0;
3030

31-
if (isset ( $_POST ['followLinkedItem'] ))
31+
if (isset($_POST ['followLinkedItem']))
3232
$_POST ['followLinkedItem'] = 1;
3333
else
3434
$_POST ['followLinkedItem'] = 0;
3535

36-
if (isset ( $_POST ['followAttachment'] ))
36+
if (isset($_POST ['followAttachment']))
3737
$_POST ['followAttachment'] = 1;
3838
else
3939
$_POST ['followAttachment'] = 0;
4040

41-
$userpref = new PluginMantisUserpref ();
42-
$userpref->update ( $_POST );
41+
$userpref = new PluginMantisUserpref();
42+
$userpref->update($_POST);
4343
}
4444

45-
Html::back ();
45+
Html::back();

hook.php

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -42,41 +42,41 @@
4242

4343
/**
4444
* function to install the plugin
45-
*
45+
*
4646
* @return boolean
4747
*/
4848
function plugin_mantis_install() {
4949
require_once ('inc/mantis.class.php');
50-
PluginMantisMantis::install ();
50+
PluginMantisMantis::install();
5151

5252
global $DB;
5353

5454
// création de la table du plugin
55-
if (! TableExists ( "glpi_plugin_mantis_mantis" )) {
55+
if (! TableExists("glpi_plugin_mantis_mantis")) {
5656
$query = "CREATE TABLE `glpi_plugin_mantis_mantis` (
5757
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
5858
`items_id` int(11) NOT NULL,
5959
`idMantis` int(11) NOT NULL,
6060
`dateEscalade` date NOT NULL,
6161
`itemtype` varchar(255) NOT NULL,
6262
`user` int(11) NOT NULL)";
63-
$DB->query ( $query ) or die ( $DB->error () );
63+
$DB->query($query) or die($DB->error());
6464
} else {
65-
$mig = new Migration ( 200 );
65+
$mig = new Migration(200);
6666
$table = 'glpi_plugin_mantis_mantis';
67-
$mig->addField ( $table, 'itemType', 'string' );
68-
$mig->executeMigration ();
67+
$mig->addField($table, 'itemType', 'string');
68+
$mig->executeMigration();
6969

70-
$mig = new Migration ( 201 );
70+
$mig = new Migration(201);
7171
$table = 'glpi_plugin_mantis_mantis';
72-
$mig->addField ( $table, 'itemType', 'string' );
73-
$mig->changeField ( 'glpi_plugin_mantis_mantis', 'itemType', 'itemtype', 'string', array () );
74-
$mig->changeField ( 'glpi_plugin_mantis_mantis', 'idTicket', 'items_id', 'integer', array () );
75-
$mig->executeMigration ();
72+
$mig->addField($table, 'itemType', 'string');
73+
$mig->changeField('glpi_plugin_mantis_mantis', 'itemType', 'itemtype', 'string', array ());
74+
$mig->changeField('glpi_plugin_mantis_mantis', 'idTicket', 'items_id', 'integer', array ());
75+
$mig->executeMigration();
7676
}
7777

7878
// création de la table du plugin
79-
if (! TableExists ( "glpi_plugin_mantis_userprefs" )) {
79+
if (! TableExists("glpi_plugin_mantis_userprefs")) {
8080
$query = "CREATE TABLE `glpi_plugin_mantis_userprefs` (
8181
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
8282
`users_id` int(11) NOT NULL ,
@@ -88,26 +88,26 @@ function plugin_mantis_install() {
8888
`followCategorie` int(11) NOT NULL default '0',
8989
`followLinkedItem` int(11) NOT NULL default '0',
9090
UNIQUE KEY (`users_id`))";
91-
$DB->query ( $query ) or die ( $DB->error () );
91+
$DB->query($query) or die($DB->error());
9292
}
9393

9494
// Création de la table uniquement lors de la première installation
95-
if (! TableExists ( "glpi_plugin_mantis_profiles" )) {
95+
if (! TableExists("glpi_plugin_mantis_profiles")) {
9696
// requete de création de la table
9797
$query = "CREATE TABLE `glpi_plugin_mantis_profiles` (
9898
`id` int(11) NOT NULL default '0' COMMENT 'RELATION to glpi_profiles (id)',
9999
`right` char(1) collate utf8_unicode_ci default NULL,
100100
PRIMARY KEY (`id`)
101101
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci";
102-
$DB->queryOrDie ( $query, $DB->error () );
102+
$DB->queryOrDie($query, $DB->error());
103103

104104
// creation du premier accès nécessaire lors de l'installation du plugin
105105
include_once ("inc/profile.class.php");
106-
PluginMantisProfile::createAdminAccess ( $_SESSION ['glpiactiveprofile'] ['id'] );
106+
PluginMantisProfile::createAdminAccess($_SESSION ['glpiactiveprofile'] ['id']);
107107
}
108108

109109
// création de la table pour la configuration du plugin
110-
if (! TableExists ( "glpi_plugin_mantis_configs" )) {
110+
if (! TableExists("glpi_plugin_mantis_configs")) {
111111
$query = "CREATE TABLE `glpi_plugin_mantis_configs` (
112112
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
113113
`host` varchar(255) NOT NULL default '',
@@ -123,40 +123,40 @@ function plugin_mantis_install() {
123123
`doc_categorie` int(3) NOT NULL default 0,
124124
`itemType` varchar(255) NOT NULL,
125125
`etatMantis` varchar(100) NOT NULL default '')";
126-
$DB->query ( $query ) or die ( $DB->error () );
126+
$DB->query($query) or die($DB->error());
127127
// insertion du occcurence dans la table (occurrence par default)
128128
$query = "INSERT INTO `glpi_plugin_mantis_configs`
129129
(`id`, `host`, `url`, `login`, `pwd`)
130130
VALUES (NULL, '','','','')";
131-
$DB->query ( $query ) or die ( "error in glpi_plugin_mantis_configs table" . $DB->error () );
131+
$DB->query($query) or die("error in glpi_plugin_mantis_configs table" . $DB->error());
132132
} else {
133-
$mig = new Migration ( 200 );
133+
$mig = new Migration(200);
134134
$table = 'glpi_plugin_mantis_configs';
135-
$mig->addField ( $table, 'neutralize_escalation', 'integer', array (
135+
$mig->addField($table, 'neutralize_escalation', 'integer', array (
136136
'value' => 5
137-
) );
138-
$mig->addField ( $table, 'status_after_escalation', 'integer' );
139-
$mig->addField ( $table, 'show_option_delete', 'integer', array (
137+
));
138+
$mig->addField($table, 'status_after_escalation', 'integer');
139+
$mig->addField($table, 'show_option_delete', 'integer', array (
140140
'value' => 0
141-
) );
142-
$mig->addField ( $table, 'doc_categorie', 'integer', array (
141+
));
142+
$mig->addField($table, 'doc_categorie', 'integer', array (
143143
'value' => 0
144-
) );
145-
$mig->addField ( $table, 'itemType', 'string' );
146-
$mig->executeMigration ();
144+
));
145+
$mig->addField($table, 'itemType', 'string');
146+
$mig->executeMigration();
147147
}
148148

149149
return true;
150150
}
151151

152152
/**
153153
* function to uninstall the plugin
154-
*
154+
*
155155
* @return boolean
156156
*/
157157
function plugin_mantis_uninstall() {
158158
require_once ('inc/mantis.class.php');
159-
PluginMantisMantis::uninstall ();
159+
PluginMantisMantis::uninstall();
160160
return true;
161161
}
162162

@@ -172,7 +172,7 @@ function plugin_mantis_getAddSearchOptions($itemtype) {
172172
$sopt [78963] ['searchtype'] = 'equals';
173173
$sopt [78963] ['nosearch'] = true;
174174
$sopt [78963] ['datatype'] = 'bool';
175-
$sopt [78963] ['name'] = __ ( 'ticket linked to mantis', 'mantis' );
175+
$sopt [78963] ['name'] = __('ticket linked to mantis', 'mantis');
176176
$sopt [78963] ['joinparams'] = array (
177177
'jointype' => "itemtype_item"
178178
);
@@ -184,21 +184,22 @@ function plugin_mantis_getAddSearchOptions($itemtype) {
184184
$sopt [78964] ['searchtype'] = 'equals';
185185
$sopt [78964] ['nosearch'] = true;
186186
$sopt [78964] ['datatype'] = 'bool';
187-
$sopt [78964] ['name'] = __ ( 'problem linked to mantis', 'mantis' );
187+
$sopt [78964] ['name'] = __('problem linked to mantis', 'mantis');
188188
$sopt [78964] ['joinparams'] = array (
189189
'jointype' => "itemtype_item"
190190
);
191191
}
192192
return $sopt;
193193
}
194+
194195
function plugin_mantis_giveItem($type, $ID, $data, $num) {
195-
$searchopt = &Search::getOptions ( $type );
196+
$searchopt = &Search::getOptions($type);
196197
$table = $searchopt [$ID] ["table"];
197198
$field = $searchopt [$ID] ["field"];
198199

199200
switch ($table . '.' . $field) {
200201
case "glpi_plugin_mantis_mantis.idMantis" :
201-
return Dropdown::getYesNo ( $data ["ITEM_$num"] );
202+
return Dropdown::getYesNo($data ["ITEM_$num"]);
202203
break;
203204
}
204205

0 commit comments

Comments
 (0)