Skip to content

Commit cc4685a

Browse files
author
amma35
committed
Change version 9.1.1
update xml
1 parent 0ebc67c commit cc4685a

File tree

3 files changed

+37
-37
lines changed

3 files changed

+37
-37
lines changed

addressing.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<versions>
2828
<version>
2929
<num>2.4.0</num>
30-
<compatibility>9.1</compatibility>
30+
<compatibility>9.1.1</compatibility>
3131
</version>
3232
<version>
3333
<num>2.3.0</num>

inc/reserveip.class.php

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
class PluginAddressingReserveip extends CommonDBTM
3535
{
3636
const COMPUTER = 'Computer';
37-
const NETWORK = 'NetworkEquipment';
38-
const PRINTER = 'Printer';
37+
const NETWORK = 'NetworkEquipment';
38+
const PRINTER = 'Printer';
3939

4040
static $rightname = 'plugin_addressing';
4141

@@ -64,58 +64,58 @@ function reserveip($input = array())
6464

6565
// Find computer
6666
$item = new $input['type']();
67-
$id = 0;
67+
$id = 0;
6868
if (!$item->getFromDBByQuery("WHERE `name`='" . $input["name"] . "' AND `entities_id`=" . $input['entities_id'] . " LIMIT 1")) {
6969
// Add computer
70-
$id = $item->add(array("name" => $input["name"],
71-
"entities_id" => $input['entities_id'],
72-
'states_id' => $input["states_id"],
73-
"comment" => $input['comment']));
70+
$id = $item->add(array("name" => $input["name"],
71+
"entities_id" => $input['entities_id'],
72+
'states_id' => $input["states_id"],
73+
"comment" => $input['comment']));
7474
} else {
7575
$id = $item->getID();
7676
//update item
77-
$item->update(array("id" => $id,
78-
"entities_id" => $input['entities_id'],
79-
'states_id' => $input["states_id"],
80-
"comment" => $input['comment']));
77+
$item->update(array("id" => $id,
78+
"entities_id" => $input['entities_id'],
79+
'states_id' => $input["states_id"],
80+
"comment" => $input['comment']));
8181
}
8282

8383
// Add a new port
8484
if ($id) {
8585
switch ($input['type']) {
8686
case 'NetworkEquipment' :
8787
$newinput = array(
88-
"itemtype" => $input['type'],
89-
"items_id" => $id,
90-
"entities_id" => $_SESSION["glpiactive_entity"],
91-
"name" => self::getPortName($input["ip"]),
92-
"instantiation_type" => "NetworkPortAggregate",
93-
"_create_children" => 1,
88+
"itemtype" => $input['type'],
89+
"items_id" => $id,
90+
"entities_id" => $_SESSION["glpiactive_entity"],
91+
"name" => self::getPortName($input["ip"]),
92+
"instantiation_type" => "NetworkPortAggregate",
93+
"_create_children" => 1,
9494
"NetworkName__ipaddresses" => array("-100" => $input["ip"]),
95-
"mac" => $input["mac"],
95+
"mac" => $input["mac"],
9696
);
9797
break;
9898
case 'Computer':
9999
case 'Printer':
100100
$newinput = array(
101-
"itemtype" => $input['type'],
102-
"items_id" => $id,
103-
"entities_id" => $_SESSION["glpiactive_entity"],
104-
"name" => self::getPortName($input["ip"]),
105-
"instantiation_type" => "NetworkPortEthernet",
106-
"_create_children" => 1,
101+
"itemtype" => $input['type'],
102+
"items_id" => $id,
103+
"entities_id" => $_SESSION["glpiactive_entity"],
104+
"name" => self::getPortName($input["ip"]),
105+
"instantiation_type" => "NetworkPortEthernet",
106+
"_create_children" => 1,
107107
"NetworkName__ipaddresses" => array("-100" => $input["ip"]),
108-
"mac" => $input["mac"],
108+
"mac" => $input["mac"],
109109
);
110110
break;
111111
}
112112

113-
$np = new NetworkPort();
113+
$np = new NetworkPort();
114114
$newID = $np->add($newinput);
115115

116116
Event::log($newID, "networkport", 5, "inventory",
117117
//TRANS: %s is the user login
118-
sprintf(__('%s adds an item'), $_SESSION["glpiname"]));
118+
sprintf(__('%s adds an item'), $_SESSION["glpiname"]));
119119
}
120120
}
121121

