Repository navigation
Add standard Cacti search filter to the Maintenance Schedules list - #69
Merged
Merged
Conversation
The main Maintenance Schedules table (the General tab) was the only list in the plugin without a search filter. Add a simple cdef.php-style filter (Search box, rows selector, Go/Clear, pagination and sortable columns). Because a schedule row itself only carries a name, the search also matches the hostname/description of any Thold device (core host table) or Servcheck test (plugin_servcheck_test) the schedule covers, joined through plugin_maint_hosts. Each association source is only queried when its plugin is enabled. Regenerated locales/po/cacti.pot for the two new strings.
TheWitness
requested review from
bmfmancini,
browniebraun,
cigamit and
xmacan
September 29, 2026 04:48
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The search value must be URL-encoded to preserve names containing URL-special characters.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds standard filtering, pagination, and sorting to the General maintenance schedule list.
Changes:
- Adds schedule and associated-device search.
- Adds row selection, pagination, and sortable columns.
- Updates translations and changelog.
| File | Description |
|---|---|
maint.php |
Implements filtering and list navigation. |
locales/po/cacti.pot |
Adds new translatable strings. |
CHANGELOG.md |
Documents the feature. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
browniebraun
approved these changes
Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
The main Maintenance Schedules table (the General tab) was the only list in the plugin without a search filter. This adds a standard Cacti search filter modeled on
cdef.phpfrom 1.2.x: a Search box, a rows-per-page selector, Go/Clear buttons, pagination, and sortable columns.Searching hostnames and descriptions
A schedule row itself only carries a
name, so to make the search useful it also matches the hostname/description of the devices a schedule covers:hosttable (hostname,description)plugin_servcheck_test(hostname,display_name)Both are joined through
plugin_maint_hosts, and each source is only queried when its plugin is enabled (api_plugin_is_enabled('thold')/api_plugin_is_enabled('servcheck')), so nothing breaks when those plugins are absent. Webseer was intentionally left out — it has no hostname/description columns. All queries use prepared statements, matching the rest of the file.Scope
schedules()(the General tab) is touched. The Thold/WebSeer/Servcheck sub-tabs already had their own filters and are unchanged.sess_maint_schedules) so it doesn't collide with the device tab'ssess_maint.Notes
locales/po/cacti.potvialocales/build_gettext.shfor the two genuinely new strings (Schedules,The name of this Maintenance Schedule.); the remaining pot churn is deterministic string-order output from that script. Translation.pofiles were left to Weblate.php -lclean.