Scheduled_reports_Model Class Reference

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= '')
 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.

Detailed Description

Model for scheduled reports.


Member Function Documentation

Scheduled_reports_Model::delete_schedule_ajax ( id = false,
context = false 
)

Delete a schedule from database.

Parameters:
$id int: The id of the report to delete.
$context string: Enables us to take different actions depending on where it is called from
Returns:
ajax output
Scheduled_reports_Model::edit_report ( id = false,
rep_type = false,
saved_report_id = false,
period = false,
recipients = false,
filename = '',
description = '',
local_persistent_filepath = '' 
)
Parameters:
$id = false
$rep_type = false
$saved_report_id = false
$period = false
$recipients = false comma separated
$filename = ''
$description = ''
$local_persistent_filepath = ''
Returns:
string|int either error string or the report's id
Scheduled_reports_Model::fetch_scheduled_field_value ( type = false,
id = false 
)

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
Scheduled_reports_Model::get_report_type_id ( identifier = false  ) 

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.
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.

Parameters:
$schedule_id The id of the schedule we're interested in.
Returns:
False on errors. Options object 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
Scheduled_reports_Model::get_typeof_report ( id = false  ) 

Get the type of a report.

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

Checks if a report is scheduled in autoreports.

Parameters:
$id The report id
$type string: {avail, sla}
Returns:
Array on success. False on error.
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.

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 23 Nov 2012 for ninja by  doxygen 1.6.1