mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-05-04 18:08:42 +02:00
strict version check + comment
git-svn-id: https://forge.glpi-project.org/svn/example/trunk@158 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
parent
24176ef4cb
commit
a9b4abfa03
11
setup.php
11
setup.php
@ -118,7 +118,7 @@ function plugin_init_example() {
|
|||||||
|
|
||||||
$PLUGIN_HOOKS['item_transfer']['example'] = 'plugin_item_transfer_example';
|
$PLUGIN_HOOKS['item_transfer']['example'] = 'plugin_item_transfer_example';
|
||||||
|
|
||||||
//redirect
|
//redirect
|
||||||
// Simple redirect : http://localhost/glpi/index.php?redirect=plugin_example_2 (ID 2 du form)
|
// Simple redirect : http://localhost/glpi/index.php?redirect=plugin_example_2 (ID 2 du form)
|
||||||
// $PLUGIN_HOOKS['redirect_page']['example'] = 'example.form.php';
|
// $PLUGIN_HOOKS['redirect_page']['example'] = 'example.form.php';
|
||||||
// Multiple redirect : http://localhost/glpi/index.php?redirect=plugin_example_one_2 (ID 2 du form)
|
// Multiple redirect : http://localhost/glpi/index.php?redirect=plugin_example_one_2 (ID 2 du form)
|
||||||
@ -170,11 +170,12 @@ function plugin_version_example() {
|
|||||||
// Optional : check prerequisites before install : may print errors or add to message after redirect
|
// Optional : check prerequisites before install : may print errors or add to message after redirect
|
||||||
function plugin_example_check_prerequisites() {
|
function plugin_example_check_prerequisites() {
|
||||||
|
|
||||||
if (GLPI_VERSION >= 0.80) {
|
// Strict version check (could be less strict, or could allow various version)
|
||||||
return true;
|
if (version_compare(GLPI_VERSION,'0.83','lt') || version_compare(GLPI_VERSION,'0.84','ge')) {
|
||||||
} else {
|
echo "This plugin requires GLPI >= 0.80";
|
||||||
echo "GLPI version not compatible need 0.80";
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user