Skip to content

Conversation

@MyvTsv
Copy link

@MyvTsv MyvTsv commented Oct 7, 2025

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • Implements custom asset support for the geninventorynumber plugin via GLPI 11's capacity system. Custom assets can now be enabled/disabled for automatic inventory number generation, with automatic configuration management when the capacity is toggled.

Screenshots (if appropriate):

Capacities menu:
image

Plugin Config:
image

@MyvTsv MyvTsv self-assigned this Oct 7, 2025
@MyvTsv MyvTsv requested review from Rom1-B and stonebuzz October 7, 2025 15:34
@stonebuzz
Copy link
Contributor

@MyvTsv Can you add some test ? If it possible ?

@stonebuzz
Copy link
Contributor

stonebuzz commented Oct 14, 2025

Could you update the logic as follows:

  • onClassBootstrap → Add the configuration entry to the database if it does not exist (set active to false by default).
  • onCapacityEnabled → Set active to true.
  • onCapacityDisabled → Set active to false.

This approach ensures that the configuration is not lost when the feature is disabled.

Additionally, we need to handle the case when a custom asset is deleted, in order to remove its corresponding entry from the database.

This last point might be the one to investigate first, because if the capacity system cannot be notified when a custom asset is deleted, we won’t be able to modify the current logic.

@stonebuzz stonebuzz mentioned this pull request Oct 20, 2025
2 tasks
@MyvTsv MyvTsv marked this pull request as ready for review November 5, 2025 13:32
@MyvTsv MyvTsv requested a review from stonebuzz November 5, 2025 13:32
@Rom1-B
Copy link
Contributor

Rom1-B commented Nov 6, 2025

Please update CHANGELOG

@MyvTsv MyvTsv requested review from Rom1-B and stonebuzz November 7, 2025 14:15
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.

3 participants