CMS  Version 3.9
ReportListView Class Reference

Public Member Functions

 ReportListView ($manager_class, $identifier)
 
 buildTable ()
 
 writeScript ()
 
 drawView ()
 

Public Attributes

 $reports
 
 $table
 
 $identifier
 
 $resultsPage
 
 $buttons_at_top = true
 

Detailed Description

Definition at line 53 of file report_view.inc.

Member Function Documentation

◆ buildTable()

ReportListView::buildTable ( )

Definition at line 72 of file report_view.inc.

73  {
74  // NOTE: "CustomReports" id is referenced in report_manager.js function reportSaved
75  $table = new DataListView($this->reports, "CustomReports");
76  $table->column("Title", "<a href='{$this->identifier}?report_id={report_id}&edit=1'>{title}</a>", true)
77  ->column("Description", "{description}")
78  ->column("Actions", "<a class='button' href='{$this->identifier}?report_id={report_id}'>Run</a>&nbsp;<a class='button' href='{$this->identifier}?report_id={report_id}&edit=1'>Edit</a>");
79 
80  $table->pageSize=20;
81  $table->emptyMessage = "There are no custom reports.";
82  $table->filter=true;
83  $table->sortable = true;
84 
85  return $table;
86  }

◆ drawView()

ReportListView::drawView ( )

Definition at line 94 of file report_view.inc.

95  {
96  if($this->buttons_at_top)
97  {
98  echo "<p><a class='button' href='{$this->identifier}'>Create a New Report</a></p>\n";
99  }
100 
101  $this->table->drawView();
102 
103  echo "<p><a class='button' href='{$this->identifier}'>Create a New Report</a></p>\n";
104  }

◆ ReportListView()

ReportListView::ReportListView (   $manager_class,
  $identifier 
)

Definition at line 61 of file report_view.inc.

62  {
63  // blank title means throw-away record presaved on generate page
64  $this->reports = Query::create(CustomReport, "WHERE manager_class=:manager_class AND title != '' ORDER BY title")
65  ->bind(":manager_class", $manager_class)
66  ->execute();
67 
68  $this->identifier = $identifier;
69  $this->table = $this->buildTable($reports);
70  }

◆ writeScript()

ReportListView::writeScript ( )

Definition at line 89 of file report_view.inc.

90  {
91  return $this->table->writeScript();
92  }

Member Data Documentation

◆ $buttons_at_top

ReportListView::$buttons_at_top = true

Definition at line 59 of file report_view.inc.

◆ $identifier

ReportListView::$identifier

Definition at line 57 of file report_view.inc.

◆ $reports

ReportListView::$reports

Definition at line 55 of file report_view.inc.

◆ $resultsPage

ReportListView::$resultsPage

Definition at line 58 of file report_view.inc.

◆ $table

ReportListView::$table

Definition at line 56 of file report_view.inc.


The documentation for this class was generated from the following file: