Skip to content

feat: add GLPI 11 compatibility (v4.0.0) - #100

Open
giovanny07 wants to merge 3 commits into
tomolimo:masterfrom
giovanny07:feat/glpi-11-compatibility
Open

feat: add GLPI 11 compatibility (v4.0.0)#100
giovanny07 wants to merge 3 commits into
tomolimo:masterfrom
giovanny07:feat/glpi-11-compatibility

Conversation

@giovanny07

Copy link
Copy Markdown
  • Migrate classes from inc/ to src/ with PSR-4 namespace GlpiPlugin\Mailanalyzer
  • Replace raw DB queries with Migration API in hook.php (fresh install + upgrade)
  • Fix signed integer warning: tickets_id and mailcollectors_id now UNSIGNED
  • Add composer.json for PSR-4 autoloading
  • Replace legacy HTML config form with Bootstrap 5/Tabler native GLPI 11 UI
  • Fix CSRF handling: form posts to front/save_config.php (not ajax/)
  • Use Glpi\Plugin\Hooks constants in setup.php
  • Initialize config defaults on install and first display
  • Drop GLPI 10 support (use v3.2.x for GLPI 10)

- Migrate classes from inc/ to src/ with PSR-4 namespace GlpiPlugin\Mailanalyzer
- Replace raw DB queries with Migration API in hook.php (fresh install + upgrade)
- Fix signed integer warning: tickets_id and mailcollectors_id now UNSIGNED
- Add composer.json for PSR-4 autoloading
- Replace legacy HTML config form with Bootstrap 5/Tabler native GLPI 11 UI
- Fix CSRF handling: form posts to front/save_config.php (not ajax/)
- Use Glpi\Plugin\Hooks constants in setup.php
- Initialize config defaults on install and first display
- Drop GLPI 10 support (use v3.2.x for GLPI 10)
@tomolimo

Copy link
Copy Markdown
Owner

Hello @giovanny07
Thank you very much for the PR, I'll look at it, and merge it asap.
Regards
Tomolimo

@tomolimo tomolimo mentioned this pull request Mar 25, 2026
@tomolimo

Copy link
Copy Markdown
Owner

Hello @giovanny07
Here are some of items that you have to change:

  1. You have kept /inc/config.class.php: is it what you expected? Same question for inc/mailcollector.class.php
  2. Your config.html.twig is not used anywhere in the /src/Config.php file
  3. The version sould be 4.1.0 as the 4.0.0 is already existing.
  4. The /locales/ folder (for translation of texts) is missing: is it what you expected?
  5. A lot of comments are not in English: please translate them
    Thank you,
    Regards,
    Tomolimo

- Remove legacy inc/config.class.php and inc/mailcollector.class.php,
  fully superseded by src/Config.php and src/MailCollectorWrapper.php
- Wire up templates/pages/config.html.twig via TemplateRenderer in
  src/Config.php instead of duplicating the form as inline HTML;
  drop dead Config::configUpdate() (never called)
- Bump version to 4.1.0 (4.0.0 already released)
- Add locales/mailanalyzer.pot translation template
- Translate remaining Spanish comments to English
@giovanny07

Copy link
Copy Markdown
Author

Hello @tomolimo,

Thank you for the review! I've pushed a new commit addressing all 5 points:

  1. /inc/config.class.php and /inc/mailcollector.class.php — these were leftover duplicates of src/Config.php and src/MailCollectorWrapper.php from before the PSR-4 migration, not referenced anywhere. Removed both.

  2. config.html.twig not usedsrc/Config.php was rendering the form as inline echo'd HTML instead of the Twig template. It now calls TemplateRenderer::getInstance()->display('@mailanalyzer/pages/config.html.twig', ...). I also removed Config::configUpdate(), which was dead code (the form posts directly to front/save_config.php, not through core's Config::update()/config_class flow that would have called it).

  3. Version — bumped to 4.1.0 in setup.php and added a new <version> entry in mailanalyzer.xml (kept the existing 4.0.0 entry for history), plus updated CHANGELOG.md.

  4. /locales/ missing — added locales/mailanalyzer.pot with all translatable strings extracted from the codebase, ready for translators.

  5. Non-English comments — translated the remaining Spanish comments in hook.php, src/Config.php, front/save_config.php, front/config.form.php, and templates/pages/config.html.twig to English.

Let me know if anything else needs adjusting.

Regards,
Giovanny

@tomolimo

tomolimo commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Hello @giovanny07
I'm going to check all these, thank you, and I'll keep you informed
Regards,
Tomolimo

@tomolimo

tomolimo commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Hello @giovanny07
Would you mind to get the latest version and to apply your modifications to it?
Thank you,
Regards,
Tomolimo

Reapplies the src/ PSR-4 migration and PR tomolimo#100 review fixes on top of
the schema/version work done upstream in parallel on the old inc/-based
code (widened message_id, dbversion-guarded migrations, version bumps
to 4.0.1/4.0.2). Bumps plugin version to 4.1.0.
@giovanny07

Copy link
Copy Markdown
Author

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants