...
The column attributes are again reasonably self evident.
- column_id is the numeric order of the column on the displayed query page.
- column_name is the header value for the column.
- column_variable is the name of the variable returned from the SQL statement above.
- column_type can be set to 'text', 'link', 'image', 'ip_address', 'multi', 'url', 'timestamp'. Formatting for each type is below:
...
text - simply show the output.
link - use the column_link variable to create a hyperlink and append the column_secondary value. Typically used to create a link to a device.
...
timestamp - currently outputs as per 'text' type.
url - and external link is created that points to the value of column_link. Will be shown using an icon instead of the actual text.
multi - is not used.
ip_address - format the output to de-pad the ip address. IP Addresses are stored in the database padded, so an ip address thus 192.168.1.1 would be internally stored as 192.168.001.001.
image - If column_name == Icon, use an image in /var/www/open-audit/theme-tango/tango-images/16_*.png where * is the value from column_variable.
...
If column_name == Picture, use an image in /var/www/open-audit/device_images/*.jpg where * is the value from column_variable.
ip_address - format the output to de-pad the ip address. IP Addresses are stroed in the database padded, so an ip address thus 192.168.1.1 would be internally stored as 192.168.001.001.
multi - is not used.
url - and external link is created that points to the value of column_link. Will be shown using an icon instead of the actual text.
...
link - use the column_link variable to create a hyperlink and append the column_secondary value. Typically used to create a link to a device.
- column_link is used to set the external link when column_type is 'url'.
- column_secondary is appended where required when column_type is 'link'.
- column_ternary is appended where required when column_type is 'link'.
- column_align is the alignment of the data in the displayed column.
Report SQL
So the main piece of code of interest is report_sql. This defines what data is extracted from the database.
...
The other join that should appear in a report_sql statement is the group join. In order to run a query on a particular group, the group id is passed for you by the front-end and you can reference it via @group. You need to create a join like thus:
Code Block | ||
---|---|---|
| ||
LEFT JOIN oa_group_sys ON system.system_id = oa_group_sys.system_id |
...