Saved_reports_Model Class Reference

Saved reports model Responsible for fetching data for saved reports. More...

Public Member Functions

 insert_id ($type='avail', $name=false)
 Fetch the ID of a saved report.
 save_period_info ($sla_id=false, $months=false)
 Handle info on SLA period values (monthly) Remove old values and enter the new ones.
 delete_report ($type='avail', $id)
 Delete info on a saved report.
 adjust_sla_periods ($num=false, &$arr, $is_quarter=false)
 Make monthly SLA values dynamic.
 get_period_info ($sla_id=false)
 Fetch saved SLA values and month info from db.

Static Public Member Functions

static get_saved_reports ($type='avail')
 Return all saved reports for a given report type.
static edit_report_info ($type, $id, Report_options $options)
 Save changes to a report, or save a new report.
static save_config_objects ($type= 'avail', $id=false, $objects=false)
 Save information on what objects are related to this report (hosts/services/-groups) and stores the name of the objects.
static get_all_report_names ($type='avail')
 Fetches all info names from {avail,sla}_config.
static get_report_info ($type='avail', $id)
 Fetch info on single saved report.
static get_config_objects ($type='avail', $id=false)
 Get config objects.

Data Fields

const USERFIELD = 'username'
 Name of the user field in database.

Detailed Description

Saved reports model Responsible for fetching data for saved reports.


Member Function Documentation

Saved_reports_Model::delete_report ( type = 'avail',
id 
)

Delete info on a saved report.

Parameters:
$type string: Report type { avail, sla, summary }
$id Id of the report to delete.
Returns:
true on success, false on errors
static Saved_reports_Model::edit_report_info ( type,
id,
Report_options $  options 
) [static]

Save changes to a report, or save a new report.

Parameters:
$type The report type ('avail', 'summary' or 'sla')
$id The report id, or false to create a new one.
$options The new options to save. For summary reports, this will first unset any old options and then set these, for other report types only the options that are set will be overwritten.
Returns:
false on error, or the id of the saved report
static Saved_reports_Model::get_all_report_names ( type = 'avail'  )  [static]

Fetches all info names from {avail,sla}_config.

Note: you get the exact same info from get_saved_reports

Parameters:
$type string: Report type. { avail, sla }
Returns:
false on errors. Array of all names on success
static Saved_reports_Model::get_config_objects ( type = 'avail',
id = false 
) [static]

Get config objects.

Parameters:
$type string: Report type { avail, sla }
$id int: Report id
Returns:
false on errors, database result array on success.
Saved_reports_Model::get_period_info ( sla_id = false  ) 

Fetch saved SLA values and month info from db.

Parameters:
$sla_id int: Id of the report schedule
Returns:
false on errors. Database result array on success.
static Saved_reports_Model::get_report_info ( type = 'avail',
id 
) [static]

Fetch info on single saved report.

Parameters:
$type string: Report type { avail, sla }
$id int Id of the report.
Returns:
false on error. Report info as array on success.
static Saved_reports_Model::get_saved_reports ( type = 'avail'  )  [static]

Return all saved reports for a given report type.

Note: you get the exact same info from get_all_report_names

Parameters:
$type The report type ('avail', 'sla' or 'summary')
Saved_reports_Model::insert_id ( type = 'avail',
name = false 
)

Fetch the ID of a saved report.

Parameters:
$type The report type
$name The report name
Returns:
The id of the report
static Saved_reports_Model::save_config_objects ( type = 'avail',
id = false,
objects = false 
) [static]

Save information on what objects are related to this report (hosts/services/-groups) and stores the name of the objects.

Parameters:
$type string: Type of report {avail, sla, summary}
$id Id of the schedule.
$objects Objects this scheduled report concerns
Returns:
true on success, false on errors.

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

Generated on 4 Dec 2012 for ninja by  doxygen 1.6.1