N°9629 - New fields Tags and Owner on Query class#963
Conversation
|
| Filename | Overview |
|---|---|
| application/query.class.inc.php | Core file adding owner_id (ExternalKey→Contact, DEL_AUTO) and usages (AttributeEnumSet, 5 values, max_items=12) to the abstract Query class, plus GetInitialStateAttributeFlags for read-only creation-time guards; display/search layouts updated for both Query and QueryOQL subclass. |
| datamodels/2.x/itop-tickets/data/en_us.data.itop-tickets.xml | Reference data: replaces the redundant finalclass element with usages=notif on all 13 ticket-related QueryOQL records; the outer tag already identifies the class so removing finalclass is safe. |
| dictionaries/en.dictionary.itop.ui.php | Adds the canonical English translations for the new usages and owner_id attributes; other dictionaries follow the same pattern with ~~ stubs for untranslated languages. |
| dictionaries/fr.dictionary.itop.ui.php | Full French translations provided for both new fields; the usages+ tooltip includes helpful semantic notes on each enum value that are absent from the English description. |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
class cmdbAbstractObject {
}
class Query {
+string name
+text description
+enum is_template
+int export_count
+datetime export_last_date
+extkey export_last_user_id
+extfield export_last_user_contact
+extkey owner_id [NEW]
+enumset usages [NEW]
+GetAttributeFlags()
+GetInitialStateAttributeFlags() [NEW]
+UpdateLastExportInformation()
}
class QueryOQL {
+oql oql
+text fields
+GetExportUrl()
+DisplayBareProperties()
}
class Contact {
}
cmdbAbstractObject <|-- Query
Query <|-- QueryOQL
Query --> Contact : owner_id (DEL_AUTO)
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
classDiagram
class cmdbAbstractObject {
}
class Query {
+string name
+text description
+enum is_template
+int export_count
+datetime export_last_date
+extkey export_last_user_id
+extfield export_last_user_contact
+extkey owner_id [NEW]
+enumset usages [NEW]
+GetAttributeFlags()
+GetInitialStateAttributeFlags() [NEW]
+UpdateLastExportInformation()
}
class QueryOQL {
+oql oql
+text fields
+GetExportUrl()
+DisplayBareProperties()
}
class Contact {
}
cmdbAbstractObject <|-- Query
Query <|-- QueryOQL
Query --> Contact : owner_id (DEL_AUTO)
Reviews (2): Last reviewed commit: "Fix missing blank line" | Re-trigger Greptile
There was a problem hiding this comment.
Pull request overview
This PR enhances iTop’s Query / QueryOQL objects by introducing metadata to better categorize and govern stored OQL queries (usage tags + an owner contact), and surfaces these fields in the UI (details, list, search). It also updates built-in ticketing sample queries to be tagged for notification usage and adds dictionary entries for the new fields.
Changes:
- Add
owner_id(Contact) andusages(enum set) attributes toQuery, and display them in details/list/search forQueryandQueryOQL. - Add translations for the new attributes/values across multiple core UI dictionaries.
- Tag the ticketing module’s predefined
QueryOQLtemplates withusages=notif.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| application/query.class.inc.php | Adds owner_id and usages attributes to Query, updates Query/QueryOQL UI zlists and search criteria, and introduces initial-state read-only flags for export technical fields. |
| datamodels/2.x/itop-tickets/data/en_us.data.itop-tickets.xml | Sets <usages>notif</usages> on predefined notification recipient QueryOQL templates. |
| datamodels/2.x/itop-tickets/data/fr_fr.data.itop-tickets.xml | Sets <usages>notif</usages> on predefined notification recipient QueryOQL templates. |
| datamodels/2.x/itop-tickets/data/de_de.data.itop-tickets.xml | Sets <usages>notif</usages> on predefined notification recipient QueryOQL templates. |
| dictionaries/en.dictionary.itop.ui.php | Adds labels/helptext for Query.usages, usage values, and Query.owner_id. |
| dictionaries/fr.dictionary.itop.ui.php | Adds French labels/helptext for Query.usages/values and Query.owner_id. |
| dictionaries/de.dictionary.itop.ui.php | Adds dictionary keys for new query usage/owner fields (placeholder translations). |
| dictionaries/en_gb.dictionary.itop.ui.php | Adds dictionary keys for new query usage/owner fields (placeholder translations). |
| dictionaries/es_cr.dictionary.itop.ui.php | Adds dictionary keys for new query usage/owner fields (placeholder translations). |
| dictionaries/it.dictionary.itop.ui.php | Adds dictionary keys for new query usage/owner fields (placeholder translations). |
| dictionaries/ja.dictionary.itop.ui.php | Adds dictionary keys for new query usage/owner fields (placeholder translations). |
| dictionaries/nl.dictionary.itop.ui.php | Adds dictionary keys for new query usage/owner fields (placeholder translations). |
| dictionaries/pl.dictionary.itop.ui.php | Adds dictionary keys for new query usage/owner fields (placeholder translations). |
| dictionaries/pt_br.dictionary.itop.ui.php | Adds dictionary keys for new query usage/owner fields (placeholder translations). |
| dictionaries/ru.dictionary.itop.ui.php | Adds dictionary keys for new query usage/owner fields (placeholder translations). |
| dictionaries/sk.dictionary.itop.ui.php | Adds dictionary keys for new query usage/owner fields (placeholder translations). |
| dictionaries/tr.dictionary.itop.ui.php | Adds dictionary keys for new query usage/owner fields (placeholder translations). |
| dictionaries/cs.dictionary.itop.ui.php | Adds dictionary keys for new query usage/owner fields (placeholder translations). |
| dictionaries/da.dictionary.itop.ui.php | Adds dictionary keys for new query usage/owner fields (placeholder translations). |
| dictionaries/hu.dictionary.itop.ui.php | Adds dictionary keys for new query usage/owner fields (placeholder translations). |
| dictionaries/zh_cn.dictionary.itop.ui.php | Adds dictionary keys for new query usage/owner fields (placeholder translations). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* N°9629 - Add Usages EnumSet and Owner on Query class * N°9629 - Add Usages on structural Queries Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Base information
Symptom (bug) / Objective (enhancement)
Proposed solution (bug and enhancement)
Two new fields on OQL Query to specify the usages and a contact responsible for this query
This allow to better manage a large number of queries, proposing filtering criteria, more efficient than a simple naming convention of queries
Checklist before requesting a review