Model for scheduled reports. More...
Public Member Functions | |
delete_scheduled_report ($id=false) | |
Given a scheduled report id, delet it from db. | |
delete_all_scheduled_reports ($type='avail', $id=false) | |
Delete ALL schedules for a certain report_id and type. | |
report_is_scheduled ($type='avail', $id=false) | |
Checks if a report is scheduled in autoreports. | |
fetch_scheduled_field_value ($type=false, $id=false) | |
Retrieves the value of a db field for a report id. | |
delete_schedule_ajax ($id=false, $context=false) | |
Delete a schedule from database. | |
edit_report ($id=false, $rep_type=false, $saved_report_id=false, $period=false, $recipients=false, $filename='', $description='', $local_persistent_filepath= '', $attach_description=0) | |
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. | |
get_typeof_report ($id=false) | |
Get the type of a report. | |
get_report_type_id ($identifier=false) | |
Get the id of a named report. | |
get_scheduled_data ($schedule_id=false) | |
Fetch all info for a specific schedule. | |
Static Public Member Functions | |
static | get_scheduled_reports ($type) |
Fetches all scheduled reports of current report type (avail/sla). | |
static | get_available_report_periods () |
Get available report periods. | |
static | get_all_report_types () |
Fetch info on all defined report types, i.e all types we can 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. |
Model for scheduled reports.
Scheduled_reports_Model::delete_schedule_ajax | ( | $ | id = false , |
|
$ | context = false | |||
) |
Delete a schedule from database.
$id | int: The id of the report to delete. | |
$context | string: Enables us to take different actions depending on where it is called from |
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 | |||
) |
$id | = false | |
$rep_type | = false | |
$saved_report_id | = false | |
$period | = false | |
$recipients | = false comma separated | |
$filename | = '' | |
$description | = '' | |
$local_persistent_filepath | = '' | |
$attach_description | = '' |
Scheduled_reports_Model::fetch_scheduled_field_value | ( | $ | type = false , |
|
$ | id = false | |||
) |
Retrieves the value of a db field for a report id.
$type | the database column | |
$id | the id of the scheduled report |
static Scheduled_reports_Model::get_available_report_periods | ( | ) | [static] |
Get available report periods.
static Scheduled_reports_Model::get_period_schedules | ( | $ | period_str | ) | [static] |
Fetch info on reports to be sent for specific period (daily/weekly/monthly).
$period_str | string: { daily, weekly, monthly } |
Scheduled_reports_Model::get_report_type_id | ( | $ | identifier = false |
) |
Get the id of a named report.
$identifier | string: The name of the report |
Scheduled_reports_Model::get_scheduled_data | ( | $ | schedule_id = false |
) |
Fetch all info for a specific schedule.
This includes all relevant data about both schedule and the report.
$schedule_id | The id of the schedule we're interested in. |
static Scheduled_reports_Model::get_scheduled_reports | ( | $ | type | ) | [static] |
Fetches all scheduled reports of current report type (avail/sla).
$type | string: {avail, sla, summary} |
Scheduled_reports_Model::get_typeof_report | ( | $ | id = false |
) |
Get the type of a report.
$id | The id of the report. |
Scheduled_reports_Model::report_is_scheduled | ( | $ | type = 'avail' , |
|
$ | id = false | |||
) |
Checks if a report is scheduled in autoreports.
$id | The report id | |
$type | string: {avail, sla} |
Scheduled_reports_Model::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.
$id | int: The id of the report. | |
$field | string: The report field to update. | |
$value | string: The new value. |