diff --git a/example.xml b/example.xml
index 1997a8e..33b8a40 100644
--- a/example.xml
+++ b/example.xml
@@ -26,7 +26,7 @@
0.0.1
- 0.85
+ 9.4
diff --git a/inc/showtabitem.class.php b/inc/showtabitem.class.php
index f0a7324..8f98612 100644
--- a/inc/showtabitem.class.php
+++ b/inc/showtabitem.class.php
@@ -36,7 +36,7 @@ along with GLPI. If not, see .
* ex: when viewing a ticket, change, computer,...
*
* will be fired at each sub-item
- * ex: for each TicketTask, TicketFollowup, ...
+ * ex: for each TicketTask, ITILFollowup, ...
*
* post_show_item will be fired after the item show
*
@@ -58,7 +58,7 @@ class PluginExampleShowtabitem {
* and 'options' are options like following
* array( 'tabnum', 'itemtype')
* where 'tabnum' is the internal name of the tab that will be shown
- * and 'itemtype' is the type of the tab (ex: 'TicketFollowup' when showing followup tab in a ticket)
+ * and 'itemtype' is the type of the tab (ex: 'ITILFollowup' when showing followup tab in a ticket)
* Note: you may pass datas to post_show_tab using the $param['options'] array (see example below)
*/
static function pre_show_tab($params) {
@@ -135,7 +135,7 @@ class PluginExampleShowtabitem {
* where 'id' is the id of object that will be shown (same than $param['item']->fields['id'])
* or if item contains a sub-object like followup, task, ... then it contains
* array( 'parent', 'rand', 'showprivate')
- * where 'parent' is the main object related to the current item (ex: if 'item' is TicketFollowup then it will be the related Ticket)
+ * where 'parent' is the main object related to the current item (ex: if 'item' is ITILFollowup then it will be the related Ticket)
* and 'rand' contains the random number that will be used to render the item
* and 'showprivate' is the right to show private items
* Note: you may pass datas to post_show_item using the $param['options'] array
@@ -149,7 +149,7 @@ class PluginExampleShowtabitem {
case 'TicketTask' :
//echo 'test' ;
break;
- case 'TicketFollowup' :
+ case 'ITILFollowup' :
//echo 'test' ;
break;
}
@@ -170,7 +170,7 @@ class PluginExampleShowtabitem {
* where 'id' is the id of object that will be shown (same than $param['item']->fields['id'])
* or if item contains a sub-object like followup, task, ... then it contains
* array( 'parent', 'rand', 'showprivate')
- * where 'parent' is the main object related to the current item (ex: if 'item' is TicketFollowup then it will be the related Ticket)
+ * where 'parent' is the main object related to the current item (ex: if 'item' is ITILFollowup then it will be the related Ticket)
* and 'rand' contains the random number that will be used to render the item
* and 'showprivate' is the right to show private items
* Note: you may get datas from pre_show_item using the $param['options'] array
@@ -184,7 +184,7 @@ class PluginExampleShowtabitem {
case 'TicketTask' :
//echo 'test' ;
break;
- case 'TicketFollowup' :
+ case 'ITILFollowup' :
//echo 'test' ;
break;
}
diff --git a/setup.php b/setup.php
index c307661..9f4b21a 100755
--- a/setup.php
+++ b/setup.php
@@ -232,8 +232,7 @@ function plugin_version_example() {
'homepage' => 'https://github.com/pluginsGLPI/example',
'requirements' => [
'glpi' => [
- 'min' => '9.3',
- 'dev' => true
+ 'min' => '9.4',
]
]
];
@@ -248,12 +247,12 @@ function plugin_version_example() {
*/
function plugin_example_check_prerequisites() {
- $version = rtrim(GLPI_VERSION, '-dev');
- if (version_compare($version, '9.3', 'lt')) {
- echo "This plugin requires GLPI 9.3";
+ //Version check is not done by core in GLPI < 9.2 but has to be delegated to core in GLPI >= 9.2.
+ $version = preg_replace('/^((\d+\.?)+).*$/', '$1', GLPI_VERSION);
+ if (version_compare($version, '9.2', '<')) {
+ echo "This plugin requires GLPI >= 9.4";
return false;
}
-
return true;
}