From d1101b0150dcd38828c2df94fea1f58c568f8e0c Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 28 May 2010 02:32:34 +0000 Subject: [PATCH] MINOR set Print flag correctly on TLF MINOR custom print template for SSReport TLF's that exposes the report title, and filters set (from r97138) (from r98208) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@105852 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/ReportAdmin.php | 16 ++++++++++++++ templates/SSReportTableField_printable.ss | 26 +++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 templates/SSReportTableField_printable.ss diff --git a/code/ReportAdmin.php b/code/ReportAdmin.php index 32117d01..cace47f0 100755 --- a/code/ReportAdmin.php +++ b/code/ReportAdmin.php @@ -71,6 +71,22 @@ class ReportAdmin extends LeftAndMain { return $output; } + /** + * Get the current report + * + * @return SSReport + */ + public function CurrentReport() { + $id = isset($_REQUEST['ID']) ? $_REQUEST['ID'] : Session::get('currentReport'); + + if($id) { + foreach($this->Reports() as $report) { + if($id == $report->ID()) return $report; + } + } + return false; + } + /** * Return a Form instance with fields for the * particular report currently viewed. diff --git a/templates/SSReportTableField_printable.ss b/templates/SSReportTableField_printable.ss new file mode 100644 index 00000000..20b68052 --- /dev/null +++ b/templates/SSReportTableField_printable.ss @@ -0,0 +1,26 @@ + + + + +<% base_tag %> +Print + + + + + <% control Form.Controller %> +

$CurrentReport.Title

+ <% control CurrentReport.getCmsFields %> + <% if Name == Filters %> +

Filters

+ + <% end_if %> + <% end_control %> + <% end_control %> + <% include TableListField %> + + \ No newline at end of file