mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
Accessing Audit tables in Reports #4011
Labels
No labels
Area: API
Area: Campaigns
Area: Cases
Area: Clean Up
Area: Clean Up: Performance
Area: Dashlets
Area: Databases
Area: Developer Tools
Area: Elasticsearch
Area: Elasticsearch
Area: Emails
Area: Emails:Campaigns
Area: Emails:Cases
Area: Emails:Compose
Area: Emails:Config
Area: Emails:Templates
Area: Environment
Area: Installation
Area: Language
Area: Mobile
Area: Module
Area: PDFs
Area: PHP8
Area: Reports
Area: Studio
Area: Styling
Area: Upgrading
Area: Workflow
Area:Activity Stream
Area:Calls
Area:Import
Area:Projects
Area:Search
Area:Surveys
Area:Themes
Area:Users
Branch:Hotfix
Good First Issue
Hacktoberfest
Help Wanted
PR:Community Contribution
PR:Type:Enhancement
Priority:Critical
Priority:Important
Priority:Moderate
Severity: Major
Severity: Minor
Severity: Moderate
Status: Requires Code Review
Status: Requires Updates
Status: Stale
Status: Team Investigating
Status:Assessed
Status:Fix Proposed
Status:Needs Assessed
Status:Requires Automated Tests
Type: Bug
Type:Deprecated
Type:Discussion
Type:Duplicate
Type:Invalid
Type:Question
Type:Suggestion
Type:Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SuiteCRM-SuiteCRM#4011
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @connorshea on GitHub (Sep 26, 2019).
Issue
I'd like to be able to use the information from audit tables in the Reports module. The idea would be that I'd be able to create a report, e.g. where the Lead 'was edited on November 2, 2018', or something like that. Or getting the time the status of the Lead changed to 'Sold'. Stuff like that.
Context
We do some dumb stuff and want to have the audit tables usable in some Reports. KReports is able to use the audit tables, but I'm not sure how exactly.
I've been trying to figure out how to add this functionality, and I'm pretty lost at this point with regards to how the audit tables work. The module has a 'polymorphic' relationship, I guess? But it's not really a module and it doesn't exist in the
$beanFilesarray (it's commented out, and has been for a long time).I tried uncommenting that line to add Audit to the
$beanFilesarray, then adding public variables on the Audit class for each column in audit tables, and then defining vardefs for the fields. Now the audit fields show up in the Reports module tree, but the Change Log view fails with a database error, so that's great. I'm guessing implementing anything like this is going to be a huge pain.@connorshea commented on GitHub (Sep 26, 2019):
The
vardefs.phplooks like this, FWIW:vardefs.php
@Mac-Rae commented on GitHub (Sep 27, 2019):
Hey @connorshea, I believe you are able to update the vardefs in the target module to change from this
To this (Added 'audited'=>true,)
Afterwords running an R&R should make it create the table in the database
@connorshea commented on GitHub (Sep 27, 2019):
@Mac-Rae I think you misunderstood what I'm wanting to do :) I don't want the reports to have audit tables (I think they have them already anyway), I want to be able to make Reports that use the data from the audit tables.