@@ -127,17 +127,17 @@ function reserveip($input = array())
127127
*/
128128
function checkMandatoryFields($input)
129129
{
130-
$msg = array();
130+
$msg = array();
131131
$checkKo = false;
132132

133133
$mandatory_fields = array('name' => __("Object's name", 'addressing'),
134-
'ip' => _n("IP address", "IP addresses", 1));
134+
'ip' => _n("IP address", "IP addresses", 1));
135135

136136
foreach ($input as $key => $value) {
137137
if (isset($mandatory_fields[$key])) {
138138
if ((isset($value) && empty($value)) || !isset($value)) {
139139
$msg[$key] = $mandatory_fields[$key];
140-
$checkKo = true;
140+
$checkKo = true;
141141
}
142142
}
143143
}
@@ -201,8 +201,8 @@ function showForm($ip, $id_addressing, $randmodal)
201201
<td>" . __("Type") . "</td>
202202
<td>";
203203
Dropdown::showFromArray('type', array(PluginAddressingReserveip::COMPUTER => Computer::getTypeName(),
204-
PluginAddressingReserveip::NETWORK => NetworkEquipment::getTypeName(),
205-
PluginAddressingReserveip::PRINTER => Printer::getTypeName()), array('on_change' => "nameIsThere(\"" . $CFG_GLPI['root_doc'] . "\");"));
204+
PluginAddressingReserveip::NETWORK => NetworkEquipment::getTypeName(),
205+
PluginAddressingReserveip::PRINTER => Printer::getTypeName()), array('on_change' => "nameIsThere(\"" . $CFG_GLPI['root_doc'] . "\");"));
206206
echo "</td><td></td>";
207207
echo "</tr>";
208208
echo "<tr class='tab_bg_1'>
@@ -239,7 +239,7 @@ function showForm($ip, $id_addressing, $randmodal)
239239
echo "<tr class='tab_bg_1'>
240240
<td colspan='4' class='center'>
241241
<input type='submit' name='add' class='submit' value='" . __("Validate the reservation", 'addressing') . "' "
242-
. "onclick=\"" . Html::jsGetElementbyID("reserveip" . $randmodal) . ".dialog('close');window.location.reload();return true;\"/>
242+
. "onclick=\"" . Html::jsGetElementbyID("reserveip" . $randmodal) . ".dialog('close');window.location.reload();return true;\"/>
243243
</td>
244244
</tr>
245245
</table>";

setup.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ function plugin_version_addressing() {
7272
'author' => 'Gilles Portheault, Xavier Caillaud, Remi Collet, Nelly Mahu-Lasson',
7373
'license' => 'GPLv2+',
7474
'homepage' => 'https://github.com/pluginsGLPI/addressing',
75-
'minGlpiVersion' => '0.85');// For compatibility / no install in version < 0.85
75+
'minGlpiVersion' => '9.1.1');// For compatibility / no install in version < 9.1.1
7676
}
7777

7878

7979
// Optional : check prerequisites before install : may print errors or add to message after redirect
8080
function plugin_addressing_check_prerequisites() {
8181

82-
if (version_compare(GLPI_VERSION,'0.85.3','lt') || version_compare(GLPI_VERSION,'9.2','ge')) {
83-
_e('This plugin requires GLPI >= 0.85.3', 'addressing');
82+
if (version_compare(GLPI_VERSION, '9.1.1', 'lt') || version_compare(GLPI_VERSION, '9.2', 'ge')) {
83+
echo "This plugin requires GLPI = 9.1.1";
8484
return false;
8585
}
8686
return true;

0 commit comments

Comments
 (0)