diff --git a/inc/itemtype.class.php b/inc/itemtype.class.php
index ecbd91b..abe430b 100644
--- a/inc/itemtype.class.php
+++ b/inc/itemtype.class.php
@@ -58,11 +58,11 @@ public function maybeTranslated() {
function showForm($id = null, $options = []) {
global $CFG_GLPI;
- if (!$this->isNewID($id)) {
- $this->check($id, READ);
- } else {
- // Create item
- $this->check(-1, CREATE);
+ if (!$this->isNewID($id)) {
+ $this->check($id, READ);
+ } else {
+ // Create item
+ $this->check(-1, CREATE);
}
$this->showFormHeader(['colspan' => 3]);
@@ -78,7 +78,7 @@ function showForm($id = null, $options = []) {
echo "
";
echo " | ";
echo " | ";
- $file_path = GLPI_ROOT . "/" . $this->fields['url_path_pics'];
+ $file_path = GLPI_ROOT . "/" . $this->fields['url_path_pics'];
if (file_exists($file_path)
&& is_file($file_path)) {
echo " fields['url_path_pics']."' style='width: 32px; height: 32px;'/> | ";
@@ -87,11 +87,11 @@ function showForm($id = null, $options = []) {
}
echo "
\n";
- if (isset($_REQUEST['_in_modal'])) {
- echo "";
+ if (isset($_REQUEST['_in_modal'])) {
+ echo "";
}
- $this->showFormButtons($options);
+ $this->showFormButtons($options);
}
@@ -149,7 +149,7 @@ function prepareInputForUpdate($input) {
$input = false;
}
$elt = new self;
- if ($input && $elt->getFromDBByCrit(['name' => $input['name']])) {
+ if ($input && $elt->getFromDBByCrit(['name' => $input['name']]) && $input['url_path_pics'] == $elt->fields['url_path_pics']) {
Session::addMessageAfterRedirect(
sprintf(__('Item type class: \''.$input['name'].'\' is already existing!')),
true,
diff --git a/setup.php b/setup.php
index 51eab21..5a31afa 100644
--- a/setup.php
+++ b/setup.php
@@ -32,7 +32,7 @@
// ----------------------------------------------------------------------
-define('IMPACTS_VERSION', '2.0.3');
+define('IMPACTS_VERSION', '2.0.4');
// Minimal GLPI version, inclusive
define("IMPACTS_MIN_GLPI", "9.5");