@@ -90,10 +88,7 @@
{{ fields.dropdownField('ComputerType', 'appletv_type', config.appletv_type|default(0), _x('config', 'AppleTV Type', 'jamf')) }}
{{ fields.dropdownField('State', 'default_status', config.default_status|default(0), _x('config', 'Default status', 'jamf'), {
entity: 0,
- condition: {
- is_visible_computer: true,
- is_visible_phone: true,
- }
+ condition: states_condition
}) }}
diff --git a/templates/ext_attributes.html.twig b/templates/ext_attributes.html.twig
index c96fc96..703463b 100644
--- a/templates/ext_attributes.html.twig
+++ b/templates/ext_attributes.html.twig
@@ -1,33 +1,31 @@
{#
-/**
- * -------------------------------------------------------------------------
- * JAMF plugin for GLPI
- * -------------------------------------------------------------------------
- *
- * LICENSE
- *
- * This file is part of JAMF plugin for GLPI.
- *
- * JAMF plugin for GLPI is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * JAMF plugin for GLPI is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with JAMF plugin for GLPI. If not, see
.
- * -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
- * @copyright Copyright (C) 2019-2024 by Curtis Conard
- * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
- * @link https://github.com/pluginsGLPI/jamf
- * -------------------------------------------------------------------------
- */
-#}
+ # -------------------------------------------------------------------------
+ # JAMF plugin for GLPI
+ # -------------------------------------------------------------------------
+ #
+ # LICENSE
+ #
+ # This file is part of JAMF plugin for GLPI.
+ #
+ # JAMF plugin for GLPI is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 2 of the License, or
+ # (at your option) any later version.
+ #
+ # JAMF plugin for GLPI is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with JAMF plugin for GLPI. If not, see
.
+ # -------------------------------------------------------------------------
+ # @copyright Copyright (C) 2024-2025 by Teclib'
+ # @copyright Copyright (C) 2019-2024 by Curtis Conard
+ # @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
+ # @link https://github.com/pluginsGLPI/jamf
+ # -------------------------------------------------------------------------
+ #}
diff --git a/templates/import.html.twig b/templates/import.html.twig
index 385435c..8b06298 100644
--- a/templates/import.html.twig
+++ b/templates/import.html.twig
@@ -1,38 +1,36 @@
{#
-/**
- * -------------------------------------------------------------------------
- * JAMF plugin for GLPI
- * -------------------------------------------------------------------------
- *
- * LICENSE
- *
- * This file is part of JAMF plugin for GLPI.
- *
- * JAMF plugin for GLPI is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * JAMF plugin for GLPI is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with JAMF plugin for GLPI. If not, see .
- * -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
- * @copyright Copyright (C) 2019-2024 by Curtis Conard
- * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
- * @link https://github.com/pluginsGLPI/jamf
- * -------------------------------------------------------------------------
- */
-#}
+ # -------------------------------------------------------------------------
+ # JAMF plugin for GLPI
+ # -------------------------------------------------------------------------
+ #
+ # LICENSE
+ #
+ # This file is part of JAMF plugin for GLPI.
+ #
+ # JAMF plugin for GLPI is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 2 of the License, or
+ # (at your option) any later version.
+ #
+ # JAMF plugin for GLPI is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with JAMF plugin for GLPI. If not, see .
+ # -------------------------------------------------------------------------
+ # @copyright Copyright (C) 2024-2025 by Teclib'
+ # @copyright Copyright (C) 2019-2024 by Curtis Conard
+ # @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
+ # @link https://github.com/pluginsGLPI/jamf
+ # -------------------------------------------------------------------------
+ #}
{% set limitdropdown = include('components/dropdown/limit.html.twig', {
- href: get_plugin_web_dir('jamf') ~ '/front/import.php',
+ href: path('/plugins/jamf/front/import.php'),
}) %}
{{ __('Show %s entries')|format(limitdropdown)|raw }}
@@ -90,16 +88,18 @@
const import_ids = $(':checkbox:checked').filter(':not([name^="_checkall"])').map(function() {
return this.name.replace("import","").substring(1).split('_');
}).toArray();
+
$.ajax({
type: "POST",
- url: "{{ get_plugin_web_dir('jamf') }}/ajax/import.php",
+ url: "{{ path('/plugins/jamf/ajax/import.php') }}",
data: {
action: "import",
import_ids: import_ids
},
contentType: 'application/json',
beforeSend: () => {
- $('button[name="import"]').prop('disabled', true).html('{{ _x('action', 'Importing', 'jamf') }}');
+ $('button[name="import"]').prop('disabled', true)
+ .html('{{ _x("action", "Importing", "jamf") }}');
$('button[name="discover"]').prop('disabled', true);
$('button[name="clear"]').prop('disabled', true);
},
@@ -108,15 +108,17 @@
}
});
}
+
function discoverNow() {
$.ajax({
type: "POST",
- url: "{{ get_plugin_web_dir('jamf') }}/ajax/cron.php",
- data: {crontask: "importJamf"},
+ url: "{{ path('/plugins/jamf/ajax/cron.php') }}",
+ data: { crontask: "importJamf" },
contentType: 'application/json',
beforeSend: () => {
$('button[name="import"]').prop('disabled', true);
- $('button[name="discover"]').prop('disabled', true).html('{{ _x('action', 'Discovering', 'jamf') }}');
+ $('button[name="discover"]').prop('disabled', true)
+ .html('{{ _x("action", "Discovering", "jamf") }}');
$('button[name="clear"]').prop('disabled', true);
},
complete: () => {
@@ -124,10 +126,11 @@
}
});
}
+
function clearPendingImports() {
$.ajax({
type: "POST",
- url: "{{ get_plugin_web_dir('jamf') }}/ajax/import.php",
+ url: "{{ path('/plugins/jamf/ajax/import.php') }}",
data: {
action: "clear"
},
@@ -135,13 +138,15 @@
beforeSend: () => {
$('button[name="import"]').prop('disabled', true);
$('button[name="discover"]').prop('disabled', true);
- $('button[name="clear"]').prop('disabled', true).html('{{ _x('action', 'Clearing', 'jamf') }}');
+ $('button[name="clear"]').prop('disabled', true)
+ .html('{{ _x("action", "Clearing", "jamf") }}');
},
complete: () => {
window.location.reload();
}
});
}
+
diff --git a/templates/inventory_info.html.twig b/templates/inventory_info.html.twig
index 23f7e4c..5396056 100644
--- a/templates/inventory_info.html.twig
+++ b/templates/inventory_info.html.twig
@@ -1,33 +1,31 @@
{#
-/**
- * -------------------------------------------------------------------------
- * JAMF plugin for GLPI
- * -------------------------------------------------------------------------
- *
- * LICENSE
- *
- * This file is part of JAMF plugin for GLPI.
- *
- * JAMF plugin for GLPI is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * JAMF plugin for GLPI is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with JAMF plugin for GLPI. If not, see
.
- * -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
- * @copyright Copyright (C) 2019-2024 by Curtis Conard
- * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
- * @link https://github.com/pluginsGLPI/jamf
- * -------------------------------------------------------------------------
- */
-#}
+ # -------------------------------------------------------------------------
+ # JAMF plugin for GLPI
+ # -------------------------------------------------------------------------
+ #
+ # LICENSE
+ #
+ # This file is part of JAMF plugin for GLPI.
+ #
+ # JAMF plugin for GLPI is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 2 of the License, or
+ # (at your option) any later version.
+ #
+ # JAMF plugin for GLPI is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with JAMF plugin for GLPI. If not, see
.
+ # -------------------------------------------------------------------------
+ # @copyright Copyright (C) 2024-2025 by Teclib'
+ # @copyright Copyright (C) 2019-2024 by Curtis Conard
+ # @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
+ # @link https://github.com/pluginsGLPI/jamf
+ # -------------------------------------------------------------------------
+ #}
{% import 'components/form/fields_macros.html.twig' as fields %}
diff --git a/templates/mdm_command.html.twig b/templates/mdm_command.html.twig
index 9d36ab9..4cd3362 100644
--- a/templates/mdm_command.html.twig
+++ b/templates/mdm_command.html.twig
@@ -1,33 +1,31 @@
{#
-/**
- * -------------------------------------------------------------------------
- * JAMF plugin for GLPI
- * -------------------------------------------------------------------------
- *
- * LICENSE
- *
- * This file is part of JAMF plugin for GLPI.
- *
- * JAMF plugin for GLPI is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * JAMF plugin for GLPI is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with JAMF plugin for GLPI. If not, see
.
- * -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
- * @copyright Copyright (C) 2019-2024 by Curtis Conard
- * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
- * @link https://github.com/pluginsGLPI/jamf
- * -------------------------------------------------------------------------
- */
-#}
+ # -------------------------------------------------------------------------
+ # JAMF plugin for GLPI
+ # -------------------------------------------------------------------------
+ #
+ # LICENSE
+ #
+ # This file is part of JAMF plugin for GLPI.
+ #
+ # JAMF plugin for GLPI is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 2 of the License, or
+ # (at your option) any later version.
+ #
+ # JAMF plugin for GLPI is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with JAMF plugin for GLPI. If not, see
.
+ # -------------------------------------------------------------------------
+ # @copyright Copyright (C) 2024-2025 by Teclib'
+ # @copyright Copyright (C) 2019-2024 by Curtis Conard
+ # @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
+ # @link https://github.com/pluginsGLPI/jamf
+ # -------------------------------------------------------------------------
+ #}
{% import 'components/form/fields_macros.html.twig' as fields %}
diff --git a/templates/mdm_commands.html.twig b/templates/mdm_commands.html.twig
index ca4d0a5..b858553 100644
--- a/templates/mdm_commands.html.twig
+++ b/templates/mdm_commands.html.twig
@@ -1,33 +1,31 @@
{#
-/**
- * -------------------------------------------------------------------------
- * JAMF plugin for GLPI
- * -------------------------------------------------------------------------
- *
- * LICENSE
- *
- * This file is part of JAMF plugin for GLPI.
- *
- * JAMF plugin for GLPI is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * JAMF plugin for GLPI is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with JAMF plugin for GLPI. If not, see
.
- * -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
- * @copyright Copyright (C) 2019-2024 by Curtis Conard
- * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
- * @link https://github.com/pluginsGLPI/jamf
- * -------------------------------------------------------------------------
- */
-#}
+ # -------------------------------------------------------------------------
+ # JAMF plugin for GLPI
+ # -------------------------------------------------------------------------
+ #
+ # LICENSE
+ #
+ # This file is part of JAMF plugin for GLPI.
+ #
+ # JAMF plugin for GLPI is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 2 of the License, or
+ # (at your option) any later version.
+ #
+ # JAMF plugin for GLPI is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with JAMF plugin for GLPI. If not, see
.
+ # -------------------------------------------------------------------------
+ # @copyright Copyright (C) 2024-2025 by Teclib'
+ # @copyright Copyright (C) 2019-2024 by Curtis Conard
+ # @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
+ # @link https://github.com/pluginsGLPI/jamf
+ # -------------------------------------------------------------------------
+ #}
{% import 'components/form/fields_macros.html.twig' as fields %}
diff --git a/templates/menu.html.twig b/templates/menu.html.twig
index a7c936e..d14a4a9 100644
--- a/templates/menu.html.twig
+++ b/templates/menu.html.twig
@@ -1,33 +1,31 @@
{#
-/**
- * -------------------------------------------------------------------------
- * JAMF plugin for GLPI
- * -------------------------------------------------------------------------
- *
- * LICENSE
- *
- * This file is part of JAMF plugin for GLPI.
- *
- * JAMF plugin for GLPI is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * JAMF plugin for GLPI is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with JAMF plugin for GLPI. If not, see
.
- * -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
- * @copyright Copyright (C) 2019-2024 by Curtis Conard
- * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
- * @link https://github.com/pluginsGLPI/jamf
- * -------------------------------------------------------------------------
- */
-#}
+ # -------------------------------------------------------------------------
+ # JAMF plugin for GLPI
+ # -------------------------------------------------------------------------
+ #
+ # LICENSE
+ #
+ # This file is part of JAMF plugin for GLPI.
+ #
+ # JAMF plugin for GLPI is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 2 of the License, or
+ # (at your option) any later version.
+ #
+ # JAMF plugin for GLPI is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with JAMF plugin for GLPI. If not, see
.
+ # -------------------------------------------------------------------------
+ # @copyright Copyright (C) 2024-2025 by Teclib'
+ # @copyright Copyright (C) 2019-2024 by Curtis Conard
+ # @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
+ # @link https://github.com/pluginsGLPI/jamf
+ # -------------------------------------------------------------------------
+ #}
{% if links|length > 0 %}
diff --git a/templates/merge.html.twig b/templates/merge.html.twig
index 2e7740a..ebc63db 100644
--- a/templates/merge.html.twig
+++ b/templates/merge.html.twig
@@ -1,40 +1,38 @@
{#
-/**
- * -------------------------------------------------------------------------
- * JAMF plugin for GLPI
- * -------------------------------------------------------------------------
- *
- * LICENSE
- *
- * This file is part of JAMF plugin for GLPI.
- *
- * JAMF plugin for GLPI is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * JAMF plugin for GLPI is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with JAMF plugin for GLPI. If not, see .
- * -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
- * @copyright Copyright (C) 2019-2024 by Curtis Conard
- * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
- * @link https://github.com/pluginsGLPI/jamf
- * -------------------------------------------------------------------------
- */
-#}
+ # -------------------------------------------------------------------------
+ # JAMF plugin for GLPI
+ # -------------------------------------------------------------------------
+ #
+ # LICENSE
+ #
+ # This file is part of JAMF plugin for GLPI.
+ #
+ # JAMF plugin for GLPI is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 2 of the License, or
+ # (at your option) any later version.
+ #
+ # JAMF plugin for GLPI is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with JAMF plugin for GLPI. If not, see .
+ # -------------------------------------------------------------------------
+ # @copyright Copyright (C) 2024-2025 by Teclib'
+ # @copyright Copyright (C) 2019-2024 by Curtis Conard
+ # @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
+ # @link https://github.com/pluginsGLPI/jamf
+ # -------------------------------------------------------------------------
+ #}
{% import 'components/form/fields_macros.html.twig' as fields %}
{% set limitdropdown = include('components/dropdown/limit.html.twig', {
- href: get_plugin_web_dir('jamf') ~ '/front/merge.php',
+ href: path('/plugins/jamf/front/merge.php'),
}) %}
{{ __('Show %s entries')|format(limitdropdown)|raw }}
@@ -104,7 +102,7 @@
}
$.ajax({
type: "POST",
- url: "{{ get_plugin_web_dir('jamf') }}/ajax/merge.php",
+ url: "{{ path('/plugins/jamf/ajax/merge.php') }}",
data: {action: "merge", item_ids: post_data},
contentType: 'application/json',
beforeSend: () => {
diff --git a/templates/user_jssaccount.html.twig b/templates/user_jssaccount.html.twig
index 1c5bd0c..046b17d 100644
--- a/templates/user_jssaccount.html.twig
+++ b/templates/user_jssaccount.html.twig
@@ -1,33 +1,31 @@
{#
-/**
- * -------------------------------------------------------------------------
- * JAMF plugin for GLPI
- * -------------------------------------------------------------------------
- *
- * LICENSE
- *
- * This file is part of JAMF plugin for GLPI.
- *
- * JAMF plugin for GLPI is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * JAMF plugin for GLPI is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with JAMF plugin for GLPI. If not, see .
- * -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
- * @copyright Copyright (C) 2019-2024 by Curtis Conard
- * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
- * @link https://github.com/pluginsGLPI/jamf
- * -------------------------------------------------------------------------
- */
-#}
+ # -------------------------------------------------------------------------
+ # JAMF plugin for GLPI
+ # -------------------------------------------------------------------------
+ #
+ # LICENSE
+ #
+ # This file is part of JAMF plugin for GLPI.
+ #
+ # JAMF plugin for GLPI is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+ # the Free Software Foundation; either version 2 of the License, or
+ # (at your option) any later version.
+ #
+ # JAMF plugin for GLPI is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with JAMF plugin for GLPI. If not, see .
+ # -------------------------------------------------------------------------
+ # @copyright Copyright (C) 2024-2025 by Teclib'
+ # @copyright Copyright (C) 2019-2024 by Curtis Conard
+ # @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
+ # @link https://github.com/pluginsGLPI/jamf
+ # -------------------------------------------------------------------------
+ #}
{% import 'components/form/fields_macros.html.twig' as fields %}
diff --git a/tests/AbstractDBTest.php b/tests/AbstractDBTest.php
index 44b82fa..6ea786a 100644
--- a/tests/AbstractDBTest.php
+++ b/tests/AbstractDBTest.php
@@ -22,36 +22,38 @@
* You should have received a copy of the GNU General Public License
* along with JAMF plugin for GLPI. If not, see .
* -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
+ * @copyright Copyright (C) 2024-2025 by Teclib'
* @copyright Copyright (C) 2019-2024 by Curtis Conard
* @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/pluginsGLPI/jamf
* -------------------------------------------------------------------------
*/
+namespace GlpiPlugin\Jamf\Tests;
+
+use InvalidArgumentException;
+use Auth;
+use CommonDBTM;
+use DBmysql;
use PHPUnit\Framework\TestCase;
use Glpi\Tests\Log\TestHandler;
-use Glpi\Toolbox\Sanitizer;
use Psr\Log\LogLevel;
+use RecursiveDirectoryIterator;
+use RecursiveIteratorIterator;
+use ReflectionClass;
+use Session;
+use Monolog\Logger;
+use Psr\Log\LoggerInterface;
+
+use function Safe\preg_match;
class AbstractDBTest extends TestCase
{
- private int $int;
-
- private string $str;
-
- /**
- * @var TestHandler
- */
private static TestHandler $php_log_handler;
- /**
- * @var TestHandler
- */
- private static TestHandler $sql_log_handler;
-
public static function setUpBeforeClass(): void
{
+ /** @var DBmysql $DB */
global $DB;
$DB->beginTransaction();
static::resetSession();
@@ -60,13 +62,11 @@ public static function setUpBeforeClass(): void
global $GLPI_CACHE;
$GLPI_CACHE->clear();
- // Init log handlers
- global $PHPLOGGER, $SQLLOGGER;
- /** @var Monolog\Logger $PHPLOGGER */
- static::$php_log_handler = new TestHandler(LogLevel::DEBUG);
- $PHPLOGGER->setHandlers([static::$php_log_handler]);
- static::$sql_log_handler = new TestHandler(LogLevel::DEBUG);
- $SQLLOGGER->setHandlers([static::$sql_log_handler]);
+ /** @var LoggerInterface $PHPLOGGER */
+ global $PHPLOGGER;
+ /** @var Logger $PHPLOGGER */
+ self::$php_log_handler = new TestHandler(LogLevel::DEBUG);
+ $PHPLOGGER->setHandlers([self::$php_log_handler]);
$default_config = [
'autoimport' => 0,
@@ -96,6 +96,7 @@ public static function setUpBeforeClass(): void
public static function tearDownAfterClass(): void
{
+ /** @var DBmysql $DB */
global $DB;
$DB->rollback();
}
@@ -108,38 +109,16 @@ protected static function resetSession()
$_SESSION['glpi_use_mode'] = Session::NORMAL_MODE;
$_SESSION['glpiactive_entity'] = 0;
+ /** @var array $CFG_GLPI */
global $CFG_GLPI;
+
foreach ($CFG_GLPI['user_pref_field'] as $field) {
- if (!isset($_SESSION["glpi$field"]) && isset($CFG_GLPI[$field])) {
- $_SESSION["glpi$field"] = $CFG_GLPI[$field];
+ if (!isset($_SESSION['glpi' . $field]) && isset($CFG_GLPI[$field])) {
+ $_SESSION['glpi' . $field] = $CFG_GLPI[$field];
}
}
}
- /**
- * Get a unique random string
- */
- protected function getUniqueString()
- {
- if (is_null($this->str)) {
- return $this->str = uniqid('str', false);
- }
-
- return $this->str .= 'x';
- }
-
- /**
- * Get a unique random integer
- */
- protected function getUniqueInteger()
- {
- if (is_null($this->int)) {
- return $this->int = random_int(1000, 10000);
- }
-
- return $this->int++;
- }
-
/**
* Connect (using the test user per default)
*
@@ -147,17 +126,15 @@ protected function getUniqueInteger()
* @param string $user_pass user password (defaults to TU_PASS)
* @param bool $noauto disable autologin (from CAS by example)
* @param bool $expected bool result expected from login return
- *
- * @return \Auth
*/
protected function login(
string $user_name = TU_USER,
string $user_pass = TU_PASS,
bool $noauto = true,
- bool $expected = true
- ): \Auth {
- \Session::destroy();
- \Session::start();
+ bool $expected = true,
+ ): Auth {
+ Session::destroy();
+ Session::start();
$auth = new Auth();
$this->assertEquals($expected, $auth->login($user_name, $user_pass, $noauto));
@@ -173,7 +150,7 @@ protected function login(
protected function logOut()
{
$ctime = $_SESSION['glpi_currenttime'];
- \Session::destroy();
+ Session::destroy();
$_SESSION['glpi_currenttime'] = $ctime;
}
@@ -203,8 +180,6 @@ protected function setEntity($entityname, $subtree)
*/
protected function checkInput(CommonDBTM $object, $id = 0, $input = [])
{
- $input = Sanitizer::dbUnescapeRecursive($input); // slashes in input should not be stored in DB
-
$this->assertGreaterThan(0, $id, 'ID is not valid');
$this->assertTrue($object->getFromDB($id), 'Object not found in DB');
$this->assertEquals($id, $object->getID(), 'Object could not be loaded');
@@ -212,8 +187,8 @@ protected function checkInput(CommonDBTM $object, $id = 0, $input = [])
if (count($input)) {
foreach ($input as $k => $v) {
$this->assertEquals($v, $object->fields[$k], "
- '$k' key current value '{$object->fields[$k]}' (" . gettype($object->fields[$k]) . ")
- is not equal to '$v' (" . gettype($v) . ')');
+ '{$k}' key current value '{$object->fields[$k]}' (" . gettype($object->fields[$k]) . ")
+ is not equal to '{$v}' (" . gettype($v) . ')');
}
}
}
@@ -252,11 +227,12 @@ protected function getClasses($function = false, array $excludes = [])
$is_excluded = false;
foreach ($excludes as $exclude) {
- if ($classname === $exclude || @preg_match($exclude, $classname) === 1) {
+ if ($classname === $exclude || @preg_match($exclude, (string) $classname) === 1) {
$is_excluded = true;
break;
}
}
+
if ($is_excluded) {
continue;
}
@@ -264,13 +240,14 @@ protected function getClasses($function = false, array $excludes = [])
if (!class_exists($classname)) {
continue;
}
+
$reflectionClass = new ReflectionClass($classname);
if ($reflectionClass->isAbstract()) {
continue;
}
if ($function) {
- if (method_exists($classname, $function)) {
+ if (method_exists($classname, (string) $function)) {
$classes[] = $classname;
}
} else {
@@ -287,20 +264,19 @@ protected function getClasses($function = false, array $excludes = [])
* @param string $itemtype
* @param array $input
* @param array $skip_fields Fields that wont be checked after creation
- *
- * @return CommonDBTM
*/
protected function createItem($itemtype, $input, $skip_fields = []): CommonDBTM
{
+ if (!is_a($itemtype, CommonDBTM::class, true)) {
+ throw new InvalidArgumentException(sprintf("Itemtype '%s' is not a valid CommonDBTM class", $itemtype));
+ }
+
$item = new $itemtype();
- $input = Sanitizer::sanitize($input);
$id = $item->add($input);
$this->assertGreaterThan(0, $id, 'ID is not valid');
// Remove special fields
- $input = array_filter($input, static function ($key) use ($skip_fields) {
- return !in_array($key, $skip_fields, true) && !str_starts_with($key, '_');
- }, ARRAY_FILTER_USE_KEY);
+ $input = array_filter($input, static fn($key) => !in_array($key, $skip_fields, true) && !str_starts_with((string) $key, '_'), ARRAY_FILTER_USE_KEY);
$this->checkInput($item, $id, $input);
@@ -315,14 +291,17 @@ protected function createItem($itemtype, $input, $skip_fields = []): CommonDBTM
*/
protected function updateItem($itemtype, $id, $input)
{
+ if (!is_a($itemtype, CommonDBTM::class, true)) {
+ throw new InvalidArgumentException(sprintf("Itemtype '%s' is not a valid CommonDBTM class", $itemtype));
+ }
+
$item = new $itemtype();
$input['id'] = $id;
- $input = Sanitizer::sanitize($input);
$success = $item->update($input);
$this->assertTrue($success);
// Remove special fields
- $input = array_filter($input, static fn($key) => !str_starts_with($key, '_'), ARRAY_FILTER_USE_KEY);
+ $input = array_filter($input, static fn($key) => !str_starts_with((string) $key, '_'), ARRAY_FILTER_USE_KEY);
$this->checkInput($item, $id, $input);
}
diff --git a/tests/apitest.class.php b/tests/PluginJamfApiTest.php
similarity index 89%
rename from tests/apitest.class.php
rename to tests/PluginJamfApiTest.php
index 5b75996..abde35a 100644
--- a/tests/apitest.class.php
+++ b/tests/PluginJamfApiTest.php
@@ -22,13 +22,18 @@
* You should have received a copy of the GNU General Public License
* along with JAMF plugin for GLPI. If not, see .
* -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
+ * @copyright Copyright (C) 2024-2025 by Teclib'
* @copyright Copyright (C) 2019-2024 by Curtis Conard
* @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/pluginsGLPI/jamf
* -------------------------------------------------------------------------
*/
+namespace GlpiPlugin\Jamf\Tests;
+
+use GlpiPlugin\Jamf\Tests\PluginJamfConnectionTest;
+use PluginJamfAPI;
+
class PluginJamfApiTest extends PluginJamfAPI
{
protected static $connection_class = PluginJamfConnectionTest::class;
diff --git a/tests/computertestsync.class.php b/tests/PluginJamfComputerTestSync.php
similarity index 93%
rename from tests/computertestsync.class.php
rename to tests/PluginJamfComputerTestSync.php
index f173c09..a8718cd 100644
--- a/tests/computertestsync.class.php
+++ b/tests/PluginJamfComputerTestSync.php
@@ -22,13 +22,17 @@
* You should have received a copy of the GNU General Public License
* along with JAMF plugin for GLPI. If not, see .
* -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
+ * @copyright Copyright (C) 2024-2025 by Teclib'
* @copyright Copyright (C) 2019-2024 by Curtis Conard
* @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/pluginsGLPI/jamf
* -------------------------------------------------------------------------
*/
+namespace GlpiPlugin\Jamf\Tests;
+
+use PluginJamfComputerSync;
+
class PluginJamfComputerTestSync extends PluginJamfComputerSync
{
protected static $api = PluginJamfApiTest::class;
diff --git a/tests/PluginJamfConnectionTest.php b/tests/PluginJamfConnectionTest.php
new file mode 100644
index 0000000..07917e9
--- /dev/null
+++ b/tests/PluginJamfConnectionTest.php
@@ -0,0 +1,66 @@
+.
+ * -------------------------------------------------------------------------
+ * @copyright Copyright (C) 2024-2025 by Teclib'
+ * @copyright Copyright (C) 2019-2024 by Curtis Conard
+ * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
+ * @link https://github.com/pluginsGLPI/jamf
+ * -------------------------------------------------------------------------
+ */
+
+namespace GlpiPlugin\Jamf\Tests;
+
+use GuzzleHttp\Client;
+use GuzzleHttp\Psr7\Response;
+use GuzzleHttp\Handler\MockHandler;
+use GuzzleHttp\HandlerStack;
+use PluginJamfConnection;
+
+use function Safe\file_get_contents;
+
+class PluginJamfConnectionTest extends PluginJamfConnection
+{
+ public function getClient(): Client
+ {
+ $mock = new MockHandler([
+ function ($request, $options) {
+ $endpoint = $request->getUri()->getPath();
+ $endpoint = str_contains($endpoint, '?') ? explode('?', $endpoint)[0] : $endpoint;
+
+ $response_type = $request->getHeaderLine('Accept') ?: 'application/json';
+ $response_ext = $response_type === 'application/xml' ? 'xml' : 'json';
+ $mock_file_path = GLPI_ROOT . '/plugins/jamf/tools/samples/' . $endpoint . '.' . $response_ext;
+
+ $body = file_get_contents($mock_file_path);
+
+ return new Response(200, [], $body);
+ },
+ ]);
+
+ $handlerStack = HandlerStack::create($mock);
+ $this->client = new Client(['handler' => $handlerStack]);
+
+ return $this->client;
+ }
+}
diff --git a/tests/mobiletestsync.class.php b/tests/PluginJamfMobileTestSync.php
similarity index 93%
rename from tests/mobiletestsync.class.php
rename to tests/PluginJamfMobileTestSync.php
index 3b44bfc..7228666 100644
--- a/tests/mobiletestsync.class.php
+++ b/tests/PluginJamfMobileTestSync.php
@@ -22,13 +22,17 @@
* You should have received a copy of the GNU General Public License
* along with JAMF plugin for GLPI. If not, see .
* -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
+ * @copyright Copyright (C) 2024-2025 by Teclib'
* @copyright Copyright (C) 2019-2024 by Curtis Conard
* @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/pluginsGLPI/jamf
* -------------------------------------------------------------------------
*/
+namespace GlpiPlugin\Jamf\Tests;
+
+use PluginJamfMobileSync;
+
class PluginJamfMobileTestSync extends PluginJamfMobileSync
{
protected static $api = PluginJamfApiTest::class;
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index fc5cfb0..e684ffd 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -22,42 +22,16 @@
* You should have received a copy of the GNU General Public License
* along with JAMF plugin for GLPI. If not, see .
* -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
+ * @copyright Copyright (C) 2024-2025 by Teclib'
* @copyright Copyright (C) 2019-2024 by Curtis Conard
* @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/pluginsGLPI/jamf
* -------------------------------------------------------------------------
*/
-global $CFG_GLPI;
+require __DIR__ . '/../../../tests/bootstrap.php';
+require __DIR__ . '/../vendor/autoload.php';
-define('GLPI_ROOT', dirname(dirname(dirname(__DIR__))));
-
-if (file_exists('vendor/autoload.php')) {
- require_once 'vendor/autoload.php';
-}
-include GLPI_ROOT . '/inc/includes.php';
-//include_once GLPI_ROOT . '/tests/GLPITestCase.php';
-//include_once GLPI_ROOT . '/tests/DbTestCase.php';
-include_once 'AbstractDBTest.php';
-
-$plugin = new Plugin();
-$plugin->checkPluginState('jamf');
-$plugin->getFromDBbyDir('jamf');
-
-if (!plugin_jamf_check_prerequisites()) {
- echo "\nPrerequisites are not met!";
- die(1);
+if (!Plugin::isPluginActive('jamf')) {
+ throw new RuntimeException('Plugin jamf is not active in the test database');
}
-
-if (!$plugin->isInstalled('jamf')) {
- $plugin->install($plugin->getID());
-}
-if (!$plugin->isActivated('jamf')) {
- $plugin->activate($plugin->getID());
-}
-
-include_once 'apitest.class.php';
-include_once 'connectiontest.class.php';
-include_once 'mobiletestsync.class.php';
-include_once 'computertestsync.class.php';
diff --git a/tests/connectiontest.class.php b/tests/connectiontest.class.php
deleted file mode 100644
index 6b8b20b..0000000
--- a/tests/connectiontest.class.php
+++ /dev/null
@@ -1,74 +0,0 @@
-.
- * -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
- * @copyright Copyright (C) 2019-2024 by Curtis Conard
- * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
- * @link https://github.com/pluginsGLPI/jamf
- * -------------------------------------------------------------------------
- */
-
-use GuzzleHttp\ClientTrait;
-use Psr\Http\Client\ClientInterface;
-use Psr\Http\Message\RequestInterface;
-use Psr\Http\Message\ResponseInterface;
-
-class PluginJamfConnectionTest extends PluginJamfConnection
-{
- public function getClient(): ClientInterface
- {
- if (!isset($this->client)) {
- $this->client = new class implements ClientInterface {
- use ClientTrait;
-
- public function sendRequest(RequestInterface $request): ResponseInterface
- {
- $endpoint = $request->getUri()->getPath();
- var_dump($endpoint);
- // remove query parameters
- $endpoint = str_contains($endpoint, '?') ? explode('?', $endpoint)[0] : $endpoint;
- $response_type = $request->getHeader('Accept')[0] ?? 'application/json';
- $response_ext = $response_type === 'application/xml' ? 'xml' : 'json';
- $mock_file_path = GLPI_ROOT . '/plugins/jamf/tools/samples/' . $endpoint . '.' . $response_ext;
-
- return new \GuzzleHttp\Psr7\Response(200, [], file_get_contents($mock_file_path));
- }
-
- public function request(string $method, $uri, array $options = []): ResponseInterface
- {
- $request = new \GuzzleHttp\Psr7\Request($method, $uri, $options['headers'] ?? []);
-
- return $this->sendRequest($request);
- }
-
- public function requestAsync(string $method, $uri, array $options = []): \GuzzleHttp\Promise\PromiseInterface
- {
- return \GuzzleHttp\Promise\Create::promiseFor($this->request($method, $uri, $options));
- }
- };
- }
-
- return $this->client;
- }
-}
diff --git a/tests/units/PluginJamfComputerSync.php b/tests/units/PluginJamfComputerSync.php
index 7c08e76..f36a334 100644
--- a/tests/units/PluginJamfComputerSync.php
+++ b/tests/units/PluginJamfComputerSync.php
@@ -22,25 +22,29 @@
* You should have received a copy of the GNU General Public License
* along with JAMF plugin for GLPI. If not, see .
* -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
+ * @copyright Copyright (C) 2024-2025 by Teclib'
* @copyright Copyright (C) 2019-2024 by Curtis Conard
* @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/pluginsGLPI/jamf
* -------------------------------------------------------------------------
*/
-namespace tests\units;
+namespace GlpiPlugin\Jamf\Tests\units;
+use Computer;
+use DBmysql;
+use GlpiPlugin\Jamf\Tests\AbstractDBTest;
+use GlpiPlugin\Jamf\Tests\PluginJamfComputerTestSync;
use PluginJamfComputer;
-use PluginJamfComputerTestSync;
use PluginJamfExtensionAttribute;
use PluginJamfImport;
use PluginJamfItem_ExtensionAttribute;
-class PluginJamfComputerSync extends \AbstractDBTest
+class PluginJamfComputerSync extends AbstractDBTest
{
public function testDiscover()
{
+ /** @var DBmysql $DB */
global $DB;
PluginJamfComputerTestSync::discover();
@@ -53,6 +57,7 @@ public function testDiscover()
public function testSyncExtensionAttributeDefinitions()
{
+ /** @var DBmysql $DB */
global $DB;
PluginJamfComputerTestSync::syncExtensionAttributeDefinitions();
@@ -79,6 +84,7 @@ public function testSyncExtensionAttributeDefinitions()
public function testImport()
{
+ /** @var DBmysql $DB */
global $DB;
PluginJamfComputerTestSync::syncExtensionAttributeDefinitions();
@@ -87,7 +93,7 @@ public function testImport()
// Make sure the computer was created
$iterator = $DB->request([
- 'FROM' => \Computer::getTable(),
+ 'FROM' => Computer::getTable(),
'WHERE' => [
'name' => 'CConardMBA',
],
diff --git a/tests/units/PluginJamfMobileSync.php b/tests/units/PluginJamfMobileSync.php
index a52fc34..615e8df 100644
--- a/tests/units/PluginJamfMobileSync.php
+++ b/tests/units/PluginJamfMobileSync.php
@@ -22,15 +22,19 @@
* You should have received a copy of the GNU General Public License
* along with JAMF plugin for GLPI. If not, see .
* -------------------------------------------------------------------------
- * @copyright Copyright (C) 2024-2024 by Teclib'
+ * @copyright Copyright (C) 2024-2025 by Teclib'
* @copyright Copyright (C) 2019-2024 by Curtis Conard
* @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/pluginsGLPI/jamf
* -------------------------------------------------------------------------
*/
-namespace tests\units;
+namespace GlpiPlugin\Jamf\Tests\units;
+use Computer;
+use DBmysql;
+use GlpiPlugin\Jamf\Tests\AbstractDBTest;
+use GlpiPlugin\Jamf\Tests\PluginJamfMobileTestSync;
use Phone;
use PluginJamfAbstractDevice;
use PluginJamfExtensionAttribute;
@@ -38,14 +42,14 @@
use PluginJamfImport;
use PluginJamfItem_ExtensionAttribute;
use PluginJamfMobileDevice;
-use PluginJamfMobileTestSync;
use PluginJamfSync;
use ReflectionClass;
-class PluginJamfMobileSync extends \AbstractDBTest
+class PluginJamfMobileSync extends AbstractDBTest
{
public function testDiscover()
{
+ /** @var DBmysql $DB */
global $DB;
PluginJamfMobileTestSync::discover();
@@ -59,6 +63,7 @@ public function testDiscover()
public function testSyncExtensionAttributeDefinitions()
{
+ /** @var DBmysql $DB */
global $DB;
PluginJamfMobileTestSync::syncExtensionAttributeDefinitions();
@@ -85,6 +90,7 @@ public function testSyncExtensionAttributeDefinitions()
public function testImportAsComputer()
{
+ /** @var DBmysql $DB */
global $DB;
// Force sync extension attribute definitions
@@ -94,7 +100,7 @@ public function testImportAsComputer()
// Make sure the computer was created
$iterator = $DB->request([
- 'FROM' => \Computer::getTable(),
+ 'FROM' => Computer::getTable(),
'WHERE' => [
'name' => 'Test iPad 3',
],
@@ -140,6 +146,7 @@ public function testImportAsComputer()
public function testImportAsPhone()
{
+ /** @var DBmysql $DB */
global $DB;
PluginJamfMobileTestSync::import('Phone', 5, false);
@@ -186,7 +193,7 @@ public function testImportAsPhone()
$this->assertEquals('1aec6610a9401d2cc47cb55e1a2f7b500ab75864', $ext_field['value']);
}
- public function deviceSyncEnginesProvider()
+ public static function deviceSyncEnginesProvider()
{
$engines = PluginJamfSync::getDeviceSyncEngines();
$result = [];
diff --git a/tools/HEADER b/tools/HEADER
new file mode 100644
index 0000000..1e6780a
--- /dev/null
+++ b/tools/HEADER
@@ -0,0 +1,26 @@
+-------------------------------------------------------------------------
+JAMF plugin for GLPI
+-------------------------------------------------------------------------
+
+LICENSE
+
+This file is part of JAMF plugin for GLPI.
+
+JAMF plugin for GLPI is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+JAMF plugin for GLPI is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with JAMF plugin for GLPI. If not, see .
+-------------------------------------------------------------------------
+@copyright Copyright (C) 2024-2025 by Teclib'
+@copyright Copyright (C) 2019-2024 by Curtis Conard
+@license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
+@link https://github.com/pluginsGLPI/jamf
+-------------------------------------------------------------------------
diff --git a/tools/extract_template.sh b/tools/extract_template.sh
index 959470c..6684b89 100755
--- a/tools/extract_template.sh
+++ b/tools/extract_template.sh
@@ -1,36 +1,33 @@
#!/bin/bash
-# /**
-# * ---------------------------------------------------------------------
-# * Modified by Curtis Conard for the Jamf for GLPI Plugin 2020
-# *
-# * GLPI - Gestionnaire Libre de Parc Informatique
-# * Copyright (C) 2015-2020 Teclib' and contributors.
-# *
-# * http://glpi-project.org
-# *
-# * based on GLPI - Gestionnaire Libre de Parc Informatique
-# * Copyright (C) 2003-2014 by the INDEPNET Development Team.
-# *
-# * ---------------------------------------------------------------------
-# *
-# * LICENSE
-# *
-# * This file is part of GLPI.
-# *
-# * GLPI is free software; you can redistribute it and/or modify
-# * it under the terms of the GNU General Public License as published by
-# * the Free Software Foundation; either version 2 of the License, or
-# * (at your option) any later version.
-# *
-# * GLPI is distributed in the hope that it will be useful,
-# * but WITHOUT ANY WARRANTY; without even the implied warranty of
-# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# * GNU General Public License for more details.
-# *
-# * You should have received a copy of the GNU General Public License
-# * along with GLPI. If not, see .
-# * ---------------------------------------------------------------------
-# */
+
+#
+# -------------------------------------------------------------------------
+# JAMF plugin for GLPI
+# -------------------------------------------------------------------------
+#
+# LICENSE
+#
+# This file is part of JAMF plugin for GLPI.
+#
+# JAMF plugin for GLPI is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# JAMF plugin for GLPI is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with JAMF plugin for GLPI. If not, see .
+# -------------------------------------------------------------------------
+# @copyright Copyright (C) 2024-2025 by Teclib'
+# @copyright Copyright (C) 2019-2024 by Curtis Conard
+# @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
+# @link https://github.com/pluginsGLPI/jamf
+# -------------------------------------------------------------------------
+#
# Clean existing file
rm -f locales/jamf.pot && touch locales/jamf.pot