Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

get_reports()

Description

Retrieves an array of reports from the database.

This function queries the database for all reports and processes them by:
1. Translating the report names using the `get_report_name` function.
2. Checking if the reports contain date fields using `report_has_date`.
3. Verifying if the reports have associated thumbnails using `report_has_thumbnail`.

The reports are always listed in the same order, regardless of the language used.

'contains_date', and 'has_thumbnail' keys.

Parameters

This function accepts no parameters.

Return

array An array of processed reports, each containing 'ref', 'name',

Location

include/reporting_functions.php lines 34 to 52

Definition

 
function get_reports()
    {
    
# Executes query.
    
$r ps_query("SELECT ref, `name`, `query`, support_non_correlated_sql FROM report ORDER BY name");

    
# Translates report names in the newly created array.
    
$return = array();
    for (
$n 0;$n<count($r);$n++)
        {
        if (!
hook('ignorereport''', array($r[$n])))
            {
            
$r[$n]["name"] = get_report_name($r[$n]);
            
$r[$n]["contains_date"] = report_has_date((string) $r[$n]["query"]);
            
$r[$n]['has_thumbnail'] = report_has_thumbnail((string) $r[$n]["query"]);
            
$return[] = $r[$n];
            }
        }
    return 
$return;
    }

This article was last updated 17th November 2024 15:35 Europe/London time based on the source file dated 7th November 2024 17:40 Europe/London time.