Scheduled_reports_Model Class Reference

Model for scheduled reports. More...

Static Public Member Functions

static delete_scheduled_report ($id=false)
 Given a scheduled report id, delet it from db.
static delete_all_scheduled_reports ($type='avail', $id=false)
 Delete ALL schedules for a certain report_id and type.
static get_scheduled_reports ($type)
 Fetches all scheduled reports of current report type (avail/sla).
static report_is_scheduled ($type='avail', $id=false)
 Checks if a report is scheduled in autoreports.
static get_available_report_periods ()
 Get available report periods.
static fetch_scheduled_field_value ($type=false, $id=false)
 Retrieves the value of a db field for a report id.
static edit_report ($id=false, $rep_type=false, $saved_report_id=false, $period=false, $recipients=false, $filename='', $description='', $local_persistent_filepath= '', $attach_description=0, $report_time=false, $report_on=false, $report_period=false)
static update_report_field ($id=false, $field=false, $value=false)
 Update specific field for certain scheduled report Called from reports_Controller::save_schedule_item() through ajax.
static get_typeof_report ($id=false)
 Get the type of a report.
static get_report_type_id ($identifier=false)
 Get the id of a named report.
static get_all_report_types ()
 Fetch info on all defined report types, i.e all types we can schedule.
static get_scheduled_data ($schedule_id=false)
 Fetch all info for a specific schedule.
static get_period_schedules ($period_str)
 Fetch info on reports to be sent for specific period (daily/weekly/monthly).

Data Fields

const USERFIELD = 'username'
 Name of username column in database.

Detailed Description

Model for scheduled reports.


Member Function Documentation

static Scheduled_reports_Model::edit_report ( id = false,
rep_type = false,
saved_report_id = false,
period = false,
recipients = false,
filename = '',
description = '',
local_persistent_filepath = '',
attach_description = 0,
report_time = false,
report_on = false,
report_period = false 
) [static]
Parameters:
$id = false
$rep_type = false
$saved_report_id = false
$period = false
$recipients = false comma separated
$filename = ''
$description = ''
$local_persistent_filepath = ''
$attach_description = ''
$report_time = false
$report_on = false
$report_period = false
Returns:
string|int either error string or the report's id
static Scheduled_reports_Model::fetch_scheduled_field_value ( type = false,
id = false 
) [static]

Retrieves the value of a db field for a report id.

Parameters:
$type the database column
$id the id of the scheduled report
static Scheduled_reports_Model::get_available_report_periods (  )  [static]

Get available report periods.

Returns:
array [id] => string. False on errors.
static Scheduled_reports_Model::get_period_schedules ( period_str  )  [static]

Fetch info on reports to be sent for specific period (daily/weekly/monthly).

Parameters:
$period_str string: { daily, weekly, monthly }
Returns:
array
static Scheduled_reports_Model::get_report_type_id ( identifier = false  )  [static]

Get the id of a named report.

Parameters:
$identifier string: The name of the report
Returns:
False on errors. Id of the report on success.
static Scheduled_reports_Model::get_scheduled_data ( schedule_id = false  )  [static]

Fetch all info for a specific schedule.

This includes all relevant data about both schedule and the report.

Parameters:
$schedule_id The id of the schedule we're interested in.
Returns:
False on errors. Array with scheduling information on success.
static Scheduled_reports_Model::get_scheduled_reports ( type  )  [static]

Fetches all scheduled reports of current report type (avail/sla).

Parameters:
$type string: {avail, sla, summary}
Returns:
res
static Scheduled_reports_Model::get_typeof_report ( id = false  )  [static]

Get the type of a report.

Parameters:
$id The id of the report.
Returns:
Report type on success. False on errors.
static Scheduled_reports_Model::report_is_scheduled ( type = 'avail',
id = false 
) [static]

Checks if a report is scheduled in autoreports.

Parameters:
$type string: {avail, sla}
$id int The report id
Returns:
Array on success. False on error.
static Scheduled_reports_Model::update_report_field ( id = false,
field = false,
value = false 
) [static]

Update specific field for certain scheduled report Called from reports_Controller::save_schedule_item() through ajax.

Parameters:
$id int: The id of the report.
$field string: The report field to update.
$value string: The new value.
Returns:
true on succes. false on errors.

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables

Generated on 19 Dec 2018 for ninja by  doxygen 1.6.1