CMS  Version 3.9
email_logs.inc
Go to the documentation of this file.
1 <?php
2 Fakoli::using("email");
3 Fakoli::usingFeature("filter_form");
4 
5 $menu_item = "Email Logs";
6 
8 $emailLog->filter = new InclusionFilter("date_sent");
9 $emailLog->fromGET();
10 
11 $filterForm = new FilterForm($emailLog, "GET");
12 $filterForm->hide("startDate");
13 
14 $dateRangeRenderer = new DateRangeFilterRenderer($filterForm, "date_sent", "date_sent");
15 $title = "Email Logs for ". $dateRangeRenderer->subTitle;
16 
17 $constraint = $filterForm->getConstraint();
18 
19 $logs = Query::create(EmailLog, "$constraint ORDER BY date_sent DESC")->execute();
20 
21 $table = new DataListView($logs, "EmailLogs");
22 $table->column("Recipient Email", "{recipient_email}", true)
23  ->column("Sender Email", "{sender_email}", true)
24  ->column("Subject", "{subject}", true)
25  ->column("Body", "<a href='#' onclick='new EmailManager().showMessageLog({email_log_id})'><img src='/fakoli/images/documents.gif' alt='Show Message Body'/></a>", false, "text-align: center; width: 10%")
26  ->column("Date Sent", "{date_sent:short}", true);
27 
28 $table->filter = true;
29 $table->pageSize = 10;
30 $table->sortable = true;
31 $table->excelFile = "email_logs.xls";
32 $table->emptyMessage = "There are no email logs for " .$dateRangeRenderer->subTitle;
33 
34 $script .= $filterForm->writeScript();
35 $script .= $table->writeScript();
36 
37 $filterForm->drawForm();
38 $table->drawView();
39 
40 ?>
$logs
Definition: email_logs.inc:19
$dateRangeRenderer
Definition: email_logs.inc:14
$constraint
Definition: email_logs.inc:17
$filterForm
Definition: email_logs.inc:11
$menu_item
Definition: email_logs.inc:5
$emailLog
Definition: email_logs.inc:7
$title
Definition: email_logs.inc:15
$table
Definition: email_logs.inc:21
$script
Definition: email_logs.inc:34
static usingFeature()
Uses the specified framework feature(s).
Definition: core.inc:388
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116